summaryrefslogtreecommitdiff
path: root/ext2fs/dir.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-04-15 13:17:06 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-04-17 22:01:39 +0200
commitc234e34ad80801acd902c6d4892a7722fd084a87 (patch)
tree6fa1b1efbe734e1fbd8dd11625608e010c78db5c /ext2fs/dir.c
parentbf06e6535f7e00a3711978fa7835a3394b82b547 (diff)
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.
Diffstat (limited to 'ext2fs/dir.c')
-rw-r--r--ext2fs/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext2fs/dir.c b/ext2fs/dir.c
index 2dfe1d76..6cdfba27 100644
--- a/ext2fs/dir.c
+++ b/ext2fs/dir.c
@@ -306,7 +306,7 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type,
/* Here below are the spec dotdot cases. */
else if (type == RENAME || type == REMOVE)
- np = ifind (inum);
+ np = diskfs_cached_ifind (inum);
else if (type == LOOKUP)
{
@@ -359,7 +359,7 @@ diskfs_lookup_hard (struct node *dp, const char *name, enum lookup_type type,
diskfs_nput (np);
}
else if (type == RENAME || type == REMOVE)
- /* We just did ifind to get np; that allocates
+ /* We just did diskfs_cached_ifind to get np; that allocates
no new references, so we don't have anything to do */
;
else if (type == LOOKUP)