]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/namei.h
xnu-3789.31.2.tar.gz
[apple/xnu.git] / bsd / sys / namei.h
index 803a9d8d7deae438cd3232ad4ccf86e3393ad776..2f5b90bfbe6558ca4897d272b1baabd84d295a2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2011 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
 #define        LOCKLEAF        0x0004  /* lock inode on return */
 #define        LOCKPARENT      0x0008  /* want parent vnode returned */
 #define        WANTPARENT      0x0010  /* want parent vnode returned */
+
+#ifdef KERNEL_PRIVATE
+#define CN_SECLUDE_RENAME 0x10000000 /*rename iff ¬(hard-linked ∨ opened ∨ mmaped)*/
+#define CN_RAW_ENCRYPTED 0x80000000 /* Look-up is for RO raw encrypted access. */
 #endif
 
+#endif // KERNEL
 
 #ifdef BSD_KERNEL_PRIVATE
 
@@ -147,7 +152,6 @@ struct nameidata {
 #define        NOFOLLOW        0x00000000 /* do not follow symbolic links (pseudo) */
 /* public FOLLOW       0x00000040    see vnode.h */
 #define        SHAREDLEAF      0x00000080 /* OK to have shared leaf lock */
-/* public NOTRIGGER    0x10000000    see vnode.h */
 #define        MODMASK         0x100000fc /* mask of operational modifiers */
 /*
  * Namei parameter descriptors.
@@ -175,16 +179,17 @@ struct nameidata {
 #define        AUDITVNPATH2    0x00200000 /* audit the path/vnode info */
 #define        USEDVP          0x00400000 /* start the lookup at ndp.ni_dvp */
 #define        CN_VOLFSPATH    0x00800000 /* user path was a volfs style path */
-#if CONFIG_VFS_FUNNEL
-#define FSNODELOCKHELD 0x01000000
-#endif /* CONFIG_VFS_FUNNEL */
 #define UNIONCREATED   0x02000000 /* union fs creation of vnode */
 #if NAMEDRSRCFORK
 #define CN_WANTSRSRCFORK 0x04000000
 #define CN_ALLOWRSRCFORK 0x08000000
-#endif
-/* public NOTRIGGER            0x10000000    see vnode.h */
+#endif // NAMEDRSRCFORK
+// CN_SECLUDE_RENAME is defined above as 0x10000000 (SPI)
 #define CN_NBMOUNTLOOK 0x20000000 /* do not block for cross mount lookups */
+#ifdef BSD_KERNEL_PRIVATE
+#define CN_SKIPNAMECACHE       0x40000000      /* skip cache during lookup(), allow FS to handle all components */
+#endif
+// CN_RAW_ENCRYPTED    is defined above as 0x80000000 (SPI)
 
 /*
  * Initialization of an nameidata structure.
@@ -231,21 +236,17 @@ struct nameidata {
  * This structure describes the elements in the cache of recent
  * names looked up by namei.
  */
-
-#define NCHASHMASK     0x7fffffff
-
 struct namecache {
        TAILQ_ENTRY(namecache)  nc_entry;       /* chain of all entries */
-       LIST_ENTRY(namecache)   nc_hash;        /* hash chain */
-        LIST_ENTRY(namecache)  nc_child;       /* chain of ncp's that are children of a vp */
+        TAILQ_ENTRY(namecache) nc_child;       /* chain of ncp's that are children of a vp */
         union {
          LIST_ENTRY(namecache)  nc_link;       /* chain of ncp's that 'name' a vp */
          TAILQ_ENTRY(namecache) nc_negentry;   /* chain of ncp's that 'name' a vp */
        } nc_un;
+       LIST_ENTRY(namecache)   nc_hash;        /* hash chain */
        vnode_t                 nc_dvp;         /* vnode of parent of name */
        vnode_t                 nc_vp;          /* vnode the name refers to */
-        unsigned int           nc_whiteout:1,  /* name has whiteout applied */
-                               nc_hashval:31;  /* hashval of stringname */
+        unsigned int           nc_hashval;     /* hashval of stringname */
        const char              *nc_name;       /* pointer to segment name in string cache */
 };
 
@@ -254,10 +255,10 @@ struct    namecache {
 
 int    namei(struct nameidata *ndp);
 void   nameidone(struct nameidata *);
-void   namei_unlock_fsnode(struct nameidata *ndp);
 int    lookup(struct nameidata *ndp);
 int    relookup(struct vnode *dvp, struct vnode **vpp,
                struct componentname *cnp);
+int    lookup_traverse_union(vnode_t dvp, vnode_t *new_dvp, vfs_context_t ctx);
 void   lookup_compound_vnop_post_hook(int error, vnode_t dvp, vnode_t vp, struct nameidata *ndp, int did_create);
 
 /*