From: Yu Watanabe Date: Wed, 27 Sep 2023 17:42:00 +0000 (+0900) Subject: sd-journal: drop unnecessary re-read of data object X-Git-Tag: v255-rc1~315^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20c45e578488c1d67f44eac45c168c23331fa19f;p=thirdparty%2Fsystemd.git sd-journal: drop unnecessary re-read of data object Follow-up for ec50313d4e329de276240883d86d05168a4cf09f. The function generic_array_bisect_plus_one() does not read any new data objects, so the data object is still valid, and not necessary to re-read it. --- diff --git a/src/libsystemd/sd-journal/journal-file.c b/src/libsystemd/sd-journal/journal-file.c index af946e6cadc..05bdac9ed4a 100644 --- a/src/libsystemd/sd-journal/journal-file.c +++ b/src/libsystemd/sd-journal/journal-file.c @@ -3541,7 +3541,7 @@ int journal_file_move_to_entry_by_monotonic_for_data( Object **ret_object, uint64_t *ret_offset) { - uint64_t b, z, entry_offset, entry_array_offset, n_entries; + uint64_t z, entry_offset, entry_array_offset, n_entries; Object *o; int r; @@ -3555,7 +3555,7 @@ int journal_file_move_to_entry_by_monotonic_for_data( n_entries = le64toh(READ_NOW(d->data.n_entries)); /* First, seek by time */ - r = find_data_object_by_boot_id(f, boot_id, &o, &b); + r = find_data_object_by_boot_id(f, boot_id, &o, NULL); if (r <= 0) return r; @@ -3572,11 +3572,6 @@ int journal_file_move_to_entry_by_monotonic_for_data( /* And now, continue seeking until we find an entry that * exists in both bisection arrays */ - - r = journal_file_move_to_object(f, OBJECT_DATA, b, &o); - if (r < 0) - return r; - for (;;) { uint64_t p, q;