diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-12-16 21:03:36 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-12-18 12:17:20 +0100 |
commit | 6573ef05a3cbe15949acfbbf1ad03726068907bd (patch) | |
tree | cb3d38ce419ba37de77b8cb358e82883573d8e22 /src/journal/journal-file.h | |
parent | 1fc605b0e130149a44abfa38c33f4535cfe548ea (diff) |
journal: keep per-JournalFile location info during iteration
In next_beyond_location() when we find a candidate entry in a journal
file, save its location information in struct JournalFile.
The purpose of remembering the locations of candidate entries is to be
able to save work in the next iteration. This patch does only the
remembering part.
LOCATION_SEEK means the location identifies a candidate entry.
When a winner is picked from among candidates, it becomes
LOCATION_DISCRETE.
LOCATION_TAIL here signifies we've iterated the file to the end (or the
beginning in the case of reversed direction).
Diffstat (limited to 'src/journal/journal-file.h')
-rw-r--r-- | src/journal/journal-file.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index 3a19827fb7..2bdfff782e 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -77,6 +77,7 @@ typedef struct JournalFile { bool tail_entry_monotonic_valid:1; direction_t last_direction; + LocationType location_type; char *path; struct stat last_stat; @@ -86,6 +87,11 @@ typedef struct JournalFile { HashItem *field_hash_table; uint64_t current_offset; + uint64_t current_seqnum; + uint64_t current_realtime; + uint64_t current_monotonic; + sd_id128_t current_boot_id; + uint64_t current_xor_hash; JournalMetrics metrics; MMapCache *mmap; @@ -190,6 +196,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); int journal_file_next_entry(JournalFile *f, Object *o, uint64_t p, direction_t direction, Object **ret, uint64_t *offset); int journal_file_next_entry_for_data(JournalFile *f, Object *o, uint64_t p, uint64_t data_offset, direction_t direction, Object **ret, uint64_t *offset); |