]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
btrfs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
authorAnand Jain <anand.jain@oracle.com>
Thu, 8 Aug 2019 04:32:44 +0000 (12:32 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:11 +0000 (14:59 +0200)
The BTRFS_DEV_REPLACE_ITEM_STATE_x defines, as shown in [1], are
unused in both kernel and btrfs-progs (except for one instance of
BTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTED in kernel).

[1]
btrfs.h:#define BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED        2
btrfs.h:#define BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED        3
btrfs.h:#define BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED       4

Further these define-values are different form its counterpart
BTRFS_IOCTL_DEV_REPLACE_STATE_x series as shown in [2].

[2]
btrfs_tree.h:#define BTRFS_DEV_REPLACE_ITEM_STATE_SUSPENDED   2
btrfs_tree.h:#define BTRFS_DEV_REPLACE_ITEM_STATE_FINISHED    3
btrfs_tree.h:#define BTRFS_DEV_REPLACE_ITEM_STATE_CANCELED    4

So this patch deletes the BTRFS_DEV_REPLACE_ITEM_STATE_x altogether, and
one instance of BTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTED is replaced
with BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED in the kernel.

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

index 6b2e9aa83ffaa5643d5e9d451b63792f79851593..00ea828beb002c63cd1fd89750881713b78cf3d4 100644 (file)
@@ -56,7 +56,7 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)
 no_valid_dev_replace_entry_found:
                ret = 0;
                dev_replace->replace_state =
-                       BTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTED;
+                       BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED;
                dev_replace->cont_reading_from_srcdev_mode =
                    BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_ALWAYS;
                dev_replace->time_started = 0;
index 34d5b34286facd92b92d896f4a87905d4f86b0ff..71246c1941aae479b7e3953b13df8b1163af1cc1 100644 (file)
@@ -806,11 +806,6 @@ struct btrfs_dev_stats_item {
 
 #define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_ALWAYS    0
 #define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_AVOID     1
-#define BTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTED     0
-#define BTRFS_DEV_REPLACE_ITEM_STATE_STARTED           1
-#define BTRFS_DEV_REPLACE_ITEM_STATE_SUSPENDED         2
-#define BTRFS_DEV_REPLACE_ITEM_STATE_FINISHED          3
-#define BTRFS_DEV_REPLACE_ITEM_STATE_CANCELED          4
 
 struct btrfs_dev_replace_item {
        /*