summaryrefslogtreecommitdiff
path: root/src/journal/journal-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r--src/journal/journal-file.c8
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,