summaryrefslogtreecommitdiffstats
path: root/sys/sys/namei.h
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-01-24 09:57:35 +0000
committerjeff <jeff@FreeBSD.org>2005-01-24 09:57:35 +0000
commit865b6a733b269a86ec4a81c0b030e3ea29401e11 (patch)
treeadf8608dc8459f4c7bf8fd0fe8aa8b33bd0afd8f /sys/sys/namei.h
parentf19a155881cea6b452b411a866ff3ff0c976b3fc (diff)
downloadFreeBSD-src-865b6a733b269a86ec4a81c0b030e3ea29401e11.zip
FreeBSD-src-865b6a733b269a86ec4a81c0b030e3ea29401e11.tar.gz
- Add two new flags to the nd structure. MPSAFE indicates that the
caller may not be holding Giant, and namei() should acquire it as necessary. HASGIANT is used to indicate when namei() is returning with a reference to a vnode that requires giant, and giant is locked. - Add the macro NDHASGIANT() which can be used in conjunction with VFS_UNLOCK_GIANT() in callers who have marked the nd with MPSAFE. Sponsored By: Isilon Systems, Inc.
Diffstat (limited to 'sys/sys/namei.h')
-rw-r--r--sys/sys/namei.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/sys/sys/namei.h b/sys/sys/namei.h
index c5a4c7d..3a9d047 100644
--- a/sys/sys/namei.h
+++ b/sys/sys/namei.h
@@ -122,22 +122,26 @@ struct nameidata {
* name being sought. The caller is responsible for releasing the
* buffer and for vrele'ing ni_startdir.
*/
-#define RDONLY 0x000200 /* lookup with read-only semantics */
-#define HASBUF 0x000400 /* has allocated pathname buffer */
-#define SAVENAME 0x000800 /* save pathname buffer */
-#define SAVESTART 0x001000 /* save starting directory */
-#define ISDOTDOT 0x002000 /* current component name is .. */
-#define MAKEENTRY 0x004000 /* entry is to be added to name cache */
-#define ISLASTCN 0x008000 /* this is last component of pathname */
-#define ISSYMLINK 0x010000 /* symlink needs interpretation */
-#define ISWHITEOUT 0x020000 /* found whiteout */
-#define DOWHITEOUT 0x040000 /* do whiteouts */
-#define WILLBEDIR 0x080000 /* new files will be dirs; allow trailing / */
-#define ISUNICODE 0x100000 /* current component name is unicode*/
-#define PDIRUNLOCK 0x200000 /* filesystem lookup() unlocked parent dir */
-#define NOCROSSMOUNT 0x400000 /* do not cross mount points */
-#define NOMACCHECK 0x800000 /* do not perform MAC checks */
-#define PARAMASK 0xfffe00 /* mask of parameter descriptors */
+#define RDONLY 0x0000200 /* lookup with read-only semantics */
+#define HASBUF 0x0000400 /* has allocated pathname buffer */
+#define SAVENAME 0x0000800 /* save pathname buffer */
+#define SAVESTART 0x0001000 /* save starting directory */
+#define ISDOTDOT 0x0002000 /* current component name is .. */
+#define MAKEENTRY 0x0004000 /* entry is to be added to name cache */
+#define ISLASTCN 0x0008000 /* this is last component of pathname */
+#define ISSYMLINK 0x0010000 /* symlink needs interpretation */
+#define ISWHITEOUT 0x0020000 /* found whiteout */
+#define DOWHITEOUT 0x0040000 /* do whiteouts */
+#define WILLBEDIR 0x0080000 /* new files will be dirs; allow trailing / */
+#define ISUNICODE 0x0100000 /* current component name is unicode*/
+#define PDIRUNLOCK 0x0200000 /* filesystem lookup() unlocked parent dir */
+#define NOCROSSMOUNT 0x0400000 /* do not cross mount points */
+#define NOMACCHECK 0x0800000 /* do not perform MAC checks */
+#define MPSAFE 0x1000000 /* namei() must acquire Giant if needed. */
+#define GIANTHELD 0x2000000 /* namei() is holding giant. */
+#define PARAMASK 0x3fffe00 /* mask of parameter descriptors */
+
+#define NDHASGIANT(NDP) (((NDP)->ni_cnd.cn_flags & GIANTHELD) != 0)
/*
* Initialization of a nameidata structure.
OpenPOWER on IntegriCloud