vfs: NDFREE(&nd, NDF_ONLY_PNBUF) -> NDFREE_PNBUF(&nd)

This commit is contained in:
Mateusz Guzik 2022-03-24 10:10:03 +00:00
parent 9b597132ae
commit bb92cd7bcd
42 changed files with 102 additions and 102 deletions

View File

@ -2261,7 +2261,7 @@ ctl_be_block_open(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req)
else
cbe_lun->flags |= CTL_LUN_FLAG_READONLY;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
be_lun->vn = nd.ni_vp;
/* We only support disks and files. */

View File

@ -289,7 +289,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
goto cleanup;
vp = ni.ni_vp;
NDFREE(&ni, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&ni);
/*
* From here on down, we have a locked vnode that must be unlocked.

View File

@ -5368,7 +5368,7 @@ zfs_getextattr_dir(struct vop_getextattr_args *ap, const char *attrname)
#endif
error = vn_open_cred(&nd, &flags, 0, VN_OPEN_INVFS, ap->a_cred, NULL);
vp = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error != 0)
return (SET_ERROR(error));
@ -5514,12 +5514,12 @@ zfs_deleteextattr_dir(struct vop_deleteextattr_args *ap, const char *attrname)
error = namei(&nd);
vp = nd.ni_vp;
if (error != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
return (SET_ERROR(error));
}
error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if (vp == nd.ni_dvp)
@ -5658,7 +5658,7 @@ zfs_setextattr_dir(struct vop_setextattr_args *ap, const char *attrname)
error = vn_open_cred(&nd, &flags, 0600, VN_OPEN_INVFS, ap->a_cred,
NULL);
vp = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error != 0)
return (SET_ERROR(error));
@ -5845,7 +5845,7 @@ zfs_listextattr_dir(struct vop_listextattr_args *ap, const char *attrprefix)
#endif
error = namei(&nd);
vp = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error != 0)
return (SET_ERROR(error));

View File

@ -245,7 +245,7 @@ open_file(struct beri_vtblk_softc *sc, struct thread *td)
error = vn_open(&nd, &flags, 0, NULL);
if (error != 0)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_vp->v_type != VREG) {
return (EINVAL);

View File

@ -1437,7 +1437,7 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td)
error = vn_open(&nd, &flags, 0, NULL);
if (error != 0)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_vp->v_type != VREG) {
error = EINVAL;
goto bad;

View File

@ -2711,7 +2711,7 @@ xbb_open_backend(struct xbb_softc *xbb)
return (error);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
xbb->vn = nd.ni_vp;

View File

@ -162,7 +162,7 @@ cd9660_mount(struct mount *mp)
NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec);
if ((error = namei(&ndp)))
return (error);
NDFREE(&ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&ndp);
devvp = ndp.ni_vp;
if (!vn_isdisk_error(devvp, &error)) {

View File

@ -243,7 +243,7 @@ ext2_mount(struct mount *mp)
NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec);
if ((error = namei(ndp)) != 0)
return (error);
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
devvp = ndp->ni_vp;
if (!vn_isdisk_error(devvp, &error)) {

View File

@ -152,7 +152,7 @@ fuse_getdevice(const char *fspec, struct thread *td, struct cdev **fdevp)
NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec);
if ((err = namei(ndp)) != 0)
return err;
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
devvp = ndp->ni_vp;
if (devvp->v_type != VCHR) {

View File

@ -360,7 +360,7 @@ msdosfs_mount(struct mount *mp)
if (error)
return (error);
devvp = ndp.ni_vp;
NDFREE(&ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&ndp);
if (!vn_isdisk_error(devvp, &error)) {
vput(devvp);

View File

@ -244,7 +244,7 @@ nfsrv_lookupfilename(struct nameidata *ndp, char *fname, NFSPROC_T *p __unused)
NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, fname);
error = namei(ndp);
if (!error) {
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
}
return (error);
}

View File

@ -137,7 +137,7 @@ nullfs_mount(struct mount *mp)
if (error)
return (error);
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
/*
* Sanity check on lower vnode

View File

@ -230,7 +230,7 @@ udf_mount(struct mount *mp)
NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec);
if ((error = namei(ndp)))
return (error);
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
devvp = ndp->ni_vp;
if (!vn_isdisk_error(devvp, &error)) {

View File

@ -236,7 +236,7 @@ unionfs_domount(struct mount *mp)
if ((error = namei(ndp)))
return (error);
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
/* get root vnodes */
lowerrootvp = mp->mnt_vnodecovered;

