diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-01-31 19:20:27 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-02 10:03:15 +0100 |
commit | 206f0f397edf1144c63a158fb30f496c3e89f256 (patch) | |
tree | d16777bd74b799acc0440efdf15cfe70869b8f47 /docs/JOURNAL_FILE_FORMAT.md | |
parent | Merge pull request #26627 from mrc0mmand/TEST-17-tweaks (diff) | |
download | systemd-206f0f397edf1144c63a158fb30f496c3e89f256.tar.xz systemd-206f0f397edf1144c63a158fb30f496c3e89f256.zip |
journal-file: journal-file: extend journal header to always carry offset of most recent entry
This way we can quickly find the most recent entry, without searching or
traversing entry array chains.
This is relevant later, as it it allows us to quickly determine the most
recent timestamps of each journal file, in a roughly atomic way.
Diffstat (limited to 'docs/JOURNAL_FILE_FORMAT.md')
-rw-r--r-- | docs/JOURNAL_FILE_FORMAT.md | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/JOURNAL_FILE_FORMAT.md b/docs/JOURNAL_FILE_FORMAT.md index 712f3bce36..ede9d923a4 100644 --- a/docs/JOURNAL_FILE_FORMAT.md +++ b/docs/JOURNAL_FILE_FORMAT.md @@ -178,8 +178,10 @@ _packed_ struct Header { le64_t data_hash_chain_depth; le64_t field_hash_chain_depth; /* Added in 252 */ - le32_t tail_entry_array_offset; \ - le32_t tail_entry_array_n_entries; \ + le32_t tail_entry_array_offset; + le32_t tail_entry_array_n_entries; + /* Added in 254 */ + le64_t tail_entry_offset; }; ``` @@ -252,6 +254,9 @@ field hash table, minus one. **tail_entry_array_offset** and **tail_entry_array_n_entries** allow immediate access to the last entry array in the global entry array chain. +**tail_entry_offset** allow immediate access to the last entry in the journal +file. + ## Extensibility The format is supposed to be extensible in order to enable future additions of |