From b497f1613187c142ad6d0b76761a49811c37da80 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 16 Apr 2015 16:12:05 +0200 Subject: fatfs: port to libdiskfs' node cache * fatfs/inode.c: Drop all cache-related code. (diskfs_user_make_node): New function. (diskfs_cached_lookup_in_dirbuf): Reimplement using the `lookup_context'. (read_node): Rename to diskfs_user_read_node and adopt accordingly. (diskfs_try_dropping_softrefs): Rename to `diskfs_user_try_dropping_softrefs'. (diskfs_node_reload): Pass context to `diskfs_user_read_node'. (diskfs_alloc_node): Pass `dir' via context to `diskfs_user_read_node'. * fatfs/fatfs.h (struct disknode): Drop fields `hnext', `hprevp'. (struct lookup_context): New definition. (ifind): Drop declaration. * fatfs/dir.c (diskfs_lookup_hard): Adjust accordingly. * fatfs/main.c (fetch_root): Likewise. --- fatfs/dir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'fatfs/dir.c') diff --git a/fatfs/dir.c b/fatfs/dir.c index 5a38c63a..9eea74c1 100644 --- a/fatfs/dir.c +++ b/fatfs/dir.c @@ -342,7 +342,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) { @@ -395,7 +395,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) @@ -732,7 +732,7 @@ diskfs_dirrewrite_hard (struct node *dp, struct node *np, struct dirstat *ds) assert (err != EINVAL); /* Lookup the node, we already have a reference. */ - oldnp = ifind (inode); + oldnp = diskfs_cached_ifind (inode); assert (ds->type == RENAME); assert (ds->stat == HERE_TIS); -- cgit v1.2.3