+typedef enum dir_clone_authorizer_op {
+ OP_AUTHORIZE = 0, /* request authorization of action */
+ OP_VATTR_SETUP = 1, /* query for attributes that are required for OP_AUTHORIZE */
+ OP_VATTR_CLEANUP = 2 /* request to cleanup any state or free any memory allocated in OP_AUTHORIZE */
+} dir_clone_authorizer_op_t;
+
+struct vnop_clonefile_args {
+ struct vnodeop_desc *a_desc;
+ vnode_t a_fvp;
+ vnode_t a_dvp;
+ vnode_t *a_vpp;
+ struct componentname *a_cnp;
+ struct vnode_attr *a_vap;
+ uint32_t a_flags;
+ vfs_context_t a_context;
+ int (*a_dir_clone_authorizer)( /* Authorization callback */
+ struct vnode_attr *vap, /* attribute to be authorized */
+ kauth_action_t action, /* action for which attribute is to be authorized */
+ struct vnode_attr *dvap, /* target directory attributes */
+ vnode_t sdvp, /* source directory vnode pointer (optional) */
+ mount_t mp, /* mount point of filesystem */
+ dir_clone_authorizer_op_t vattr_op, /* specific operation requested : setup, authorization or cleanup */
+ uint32_t flags, /* needs to have the value passed to a_flags */
+ vfs_context_t ctx, /* As passed to VNOP */
+ void *reserved); /* Always NULL */
+ void *a_reserved; /* Currently unused */
+};
+
+/*!
+ * @function VNOP_CLONEFILE
+ * @abstract Call down to a filesystem to clone a filesystem object (regular file, directory or symbolic link.)
+ * @discussion If file creation succeeds, "vpp" should be returned with an iocount to be dropped by the caller.
+ * @param dvp Directory in which to clone object.
+ * @param vpp Destination for vnode for newly cloned object.
+ * @param cnp Description of name of object to clone.
+ * @param vap File creation properties, as seen in vnode_getattr(). Manipulated with VATTR_ISACTIVE, VATTR_RETURN,
+ * VATTR_SET_SUPPORTED, and so forth. All attributes not set here should either be copied
+ * from the source object
+ * or set to values which are used for creating new filesystem objects
+ * @param ctx Context against which to authenticate file creation.
+ * @return 0 for success or a filesystem-specific error.
+ */
+#ifdef XNU_KERNEL_PRIVATE
+extern errno_t VNOP_CLONEFILE(vnode_t, vnode_t, vnode_t *, struct componentname *, struct vnode_attr *, uint32_t, vfs_context_t);
+#endif /* XNU_KERNEL_PRIVATE */
+