]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
btrfs: rename flags for vol args v2
authorDavid Sterba <dsterba@suse.com>
Mon, 15 Feb 2016 17:15:21 +0000 (18:15 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 26 Feb 2016 14:04:55 +0000 (15:04 +0100)
Rename BTRFS_DEVICE_BY_ID so it's more descriptive that we specify the
device by id, it'll be part of the public API. The mask of supported
flags is also renamed, only for internal use.

The error code for unknown flags is EOPNOTSUPP, fixed.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c
include/uapi/linux/btrfs.h

index 379f0410aed01d6fedebbc91cb81741b2e271433..751dae5ad0058a0f1b5af0be2077ae7ceefaf634 100644 (file)
@@ -2689,8 +2689,8 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
        }
 
        /* Check for compatibility reject unknown flags */
-       if (vol_args->flags & ~BTRFS_VOL_ARG_V2_FLAGS)
-               return -ENOTTY;
+       if (vol_args->flags & ~BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED)
+               return -EOPNOTSUPP;
 
        if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
                        1)) {
@@ -2699,7 +2699,7 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
        }
 
        mutex_lock(&root->fs_info->volume_mutex);
-       if (vol_args->flags & BTRFS_DEVICE_BY_ID) {
+       if (vol_args->flags & BTRFS_DEVICE_SPEC_BY_ID) {
                ret = btrfs_rm_device(root, NULL, vol_args->devid);
        } else {
                vol_args->name[BTRFS_SUBVOL_NAME_MAX] = '\0';
@@ -2709,7 +2709,7 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
        atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0);
 
        if (!ret) {
-               if (vol_args->flags & BTRFS_DEVICE_BY_ID)
+               if (vol_args->flags & BTRFS_DEVICE_SPEC_BY_ID)
                        btrfs_info(root->fs_info, "device deleted: id %llu",
                                        vol_args->devid);
                else
index 396a4efca7751db362f0ca33536c00645d359097..3975e683af72009634f963d3353a40a5aedea2b7 100644 (file)
@@ -36,12 +36,13 @@ struct btrfs_ioctl_vol_args {
 #define BTRFS_SUBVOL_CREATE_ASYNC      (1ULL << 0)
 #define BTRFS_SUBVOL_RDONLY            (1ULL << 1)
 #define BTRFS_SUBVOL_QGROUP_INHERIT    (1ULL << 2)
-#define BTRFS_DEVICE_BY_ID             (1ULL << 3)
-#define BTRFS_VOL_ARG_V2_FLAGS                         \
+#define BTRFS_DEVICE_SPEC_BY_ID                (1ULL << 3)
+
+#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED               \
                        (BTRFS_SUBVOL_CREATE_ASYNC |    \
                        BTRFS_SUBVOL_RDONLY |           \
                        BTRFS_SUBVOL_QGROUP_INHERIT |   \
-                       BTRFS_DEVICE_BY_ID)
+                       BTRFS_DEVICE_SPEC_BY_ID)
 
 #define BTRFS_FSID_SIZE 16
 #define BTRFS_UUID_SIZE 16