Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] btrfs-progs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
@ 2019-08-08  4:32 Anand Jain
  2019-08-08  4:32 ` [PATCH] btrfs: " Anand Jain
  2019-08-19 16:50 ` [PATCH] btrfs-progs: " David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2019-08-08  4:32 UTC (permalink / raw)
  To: linux-btrfs

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.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 libbtrfsutil/btrfs_tree.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/libbtrfsutil/btrfs_tree.h b/libbtrfsutil/btrfs_tree.h
index 2af7205cc645..8ea3e31d9b96 100644
--- a/libbtrfsutil/btrfs_tree.h
+++ b/libbtrfsutil/btrfs_tree.h
@@ -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		4
 
 struct btrfs_dev_replace_item {
 	/*
-- 
2.21.0 (Apple Git-120)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] btrfs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
  2019-08-08  4:32 [PATCH] btrfs-progs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go Anand Jain
@ 2019-08-08  4:32 ` " Anand Jain
  2019-08-19 16:46   ` David Sterba
  2019-08-19 16:50 ` [PATCH] btrfs-progs: " David Sterba
  1 sibling, 1 reply; 4+ messages in thread
From: Anand Jain @ 2019-08-08  4:32 UTC (permalink / raw)
  To: linux-btrfs

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>
---
 fs/btrfs/dev-replace.c          | 2 +-
 include/uapi/linux/btrfs_tree.h | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index 6b2e9aa83ffa..00ea828beb00 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -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;
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index 34d5b34286fa..71246c1941aa 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -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 {
 	/*
-- 
2.21.0 (Apple Git-120)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
  2019-08-08  4:32 ` [PATCH] btrfs: " Anand Jain
@ 2019-08-19 16:46   ` David Sterba
  0 siblings, 0 replies; 4+ messages in thread
From: David Sterba @ 2019-08-19 16:46 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Thu, Aug 08, 2019 at 12:32:44PM +0800, Anand Jain wrote:
> 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>

Added to misc-next, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] btrfs-progs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go
  2019-08-08  4:32 [PATCH] btrfs-progs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go Anand Jain
  2019-08-08  4:32 ` [PATCH] btrfs: " Anand Jain
@ 2019-08-19 16:50 ` " David Sterba
  1 sibling, 0 replies; 4+ messages in thread
From: David Sterba @ 2019-08-19 16:50 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Thu, Aug 08, 2019 at 12:32:43PM +0800, Anand Jain wrote:
> 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.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Applied, thanks. Please note that in this case the subject prefix should
be "libbtrfsutil: ", not "btrfs-progs: ".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08  4:32 [PATCH] btrfs-progs: replace: BTRFS_DEV_REPLACE_ITEM_STATE_x defines should go Anand Jain
2019-08-08  4:32 ` [PATCH] btrfs: " Anand Jain
2019-08-19 16:46   ` David Sterba
2019-08-19 16:50 ` [PATCH] btrfs-progs: " David Sterba

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox