From 52b5c7e8db6e6742dd6d7bf1548c6d33e149f59a Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 24 Jun 2015 02:30:01 +0200 Subject: 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. --- libdiskfs/diskfs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libdiskfs/diskfs.h') 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 #include #include +#include #include #include #include @@ -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; -- cgit v1.2.3