#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)
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.
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.
*/
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 */
};
*/
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.
#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 */
#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);