linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: qgroups: Prepare to deprecate BTRFS_QGROUP_LIMIT_RSV_RFER/EXCL flags
@ 2018-11-13  6:09 Qu Wenruo
  2018-11-13  9:48 ` Nikolay Borisov
  0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2018-11-13  6:09 UTC (permalink / raw)
  To: linux-btrfs

These two flags are only used to set btrfs_qgroup::rsv_rfer/excl number,
but then are never used.

Nor these flags are really used by btrfs-progs, so it's pretty safe just
to deprecate them in next kernel release.

This patch will mark these two flags deprecated and output warning
messages, but still handle them.

These two flags will be completely removed in next kernel release.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/qgroup.c          | 16 ++++++++++------
 include/uapi/linux/btrfs.h | 12 ++++++------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 9afad8c14220..d4a52dbad044 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1385,21 +1385,25 @@ int btrfs_limit_qgroup(struct btrfs_trans_handle *trans,
 			qgroup->max_excl = limit->max_excl;
 		}
 	}
-	if (limit->flags & BTRFS_QGROUP_LIMIT_RSV_RFER) {
+	if (limit->flags & __BTRFS_QGROUP_LIMIT_RSV_RFER) {
 		if (limit->rsv_rfer == CLEAR_VALUE) {
-			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_RSV_RFER;
-			limit->flags &= ~BTRFS_QGROUP_LIMIT_RSV_RFER;
+			qgroup->lim_flags &= ~__BTRFS_QGROUP_LIMIT_RSV_RFER;
+			limit->flags &= ~__BTRFS_QGROUP_LIMIT_RSV_RFER;
 			qgroup->rsv_rfer = 0;
 		} else {
+			btrfs_warn_rl(fs_info,
+"BTRFS_QGROUP_LIMIT_RSV_RFER flag is deprecated, will not be supported in v5.1");
 			qgroup->rsv_rfer = limit->rsv_rfer;
 		}
 	}
-	if (limit->flags & BTRFS_QGROUP_LIMIT_RSV_EXCL) {
+	if (limit->flags & __BTRFS_QGROUP_LIMIT_RSV_EXCL) {
 		if (limit->rsv_excl == CLEAR_VALUE) {
-			qgroup->lim_flags &= ~BTRFS_QGROUP_LIMIT_RSV_EXCL;
-			limit->flags &= ~BTRFS_QGROUP_LIMIT_RSV_EXCL;
+			qgroup->lim_flags &= ~__BTRFS_QGROUP_LIMIT_RSV_EXCL;
+			limit->flags &= ~__BTRFS_QGROUP_LIMIT_RSV_EXCL;
 			qgroup->rsv_excl = 0;
 		} else {
+			btrfs_warn_rl(fs_info,
+"BTRFS_QGROUP_LIMIT_RSV_EXCL flag is deprecated, will not be supported in v5.1");
 			qgroup->rsv_excl = limit->rsv_excl;
 		}
 	}
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index db4c253f8011..ec79ab781ee0 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -53,12 +53,12 @@ struct btrfs_ioctl_vol_args {
  * struct btrfs_qgroup_limit.flags
  * struct btrfs_qgroup_limit_item.flags
  */
-#define BTRFS_QGROUP_LIMIT_MAX_RFER	(1ULL << 0)
-#define BTRFS_QGROUP_LIMIT_MAX_EXCL	(1ULL << 1)
-#define BTRFS_QGROUP_LIMIT_RSV_RFER	(1ULL << 2)
-#define BTRFS_QGROUP_LIMIT_RSV_EXCL	(1ULL << 3)
-#define BTRFS_QGROUP_LIMIT_RFER_CMPR	(1ULL << 4)
-#define BTRFS_QGROUP_LIMIT_EXCL_CMPR	(1ULL << 5)
+#define BTRFS_QGROUP_LIMIT_MAX_RFER	(1ULL << 0) /* reference (rfer) limit */
+#define BTRFS_QGROUP_LIMIT_MAX_EXCL	(1ULL << 1) /* exclusive (excl) limit */
+#define __BTRFS_QGROUP_LIMIT_RSV_RFER	(1ULL << 2) /* deprecated */
+#define __BTRFS_QGROUP_LIMIT_RSV_EXCL	(1ULL << 3) /* deprecated */
+#define BTRFS_QGROUP_LIMIT_RFER_CMPR	(1ULL << 4) /* compressed rfer limit */
+#define BTRFS_QGROUP_LIMIT_EXCL_CMPR	(1ULL << 5) /* compressed excl limit */
 
 struct btrfs_qgroup_limit {
 	__u64	flags;
-- 
2.19.1


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

end of thread, other threads:[~2018-11-13 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-13  6:09 [PATCH] btrfs: qgroups: Prepare to deprecate BTRFS_QGROUP_LIMIT_RSV_RFER/EXCL flags Qu Wenruo
2018-11-13  9:48 ` Nikolay Borisov
2018-11-13 10:07   ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).