From: Chas Williams Date: Mon, 2 Apr 2001 23:48:22 +0000 (+0000) Subject: linux-dentry-validation-changes-20010402 X-Git-Tag: openafs-stable-1_1_0~242 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=2fb73345baf5e6b3cf93ce35ff8910612850d767 linux-dentry-validation-changes-20010402 change afs_linux_dentry_revalidate to call afs_linux_revalidate --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 2da94cb..740e098 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -619,22 +619,13 @@ static int afs_linux_revalidate(struct dentry *dp) lock_kernel(); #endif - /* If it's a negative dentry, then there's nothing to do. */ - if (!vcp) { -#ifdef AFS_LINUX24_ENV - unlock_kernel(); -#endif - AFS_GUNLOCK(); - return 0; - } - /* Drop the dentry if the callback is broken */ if (!(vcp->states & CStatd)) { - d_drop(dp); + d_drop(dp); #ifdef AFS_LINUX24_ENV - unlock_kernel(); + unlock_kernel(); #endif - AFS_GUNLOCK(); + AFS_GUNLOCK(); return 0; } @@ -682,44 +673,19 @@ static int afs_linux_dentry_revalidate(struct dentry *dp) struct vrequest treq; struct vcache *vcp = (struct vcache*)dp->d_inode; - AFS_GLOCK(); -#ifdef AFS_LINUX24_ENV - lock_kernel(); -#endif - /* If it's a negative dentry, then there's nothing to do. */ - if (!vcp) { -#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 */ - check_bad_parent(dp); /* check and correct mvid */ - vcache2inode(vcp); -#ifdef AFS_LINUX24_ENV - unlock_kernel(); -#endif - AFS_GUNLOCK(); - return 0; - } + if (!vcp) + goto out_valid; - credp = crref(); - code = afs_InitReq(&treq, credp); - if (!code) - code = afs_VerifyVCache(vcp, &treq); + if (afs_linux_revalidate(dp) == 0) + goto out_valid; -#ifdef AFS_LINUX24_ENV - unlock_kernel(); -#endif - AFS_GUNLOCK(); - crfree(credp); +out_bad: + return 0; +out_valid: return 1; + } /* afs_dentry_iput */