btrfs-progs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
PATCH 1/1 btrfs-progs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
The BTRFS_DEV_REPLACE_ITEM_STATE_x series defines as shown in [1] are unused in both kernel and btrfs-progs.
[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 the BTRFS_DEV_REPLACE_ITEM_STATE_x 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.
--- libbtrfsutil/btrfs_tree.h | 5 ----- 1 file changed, 5 deletions(-)
libbtrfsutil/btrfs_tree.h +0 -5
@@ -800,11 +800,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 4struct btrfs_dev_replace_item {/*
Signature · 1 line
2.21.0 (Apple Git-120)
PATCH 1/1 btrfs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
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.
--- fs/btrfs/dev-replace.c | 2 +- include/uapi/linux/btrfs_tree.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-)
fs/btrfs/dev-replace.c +1 -1
@@ -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 ;
include/uapi/linux/btrfs_tree.h +0 -5
@@ -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 4struct btrfs_dev_replace_item {/*
Signature · 1 line
2.21.0 (Apple Git-120)
Re: [PATCH] btrfs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
Quoted 17 lines · Anand Jain
The
BTRFS_DEV_REPLACE_ITEM_STATE_xdefines, as shown in [1], are unused in both kernel and btrfs-progs (except for one instance ofBTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTEDin 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 4Further these define-values are different form its counterpart
BTRFS_IOCTL_DEV_REPLACE_STATE_xseries 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
Quoted 5 lines
So this patch deletes the
BTRFS_DEV_REPLACE_ITEM_STATE_xaltogether, and one instance ofBTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTEDis replaced withBTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTEDin the kernel.Signed-off-by Anand Jain <[email protected]>
Added to misc-next, thanks.
David Sterba
AppliedQuoted 11 lines · Anand Jain
The
BTRFS_DEV_REPLACE_ITEM_STATE_xseries defines as shown in [1] are unused in both kernel and btrfs-progs.[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 4Further the
BTRFS_DEV_REPLACE_ITEM_STATE_xvalues are different form its counterpartBTRFS_IOCTL_DEV_REPLACE_STATE_xseries as shown in [2].
Quoted 8 lines
[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 4So this patch deletes the
BTRFS_DEV_REPLACE_ITEM_STATE_xaltogether.Signed-off-by Anand Jain <[email protected]>
Applied, thanks. Please note that in this case the subject prefix should be "libbtrfsutil: ", not "btrfs-progs: ".