History

btrfs: define support masks for ioctl volume args v2

The ioctl data for devices or subvolumes can be passed via btrfs_ioctl_vol_args or btrfs_ioctl_vol_args_v2. The latter is more versatile and needs some caution as some of the flags make sense only for some ioctls. As we're going to extend the flags, define support masks for each ioctl class separately.

David Sterba committed 6 years ago

Commit eed02691 parent 5ce48d01 file · +13 −3Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/btrfs.h+13−3
@@ -97,16 +97,26 @@ struct btrfs_ioctl_qgroup_limit_args { · 96 unmodified lines
97};97};
98 98
99/*99/*
100 * flags for subvolumes100 * Arguments for specification of subvolumes or devices, supporting by-name or
101 * by-id and flags
101 *102 *
102 * Used by:103 * The set of supported flags depends on the ioctl
103 * struct btrfs_ioctl_vol_args_v2.flags
104 *104 *
105 * BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls:105 * BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls:
106 * - BTRFS_IOC_SUBVOL_GETFLAGS106 * - BTRFS_IOC_SUBVOL_GETFLAGS
107 * - BTRFS_IOC_SUBVOL_SETFLAGS107 * - BTRFS_IOC_SUBVOL_SETFLAGS
108 */108 */
109 109
110/* Supported flags for BTRFS_IOC_RM_DEV_V2 */
111#define BTRFS_DEVICE_REMOVE_ARGS_MASK \
112 (BTRFS_DEVICE_SPEC_BY_ID)
113
114/* Supported flags for BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SUBVOL_CREATE_V2 */
115#define BTRFS_SUBVOL_CREATE_ARGS_MASK \
116 (BTRFS_SUBVOL_CREATE_ASYNC | \
117 BTRFS_SUBVOL_RDONLY | \
118 BTRFS_SUBVOL_QGROUP_INHERIT)
119
110struct btrfs_ioctl_vol_args_v2 {120struct btrfs_ioctl_vol_args_v2 {
111 __s64 fd;121 __s64 fd;
112 __u64 transid;122 __u64 transid;