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/sd-journal.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/journal/sd-journal.c') diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 23aad740dd..028060d348 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -2563,7 +2563,6 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_ size_t ol; bool found; int r; - void *release_cookie; /* Proceed to next data object in the field's linked list */ if (j->unique_offset == 0) { @@ -2604,10 +2603,6 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_ return -EBADMSG; } - r = journal_file_object_keep(j->unique_file, o, j->unique_offset, &release_cookie); - if (r < 0) - return r; - r = return_data(j, j->unique_file, o, &odata, &ol); if (r < 0) return r; @@ -2652,10 +2647,6 @@ _public_ int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_ found = true; } - r = journal_file_object_release(j->unique_file, release_cookie); - if (r < 0) - return r; - if (found) continue; -- cgit v1.2.3-54-g00ecf