# pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
+DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
+ journal_file_hash_ops_by_path,
+ char, path_hash_func, path_compare,
+ JournalFile, journal_file_close);
+
static int mmap_prot_from_open_flags(int flags) {
switch (flags & O_ACCMODE) {
case O_RDONLY:
return NULL;
}
- j->files = ordered_hashmap_new(&path_hash_ops);
+ j->files = ordered_hashmap_new(&journal_file_hash_ops_by_path);
if (!j->files)
return NULL;
if (j->mmap)
mmap_cache_stats_log_debug(j->mmap);
- ordered_hashmap_free_with_destructor(j->files, journal_file_close);
+ ordered_hashmap_free(j->files);
iterated_cache_free(j->files_cache);
hashmap_free(j->directories_by_path);