From f534928ad7aaeec0bec2d653b4a50e79b0fc8418 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Wed, 17 Dec 2014 15:45:10 +0100 Subject: journal: journal_file_next_entry() does not need pointer to current Object The current offset is sufficient information. --- src/journal/journal-file.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/journal/journal-file.c') diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 35f3ea92a4..fec54f31b9 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -2003,7 +2003,7 @@ int journal_file_compare_locations(JournalFile *af, JournalFile *bf) { int journal_file_next_entry( JournalFile *f, - Object *o, uint64_t p, + uint64_t p, direction_t direction, Object **ret, uint64_t *offset) { @@ -2011,18 +2011,14 @@ int journal_file_next_entry( int r; assert(f); - assert(p > 0 || !o); n = le64toh(f->header->n_entries); if (n <= 0) return 0; - if (!o) + if (p == 0) i = direction == DIRECTION_DOWN ? 0 : n - 1; else { - if (o->object.type != OBJECT_ENTRY) - return -EINVAL; - r = generic_array_bisect(f, le64toh(f->header->entry_array_offset), le64toh(f->header->n_entries), -- cgit v1.2.3-54-g00ecf