View File

@ -816,7 +816,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
nd->ni_vp = NULL;
goto fail;
}
NDFREE(nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(nd);
imgp->vp = nd->ni_vp;
/*

View File

@ -222,7 +222,7 @@ sys_acct(struct thread *td, struct acct_args *uap)
error = vn_open(&nd, &flags, 0, NULL);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
#ifdef MAC
error = mac_system_check_acct(td->td_ucred, nd.ni_vp);
if (error) {

View File

@ -447,7 +447,7 @@ alq_open_flags(struct alq **alqp, const char *file, struct ucred *cred, int cmod
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
/* We just unlock so we hold a reference */
VOP_UNLOCK(nd.ni_vp);

View File

@ -100,7 +100,7 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc)
error = vn_open(&nd, &flags, 0, NULL);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
/* Allocate memory for the FLF header. */
hdr = malloc(sizeof(*hdr), M_LINKER, M_WAITOK);

View File

@ -691,7 +691,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p,
vrele(newtextdvp);
newtextdvp = NULL;
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
free(newbinname, M_PARGS);
newbinname = NULL;
}
@ -948,7 +948,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p,
else
VOP_UNLOCK(imgp->vp);
if (args->fname != NULL)
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (newtextdvp != NULL)
vrele(newtextdvp);
free(newbinname, M_PARGS);

View File

@ -1337,7 +1337,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags)
if (error)
goto done_free;
root = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
g_path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
strlcpy(g_path, path, MAXPATHLEN);
error = vn_path_to_global_path(td, root, g_path, MAXPATHLEN);

View File

