+
+ /*!
+ @function vfs_ioctl
+ @abstract File system control operations.
+ @discussion Unlike vfs_sysctl, this is specific to a particular volume.
+ @param mp The mount to execute the command on.
+ @param command Identifier for action to take. The command used here
+ should be in the same namespace as VNOP ioctl commands.
+ @param data Pointer to data; this can be an integer constant (of 32 bits
+ only) or an address to be read from or written to, depending on "command."
+ If it is an address, it is valid and resides in the kernel; callers of
+ VFS_IOCTL() are responsible for copying to and from userland.
+ @param flags Reserved for future use, set to zero
+ @param ctx Context against which to authenticate ioctl request.
+ @return 0 for success, else an error code.
+ */
+ int (*vfs_ioctl)(struct mount *mp, u_long command, caddr_t data,
+ int flags, vfs_context_t context);
+
+ /*!
+ @function vfs_vget_snapdir
+ @abstract Get the vnode for the snapshot directory of a filesystem.
+ @discussion Upon success, should return with an iocount held on the root vnode which the caller will
+ drop with vnode_put().
+ @param mp Mount for which to get the root.
+ @param vpp Destination for snapshot directory vnode.
+ @param context Context to authenticate for getting the snapshot directory.
+ @return 0 for success, else an error code.
+ */
+ int (*vfs_vget_snapdir)(struct mount *mp, struct vnode **vpp, vfs_context_t context);
+ void *vfs_reserved5;
+ void *vfs_reserved4;
+ void *vfs_reserved3;
+ void *vfs_reserved2;
+ void *vfs_reserved1;
+};
+
+#ifdef KERNEL
+
+/*
+ * Commands for vfs_ioctl. While they are encoded the same way as for ioctl(2),
+ * there is no generic interface for them from userspace like ioctl(2).
+ */
+struct fs_snapshot_mount_args {
+ mount_t sm_mp;
+ struct componentname *sm_cnp;
+};
+
+#define VFSIOC_MOUNT_SNAPSHOT _IOW('V', 1, struct fs_snapshot_mount_args)
+#define VFSCTL_MOUNT_SNAPSHOT IOCBASECMD(VFSIOC_MOUNT_SNAPSHOT)
+
+struct fs_snapshot_revert_args {
+ struct componentname *sr_cnp;