+ return _err;
+}
+
+#if 0
+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; /* value passed in a_flags to the VNOP */
+ vfs_context_t ctx, /* As passed to VNOP */
+ void *reserved); /* Always NULL */
+ void *a_reserved; /* Currently unused */
+};
+#endif /* 0 */
+
+errno_t
+VNOP_CLONEFILE(vnode_t fvp, vnode_t dvp, vnode_t *vpp,
+ struct componentname *cnp, struct vnode_attr *vap, uint32_t flags,
+ vfs_context_t ctx)
+{
+ int _err;
+ struct vnop_clonefile_args a;
+ a.a_desc = &vnop_clonefile_desc;
+ a.a_fvp = fvp;
+ a.a_dvp = dvp;
+ a.a_vpp = vpp;
+ a.a_cnp = cnp;
+ a.a_vap = vap;
+ a.a_flags = flags;
+ a.a_context = ctx;
+
+ if (vnode_vtype(fvp) == VDIR) {
+ a.a_dir_clone_authorizer = vnode_attr_authorize_dir_clone;
+ } else {
+ a.a_dir_clone_authorizer = NULL;
+ }
+
+ _err = (*dvp->v_op[vnop_clonefile_desc.vdesc_offset])(&a);
+
+ if (_err == 0 && *vpp) {
+ DTRACE_FSINFO(clonefile, vnode_t, *vpp);
+ if (kdebug_enable) {
+ kdebug_lookup(*vpp, cnp);
+ }
+ }
+
+ post_event_if_success(dvp, _err, NOTE_WRITE);
+
+ return _err;