From 9922c42701f8a49d3df743a95c4f7a54c84c7452 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Fri, 27 Feb 2015 16:26:33 +0800 Subject: 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 Signed-off-by: David Sterba --- print-tree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'print-tree.c') diff --git a/print-tree.c b/print-tree.c index 931a321..30adc1a 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: -- cgit v1.2.1