diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-02-27 16:26:33 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-24 00:07:59 +0100 |
commit | 9922c42701f8a49d3df743a95c4f7a54c84c7452 (patch) | |
tree | 121dd77ff9b992beb0f1f93747b29a9cc2ca656c /print-tree.c | |
parent | f18f8b7afc6f4c714ece79bbd56064d012cbbea4 (diff) |
btrfs-progs: Update qgroup status flags and replace qgroup level/subvid calculation with inline function
Ctree.h of btrfs-progs contains wrong flags for btrfs_qgroup_status.
Update it with the one in kernel.
Also, introduce the inline function btrfs_qgroup_(level/subvid) to get
the level/subvolid of qgroup, to replace the old open-coded bit
operations.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'print-tree.c')
-rw-r--r-- | print-tree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/print-tree.c b/print-tree.c index 931a321a..30adc1a3 100644 --- a/print-tree.c +++ b/print-tree.c @@ -645,8 +645,8 @@ static void print_objectid(u64 objectid, u8 type) printf("%llu", (unsigned long long)objectid); /* device id */ return; case BTRFS_QGROUP_RELATION_KEY: - printf("%llu/%llu", objectid >> 48, - objectid & ((1ll << 48) - 1)); + printf("%llu/%llu", btrfs_qgroup_level(objectid), + btrfs_qgroup_subvid(objectid)); return; case BTRFS_UUID_KEY_SUBVOL: case BTRFS_UUID_KEY_RECEIVED_SUBVOL: @@ -743,8 +743,8 @@ void btrfs_print_key(struct btrfs_disk_key *disk_key) case BTRFS_QGROUP_RELATION_KEY: case BTRFS_QGROUP_INFO_KEY: case BTRFS_QGROUP_LIMIT_KEY: - printf(" %llu/%llu)", (unsigned long long)(offset >> 48), - (unsigned long long)(offset & ((1ll << 48) - 1))); + printf(" %llu/%llu)", btrfs_qgroup_level(offset), + btrfs_qgroup_subvid(offset)); break; case BTRFS_UUID_KEY_SUBVOL: case BTRFS_UUID_KEY_RECEIVED_SUBVOL: |