sd-journal: drop unnecessary re-read of data object

Follow-up for ec50313d4e.

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.
This commit is contained in:
Yu Watanabe
2023-09-28 02:42:00 +09:00
parent d67078b4a3
commit 20c45e5784

View File

@@ -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;