From: Chas Williams Date: Fri, 13 Apr 2001 22:56:00 +0000 (+0000) Subject: linux-inode-and-dentry-validation-rework-20010413 X-Git-Tag: openafs-stable-1_1_0~211 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=c402670db9c69f31bf7a5bcf522035b3f9a1a217 linux-inode-and-dentry-validation-rework-20010413 gets us closer to the ideal in inode and dentry revalidation --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index e89704d..ee36db5 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -649,16 +649,6 @@ static int afs_linux_revalidate(struct dentry *dp) lock_kernel(); #endif - /* Drop the dentry if the callback is broken */ - if (!(vcp->states & CStatd)) { - d_drop(dp); -#ifdef AFS_LINUX24_ENV - unlock_kernel(); -#endif - AFS_GUNLOCK(); - return 0; - } - /* Make this a fast path (no crref), since it's called so often. */ if (vcp->states & CStatd) { if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */ @@ -704,18 +694,39 @@ static int afs_linux_dentry_revalidate(struct dentry *dp) struct vcache *vcp = (struct vcache*)dp->d_inode; /* If it's a negative dentry, then there's nothing to do. */ - if (!vcp) + if (!vcp) { goto out_valid; + } - if (afs_linux_revalidate(dp) == 0) - goto out_valid; + AFS_GLOCK(); +#ifdef AFS_LINUX24_ENV + lock_kernel(); +#endif -out_bad: - return 0; + /* Drop the dentry if the callback is broken */ + if (!(vcp->states & CStatd)) { + d_drop(dp); +#ifdef AFS_LINUX24_ENV + unlock_kernel(); +#endif + AFS_GUNLOCK(); + return 0; + } + + /* Make this a fast path (no crref), since it's called so often. */ + if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */ + check_bad_parent(dp); /* check and correct mvid */ + vcache2inode(vcp); +#ifdef AFS_LINUX24_ENV + unlock_kernel(); +#endif + AFS_GUNLOCK(); out_valid: return 1; +out_bad: + return 0; } /* afs_dentry_iput */