diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2021-11-25 21:43:06 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2021-11-25 22:50:42 +0000 |
commit | 7e1d3eefd410ca0fbae5a217422821244c3eeee4 (patch) | |
tree | 4bd504069949f38227970cbe8e49c45665f06279 /sys/kern | |
parent | c40fee6f7d26862260f0accc1dfeaa7b1328f5fd (diff) | |
download | src-7e1d3eefd410ca0fbae5a217422821244c3eeee4.tar.gz src-7e1d3eefd410ca0fbae5a217422821244c3eeee4.zip |
vfs: remove the unused thread argument from NDINIT*
See b4a58fbf640409a1 ("vfs: remove cn_thread")
Bump __FreeBSD_version to 1400043.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/imgact_elf.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_acct.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_alq.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_ctf.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_exec.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_jail.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_ktrace.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_linker.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_proc.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 4 | ||||
-rw-r--r-- | sys/kern/link_elf.c | 2 | ||||
-rw-r--r-- | sys/kern/link_elf_obj.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_usrreq.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_acl.c | 8 | ||||
-rw-r--r-- | sys/kern/vfs_cache.c | 5 | ||||
-rw-r--r-- | sys/kern/vfs_default.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_extattr.c | 16 | ||||
-rw-r--r-- | sys/kern/vfs_lookup.c | 7 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_mountroot.c | 11 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 63 |
22 files changed, 74 insertions, 86 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index c7c131da184c..7e970c0215b6 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -800,7 +800,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_long *addr, imgp->attr = attr; NDINIT(nd, LOOKUP, ISOPEN | FOLLOW | LOCKSHARED | LOCKLEAF, - UIO_SYSSPACE, file, curthread); + UIO_SYSSPACE, file); if ((error = namei(nd)) != 0) { nd->ni_vp = NULL; goto fail; diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index ad272676083e..7a3ff1700b66 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -216,8 +216,8 @@ sys_acct(struct thread *td, struct acct_args *uap) * appending and make sure it's a 'normal'. */ if (uap->path != NULL) { - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, - UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, + uap->path); flags = FWRITE | O_APPEND; error = vn_open(&nd, &flags, 0, NULL); if (error) diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index 4b30e519d335..4285ddb03b78 100644 --- a/sys/kern/kern_alq.c +++ b/sys/kern/kern_alq.c @@ -431,7 +431,6 @@ int alq_open_flags(struct alq **alqp, const char *file, struct ucred *cred, int cmode, int size, int flags) { - struct thread *td __unused; struct nameidata nd; struct alq *alq; int oflags; @@ -440,9 +439,8 @@ alq_open_flags(struct alq **alqp, const char *file, struct ucred *cred, int cmod KASSERT((size > 0), ("%s: size <= 0", __func__)); *alqp = NULL; - td = curthread; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file); oflags = FWRITE | O_NOFOLLOW | O_CREAT; error = vn_open_cred(&nd, &oflags, cmode, 0, cred, NULL); diff --git a/sys/kern/kern_ctf.c b/sys/kern/kern_ctf.c index ee7576ab6fb9..bd2186693f0b 100644 --- a/sys/kern/kern_ctf.c +++ b/sys/kern/kern_ctf.c @@ -100,7 +100,7 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) */ ef->ctfcnt = -1; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, lf->pathname, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, lf->pathname); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 575771346fd1..b9684833fa0e 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -499,7 +499,7 @@ interpret: */ NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | LOCKSHARED | FOLLOW | SAVENAME | AUDITVNODE1 | WANTPARENT, UIO_SYSSPACE, - args->fname, td); + args->fname); error = namei(&nd); if (error) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index e9019eda4d6c..377539f1d1bd 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -962,8 +962,7 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) error = EINVAL; goto done_free; } - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, - path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, path); error = namei(&nd); if (error) goto done_free; diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index be0ccfd344fa..5371f73672a0 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1023,7 +1023,7 @@ sys_ktrace(struct thread *td, struct ktrace_args *uap) /* * an operation which requires a file argument. */ - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->fname, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->fname); flags = FREAD | FWRITE | O_NOFOLLOW; error = vn_open(&nd, &flags, 0, NULL); if (error) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index c0005f2f5cf6..bcdbb467e84e 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1854,7 +1854,7 @@ linker_lookup_file(const char *path, int pathlen, const char *name, * Attempt to open the file, and return the path if * we succeed and it's a regular file. */ - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, result, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, result); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error == 0) { @@ -1904,7 +1904,7 @@ linker_hints_lookup(const char *path, int pathlen, const char *modname, snprintf(pathbuf, reclen, "%.*s%s%s", pathlen, path, sep, linker_hintfile); - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, pathbuf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, pathbuf); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 21af09265dd2..2f029e261427 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2275,8 +2275,7 @@ proc_get_binpath(struct proc *p, char *binname, char **retbuf, * might have been renamed or replaced, in * which case we should not report old name. */ - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, *retbuf, - curthread); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, *retbuf); error = namei(&nd); if (error == 0) { if (nd.ni_vp == vp) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 15d509eca52d..4b036395f133 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3658,7 +3658,7 @@ corefile_open_last(struct thread *td, char *name, int indexpos, i); name[indexpos + indexlen] = ch; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name); error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, NULL); if (error != 0) @@ -3833,7 +3833,7 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, struct thread *td, if ((td->td_proc->p_flag & P_SUGID) != 0) flags |= O_EXCL; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name); error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, NULL); if (error == 0) { diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 4114bd46f0c0..075238b91d95 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -972,7 +972,7 @@ link_elf_load_file(linker_class_t cls, const char* filename, lf = NULL; shstrs = NULL; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error != 0) diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index bafbd9f4c616..bb2b7628a60e 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -698,7 +698,7 @@ link_elf_load_file(linker_class_t cls, const char *filename, hdr = NULL; nd = malloc(sizeof(struct nameidata), M_TEMP, M_WAITOK); - NDINIT(nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename, td); + NDINIT(nd, LOOKUP, FOLLOW, UIO_SYSSPACE, filename); flags = FREAD; error = vn_open(nd, &flags, 0, NULL); if (error) { diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index fe018aa65d85..0ec1ba677173 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -637,8 +637,7 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td) restart: NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | SAVENAME | NOCACHE, - UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_BINDAT), - td); + UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_BINDAT)); /* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */ error = namei(&nd); if (error) @@ -1570,8 +1569,7 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam, else sa = NULL; NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, - UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_CONNECTAT), - td); + UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_CONNECTAT)); error = namei(&nd); if (error) vp = NULL; diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 6bae01bd9d85..ba4c217ae6b9 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -377,7 +377,7 @@ kern___acl_get_path(struct thread *td, const char *path, acl_type_t type, struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); error = namei(&nd); if (error == 0) { error = vacl_get_acl(td, nd.ni_vp, type, aclp); @@ -415,7 +415,7 @@ kern___acl_set_path(struct thread *td, const char *path, struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); error = namei(&nd); if (error == 0) { error = vacl_set_acl(td, nd.ni_vp, type, aclp); @@ -491,7 +491,7 @@ kern___acl_delete_path(struct thread *td, const char *path, struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path); error = namei(&nd); if (error == 0) { error = vacl_delete(td, nd.ni_vp, type); @@ -548,7 +548,7 @@ kern___acl_aclcheck_path(struct thread *td, const char *path, acl_type_t type, struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow, UIO_USERSPACE, path); error = namei(&nd); if (error == 0) { error = vacl_aclcheck(td, nd.ni_vp, type, aclp); diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 4c76244901bb..a34e0dad74a8 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3127,7 +3127,7 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf, if (flags != 0) return (EINVAL); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | SAVENAME | WANTPARENT | AUDITVNODE1, - pathseg, path, fd, &cap_fstat_rights, td); + pathseg, path, fd, &cap_fstat_rights); if ((error = namei(&nd)) != 0) return (error); error = vn_fullpath_hardlink(nd.ni_vp, nd.ni_dvp, nd.ni_cnd.cn_nameptr, @@ -3772,8 +3772,7 @@ vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path, * As a side effect, the vnode is relocked. * If vnode was renamed, return ENOENT. */ - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_SYSSPACE, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_SYSSPACE, path); error = namei(&nd); if (error != 0) { vrele(vp); diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 02fae41e3404..763e9a943f7d 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -846,7 +846,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) locked = VOP_ISLOCKED(vp); VOP_UNLOCK(vp); NDINIT_ATVP(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, - "..", vp, td); + "..", vp); flags = FREAD; error = vn_open_cred(&nd, &flags, 0, VN_OPEN_NOAUDIT, cred, NULL); if (error) { diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 43b000c78110..d520e1655cf5 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -102,8 +102,8 @@ sys_extattrctl(struct thread *td, struct extattrctl_args *uap) mp = NULL; filename_vp = NULL; if (uap->filename != NULL) { - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE2, - UIO_USERSPACE, uap->filename, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE2, UIO_USERSPACE, + uap->filename); error = namei(&nd); if (error) return (error); @@ -112,8 +112,8 @@ sys_extattrctl(struct thread *td, struct extattrctl_args *uap) } /* uap->path is always defined. */ - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, + uap->path); error = namei(&nd); if (error) goto out; @@ -302,7 +302,7 @@ kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace, return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); error = namei(&nd); if (error) return (error); @@ -467,7 +467,7 @@ kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace, return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); error = namei(&nd); if (error) return (error); @@ -599,7 +599,7 @@ kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, return(error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); error = namei(&nd); if (error) return(error); @@ -742,7 +742,7 @@ kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace, int error; AUDIT_ARG_VALUE(attrnamespace); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); error = namei(&nd); if (error) return (error); diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 6ca8ac6de6fc..d5960dd9e920 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1735,13 +1735,13 @@ kern_alternate_path(const char *prefix, const char *path, enum uio_seg pathseg, for (cp = &ptr[len] - 1; *cp != '/'; cp--); *cp = '\0'; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf); error = namei(&nd); *cp = '/'; if (error != 0) goto keeporig; } else { - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf); error = namei(&nd); if (error != 0) @@ -1755,8 +1755,7 @@ kern_alternate_path(const char *prefix, const char *path, enum uio_seg pathseg, * root directory and never finding it, because "/" resolves * to the emulation root directory. This is expensive :-( */ - NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, prefix, - td); + NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, prefix); /* We shouldn't ever get an error from this namei(). */ error = namei(&ndroot); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 07076bc2f4f7..ee163a5e8137 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1538,8 +1538,8 @@ vfs_domount( /* * Get vnode to be covered or mount point's vnode in case of MNT_UPDATE. */ - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_SYSSPACE, fspath, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_SYSSPACE, + fspath); error = namei(&nd); if (error != 0) return (error); @@ -1633,7 +1633,7 @@ kern_unmount(struct thread *td, const char *path, int flags) * Try to find global path for path argument. */ NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, - UIO_SYSSPACE, pathbuf, td); + UIO_SYSSPACE, pathbuf); if (namei(&nd) == 0) { NDFREE(&nd, NDF_ONLY_PNBUF); error = vn_path_to_global_path(td, nd.ni_vp, pathbuf, diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 54d5a442c9ee..9f3959f06b86 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -350,14 +350,13 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) if (mporoot != mpdevfs) { /* Remount old root under /.mount or /mnt */ fspath = "/.mount"; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, - fspath, td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspath); error = namei(&nd); if (error) { NDFREE(&nd, NDF_ONLY_PNBUF); fspath = "/mnt"; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, - fspath, td); + fspath); error = namei(&nd); } if (!error) { @@ -386,7 +385,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) } /* Remount devfs under /dev */ - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, "/dev", td); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, "/dev"); error = namei(&nd); if (!error) { vp = nd.ni_vp; @@ -726,7 +725,7 @@ parse_mount_dev_present(const char *dev) struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, dev, curthread); + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, dev); error = namei(&nd); if (!error) vput(nd.ni_vp); @@ -949,7 +948,7 @@ vfs_mountroot_readconf(struct thread *td, struct sbuf *sb) ssize_t resid; int error, flags, len; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, "/.mount.conf", td); + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, "/.mount.conf"); flags = FREAD; error = vn_open(&nd, &flags, 0, NULL); if (error) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index cd784cd67961..65a9ebf304fe 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -394,7 +394,7 @@ sysctl_try_reclaim_vnode(SYSCTL_HANDLER_ARGS) buf[req->newlen] = '\0'; ndflags = LOCKLEAF | NOFOLLOW | AUDITVNODE1 | SAVENAME; - NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf, curthread); + NDINIT(&nd, LOOKUP, ndflags, UIO_SYSSPACE, buf); if ((error = namei(&nd)) != 0) goto out; vp = nd.ni_vp; diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 4391853337bd..00da4e7c1b07 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -203,7 +203,7 @@ sys_quotactl(struct thread *td, struct quotactl_args *uap) if (!prison_allow(td->td_ucred, PR_ALLOW_QUOTAS)) return (EPERM); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + uap->path); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -335,7 +335,7 @@ kern_statfs(struct thread *td, const char *path, enum uio_seg pathseg, struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error != 0) return (error); @@ -953,7 +953,7 @@ kern_chdir(struct thread *td, const char *path, enum uio_seg pathseg) int error; NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, - pathseg, path, td); + pathseg, path); if ((error = namei(&nd)) != 0) return (error); if ((error = change_dir(nd.ni_vp, td)) != 0) { @@ -998,7 +998,7 @@ sys_chroot(struct thread *td, struct chroot_args *uap) PROC_UNLOCK(p); } NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1, - UIO_USERSPACE, uap->path, td); + UIO_USERSPACE, uap->path); error = namei(&nd); if (error != 0) goto error; @@ -1165,7 +1165,7 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, fp->f_flag = flags & FMASK; cmode = ((mode & ~pdp->pd_cmask) & ALLPERMS) & ~S_ISTXT; NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd, - &rights, td); + &rights); td->td_dupfd = -1; /* XXX check for fdopen */ error = vn_open(&nd, &flags, cmode, fp); if (error != 0) { @@ -1357,8 +1357,7 @@ kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | - NOCACHE, pathseg, path, fd, &cap_mknodat_rights, - td); + NOCACHE, pathseg, path, fd, &cap_mknodat_rights); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -1466,8 +1465,7 @@ kern_mkfifoat(struct thread *td, int fd, const char *path, restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | - NOCACHE, pathseg, path, fd, &cap_mkfifoat_rights, - td); + NOCACHE, pathseg, path, fd, &cap_mkfifoat_rights); if ((error = namei(&nd)) != 0) return (error); if (nd.ni_vp != NULL) { @@ -1596,7 +1594,7 @@ kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, bwillwrite(); NDINIT_ATRIGHTS(&nd, LOOKUP, AUDITVNODE1 | at2cnpflags(flag, AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH), - segflag, path1, fd1, &cap_linkat_source_rights, td); + segflag, path1, fd1, &cap_linkat_source_rights); if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1626,7 +1624,7 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, } NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2 | NOCACHE, segflag, path, fd, - &cap_linkat_target_rights, td); + &cap_linkat_target_rights); if ((error = namei(&nd)) == 0) { if (nd.ni_vp != NULL) { NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1744,8 +1742,7 @@ kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2, restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | - NOCACHE, segflg, path2, fd, &cap_symlinkat_rights, - td); + NOCACHE, segflg, path2, fd, &cap_symlinkat_rights); if ((error = namei(&nd)) != 0) goto out; if (nd.ni_vp) { @@ -1809,7 +1806,7 @@ sys_undelete(struct thread *td, struct undelete_args *uap) restart: bwillwrite(); NDINIT(&nd, DELETE, LOCKPARENT | DOWHITEOUT | AUDITVNODE1, - UIO_USERSPACE, uap->path, td); + UIO_USERSPACE, uap->path); error = namei(&nd); if (error != 0) return (error); @@ -1924,7 +1921,7 @@ restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH), - pathseg, path, dfd, &cap_unlinkat_rights, td); + pathseg, path, dfd, &cap_unlinkat_rights); if ((error = namei(&nd)) != 0) { if (error == EINVAL) error = EPERM; @@ -2150,7 +2147,7 @@ kern_accessat(struct thread *td, int fd, const char *path, AUDIT_ARG_VALUE(amode); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH | - AT_EMPTY_PATH), pathseg, path, fd, &cap_fstat_rights, td); + AT_EMPTY_PATH), pathseg, path, fd, &cap_fstat_rights); if ((error = namei(&nd)) != 0) goto out; vp = nd.ni_vp; @@ -2446,7 +2443,7 @@ kern_statat(struct thread *td, int flag, int fd, const char *path, NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_RESOLVE_BENEATH | AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH) | LOCKSHARED | LOCKLEAF | - AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td); + AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights); if ((error = namei(&nd)) != 0) { if (error == ENOTDIR && @@ -2607,7 +2604,7 @@ kern_pathconf(struct thread *td, const char *path, enum uio_seg pathseg, int error; NDINIT(&nd, LOOKUP, LOCKSHARED | LOCKLEAF | AUDITVNODE1 | flags, - pathseg, path, td); + pathseg, path); if ((error = namei(&nd)) != 0) return (error); NDFREE_NOTHING(&nd); @@ -2662,7 +2659,7 @@ kern_readlinkat(struct thread *td, int fd, const char *path, return (EINVAL); NDINIT_AT(&nd, LOOKUP, NOFOLLOW | LOCKSHARED | LOCKLEAF | AUDITVNODE1 | - EMPTYPATH, pathseg, path, fd, td); + EMPTYPATH, pathseg, path, fd); if ((error = namei(&nd)) != 0) return (error); @@ -2814,7 +2811,7 @@ kern_chflagsat(struct thread *td, int fd, const char *path, AUDIT_ARG_FFLAGS(flags); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(atflag, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, - fd, &cap_fchflags_rights, td); + fd, &cap_fchflags_rights); if ((error = namei(&nd)) != 0) return (error); NDFREE_NOTHING(&nd); @@ -2945,7 +2942,7 @@ kern_fchmodat(struct thread *td, int fd, const char *path, AUDIT_ARG_MODE(mode); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, - fd, &cap_fchmod_rights, td); + fd, &cap_fchmod_rights); if ((error = namei(&nd)) != 0) return (error); NDFREE_NOTHING(&nd); @@ -3057,7 +3054,7 @@ kern_fchownat(struct thread *td, int fd, const char *path, AUDIT_ARG_OWNER(uid, gid); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, - fd, &cap_fchown_rights, td); + fd, &cap_fchown_rights); if ((error = namei(&nd)) != 0) return (error); @@ -3274,7 +3271,7 @@ kern_utimesat(struct thread *td, int fd, const char *path, if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, fd, - &cap_futimes_rights, td); + &cap_futimes_rights); if ((error = namei(&nd)) != 0) return (error); @@ -3311,7 +3308,7 @@ kern_lutimes(struct thread *td, const char *path, enum uio_seg pathseg, if ((error = getutimes(tptr, tptrseg, ts)) != 0) return (error); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, pathseg, path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, pathseg, path); if ((error = namei(&nd)) != 0) return (error); NDFREE_NOTHING(&nd); @@ -3424,7 +3421,7 @@ kern_utimensat(struct thread *td, int fd, const char *path, return (error); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, - pathseg, path, fd, &cap_futimes_rights, td); + pathseg, path, fd, &cap_futimes_rights); if ((error = namei(&nd)) != 0) return (error); /* @@ -3472,7 +3469,7 @@ kern_truncate(struct thread *td, const char *path, enum uio_seg pathseg, return (EINVAL); NDPREINIT(&nd); retry: - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -3642,7 +3639,7 @@ kern_renameat_mac(struct thread *td, int oldfd, const char *old, int newfd, int error; NDINIT_ATRIGHTS(fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | - AUDITVNODE1, pathseg, old, oldfd, &cap_renameat_source_rights, td); + AUDITVNODE1, pathseg, old, oldfd, &cap_renameat_source_rights); if ((error = namei(fromnd)) != 0) return (error); error = mac_vnode_check_rename_from(td->td_ucred, fromnd->ni_dvp, @@ -3682,7 +3679,7 @@ again: } else { #endif NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1, - pathseg, old, oldfd, &cap_renameat_source_rights, td); + pathseg, old, oldfd, &cap_renameat_source_rights); if ((error = namei(&fromnd)) != 0) return (error); #ifdef MAC @@ -3693,7 +3690,7 @@ again: if (fromnd.ni_vp->v_type == VDIR) tondflags |= WILLBEDIR; NDINIT_ATRIGHTS(&tond, RENAME, tondflags, pathseg, new, newfd, - &cap_renameat_target_rights, td); + &cap_renameat_target_rights); if ((error = namei(&tond)) != 0) { /* Translate error code for rename("dir1", "dir2/."). */ if (error == EISDIR && fvp->v_type == VDIR) @@ -3837,7 +3834,7 @@ restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 | NC_NOMAKEENTRY | NC_KEEPPOSENTRY | FAILIFEXISTS | WILLBEDIR, - segflg, path, fd, &cap_mkdirat_rights, td); + segflg, path, fd, &cap_mkdirat_rights); if ((error = namei(&nd)) != 0) return (error); if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { @@ -3908,7 +3905,7 @@ restart: bwillwrite(); NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 | at2cnpflags(flag, AT_RESOLVE_BENEATH), - pathseg, path, dfd, &cap_unlinkat_rights, td); + pathseg, path, dfd, &cap_unlinkat_rights); if ((error = namei(&nd)) != 0) goto fdout; vp = nd.ni_vp; @@ -4280,7 +4277,7 @@ sys_revoke(struct thread *td, struct revoke_args *uap) int error; NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + uap->path); if ((error = namei(&nd)) != 0) return (error); vp = nd.ni_vp; @@ -4442,7 +4439,7 @@ kern_getfhat(struct thread *td, int flags, int fd, const char *path, return (error); NDINIT_AT(&nd, LOOKUP, at2cnpflags(flags, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH) | LOCKLEAF | AUDITVNODE1, pathseg, path, - fd, td); + fd); error = namei(&nd); if (error != 0) return (error); |