summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.h
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-02-24 19:45:17 +0100
committerMichal Schmidt <mschmidt@redhat.com>2015-02-25 17:32:27 +0100
commit950c07d421c04e5aae99973479f4f13131fb45e1 (patch)
treefb12be70bf3136b42f7894a2b361fa78159a3781 /src/journal/journal-file.h
parent3cabeab1197d3e45f16f514f5a396e0fb311e867 (diff)
journal: make skipping of exhausted journal files effective again
Commit 668c965af "journal: skipping of exhausted journal files is bad if direction changed" fixed a correctness issue, but it also significantly limited the cases where the optimization that skips exhausted journal files could apply. As a result, some journalctl queries are much slower in v219 than in v218. (e.g. queries where a "--since" cutoff should have quickly eliminated older journal files from consideration, but didn't.) If already in the initial iteration find_location_with_matches() finds no entry, the journal file's location is not updated. This is fine, except that: - We must update at least f->last_direction. The optimization relies on it. Let's separate that from journal_file_save_location() and update it immediately after the direction checks. - The optimization was conditional on "f->current_offset > 0", but it would always be 0 in this scenario. This check is unnecessary for the optimization.
Diffstat (limited to 'src/journal/journal-file.h')
-rw-r--r--src/journal/journal-file.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index 2526e14d65..403c8f760c 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -199,7 +199,7 @@ int journal_file_find_field_object(JournalFile *f, const void *field, uint64_t s
int journal_file_find_field_object_with_hash(JournalFile *f, const void *field, uint64_t size, uint64_t hash, Object **ret, uint64_t *offset);
void journal_file_reset_location(JournalFile *f);
-void journal_file_save_location(JournalFile *f, direction_t direction, Object *o, uint64_t offset);
+void journal_file_save_location(JournalFile *f, Object *o, uint64_t offset);
int journal_file_compare_locations(JournalFile *af, JournalFile *bf);
int journal_file_next_entry(JournalFile *f, uint64_t p, direction_t direction, Object **ret, uint64_t *offset);