summaryrefslogtreecommitdiff
path: root/libdiskfs/diskfs.h
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-06-24 02:30:01 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-12-01 23:31:13 +0100
commit52b5c7e8db6e6742dd6d7bf1548c6d33e149f59a (patch)
tree72f4d4debab79a88c67f58d17083672a7fd1a17f /libdiskfs/diskfs.h
parent315a491d390a26c668ede6c8fa703b7620c10d08 (diff)
libdiskfs: use ihash for the node cache
Replace the hand-written hash table in the node cache with libihash. Libihash is a self-tuning hash table, whereas the previous code used a fixed number of buckets. * libdiskfs/Makefile (HURDLIBS): Link to `ihash'. * libdiskfs/diskfs.h (struct node): Remove bucket list, add slot pointer. * libdiskfs/node-cache.c (nodecache): New ihash table replacing the old `nodehash'. (lookup): Drop function. (diskfs_cached_lookup_context): Adapt accordingly. (diskfs_cached_ifind): Likewise. (diskfs_try_dropping_softrefs): Likewise. (diskfs_node_iterate): Likewise.
Diffstat (limited to 'libdiskfs/diskfs.h')
-rw-r--r--libdiskfs/diskfs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index 11fb0ad1..106aeb06 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -25,6 +25,7 @@
#include <pthread.h>
#include <hurd/ports.h>
#include <hurd/fshelp.h>
+#include <hurd/ihash.h>
#include <hurd/iohelp.h>
#include <idvec.h>
#include <features.h>
@@ -80,8 +81,8 @@ struct peropen
filesystem. */
struct node
{
- /* Links on hash list. */
- struct node *hnext, **hprevp;
+ /* The slot we occupy in the node cache. */
+ hurd_ihash_locp_t slot;
struct disknode *dn;