X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/c6bf4f310a33a9262d455ea4d3f0630b1255e3fe..ea3f04195ba4a5034c9c8e9b726d4f7ce96f1832:/bsd/sys/vnode.h diff --git a/bsd/sys/vnode.h b/bsd/sys/vnode.h index e5263caf4..7dfb01ef2 100644 --- a/bsd/sys/vnode.h +++ b/bsd/sys/vnode.h @@ -559,6 +559,8 @@ struct vnode_trigger_param { #define VNODE_ATTR_va_fsid64 (1LL<<41) /* 20000000000 */ #define VNODE_ATTR_va_write_gencount (1LL<<42) /* 40000000000 */ #define VNODE_ATTR_va_private_size (1LL<<43) /* 80000000000 */ +#define VNODE_ATTR_va_clone_id (1LL<<44) /* 100000000000 */ +#define VNODE_ATTR_va_extflags (1LL<<45) /* 200000000000 */ #define VNODE_ATTR_BIT(n) (VNODE_ATTR_ ## n) @@ -608,7 +610,9 @@ struct vnode_trigger_param { VNODE_ATTR_BIT(va_rsrc_alloc) | \ VNODE_ATTR_BIT(va_fsid64) | \ VNODE_ATTR_BIT(va_write_gencount) | \ - VNODE_ATTR_BIT(va_private_size)) + VNODE_ATTR_BIT(va_private_size) | \ + VNODE_ATTR_BIT(va_clone_id) | \ + VNODE_ATTR_BIT(va_extflags)) /* * Read-only attributes. @@ -637,8 +641,11 @@ struct vnode_trigger_param { VNODE_ATTR_BIT(va_rsrc_length) | \ VNODE_ATTR_BIT(va_rsrc_alloc) | \ VNODE_ATTR_BIT(va_fsid64) | \ - VNODE_ATTR_BIT(va_write_gencount) | \ - VNODE_ATTR_BIT(va_private_size)) + VNODE_ATTR_BIT(va_write_gencount) | \ + VNODE_ATTR_BIT(va_private_size) | \ + VNODE_ATTR_BIT(va_clone_id) | \ + VNODE_ATTR_BIT(va_extflags)) + /* * Attributes that can be applied to a new file object. */ @@ -742,6 +749,8 @@ struct vnode_attr { uint32_t va_write_gencount; /* counter that increments each time the file changes */ uint64_t va_private_size; /* If the file were deleted, how many bytes would be freed immediately */ + uint64_t va_clone_id; /* If a file is cloned this is a unique id shared by all "perfect" clones */ + uint64_t va_extflags; /* extended file/directory flags */ /* add new fields here only */ }; @@ -1689,6 +1698,19 @@ int vnode_isdyldsharedcache(vnode_t vp); */ int vn_authorize_unlink(vnode_t dvp, vnode_t vp, struct componentname *cnp, vfs_context_t ctx, void *reserved); + +/*! + * @function vn_authorize_rmdir + * @abstract Authorize an rmdir operation given the vfs_context_t + * @discussion Check if the context assocated with vfs_context_t is allowed to rmdir the vnode vp in directory dvp. + * @param dvp Parent vnode of the directory to be rmdir'ed + * @param vp The vnode to be rmdir'ed + * @param cnp A componentname containing the name of the file to be rmdir'ed. May be NULL. + * @param reserved Pass NULL + * @return returns zero if the operation is allowed, non-zero indicates the rmdir is not authorized. + */ +int vn_authorize_rmdir(vnode_t dvp, vnode_t vp, struct componentname *cnp, vfs_context_t ctx, void *reserved); + /*! * @function vn_getpath_fsenter * @abstract Attempt to get a vnode's path, willing to enter the filesystem. @@ -1751,6 +1773,7 @@ int vn_getpath_ext(struct vnode *vp, struct vnode *dvp, char *pathbuf, int * #define VN_GETPATH_FSENTER 0x0001 /* Can re-enter filesystem */ #define VN_GETPATH_NO_FIRMLINK 0x0002 #define VN_GETPATH_VOLUME_RELATIVE 0x0004 /* also implies VN_GETPATH_NO_FIRMLINK */ +#define VN_GETPATH_NO_PROCROOT 0x0008 /* Give the non chrooted path for a process */ #endif /* KERNEL_PRIVATE */ @@ -2379,6 +2402,7 @@ void vnode_clearnoflush(vnode_t); #define BUILDPATH_CHECK_MOVED 0x4 /* Return EAGAIN if the parent hierarchy is modified */ #define BUILDPATH_VOLUME_RELATIVE 0x8 /* Return path relative to the nearest mount point */ #define BUILDPATH_NO_FIRMLINK 0x10 /* Return non-firmlinked path */ +#define BUILDPATH_NO_PROCROOT 0x20 /* Return path relative to system root, not the process root */ int build_path(vnode_t first_vp, char *buff, int buflen, int *outlen, int flags, vfs_context_t ctx);