diff options
author | phk <phk@FreeBSD.org> | 2005-02-22 14:52:00 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-02-22 14:52:00 +0000 |
commit | 33d6741fda492f5c31a4f7d17822acc11270f73d (patch) | |
tree | ee10916ab9254a5b20ae009e37300d619a056da4 /sys/nfsclient/nfs_vnops.c | |
parent | d77b9fb94f3e72de3ae551fe226b132606e39439 (diff) | |
download | FreeBSD-src-33d6741fda492f5c31a4f7d17822acc11270f73d.zip FreeBSD-src-33d6741fda492f5c31a4f7d17822acc11270f73d.tar.gz |
vp->v_id is a private field for the vfs namecache and it is a big mistake
that NFS ever started using it. Long time ago I added the necessary
vhold()/vdrop() calls to replace it, but forgot to remove the v_id code.
Do it now.
Diffstat (limited to 'sys/nfsclient/nfs_vnops.c')
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 1c41c93..5451fff 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -796,7 +796,6 @@ nfs_lookup(struct vop_lookup_args *ap) np = VTONFS(dvp); if ((error = cache_lookup(dvp, vpp, cnp)) && error != ENOENT) { struct vattr vattr; - int vpid; if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) { *vpp = NULLVP; @@ -805,7 +804,6 @@ nfs_lookup(struct vop_lookup_args *ap) vhold(*vpp); newvp = *vpp; - vpid = newvp->v_id; /* * See the comment starting `Step through' in ufs/ufs_lookup.c * for an explanation of the locking protocol @@ -830,18 +828,16 @@ nfs_lookup(struct vop_lookup_args *ap) } } if (!error) { - if (vpid == newvp->v_id) { - if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) - && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { - nfsstats.lookupcache_hits++; - if (cnp->cn_nameiop != LOOKUP && - (flags & ISLASTCN)) - cnp->cn_flags |= SAVENAME; - vdrop(newvp); - return (0); - } - cache_purge(newvp); + if (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred, td) + && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime) { + nfsstats.lookupcache_hits++; + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + vdrop(newvp); + return (0); } + cache_purge(newvp); vput(newvp); if (lockparent && dvp != newvp && (flags & ISLASTCN)) VOP_UNLOCK(dvp, 0, td); |