From c234e34ad80801acd902c6d4892a7722fd084a87 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 15 Apr 2015 13:17:06 +0200 Subject: libdiskfs: implement a node cache Previously, all users of libdiskfs implemented a node cache on their own. Move the node cache from ext2fs into libdiskfs. We preserve the previous API by marking all functions that we pull from ext2fs as weak, so that users like tmpfs can still implement their own node cache. * ext2fs/dir.c (diskfs_lookup_hard): Adjust accordingly. * ext2fs/ext2fs.c (main): Don't call `inode_init'. * ext2fs/ext2fs.h (struct disknode): Drop `hnext', `hprevp'. * ext2fs/inode.c: Move the node cache into diskfs. (diskfs_user_make_node): New function. (diskfs_try_dropping_softrefs): Rename to `diskfs_user_try_dropping_softrefs'. (read_node): Rename to `diskfs_user_read_node'. Also move a chunk of code dealing with generations from `diskfs_cached_lookup' here. * libdiskfs/Makefile (OTHERSRCS): Add `node-cache.c'. * libdiskfs/diskfs.h (struct node): Add `hnext', `hprevp'. Amend existing comments, add forward declarations. * libdiskfs/node-cache.c: New file. --- libdiskfs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdiskfs/Makefile') diff --git a/libdiskfs/Makefile b/libdiskfs/Makefile index 996e86a0..47b93390 100644 --- a/libdiskfs/Makefile +++ b/libdiskfs/Makefile @@ -41,7 +41,7 @@ OTHERSRCS = conch-fetch.c conch-set.c dir-clear.c dir-init.c dir-renamed.c \ extern-inline.c \ node-create.c node-drop.c node-make.c node-rdwr.c node-update.c \ node-nref.c node-nput.c node-nrele.c node-nrefl.c node-nputl.c \ - node-nrelel.c \ + node-nrelel.c node-cache.c \ peropen-make.c peropen-rele.c protid-make.c protid-rele.c \ init-init.c init-startup.c init-first.c init-main.c \ rdwr-internal.c boot-start.c demuxer.c node-times.c shutdown.c \ -- cgit v1.2.3