]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: drop unnecessary re-read of data object
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 27 Sep 2023 17:42:00 +0000 (02:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 6 Oct 2023 00:55:04 +0000 (09:55 +0900)
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.

src/libsystemd/sd-journal/journal-file.c

index af946e6cadcdb6ca22d6b606a982c945ac45c078..05bdac9ed4a998e007f78a40b0a38cab47a06384 100644 (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;