public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 1/2] btrfs: use __u16 for the return value of btrfs_qgroup_level()
Date: Sun, 28 Jun 2020 13:07:14 +0800	[thread overview]
Message-ID: <20200628050715.60961-2-wqu@suse.com> (raw)
In-Reply-To: <20200628050715.60961-1-wqu@suse.com>

Btrfs qgroup level is limited to u16, so no need to use u64 for it.

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

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 74eb98479109..014d32429165 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -538,7 +538,7 @@ bool btrfs_check_quota_leak(struct btrfs_fs_info *fs_info)
 			if (qgroup->rsv.values[i]) {
 				ret = true;
 				btrfs_warn(fs_info,
-		"qgroup %llu/%llu has unreleased space, type %d rsv %llu",
+		"qgroup %hu/%llu has unreleased space, type %d rsv %llu",
 				   btrfs_qgroup_level(qgroup->qgroupid),
 				   btrfs_qgroup_subvolid(qgroup->qgroupid),
 				   i, qgroup->rsv.values[i]);
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index a3f3975df0de..9ba64ca6b4ac 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -913,9 +913,9 @@ struct btrfs_free_space_info {
 #define BTRFS_FREE_SPACE_USING_BITMAPS (1ULL << 0)
 
 #define BTRFS_QGROUP_LEVEL_SHIFT		48
-static inline __u64 btrfs_qgroup_level(__u64 qgroupid)
+static inline __u16 btrfs_qgroup_level(__u64 qgroupid)
 {
-	return qgroupid >> BTRFS_QGROUP_LEVEL_SHIFT;
+	return (__u16)(qgroupid >> BTRFS_QGROUP_LEVEL_SHIFT);
 }
 
 /*
-- 
2.27.0


  reply	other threads:[~2020-06-28  5:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28  5:07 [PATCH v2 0/2] btrfs: add sysfs interface for qgroup Qu Wenruo
2020-06-28  5:07 ` Qu Wenruo [this message]
2020-06-28  5:07 ` [PATCH v2 2/2] btrfs: qgroup: add sysfs interface for debug Qu Wenruo
2020-06-29 21:30   ` David Sterba
2020-06-29 23:17     ` Qu Wenruo
2020-06-30  8:07       ` David Sterba
2020-06-30 14:27         ` David Sterba
2020-06-30 16:57   ` David Sterba
2020-07-01  0:06     ` Qu Wenruo
2020-07-15 13:49   ` Chris Down
2020-07-16  0:15     ` Qu Wenruo
2020-07-16  0:25       ` Chris Down
2020-07-16  0:27       ` Qu Wenruo
     [not found]         ` <20200716004031.GC2140@chrisdown.name>
2020-07-16  1:51           ` Qu Wenruo
2020-07-16  6:21           ` Qu Wenruo
2020-07-16  8:41             ` Chris Down

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200628050715.60961-2-wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox