Module Name:    src
Committed By:   riastradh
Date:           Tue Apr 21 03:19:03 UTC 2015

Modified Files:
        src/sys/kern: vfs_lookup.c vfs_syscalls.c
        src/sys/nfs: nfs_serv.c
        src/sys/rump/include/rump: rump_namei.h
        src/sys/sys: namei.h

Log Message:
Cull unused INRENAME and INRELOOKUP from callers.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.496 -r1.497 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.171 -r1.172 src/sys/nfs/nfs_serv.c
cvs rdiff -u -r1.26 -r1.27 src/sys/rump/include/rump/rump_namei.h
cvs rdiff -u -r1.92 -r1.93 src/sys/sys/namei.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.201 src/sys/kern/vfs_lookup.c:1.202
--- src/sys/kern/vfs_lookup.c:1.201	Fri Feb  7 15:29:22 2014
+++ src/sys/kern/vfs_lookup.c	Tue Apr 21 03:19:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.201 2014/02/07 15:29:22 hannken Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.202 2015/04/21 03:19:03 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.201 2014/02/07 15:29:22 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.202 2015/04/21 03:19:03 riastradh Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -482,9 +482,9 @@ struct namei_state {
 static void
 namei_init(struct namei_state *state, struct nameidata *ndp)
 {
+
 	state->ndp = ndp;
 	state->cnp = &ndp->ni_cnd;
-	KASSERT((state->cnp->cn_flags & INRELOOKUP) == 0);
 
 	state->docache = 0;
 	state->rdonly = 0;
@@ -1736,9 +1736,7 @@ relookup(struct vnode *dvp, struct vnode
 	 * We now have a segment name to search for, and a directory to search.
 	 */
 	*vpp = NULL;
-	cnp->cn_flags |= INRELOOKUP;
 	error = VOP_LOOKUP(dvp, vpp, cnp);
-	cnp->cn_flags &= ~INRELOOKUP;
 	if ((error) != 0) {
 #ifdef DIAGNOSTIC
 		if (*vpp != NULL)

Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.496 src/sys/kern/vfs_syscalls.c:1.497
--- src/sys/kern/vfs_syscalls.c:1.496	Mon Apr 20 23:03:08 2015
+++ src/sys/kern/vfs_syscalls.c	Tue Apr 21 03:19:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.496 2015/04/20 23:03:08 riastradh Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.497 2015/04/21 03:19:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.496 2015/04/20 23:03:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.497 2015/04/21 03:19:03 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -4198,7 +4198,7 @@ do_sys_renameat(struct lwp *l, int fromf
 	 * locked yet, but (a) namei is insane, and (b) VOP_RENAME is
 	 * insane, so for the time being we need to leave it like this.
 	 */
-	NDINIT(&fnd, DELETE, (LOCKPARENT | TRYEMULROOT | INRENAME), fpb);
+	NDINIT(&fnd, DELETE, (LOCKPARENT | TRYEMULROOT), fpb);
 	if ((error = fd_nameiat(l, fromfd, &fnd)) != 0)
 		goto out2;
 
@@ -4251,7 +4251,7 @@ do_sys_renameat(struct lwp *l, int fromf
 	 * XXX Why not pass CREATEDIR always?
 	 */
 	NDINIT(&tnd, RENAME,
-	    (LOCKPARENT | NOCACHE | TRYEMULROOT | INRENAME |
+	    (LOCKPARENT | NOCACHE | TRYEMULROOT |
 		((fvp->v_type == VDIR)? CREATEDIR : 0)),
 	    tpb);
 	if ((error = fd_nameiat(l, tofd, &tnd)) != 0)

Index: src/sys/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.171 src/sys/nfs/nfs_serv.c:1.172
--- src/sys/nfs/nfs_serv.c:1.171	Mon Apr 20 23:03:09 2015
+++ src/sys/nfs/nfs_serv.c	Tue Apr 21 03:19:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.171 2015/04/20 23:03:09 riastradh Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.172 2015/04/21 03:19:03 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.171 2015/04/20 23:03:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.172 2015/04/21 03:19:03 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1930,7 +1930,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd
 	saved_uid = kauth_cred_geteuid(cred);
 	fromnd.ni_cnd.cn_cred = cred;
 	fromnd.ni_cnd.cn_nameiop = DELETE;
-	fromnd.ni_cnd.cn_flags = LOCKPARENT | INRENAME;
+	fromnd.ni_cnd.cn_flags = LOCKPARENT;
 	error = nfs_namei(&fromnd, &fnsfh, len, slp, nam, &md,
 		&dpos, &fdirp, lwp, (nfsd->nd_flag & ND_KERBAUTH), false);
 	if (error == 0 && fdirp && v3) {
@@ -2006,7 +2006,7 @@ nfsrv_rename(struct nfsrv_descript *nfsd
 	kauth_cred_seteuid(cred, saved_uid);
 	tond.ni_cnd.cn_cred = cred;
 	tond.ni_cnd.cn_nameiop = RENAME;
-	tond.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | NOCACHE | INRENAME;
+	tond.ni_cnd.cn_flags = LOCKPARENT | LOCKLEAF | NOCACHE;
 	error = nfs_namei(&tond, &tnsfh, len2, slp, nam, &md,
 		&dpos, &tdirp, lwp, (nfsd->nd_flag & ND_KERBAUTH), false);
 	if (tdirp && v3) {

Index: src/sys/rump/include/rump/rump_namei.h
diff -u src/sys/rump/include/rump/rump_namei.h:1.26 src/sys/rump/include/rump/rump_namei.h:1.27
--- src/sys/rump/include/rump/rump_namei.h:1.26	Fri Jan 16 21:41:07 2015
+++ src/sys/rump/include/rump/rump_namei.h	Tue Apr 21 03:19:03 2015
@@ -1,11 +1,11 @@
-/*	$NetBSD: rump_namei.h,v 1.26 2015/01/16 21:41:07 dennis Exp $	*/
+/*	$NetBSD: rump_namei.h,v 1.27 2015/04/21 03:19:03 riastradh Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.35 2015/01/16 21:38:26 dennis Exp 
+ *   from: NetBSD: namei.src,v 1.37 2015/04/21 03:18:21 riastradh Exp 
  */
 
 #ifndef _RUMP_RUMP_NAMEI_H_
@@ -34,8 +34,6 @@
 #define RUMP_NAMEI_DOWHITEOUT	0x0040000
 #define RUMP_NAMEI_REQUIREDIR	0x0080000
 #define RUMP_NAMEI_CREATEDIR	0x0200000
-#define RUMP_NAMEI_INRENAME	0x0400000
-#define RUMP_NAMEI_INRELOOKUP	0x0800000
-#define RUMP_NAMEI_PARAMASK	0x0eee300
+#define RUMP_NAMEI_PARAMASK	0x02ee300
 
 #endif /* _RUMP_RUMP_NAMEI_H_ */

Index: src/sys/sys/namei.h
diff -u src/sys/sys/namei.h:1.92 src/sys/sys/namei.h:1.93
--- src/sys/sys/namei.h:1.92	Fri Jan 16 21:41:07 2015
+++ src/sys/sys/namei.h	Tue Apr 21 03:19:03 2015
@@ -1,11 +1,11 @@
-/*	$NetBSD: namei.h,v 1.92 2015/01/16 21:41:07 dennis Exp $	*/
+/*	$NetBSD: namei.h,v 1.93 2015/04/21 03:19:03 riastradh Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.35 2015/01/16 21:38:26 dennis Exp 
+ *   from: NetBSD: namei.src,v 1.37 2015/04/21 03:18:21 riastradh Exp 
  */
 
 /*
@@ -173,9 +173,7 @@ struct nameidata {
 #define	DOWHITEOUT	0x0040000	/* do whiteouts */
 #define	REQUIREDIR	0x0080000	/* must be a directory */
 #define	CREATEDIR	0x0200000	/* trailing slashes are ok */
-#define	INRENAME	0x0400000	/* operation is a part of ``rename'' */
-#define	INRELOOKUP	0x0800000	/* set while inside relookup() */
-#define	PARAMASK	0x0eee300	/* mask of parameter descriptors */
+#define	PARAMASK	0x02ee300	/* mask of parameter descriptors */
 
 /*
  * Initialization of a nameidata structure.
@@ -354,8 +352,6 @@ struct	nchstats _NAMEI_CACHE_STATS(uint6
 #define NAMEI_DOWHITEOUT	0x0040000
 #define NAMEI_REQUIREDIR	0x0080000
 #define NAMEI_CREATEDIR	0x0200000
-#define NAMEI_INRENAME	0x0400000
-#define NAMEI_INRELOOKUP	0x0800000
-#define NAMEI_PARAMASK	0x0eee300
+#define NAMEI_PARAMASK	0x02ee300
 
 #endif /* !_SYS_NAMEI_H_ */

Reply via email to