]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/vfs/vnode_if.c
xnu-3789.70.16.tar.gz
[apple/xnu.git] / bsd / vfs / vnode_if.c
index 1a77414e2562a4d906ab965f212e6c6938c2595c..f0c1fa80d3f4d60711dc5f37ec4b5c337b1f6a93 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -106,6 +106,24 @@ struct vnodeop_desc vnop_lookup_desc = {
        NULL
 };
 
+int vnop_compound_open_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_compound_open_args, a_dvp),
+       VDESC_NO_OFFSET
+};
+
+struct vnodeop_desc vnop_compound_open_desc = {
+       0,
+       "vnop_compound_open",
+       0 | VDESC_VP0_WILLRELE,
+       vnop_compound_open_vp_offsets, 
+       VOPARG_OFFSETOF(struct vnop_compound_open_args, a_vpp),
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_compound_open_args, a_cnp),
+       VOPARG_OFFSETOF(struct vnop_compound_open_args, a_context),
+       NULL
+};
+
 int vnop_create_vp_offsets[] = {
        VOPARG_OFFSETOF(struct vnop_create_args,a_dvp),
        VDESC_NO_OFFSET
@@ -485,6 +503,23 @@ struct vnodeop_desc vnop_remove_desc = {
        NULL
 };
 
+int vnop_remove_extended_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_remove_args,a_dvp),
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_compound_remove_desc = {
+       0,
+       "vnop_compound_remove",
+       0,
+       vnop_remove_vp_offsets,
+       VOPARG_OFFSETOF(struct vnop_compound_remove_args, a_vpp),
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_remove_args, a_cnp),
+       VOPARG_OFFSETOF(struct vnop_remove_args, a_context),
+       NULL
+};
+
 int vnop_link_vp_offsets[] = {
        VOPARG_OFFSETOF(struct vnop_link_args,a_vp),
        VOPARG_OFFSETOF(struct vnop_link_args,a_tdvp),
@@ -523,6 +558,46 @@ struct vnodeop_desc vnop_rename_desc = {
        NULL
 };
 
+int vnop_renamex_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_renamex_args,a_fdvp),
+       VOPARG_OFFSETOF(struct vnop_renamex_args,a_fvp),
+       VOPARG_OFFSETOF(struct vnop_renamex_args,a_tdvp),
+       VOPARG_OFFSETOF(struct vnop_renamex_args,a_tvp),
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_renamex_desc = {
+       0,
+       "vnop_renamex",
+       0 | VDESC_VP0_WILLRELE | VDESC_VP1_WILLRELE | VDESC_VP2_WILLRELE | VDESC_VP3_WILLRELE,
+       vnop_renamex_vp_offsets,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_renamex_args, a_fcnp),
+       VOPARG_OFFSETOF(struct vnop_renamex_args, a_context),
+       NULL
+};
+
+int vnop_compound_rename_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_compound_rename_args,a_fdvp),
+       VOPARG_OFFSETOF(struct vnop_compound_rename_args,a_fvpp),
+       VOPARG_OFFSETOF(struct vnop_compound_rename_args,a_tdvp),
+       VOPARG_OFFSETOF(struct vnop_compound_rename_args,a_tvpp),
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_compound_rename_desc = {
+       0,
+       "vnop_compound_rename",
+       0 | VDESC_VP0_WILLRELE | VDESC_VP1_WILLRELE | VDESC_VP2_WILLRELE | VDESC_VP3_WILLRELE,
+       vnop_compound_rename_vp_offsets,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_compound_rename_args, a_fcnp),
+       VOPARG_OFFSETOF(struct vnop_compound_rename_args, a_context),
+       NULL
+};
+
 int vnop_mkdir_vp_offsets[] = {
        VOPARG_OFFSETOF(struct vnop_mkdir_args,a_dvp),
        VDESC_NO_OFFSET
@@ -540,6 +615,24 @@ struct vnodeop_desc vnop_mkdir_desc = {
        NULL
 };
 
+int vnop_compound_mkdir_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_compound_mkdir_args,a_dvp),
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_compound_mkdir_desc = {
+       0,
+       "vnop_compound_mkdir",
+       0 | VDESC_VP0_WILLRELE,
+       vnop_compound_mkdir_vp_offsets,
+       VOPARG_OFFSETOF(struct vnop_compound_mkdir_args, a_vpp),
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_compound_mkdir_args, a_cnp),
+       VOPARG_OFFSETOF(struct vnop_compound_mkdir_args, a_context),
+       NULL
+};
+
+
 int vnop_rmdir_vp_offsets[] = {
        VOPARG_OFFSETOF(struct vnop_rmdir_args,a_dvp),
        VOPARG_OFFSETOF(struct vnop_rmdir_args,a_vp),
@@ -558,6 +651,23 @@ struct vnodeop_desc vnop_rmdir_desc = {
        NULL
 };
 
+int vnop_compound_rmdir_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_compound_rmdir_args,a_dvp),
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_compound_rmdir_desc = {
+       0,
+       "vnop_compound_rmdir",
+       0 | VDESC_VP0_WILLRELE | VDESC_VP1_WILLRELE,
+       vnop_rmdir_vp_offsets,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_compound_rmdir_args, a_cnp),
+       VOPARG_OFFSETOF(struct vnop_compound_rmdir_args, a_context),
+       NULL
+};
+
 int vnop_symlink_vp_offsets[] = {
        VOPARG_OFFSETOF(struct vnop_symlink_args,a_dvp),
        VDESC_NO_OFFSET
@@ -609,6 +719,23 @@ struct vnodeop_desc vnop_readdirattr_desc = {
        NULL
 };
 
+int vnop_getattrlistbulk_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_getattrlistbulk_args,a_vp),
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_getattrlistbulk_desc = {
+       0,
+       "vnop_getattrlistbulk",
+       0,
+       vnop_getattrlistbulk_vp_offsets,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_getattrlistbulk_args, a_context),
+       NULL
+};
+
 int vnop_readlink_vp_offsets[] = {
        VOPARG_OFFSETOF(struct vnop_readlink_args,a_vp),
        VDESC_NO_OFFSET
@@ -781,6 +908,24 @@ struct vnodeop_desc vnop_copyfile_desc = {
        NULL
 };
 
+int vnop_clonefile_vp_offsets[] = {
+       VOPARG_OFFSETOF(struct vnop_clonefile_args,a_fvp),
+       VOPARG_OFFSETOF(struct vnop_clonefile_args,a_dvp),
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_clonefile_desc = {
+       0,
+       "vnop_clonefile",
+       0 | VDESC_VP0_WILLRELE | VDESC_VP1_WILLRELE | VDESC_VPP_WILLRELE,
+       vnop_clonefile_vp_offsets,
+       VOPARG_OFFSETOF(struct vnop_clonefile_args, a_vpp),
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VOPARG_OFFSETOF(struct vnop_clonefile_args, a_cnp),
+       VOPARG_OFFSETOF(struct vnop_clonefile_args, a_context),
+       NULL
+};
+
 int vop_getxattr_vp_offsets[] = {
        VOPARG_OFFSETOF(struct vnop_getxattr_args,a_vp),
        VDESC_NO_OFFSET
@@ -952,10 +1097,53 @@ struct vnodeop_desc vnop_removenamedstream_desc = {
        NULL
 };
 #else
-/* These symbols are in the exports list so they need to always be defined. */
-int vnop_getnamedstream_desc;
-int vnop_makenamedstream_desc;
-int vnop_removenamedstream_desc;
+int vnop_getnamedstream_vp_offsets[] = {
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_getnamedstream_desc = {
+       0,
+       "vnop_getnamedstream",
+       VDESC_DISABLED, /* flags */
+       vnop_getnamedstream_vp_offsets,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       NULL
+};
+
+int vnop_makenamedstream_vp_offsets[] = {
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_makenamedstream_desc = {
+       0,
+       "vnop_makenamedstream",
+       VDESC_DISABLED, /* flags */
+       vnop_makenamedstream_vp_offsets,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       NULL
+};
+
+int vnop_removenamedstream_vp_offsets[] = {
+       VDESC_NO_OFFSET
+};
+struct vnodeop_desc vnop_removenamedstream_desc = {
+       0,
+       "vnop_removenamedstream",
+       VDESC_DISABLED, /* flags */
+       vnop_removenamedstream_vp_offsets,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       VDESC_NO_OFFSET,
+       NULL
+};
 #endif
 
 /* Special cases: */
@@ -1004,6 +1192,7 @@ struct vnodeop_desc *vfs_op_descs[] = {
        &vnop_mknod_desc,
        &vnop_whiteout_desc,
        &vnop_open_desc,
+       &vnop_compound_open_desc,
        &vnop_close_desc,
        &vnop_access_desc,
        &vnop_getattr_desc,
@@ -1021,13 +1210,19 @@ struct vnodeop_desc *vfs_op_descs[] = {
        &vnop_mnomap_desc,
        &vnop_fsync_desc,
        &vnop_remove_desc,
+       &vnop_compound_remove_desc,
        &vnop_link_desc,
        &vnop_rename_desc,
+       &vnop_renamex_desc,
+       &vnop_compound_rename_desc,
        &vnop_mkdir_desc,
+       &vnop_compound_mkdir_desc,
        &vnop_rmdir_desc,
+       &vnop_compound_rmdir_desc,
        &vnop_symlink_desc,
        &vnop_readdir_desc,
        &vnop_readdirattr_desc,
+       &vnop_getattrlistbulk_desc,
        &vnop_readlink_desc,
        &vnop_inactive_desc,
        &vnop_reclaim_desc,
@@ -1038,6 +1233,7 @@ struct vnodeop_desc *vfs_op_descs[] = {
        &vnop_pageout_desc,
        &vnop_searchfs_desc,
        &vnop_copyfile_desc,
+       &vnop_clonefile_desc,
        &vnop_getxattr_desc,
        &vnop_setxattr_desc,
        &vnop_removexattr_desc,
@@ -1046,11 +1242,18 @@ struct vnodeop_desc *vfs_op_descs[] = {
        &vnop_offtoblk_desc,
        &vnop_blockmap_desc,
        &vnop_monitor_desc,
-#if NAMEDSTREAMS
+#if !defined(NAMEDSTREAMS)
+       /*
+        * We define the named streams ops descriptors as we _always_ have to
+        * have symbols with their names, and as such we really really need
+        * those symbols to be valid operations descriptors. However if
+        * named streams support is not enabled, we flag these descriptors
+        * as ignored.
+        */
+#endif
        &vnop_getnamedstream_desc,
        &vnop_makenamedstream_desc,
        &vnop_removenamedstream_desc,
-#endif
        NULL
 };