@ -1028,7 +1028,7 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap)
error = vn_open(&nd, &flags, 0, NULL);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp = nd.ni_vp;
VOP_UNLOCK(vp);
if (vp->v_type != VREG) {

View File

@ -1883,7 +1883,7 @@ linker_lookup_file(const char *path, int pathlen, const char *name,
flags = FREAD;
error = vn_open(&nd, &flags, 0, NULL);
if (error == 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
type = nd.ni_vp->v_type;
if (vap)
VOP_GETATTR(nd.ni_vp, vap, td->td_ucred);
@ -1934,7 +1934,7 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname,
error = vn_open(&nd, &flags, 0, NULL);
if (error)
goto bad;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_vp->v_type != VREG)
goto bad;
best = cp = NULL;

View File

@ -2281,7 +2281,7 @@ proc_get_binpath(struct proc *p, char *binname, char **retbuf,
if (nd.ni_vp == vp)
do_fullpath = false;
vrele(nd.ni_vp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
}
}
}

View File

@ -3667,7 +3667,7 @@ corefile_open_last(struct thread *td, char *name, int indexpos,
break;
vp = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if ((flags & O_CREAT) == O_CREAT) {
nextvp = vp;
break;
@ -3840,7 +3840,7 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, struct thread *td,
NULL);
if (error == 0) {
*vpp = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
}
}

View File

@ -988,7 +988,7 @@ link_elf_load_file(linker_class_t cls, const char* filename,
error = vn_open(&nd, &flags, 0, NULL);
if (error != 0)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_vp->v_type != VREG) {
error = ENOEXEC;
firstpage = NULL;

View File

@ -717,7 +717,7 @@ link_elf_load_file(linker_class_t cls, const char *filename,
free(nd, M_TEMP);
return error;
}
NDFREE(nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(nd);
if (nd->ni_vp->v_type != VREG) {
error = ENOEXEC;
goto out;

View File

@ -642,7 +642,7 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
goto error;
vp = nd.ni_vp;
if (vp != NULL || vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_dvp == vp)
vrele(nd.ni_dvp);
else
@ -666,7 +666,7 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
#endif
if (error == 0)
error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error) {
VOP_VPUT_PAIR(nd.ni_dvp, NULL, true);
vn_finished_write(mp);

View File

@ -3792,7 +3792,7 @@ vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path,
vrele(vp);
goto out;
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp1 = nd.ni_vp;
vrele(vp);
if (vp1 == vp)

View File

@ -853,7 +853,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap)
vn_lock(vp, locked | LK_RETRY);
return (error);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
mvp = *dvp = nd.ni_vp;

View File

@ -306,7 +306,7 @@ kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace,
error = namei(&nd);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
error = extattr_set_vp(nd.ni_vp, attrnamespace, attrname, data,
nbytes, td);
@ -471,7 +471,7 @@ kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace,
error = namei(&nd);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
error = extattr_get_vp(nd.ni_vp, attrnamespace, attrname, data,
nbytes, td);
@ -603,7 +603,7 @@ kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace,
error = namei(&nd);
if (error)
return(error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
error = extattr_delete_vp(nd.ni_vp, attrnamespace, attrname, td);
vrele(nd.ni_vp);
@ -746,7 +746,7 @@ kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace,
error = namei(&nd);
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
error = extattr_list_vp(nd.ni_vp, attrnamespace, data, nbytes, td);

View File

@ -1377,7 +1377,7 @@ vfs_lookup(struct nameidata *ndp)
vrele(ndp->ni_vp);
ndp->ni_dvp = NULL;
ndp->ni_vp = NULL;
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
return (EEXIST);
}
@ -1759,12 +1759,12 @@ kern_alternate_path(const char *prefix, const char *path, enum uio_seg pathseg,
if (nd.ni_vp == ndroot.ni_vp)
error = ENOENT;
NDFREE(&ndroot, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&ndroot);
vrele(ndroot.ni_vp);
}
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vrele(nd.ni_vp);
keeporig:

View File

@ -1543,7 +1543,7 @@ vfs_domount(
error = namei(&nd);
if (error != 0)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp = nd.ni_vp;
if ((fsflags & MNT_UPDATE) == 0) {
if ((vp->v_vflag & VV_ROOT) != 0 &&
@ -1635,7 +1635,7 @@ kern_unmount(struct thread *td, const char *path, int flags)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1,
UIO_SYSSPACE, pathbuf);
if (namei(&nd) == 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
error = vn_path_to_global_path(td, nd.ni_vp, pathbuf,
MNAMELEN);
if (error == 0)

View File

@ -353,7 +353,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspath);
error = namei(&nd);
if (error) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
fspath = "/mnt";
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE,
fspath);
@ -377,7 +377,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
} else
vput(vp);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error)
printf("mountroot: unable to remount previous root "
@ -414,7 +414,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs)
if (error)
printf("mountroot: unable to remount devfs under /dev "
"(error %d)\n", error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (mporoot == mpdevfs) {
vfs_unbusy(mpdevfs);
@ -729,7 +729,7 @@ parse_mount_dev_present(const char *dev)
error = namei(&nd);
if (!error)
vput(nd.ni_vp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
return (error != 0) ? 0 : 1;
}
@ -954,7 +954,7 @@ vfs_mountroot_readconf(struct thread *td, struct sbuf *sb)
if (error)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
ofs = 0;
len = sizeof(buf) - 1;
while (1) {

View File

@ -206,7 +206,7 @@ sys_quotactl(struct thread *td, struct quotactl_args *uap)
uap->path);
if ((error = namei(&nd)) != 0)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
mp = nd.ni_vp->v_mount;
vfs_ref(mp);
vput(nd.ni_vp);
@ -1198,7 +1198,7 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
goto bad;
}
td->td_dupfd = 0;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp = nd.ni_vp;
/*
@ -1362,7 +1362,7 @@ kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
return (error);
vp = nd.ni_vp;
if (vp != NULL) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (vp == nd.ni_dvp)
vrele(nd.ni_dvp);
else
@ -1391,7 +1391,7 @@ kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
}
}
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0)
return (error);
@ -1413,7 +1413,7 @@ kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
VOP_VPUT_PAIR(nd.ni_dvp, error == 0 && !whiteout ? &nd.ni_vp : NULL,
true);
vn_finished_write(mp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error == ERELOOKUP)
goto restart;
return (error);
@ -1469,7 +1469,7 @@ kern_mkfifoat(struct thread *td, int fd, const char *path,
if ((error = namei(&nd)) != 0)
return (error);
if (nd.ni_vp != NULL) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_vp == nd.ni_dvp)
vrele(nd.ni_dvp);
else
@ -1478,7 +1478,7 @@ kern_mkfifoat(struct thread *td, int fd, const char *path,
return (EEXIST);
}
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0)
return (error);
@ -1499,7 +1499,7 @@ kern_mkfifoat(struct thread *td, int fd, const char *path,
#endif
VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true);
vn_finished_write(mp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error == ERELOOKUP)
goto restart;
return (error);
@ -1597,7 +1597,7 @@ kern_linkat(struct thread *td, int fd1, int fd2, const char *path1,
segflag, path1, fd1, &cap_linkat_source_rights);
if ((error = namei(&nd)) != 0)
return (error);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if ((nd.ni_resflags & NIRES_EMPTYPATH) != 0) {
error = priv_check(td, PRIV_VFS_FHOPEN);
if (error != 0) {
@ -1627,7 +1627,7 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path,
&cap_linkat_target_rights);
if ((error = namei(&nd)) == 0) {
if (nd.ni_vp != NULL) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_dvp == nd.ni_vp)
vrele(nd.ni_dvp);
else
@ -1641,7 +1641,7 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path,
* vp->v_type, since it cannot change, except
* to VBAD.
*/
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
vrele(vp);
return (EXDEV);
@ -1655,14 +1655,14 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path,
if (error != 0) {
vput(vp);
vput(nd.ni_dvp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
return (error);
}
error = vn_start_write(vp, &mp, V_NOWAIT);
if (error != 0) {
vput(vp);
vput(nd.ni_dvp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
error = vn_start_write(NULL, &mp,
V_XSLEEP | PCATCH);
if (error != 0)
@ -1672,11 +1672,11 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path,
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
VOP_VPUT_PAIR(nd.ni_dvp, &vp, true);
vn_finished_write(mp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp = NULL;
} else {
vput(nd.ni_dvp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vrele(vp);
return (EAGAIN);
}
@ -1746,7 +1746,7 @@ kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2,
if ((error = namei(&nd)) != 0)
goto out;
if (nd.ni_vp) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_vp == nd.ni_dvp)
vrele(nd.ni_dvp);
else
@ -1757,7 +1757,7 @@ kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2,
goto out;
}
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0)
goto out;
@ -1778,7 +1778,7 @@ kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2,
#endif
VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true);
vn_finished_write(mp);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (error == ERELOOKUP)
goto restart;
out:
@ -1812,7 +1812,7 @@ sys_undelete(struct thread *td, struct undelete_args *uap)
return (error);
if (nd.ni_vp != NULLVP || !(nd.ni_cnd.cn_flags & ISWHITEOUT)) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_vp == nd.ni_dvp)
vrele(nd.ni_dvp);
else
@ -1822,14 +1822,14 @@ sys_undelete(struct thread *td, struct undelete_args *uap)
return (EEXIST);
}
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0)
return (error);
goto restart;
}
error = VOP_WHITEOUT(nd.ni_dvp, &nd.ni_cnd, DELETE);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
vn_finished_write(mp);
if (error == ERELOOKUP)
@ -1950,7 +1950,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd,
}
if (error == 0) {
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if (vp == nd.ni_dvp)
vrele(vp);
@ -1975,7 +1975,7 @@ kern_funlinkat(struct thread *td, int dfd, const char *path, int fd,
#endif
vn_finished_write(mp);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if (vp == nd.ni_dvp)
vrele(vp);
@ -3479,7 +3479,7 @@ kern_truncate(struct thread *td, const char *path, enum uio_seg pathseg,
vrele(vp);
return (error);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
if (vp->v_type == VDIR)
error = EISDIR;
@ -3648,7 +3648,7 @@ kern_renameat_mac(struct thread *td, int oldfd, const char *old, int newfd,
if (fromnd->ni_dvp != fromnd->ni_vp)
VOP_UNLOCK(fromnd->ni_vp);
if (error != 0) {
NDFREE(fromnd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(fromnd);
vrele(fromnd->ni_dvp);
vrele(fromnd->ni_vp);
if (fromnd->ni_startdir)
@ -3695,7 +3695,7 @@ kern_renameat(struct thread *td, int oldfd, const char *old, int newfd,
/* Translate error code for rename("dir1", "dir2/."). */
if (error == EISDIR && fvp->v_type == VDIR)
error = EINVAL;
NDFREE(&fromnd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&fromnd);
vrele(fromnd.ni_dvp);
vrele(fvp);
goto out1;
@ -3704,8 +3704,8 @@ kern_renameat(struct thread *td, int oldfd, const char *old, int newfd,
tvp = tond.ni_vp;
error = vn_start_write(fvp, &mp, V_NOWAIT);
if (error != 0) {
NDFREE(&fromnd, NDF_ONLY_PNBUF);
NDFREE(&tond, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&fromnd);
NDFREE_PNBUF(&tond);
if (tvp != NULL)
vput(tvp);
if (tdvp == tvp)
@ -3762,11 +3762,11 @@ kern_renameat(struct thread *td, int oldfd, const char *old, int newfd,
if (error == 0) {
error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd,
tond.ni_dvp, tond.ni_vp, &tond.ni_cnd);
NDFREE(&fromnd, NDF_ONLY_PNBUF);
NDFREE(&tond, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&fromnd);
NDFREE_PNBUF(&tond);
} else {
NDFREE(&fromnd, NDF_ONLY_PNBUF);
NDFREE(&tond, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&fromnd);
NDFREE_PNBUF(&tond);
if (tvp != NULL)
vput(tvp);
if (tdvp == tvp)
@ -3838,7 +3838,7 @@ kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg,
if ((error = namei(&nd)) != 0)
return (error);
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if ((error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH)) != 0)
return (error);
@ -3857,7 +3857,7 @@ kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg,
#ifdef MAC
out:
#endif
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
VOP_VPUT_PAIR(nd.ni_dvp, error == 0 ? &nd.ni_vp : NULL, true);
vn_finished_write(mp);
if (error == ERELOOKUP)
@ -3943,7 +3943,7 @@ kern_frmdirat(struct thread *td, int dfd, const char *path, int fd,
goto out;
#endif
if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(vp);
if (nd.ni_dvp == vp)
vrele(nd.ni_dvp);
@ -3957,7 +3957,7 @@ kern_frmdirat(struct thread *td, int dfd, const char *path, int fd,
error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd);
vn_finished_write(mp);
out:
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(vp);
if (nd.ni_dvp == vp)
vrele(nd.ni_dvp);

View File

@ -266,7 +266,7 @@ vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags,
if (fmode & O_EXCL)
vap->va_vaflags |= VA_EXCLUSIVE;
if (vn_start_write(ndp->ni_dvp, &mp, V_NOWAIT) != 0) {
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
vput(ndp->ni_dvp);
if ((error = vn_start_write(NULL, &mp,
V_XSLEEP | PCATCH)) != 0)
@ -295,7 +295,7 @@ vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags,
false);
vn_finished_write(mp);
if (error) {
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
if (error == ERELOOKUP) {
NDREINIT(ndp);
goto restart;
@ -343,7 +343,7 @@ vn_open_cred(struct nameidata *ndp, int *flagp, int cmode, u_int vn_open_flags,
*flagp = fmode;
return (0);
bad:
NDFREE(ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(ndp);
vput(vp);
*flagp = fmode;
ndp->ni_vp = NULL;

View File

@ -818,7 +818,7 @@ sys_auditctl(struct thread *td, struct auditctl_args *uap)
#else
VOP_UNLOCK(vp);
#endif
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (vp->v_type != VREG) {
vn_close(vp, AUDIT_CLOSE_FLAGS, td->td_ucred, td);
return (EINVAL);

View File

@ -705,7 +705,7 @@ mac_veriexec_syscall(struct thread *td, int call, void *arg)
error = namei(&nd);
if (error != 0)
break;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
/* Check the fingerprint status of the vnode */
error = mac_veriexec_check_vp(td->td_ucred, nd.ni_vp, VVERIFY);

View File

@ -244,7 +244,7 @@ open_file(const char *path, struct nameidata *nid)
NDINIT(nid, LOOKUP, 0, UIO_SYSSPACE, path, curthread);
rc = vn_open(nid, &flags, 0, NULL);
NDFREE(nid, NDF_ONLY_PNBUF);
NDFREE_PNBUF(nid);
if (rc != 0)
return (rc);
@ -349,7 +349,7 @@ parse_entry(char *entry, char *prefix)
}
rc = open_file(path, &nid);
NDFREE(&nid, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nid);
if (rc != 0)
return (rc);

View File

@ -276,7 +276,7 @@ ffs_snapshot(mp, snapfile)
if (nd.ni_dvp->v_mount != mp)
error = EXDEV;
if (error) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (nd.ni_dvp == nd.ni_vp)
vrele(nd.ni_dvp);
else
@ -293,7 +293,7 @@ ffs_snapshot(mp, snapfile)
panic("ffs_snapshot: mount mismatch");
vfs_rel(wrtmp);
if (vn_start_write(NULL, &wrtmp, V_NOWAIT) != 0) {
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vput(nd.ni_dvp);
if ((error = vn_start_write(NULL, &wrtmp,
V_XSLEEP | PCATCH)) != 0)
@ -303,7 +303,7 @@ ffs_snapshot(mp, snapfile)
error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vat);
if (error) {
VOP_VPUT_PAIR(nd.ni_dvp, NULL, true);
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vn_finished_write(wrtmp);
if (error == ERELOOKUP)
goto restart;
@ -866,7 +866,7 @@ ffs_snapshot(mp, snapfile)
free(copy_fs, M_UFSMNT);
copy_fs = NULL;
out:
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
if (saved_nice > 0) {
struct proc *p;

View File

@ -440,7 +440,7 @@ ffs_mount(struct mount *mp)
}
if (error != 0)
return (error);
NDFREE(&ndp, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&ndp);
if (!vn_isdisk_error(ndp.ni_vp, &error)) {
vput(ndp.ni_vp);
return (error);

View File

@ -523,7 +523,7 @@ quotaon(struct thread *td, struct mount *mp, int type, void *fname,
vfs_rel(mp);
return (error);
}
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp = nd.ni_vp;
error = vfs_busy(mp, MBF_NOWAIT);
vfs_rel(mp);

View File

@ -2366,7 +2366,7 @@ sys_swapon(struct thread *td, struct swapon_args *uap)
if (error)
goto done;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp = nd.ni_vp;
if (vn_isdisk_error(vp, &error)) {
@ -2497,7 +2497,7 @@ kern_swapoff(struct thread *td, const char *name, enum uio_seg name_seg,
error = namei(&nd);
if (error)
goto done;
NDFREE(&nd, NDF_ONLY_PNBUF);
NDFREE_PNBUF(&nd);
vp = nd.ni_vp;
mtx_lock(&sw_dev_mtx);