vfs: retire the VREF macro
It is defined as a plain use of vref. Churn generated with coccinelle: @@ expression vp; @@ - VREF(vp) + vref(vp)
This commit is contained in:
@@ -51,6 +51,9 @@
|
|||||||
# xargs -n1 | sort | uniq -d;
|
# xargs -n1 | sort | uniq -d;
|
||||||
# done
|
# done
|
||||||
|
|
||||||
|
# 20250917: VREF macro removed
|
||||||
|
OLD_FILES+=usr/share/man/man9/VREF.9.gz
|
||||||
|
|
||||||
# 20250917: Remove a miscapitalized manual
|
# 20250917: Remove a miscapitalized manual
|
||||||
OLD_FILES+=usr/share/man/man9/vnet.9.gz
|
OLD_FILES+=usr/share/man/man9/vnet.9.gz
|
||||||
OLD_FILES+=usr/share/man/man9/vimage.9.gz
|
OLD_FILES+=usr/share/man/man9/vimage.9.gz
|
||||||
|
|||||||
@@ -2475,8 +2475,7 @@ MLINKS+=VOP_RDWR.9 VOP_READ.9 \
|
|||||||
VOP_RDWR.9 VOP_WRITE.9
|
VOP_RDWR.9 VOP_WRITE.9
|
||||||
MLINKS+=VOP_REMOVE.9 VOP_RMDIR.9
|
MLINKS+=VOP_REMOVE.9 VOP_RMDIR.9
|
||||||
MLINKS+=VNET.9 VIMAGE.9
|
MLINKS+=VNET.9 VIMAGE.9
|
||||||
MLINKS+=vref.9 VREF.9 \
|
MLINKS+=vref.9 vrefl.9
|
||||||
vref.9 vrefl.9
|
|
||||||
MLINKS+=vrele.9 vput.9 \
|
MLINKS+=vrele.9 vput.9 \
|
||||||
vrele.9 vunref.9
|
vrele.9 vunref.9
|
||||||
MLINKS+=vslock.9 vsunlock.9
|
MLINKS+=vslock.9 vsunlock.9
|
||||||
|
|||||||
@@ -386,7 +386,7 @@ cd9660_lookup(struct vop_cachedlookup_args *ap)
|
|||||||
return (error);
|
return (error);
|
||||||
*vpp = tdp;
|
*vpp = tdp;
|
||||||
} else if (dp->i_number == i_ino) {
|
} else if (dp->i_number == i_ino) {
|
||||||
VREF(vdp); /* we want ourself, ie "." */
|
vref(vdp); /* we want ourself, ie "." */
|
||||||
/*
|
/*
|
||||||
* When we lookup "." we still can be asked to lock it
|
* When we lookup "." we still can be asked to lock it
|
||||||
* differently.
|
* differently.
|
||||||
|
|||||||
@@ -1080,7 +1080,7 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlock)
|
|||||||
if ((flags & ISLASTCN) && nameiop != LOOKUP)
|
if ((flags & ISLASTCN) && nameiop != LOOKUP)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1170,7 +1170,7 @@ devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlock)
|
|||||||
if (error)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
if (*vpp == dvp) {
|
if (*vpp == dvp) {
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -579,7 +579,7 @@ ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp
|
|||||||
if (dd_ino != NULL)
|
if (dd_ino != NULL)
|
||||||
return (0);
|
return (0);
|
||||||
if (dp->i_number == ino) {
|
if (dp->i_number == ino) {
|
||||||
VREF(vdp);
|
vref(vdp);
|
||||||
*vpp = vdp;
|
*vpp = vdp;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -675,7 +675,7 @@ ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp
|
|||||||
}
|
}
|
||||||
*vpp = tdp;
|
*vpp = tdp;
|
||||||
} else if (dp->i_number == ino) {
|
} else if (dp->i_number == ino) {
|
||||||
VREF(vdp); /* we want ourself, ie "." */
|
vref(vdp); /* we want ourself, ie "." */
|
||||||
/*
|
/*
|
||||||
* When we lookup "." we still can be asked to lock it
|
* When we lookup "." we still can be asked to lock it
|
||||||
* differently.
|
* differently.
|
||||||
|
|||||||
@@ -905,7 +905,7 @@ ext2_rename(struct vop_rename_args *ap)
|
|||||||
error = ext2_checkpath(ip, dp, tcnp->cn_cred);
|
error = ext2_checkpath(ip, dp, tcnp->cn_cred);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
VREF(tdvp);
|
vref(tdvp);
|
||||||
error = vfs_relookup(tdvp, &tvp, tcnp, true);
|
error = vfs_relookup(tdvp, &tvp, tcnp, true);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1031,7 +1031,7 @@ ext2_rename(struct vop_rename_args *ap)
|
|||||||
*/
|
*/
|
||||||
fcnp->cn_flags &= ~MODMASK;
|
fcnp->cn_flags &= ~MODMASK;
|
||||||
fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
|
fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
|
||||||
VREF(fdvp);
|
vref(fdvp);
|
||||||
error = vfs_relookup(fdvp, &fvp, fcnp, true);
|
error = vfs_relookup(fdvp, &fvp, fcnp, true);
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
vrele(fdvp);
|
vrele(fdvp);
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ fdesc_lookup(struct vop_lookup_args *ap)
|
|||||||
|
|
||||||
if (cnp->cn_namelen == 1 && *pname == '.') {
|
if (cnp->cn_namelen == 1 && *pname == '.') {
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -515,7 +515,7 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname
|
|||||||
* Save directory inode pointer in ndp->ni_dvp for dirremove().
|
* Save directory inode pointer in ndp->ni_dvp for dirremove().
|
||||||
*/
|
*/
|
||||||
if (dp->de_StartCluster == scn && isadir) { /* "." */
|
if (dp->de_StartCluster == scn && isadir) { /* "." */
|
||||||
VREF(vdp);
|
vref(vdp);
|
||||||
*vpp = vdp;
|
*vpp = vdp;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -602,7 +602,7 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname
|
|||||||
msdosfs_integrity_error(pmp);
|
msdosfs_integrity_error(pmp);
|
||||||
return (EBADF);
|
return (EBADF);
|
||||||
}
|
}
|
||||||
VREF(vdp); /* we want ourself, ie "." */
|
vref(vdp); /* we want ourself, ie "." */
|
||||||
*vpp = vdp;
|
*vpp = vdp;
|
||||||
} else {
|
} else {
|
||||||
if ((error = deget(pmp, cluster, blkoff, LK_EXCLUSIVE,
|
if ((error = deget(pmp, cluster, blkoff, LK_EXCLUSIVE,
|
||||||
|
|||||||
@@ -4387,7 +4387,7 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep,
|
|||||||
attr_ok = true;
|
attr_ok = true;
|
||||||
if (NFSRV_CMPFH(nfhp->nfh_fh, nfhp->nfh_len,
|
if (NFSRV_CMPFH(nfhp->nfh_fh, nfhp->nfh_len,
|
||||||
dnp->n_fhp->nfh_fh, dnp->n_fhp->nfh_len)) {
|
dnp->n_fhp->nfh_fh, dnp->n_fhp->nfh_len)) {
|
||||||
VREF(vp);
|
vref(vp);
|
||||||
newvp = vp;
|
newvp = vp;
|
||||||
unlocknewvp = 0;
|
unlocknewvp = 0;
|
||||||
free(nfhp, M_NFSFH);
|
free(nfhp, M_NFSFH);
|
||||||
|
|||||||
@@ -1325,7 +1325,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
|||||||
newvp = NULL;
|
newvp = NULL;
|
||||||
} else if (opennamed && cnp->cn_namelen == 1 &&
|
} else if (opennamed && cnp->cn_namelen == 1 &&
|
||||||
*cnp->cn_nameptr == '.') {
|
*cnp->cn_nameptr == '.') {
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@@ -1587,7 +1587,7 @@ nfs_lookup(struct vop_lookup_args *ap)
|
|||||||
0, 1);
|
0, 1);
|
||||||
} else if (NFS_CMPFH(np, nfhp->nfh_fh, nfhp->nfh_len)) {
|
} else if (NFS_CMPFH(np, nfhp->nfh_fh, nfhp->nfh_len)) {
|
||||||
free(nfhp, M_NFSFH);
|
free(nfhp, M_NFSFH);
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
newvp = dvp;
|
newvp = dvp;
|
||||||
if (attrflag)
|
if (attrflag)
|
||||||
(void) nfscl_loadattrcache(&newvp, &nfsva, NULL,
|
(void) nfscl_loadattrcache(&newvp, &nfsva, NULL,
|
||||||
@@ -2863,7 +2863,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
|
|||||||
M_NEWNFSREQ, M_WAITOK);
|
M_NEWNFSREQ, M_WAITOK);
|
||||||
sp->s_cred = crhold(cnp->cn_cred);
|
sp->s_cred = crhold(cnp->cn_cred);
|
||||||
sp->s_dvp = dvp;
|
sp->s_dvp = dvp;
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fudge together a funny name.
|
* Fudge together a funny name.
|
||||||
@@ -2961,7 +2961,7 @@ nfs_lookitup(struct vnode *dvp, char *name, int len, struct ucred *cred,
|
|||||||
newvp = NFSTOV(np);
|
newvp = NFSTOV(np);
|
||||||
} else if (NFS_CMPFH(dnp, nfhp->nfh_fh, nfhp->nfh_len)) {
|
} else if (NFS_CMPFH(dnp, nfhp->nfh_fh, nfhp->nfh_len)) {
|
||||||
free(nfhp, M_NFSFH);
|
free(nfhp, M_NFSFH);
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
newvp = dvp;
|
newvp = dvp;
|
||||||
} else {
|
} else {
|
||||||
cn.cn_nameptr = name;
|
cn.cn_nameptr = name;
|
||||||
|
|||||||
@@ -675,7 +675,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
|
|||||||
}
|
}
|
||||||
if (islocked)
|
if (islocked)
|
||||||
NFSVOPUNLOCK(dp);
|
NFSVOPUNLOCK(dp);
|
||||||
VREF(dp);
|
vref(dp);
|
||||||
*retdirp = dp;
|
*retdirp = dp;
|
||||||
if (NFSVNO_EXRDONLY(exp))
|
if (NFSVNO_EXRDONLY(exp))
|
||||||
cnp->cn_flags |= RDONLY;
|
cnp->cn_flags |= RDONLY;
|
||||||
@@ -697,7 +697,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
dp = rootvnode;
|
dp = rootvnode;
|
||||||
VREF(dp);
|
vref(dp);
|
||||||
}
|
}
|
||||||
} else if ((nfsrv_enable_crossmntpt == 0 && NFSVNO_EXPORTED(exp)) ||
|
} else if ((nfsrv_enable_crossmntpt == 0 && NFSVNO_EXPORTED(exp)) ||
|
||||||
(nd->nd_flag & ND_NFSV4) == 0) {
|
(nd->nd_flag & ND_NFSV4) == 0) {
|
||||||
@@ -814,7 +814,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
|
|||||||
if (cnp->cn_pnbuf[0] == '/') {
|
if (cnp->cn_pnbuf[0] == '/') {
|
||||||
vrele(ndp->ni_dvp);
|
vrele(ndp->ni_dvp);
|
||||||
ndp->ni_dvp = ndp->ni_rootdir;
|
ndp->ni_dvp = ndp->ni_rootdir;
|
||||||
VREF(ndp->ni_dvp);
|
vref(ndp->ni_dvp);
|
||||||
}
|
}
|
||||||
ndp->ni_startdir = ndp->ni_dvp;
|
ndp->ni_startdir = ndp->ni_dvp;
|
||||||
ndp->ni_dvp = NULL;
|
ndp->ni_dvp = NULL;
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram,
|
|||||||
(vp->v_vflag & VV_ROOT) != 0 &&
|
(vp->v_vflag & VV_ROOT) != 0 &&
|
||||||
vp != rootvnode) {
|
vp != rootvnode) {
|
||||||
tvp = mp->mnt_vnodecovered;
|
tvp = mp->mnt_vnodecovered;
|
||||||
VREF(tvp);
|
vref(tvp);
|
||||||
at_root = 1;
|
at_root = 1;
|
||||||
} else
|
} else
|
||||||
at_root = 0;
|
at_root = 0;
|
||||||
@@ -1766,7 +1766,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram,
|
|||||||
|
|
||||||
/* If this is the same file handle, just VREF() the vnode. */
|
/* If this is the same file handle, just VREF() the vnode. */
|
||||||
if (!NFSBCMP(tfh.nfsrvfh_data, &fh, NFSX_MYFH)) {
|
if (!NFSBCMP(tfh.nfsrvfh_data, &fh, NFSX_MYFH)) {
|
||||||
VREF(dp);
|
vref(dp);
|
||||||
tdp = dp;
|
tdp = dp;
|
||||||
tnes = *exp;
|
tnes = *exp;
|
||||||
tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd, p, 1,
|
tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd, p, 1,
|
||||||
|
|||||||
@@ -1110,7 +1110,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
|
|||||||
if (vp != savevp) {
|
if (vp != savevp) {
|
||||||
if (savevp)
|
if (savevp)
|
||||||
vrele(savevp);
|
vrele(savevp);
|
||||||
VREF(vp);
|
vref(vp);
|
||||||
savevp = vp;
|
savevp = vp;
|
||||||
savevpnes = vpnes;
|
savevpnes = vpnes;
|
||||||
save_fsid = cur_fsid;
|
save_fsid = cur_fsid;
|
||||||
@@ -1155,7 +1155,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
|
|||||||
nfsvno_testexp(nd,
|
nfsvno_testexp(nd,
|
||||||
&savevpnes);
|
&savevpnes);
|
||||||
if (nd->nd_repstat == 0) {
|
if (nd->nd_repstat == 0) {
|
||||||
VREF(savevp);
|
vref(savevp);
|
||||||
vrele(vp);
|
vrele(vp);
|
||||||
vp = savevp;
|
vp = savevp;
|
||||||
vpnes = savevpnes;
|
vpnes = savevpnes;
|
||||||
@@ -1235,7 +1235,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VREF(vp);
|
vref(vp);
|
||||||
if (nfsv4_opflag[op].modifyfs)
|
if (nfsv4_opflag[op].modifyfs)
|
||||||
vn_start_write(vp, &temp_mp, V_WAIT);
|
vn_start_write(vp, &temp_mp, V_WAIT);
|
||||||
error = (*(nfsrv4_ops1[op]))(nd, isdgram, vp,
|
error = (*(nfsrv4_ops1[op]))(nd, isdgram, vp,
|
||||||
@@ -1279,8 +1279,8 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
|
|||||||
if (nfsv4_opflag[op].modifyfs)
|
if (nfsv4_opflag[op].modifyfs)
|
||||||
vn_start_write(savevp, &temp_mp, V_WAIT);
|
vn_start_write(savevp, &temp_mp, V_WAIT);
|
||||||
if (NFSVOPLOCK(savevp, LK_EXCLUSIVE) == 0) {
|
if (NFSVOPLOCK(savevp, LK_EXCLUSIVE) == 0) {
|
||||||
VREF(vp);
|
vref(vp);
|
||||||
VREF(savevp);
|
vref(savevp);
|
||||||
error = (*(nfsrv4_ops2[op]))(nd, isdgram,
|
error = (*(nfsrv4_ops2[op]))(nd, isdgram,
|
||||||
savevp, vp, &savevpnes, &vpnes);
|
savevp, vp, &savevpnes, &vpnes);
|
||||||
} else
|
} else
|
||||||
@@ -1301,7 +1301,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag,
|
|||||||
lktype = LK_SHARED;
|
lktype = LK_SHARED;
|
||||||
}
|
}
|
||||||
if (NFSVOPLOCK(vp, lktype) == 0)
|
if (NFSVOPLOCK(vp, lktype) == 0)
|
||||||
VREF(vp);
|
vref(vp);
|
||||||
else
|
else
|
||||||
nd->nd_repstat = NFSERR_PERM;
|
nd->nd_repstat = NFSERR_PERM;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ null_lookup(struct vop_lookup_args *ap)
|
|||||||
if ((error == 0 || error == EJUSTRETURN) && lvp != NULL) {
|
if ((error == 0 || error == EJUSTRETURN) && lvp != NULL) {
|
||||||
if (ldvp == lvp) {
|
if (ldvp == lvp) {
|
||||||
*ap->a_vpp = dvp;
|
*ap->a_vpp = dvp;
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
vrele(lvp);
|
vrele(lvp);
|
||||||
} else {
|
} else {
|
||||||
error = null_nodeget(mp, lvp, &vp);
|
error = null_nodeget(mp, lvp, &vp);
|
||||||
@@ -665,7 +665,7 @@ null_remove(struct vop_remove_args *ap)
|
|||||||
vp = ap->a_vp;
|
vp = ap->a_vp;
|
||||||
if (vrefcnt(vp) > 1) {
|
if (vrefcnt(vp) > 1) {
|
||||||
lvp = NULLVPTOLOWERVP(vp);
|
lvp = NULLVPTOLOWERVP(vp);
|
||||||
VREF(lvp);
|
vref(lvp);
|
||||||
vreleit = 1;
|
vreleit = 1;
|
||||||
} else
|
} else
|
||||||
vreleit = 0;
|
vreleit = 0;
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ pfs_lookup(struct vop_cachedlookup_args *va)
|
|||||||
if (namelen == 1 && pname[0] == '.') {
|
if (namelen == 1 && pname[0] == '.') {
|
||||||
pn = pd;
|
pn = pd;
|
||||||
*vpp = vn;
|
*vpp = vn;
|
||||||
VREF(vn);
|
vref(vn);
|
||||||
PFS_RETURN (0);
|
PFS_RETURN (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1174,7 +1174,7 @@ smbfs_lookup(struct vop_lookup_args *ap)
|
|||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
if (isdot) {
|
if (isdot) {
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ tarfs_lookup(struct vop_cachedlookup_args *ap)
|
|||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
return (error);
|
||||||
} else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
|
} else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
#ifdef TARFS_DEBUG
|
#ifdef TARFS_DEBUG
|
||||||
} else if (dirnode == dirnode->tmp->root &&
|
} else if (dirnode == dirnode->tmp->root &&
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
|
|||||||
if (error != 0)
|
if (error != 0)
|
||||||
goto out;
|
goto out;
|
||||||
} else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
|
} else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
error = 0;
|
error = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1226,7 +1226,7 @@ udf_lookup(struct vop_cachedlookup_args *a)
|
|||||||
if (flags & ISDOTDOT) {
|
if (flags & ISDOTDOT) {
|
||||||
error = vn_vget_ino(dvp, id, lkflags, &tdp);
|
error = vn_vget_ino(dvp, id, lkflags, &tdp);
|
||||||
} else if (node->hash_id == id) {
|
} else if (node->hash_id == id) {
|
||||||
VREF(dvp); /* we want ourself, ie "." */
|
vref(dvp); /* we want ourself, ie "." */
|
||||||
/*
|
/*
|
||||||
* When we lookup "." we still can be asked to lock it
|
* When we lookup "." we still can be asked to lock it
|
||||||
* differently.
|
* differently.
|
||||||
|
|||||||
@@ -886,7 +886,7 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap)
|
|||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
pn = pd;
|
pn = pd;
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -921,7 +921,7 @@ mqfs_lookupx(struct vop_cachedlookup_args *ap)
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
if (*vpp == dvp) {
|
if (*vpp == dvp) {
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
*vpp = dvp;
|
*vpp = dvp;
|
||||||
mqnode_release(pn);
|
mqnode_release(pn);
|
||||||
return (0);
|
return (0);
|
||||||
|
|||||||
@@ -708,7 +708,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap)
|
|||||||
if (error)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
VREF(vp);
|
vref(vp);
|
||||||
locked = VOP_ISLOCKED(vp);
|
locked = VOP_ISLOCKED(vp);
|
||||||
VOP_UNLOCK(vp);
|
VOP_UNLOCK(vp);
|
||||||
NDINIT_ATVP(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE,
|
NDINIT_ATVP(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE,
|
||||||
@@ -727,10 +727,10 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap)
|
|||||||
((*dvp)->v_vflag & VV_ROOT) &&
|
((*dvp)->v_vflag & VV_ROOT) &&
|
||||||
((*dvp)->v_mount->mnt_flag & MNT_UNION)) {
|
((*dvp)->v_mount->mnt_flag & MNT_UNION)) {
|
||||||
*dvp = (*dvp)->v_mount->mnt_vnodecovered;
|
*dvp = (*dvp)->v_mount->mnt_vnodecovered;
|
||||||
VREF(mvp);
|
vref(mvp);
|
||||||
VOP_UNLOCK(mvp);
|
VOP_UNLOCK(mvp);
|
||||||
vn_close(mvp, FREAD, cred, td);
|
vn_close(mvp, FREAD, cred, td);
|
||||||
VREF(*dvp);
|
vref(*dvp);
|
||||||
vn_lock(*dvp, LK_SHARED | LK_RETRY);
|
vn_lock(*dvp, LK_SHARED | LK_RETRY);
|
||||||
covered = 1;
|
covered = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -883,7 +883,7 @@ vfs_lookup_degenerate(struct nameidata *ndp, struct vnode *dp, int wantparent)
|
|||||||
}
|
}
|
||||||
if (wantparent) {
|
if (wantparent) {
|
||||||
ndp->ni_dvp = dp;
|
ndp->ni_dvp = dp;
|
||||||
VREF(dp);
|
vref(dp);
|
||||||
}
|
}
|
||||||
ndp->ni_vp = dp;
|
ndp->ni_vp = dp;
|
||||||
cnp->cn_namelen = 0;
|
cnp->cn_namelen = 0;
|
||||||
@@ -1284,7 +1284,7 @@ vfs_lookup(struct nameidata *ndp)
|
|||||||
(cnp->cn_flags & NOCROSSMOUNT) != 0)) {
|
(cnp->cn_flags & NOCROSSMOUNT) != 0)) {
|
||||||
ndp->ni_dvp = dp;
|
ndp->ni_dvp = dp;
|
||||||
ndp->ni_vp = dp;
|
ndp->ni_vp = dp;
|
||||||
VREF(dp);
|
vref(dp);
|
||||||
goto nextname;
|
goto nextname;
|
||||||
}
|
}
|
||||||
if ((dp->v_vflag & VV_ROOT) == 0)
|
if ((dp->v_vflag & VV_ROOT) == 0)
|
||||||
@@ -1295,7 +1295,7 @@ vfs_lookup(struct nameidata *ndp)
|
|||||||
}
|
}
|
||||||
tdp = dp;
|
tdp = dp;
|
||||||
dp = dp->v_mount->mnt_vnodecovered;
|
dp = dp->v_mount->mnt_vnodecovered;
|
||||||
VREF(dp);
|
vref(dp);
|
||||||
vput(tdp);
|
vput(tdp);
|
||||||
vn_lock(dp,
|
vn_lock(dp,
|
||||||
enforce_lkflags(dp->v_mount, cnp->cn_lkflags |
|
enforce_lkflags(dp->v_mount, cnp->cn_lkflags |
|
||||||
@@ -1343,7 +1343,7 @@ vfs_lookup(struct nameidata *ndp)
|
|||||||
(dp->v_mount->mnt_flag & MNT_UNION)) {
|
(dp->v_mount->mnt_flag & MNT_UNION)) {
|
||||||
tdp = dp;
|
tdp = dp;
|
||||||
dp = dp->v_mount->mnt_vnodecovered;
|
dp = dp->v_mount->mnt_vnodecovered;
|
||||||
VREF(dp);
|
vref(dp);
|
||||||
vput(tdp);
|
vput(tdp);
|
||||||
vn_lock(dp,
|
vn_lock(dp,
|
||||||
enforce_lkflags(dp->v_mount, cnp->cn_lkflags |
|
enforce_lkflags(dp->v_mount, cnp->cn_lkflags |
|
||||||
@@ -1615,7 +1615,7 @@ vfs_relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
|
|||||||
}
|
}
|
||||||
/* ASSERT(dvp == ndp->ni_startdir) */
|
/* ASSERT(dvp == ndp->ni_startdir) */
|
||||||
if (refstart)
|
if (refstart)
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
if ((cnp->cn_flags & LOCKPARENT) == 0)
|
if ((cnp->cn_flags & LOCKPARENT) == 0)
|
||||||
VOP_UNLOCK(dp);
|
VOP_UNLOCK(dp);
|
||||||
/*
|
/*
|
||||||
@@ -1653,7 +1653,7 @@ vfs_relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
|
|||||||
|
|
||||||
/* ASSERT(dvp == ndp->ni_startdir) */
|
/* ASSERT(dvp == ndp->ni_startdir) */
|
||||||
if (refstart)
|
if (refstart)
|
||||||
VREF(dvp);
|
vref(dvp);
|
||||||
|
|
||||||
if ((cnp->cn_flags & LOCKLEAF) == 0)
|
if ((cnp->cn_flags & LOCKLEAF) == 0)
|
||||||
VOP_UNLOCK(dp);
|
VOP_UNLOCK(dp);
|
||||||
|
|||||||
@@ -4363,7 +4363,7 @@ kern_getdirentries(struct thread *td, int fd, char *buf, size_t count,
|
|||||||
struct vnode *tvp = vp;
|
struct vnode *tvp = vp;
|
||||||
|
|
||||||
vp = vp->v_mount->mnt_vnodecovered;
|
vp = vp->v_mount->mnt_vnodecovered;
|
||||||
VREF(vp);
|
vref(vp);
|
||||||
fp->f_vnode = vp;
|
fp->f_vnode = vp;
|
||||||
foffset = 0;
|
foffset = 0;
|
||||||
vput(tvp);
|
vput(tvp);
|
||||||
|
|||||||
@@ -451,8 +451,6 @@ extern int vttoif_tab[];
|
|||||||
#define VS_SKIP_UNMOUNT 0x0001 /* vfs_write_suspend: fail if the
|
#define VS_SKIP_UNMOUNT 0x0001 /* vfs_write_suspend: fail if the
|
||||||
filesystem is being unmounted */
|
filesystem is being unmounted */
|
||||||
|
|
||||||
#define VREF(vp) vref(vp)
|
|
||||||
|
|
||||||
#ifdef DIAGNOSTIC
|
#ifdef DIAGNOSTIC
|
||||||
#define VATTR_NULL(vap) vattr_null(vap)
|
#define VATTR_NULL(vap) vattr_null(vap)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
if (dp->i_number == ino) {
|
if (dp->i_number == ino) {
|
||||||
VREF(vdp);
|
vref(vdp);
|
||||||
*vpp = vdp;
|
*vpp = vdp;
|
||||||
vput(tdp);
|
vput(tdp);
|
||||||
return (0);
|
return (0);
|
||||||
@@ -707,7 +707,7 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
|
|||||||
|
|
||||||
*vpp = tdp;
|
*vpp = tdp;
|
||||||
} else if (dp->i_number == ino) {
|
} else if (dp->i_number == ino) {
|
||||||
VREF(vdp); /* we want ourself, ie "." */
|
vref(vdp); /* we want ourself, ie "." */
|
||||||
/*
|
/*
|
||||||
* When we lookup "." we still can be asked to lock it
|
* When we lookup "." we still can be asked to lock it
|
||||||
* differently.
|
* differently.
|
||||||
|
|||||||
Reference in New Issue
Block a user