Module Name:    src
Committed By:   dholland
Date:           Mon Nov  5 19:06:27 UTC 2012

Modified Files:
        src/sys/kern: vfs_lookup.c
        src/sys/nfs: nfs_srvsubs.c
        src/sys/sys: namei.src

Log Message:
Rename the new ni_startdir (the slot used to hold the starting point
for openat() and friends) to ni_atdir to avoid confusion with a
previously existing (and, alas, still documented) ni_startdir field
that meant something else entirely.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.13 -r1.14 src/sys/nfs/nfs_srvsubs.c
cvs rdiff -u -r1.29 -r1.30 src/sys/sys/namei.src

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.197 src/sys/kern/vfs_lookup.c:1.198
--- src/sys/kern/vfs_lookup.c:1.197	Mon Nov  5 17:24:11 2012
+++ src/sys/kern/vfs_lookup.c	Mon Nov  5 19:06:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.197 2012/11/05 17:24:11 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.198 2012/11/05 19:06:26 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.197 2012/11/05 17:24:11 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.198 2012/11/05 19:06:26 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -564,8 +564,8 @@ namei_getstartdir(struct namei_state *st
 	curdir = cwdi->cwdi_cdir;
 
 	if (ndp->ni_pnbuf[0] != '/') {
-		if (ndp->ni_startdir != NULL) {
-			startdir = ndp->ni_startdir;
+		if (ndp->ni_atdir != NULL) {
+			startdir = ndp->ni_atdir;
 		} else {
 			startdir = curdir;
 		}
@@ -601,14 +601,14 @@ namei_getstartdir(struct namei_state *st
 static struct vnode *
 namei_getstartdir_for_nfsd(struct namei_state *state)
 {
-	KASSERT(state->ndp->ni_startdir != NULL);
+	KASSERT(state->ndp->ni_atdir != NULL);
 
 	/* always use the real root, and never set an emulation root */
 	state->ndp->ni_rootdir = rootvnode;
 	state->ndp->ni_erootdir = NULL;
 
-	vref(state->ndp->ni_startdir);
-	return state->ndp->ni_startdir;
+	vref(state->ndp->ni_atdir);
+	return state->ndp->ni_atdir;
 }
 
 
@@ -1518,8 +1518,8 @@ lookup_for_nfsd(struct nameidata *ndp, s
 	struct namei_state state;
 	int error;
 
-	KASSERT(ndp->ni_startdir == NULL);
-	ndp->ni_startdir = forcecwd;
+	KASSERT(ndp->ni_atdir == NULL);
+	ndp->ni_atdir = forcecwd;
 
 	namei_init(&state, ndp);
 	error = namei_tryemulroot(&state,
@@ -1564,7 +1564,7 @@ do_lookup_for_nfsd_index(struct namei_st
 
 	KASSERT(cnp == &ndp->ni_cnd);
 
-	startdir = state->ndp->ni_startdir;
+	startdir = state->ndp->ni_atdir;
 
 	cnp->cn_nameptr = ndp->ni_pnbuf;
 	state->docache = 1;
@@ -1631,8 +1631,8 @@ lookup_for_nfsd_index(struct nameidata *
 	struct namei_state state;
 	int error;
 
-	KASSERT(ndp->ni_startdir == NULL);
-	ndp->ni_startdir = startdir;
+	KASSERT(ndp->ni_atdir == NULL);
+	ndp->ni_atdir = startdir;
 
 	/*
 	 * Note: the name sent in here (is not|should not be) allowed

Index: src/sys/nfs/nfs_srvsubs.c
diff -u src/sys/nfs/nfs_srvsubs.c:1.13 src/sys/nfs/nfs_srvsubs.c:1.14
--- src/sys/nfs/nfs_srvsubs.c:1.13	Sat Oct 13 17:46:50 2012
+++ src/sys/nfs/nfs_srvsubs.c	Mon Nov  5 19:06:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_srvsubs.c,v 1.13 2012/10/13 17:46:50 dholland Exp $	*/
+/*	$NetBSD: nfs_srvsubs.c,v 1.14 2012/11/05 19:06:27 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_srvsubs.c,v 1.13 2012/10/13 17:46:50 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_srvsubs.c,v 1.14 2012/11/05 19:06:27 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -241,7 +241,7 @@ nfs_namei(struct nameidata *ndp, nfsrvfh
 		path = cp;
 	}
 
-	ndp->ni_startdir = NULL;
+	ndp->ni_atdir = NULL;
 	ndp->ni_pathbuf = pathbuf_assimilate(path);
 	if (ndp->ni_pathbuf == NULL) {
 		error = ENOMEM;

Index: src/sys/sys/namei.src
diff -u src/sys/sys/namei.src:1.29 src/sys/sys/namei.src:1.30
--- src/sys/sys/namei.src:1.29	Mon Nov  5 17:27:37 2012
+++ src/sys/sys/namei.src	Mon Nov  5 19:06:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.src,v 1.29 2012/11/05 17:27:37 dholland Exp $	*/
+/*	$NetBSD: namei.src,v 1.30 2012/11/05 19:06:26 dholland Exp $	*/
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -83,7 +83,7 @@ struct nameidata {
 	/*
 	 * Arguments to namei/lookup.
 	 */
-	struct vnode *ni_startdir;	/* starting dir, cwd if null */
+	struct vnode *ni_atdir;		/* startup dir, cwd if null */
 	struct pathbuf *ni_pathbuf;	/* pathname container */
 	char *ni_pnbuf;			/* extra pathname buffer ref (XXX) */
 	/*
@@ -168,7 +168,7 @@ NAMEIFL	PARAMASK	0x0eee300	/* mask of pa
 #define NDINIT(ndp, op, flags, pathbuf) { \
 	(ndp)->ni_cnd.cn_nameiop = op; \
 	(ndp)->ni_cnd.cn_flags = flags; \
-	(ndp)->ni_startdir = NULL; \
+	(ndp)->ni_atdir = NULL; \
 	(ndp)->ni_pathbuf = pathbuf; \
 	(ndp)->ni_cnd.cn_cred = kauth_cred_get(); \
 }
@@ -177,7 +177,7 @@ NAMEIFL	PARAMASK	0x0eee300	/* mask of pa
  * Use this to set the start directory for openat()-type operations.
  */
 #define NDAT(ndp, dir) {			\
-	(ndp)->ni_startdir = (dir);		\
+	(ndp)->ni_atdir = (dir);		\
 }
 
 #endif

Reply via email to