From 1b8951e5bd9b2bf1722098a861055cae0bb52088 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 12 Dec 2014 21:52:18 +0100 Subject: journal: remove journal_file_object_keep/release functions The only user is sd_journal_enumerate_unique() and, as explained in the previous commit (fed67c38e3 "journal: map objects to context set by caller, not by actual object type"), the use of them there is now superfluous. Let's remove them. This reverts major parts of commits: ae97089d49 journal: fix access to munmapped memory in sd_journal_enumerate_unique 06cc69d44c sd-journal: fix sd_journal_enumerate_unique skipping values Tested with an "--enable-debug" build and "journalctl --list-boots". It gives the expected number of results. Additionally, if I then revert the previous commit ("journal: map objects to context set by caller, not to actual object type"), it crashes with SIGSEGV, as expected. --- src/journal/test-mmap-cache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/journal/test-mmap-cache.c') diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c index 1227b62310..3fcd77475d 100644 --- a/src/journal/test-mmap-cache.c +++ b/src/journal/test-mmap-cache.c @@ -49,23 +49,23 @@ int main(int argc, char *argv[]) { assert_se(z >= 0); unlink(pz); - r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p, NULL); + r = mmap_cache_get(m, x, PROT_READ, 0, false, 1, 2, NULL, &p); assert_se(r >= 0); - r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q, NULL); + r = mmap_cache_get(m, x, PROT_READ, 0, false, 2, 2, NULL, &q); assert_se(r >= 0); assert_se((uint8_t*) p + 1 == (uint8_t*) q); - r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q, NULL); + r = mmap_cache_get(m, x, PROT_READ, 1, false, 3, 2, NULL, &q); assert_se(r >= 0); assert_se((uint8_t*) p + 2 == (uint8_t*) q); - r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p, NULL); + r = mmap_cache_get(m, x, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p); assert_se(r >= 0); - r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q, NULL); + r = mmap_cache_get(m, x, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q); assert_se(r >= 0); assert_se((uint8_t*) p + 1 == (uint8_t*) q); -- cgit v1.2.3-54-g00ecf