diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-08-18 01:45:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-08-18 01:45:39 +0200 |
commit | fb9a24b6b1ed5b1f42e6e350ccdb7e11800a83bd (patch) | |
tree | c71c7fc28c6bf938d009123ee425e5be248fd4e7 /src/journal/journal-file.c | |
parent | 97147f8c1f63234470a7062d2ed0f999c0996d42 (diff) |
journal: even more simple static object tests
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r-- | src/journal/journal-file.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index e04ffd0452..df991a4a07 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -798,6 +798,14 @@ uint64_t journal_file_entry_array_n_items(Object *o) { return (le64toh(o->object.size) - offsetof(Object, entry_array.items)) / sizeof(uint64_t); } +uint64_t journal_file_hash_table_n_items(Object *o) { + assert(o); + assert(o->object.type == OBJECT_DATA_HASH_TABLE || + o->object.type == OBJECT_FIELD_HASH_TABLE); + + return (le64toh(o->object.size) - offsetof(Object, hash_table.items)) / sizeof(HashItem); +} + static int link_entry_into_array(JournalFile *f, le64_t *first, le64_t *idx, |