btrfs-progs: qgroups: fix misleading index check

In print_single_qgroup_table we check the loop index against
BTRFS_QGROUP_CHILD, but what we really mean is "last column."  Since
we have an enum value to indicate the last value, use that instead
of assuming that BTRFS_QGROUP_CHILD is always last.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Jeff Mahoney 2018-05-16 17:38:35 -04:00 committed by David Sterba
parent 33d16ffc0d
commit 66d90453cd

View File

@ -267,7 +267,7 @@ static void print_single_qgroup_table(struct btrfs_qgroup *qgroup)
continue;
print_qgroup_column(qgroup, i);
if (i != BTRFS_QGROUP_CHILD)
if (i != BTRFS_QGROUP_ALL - 1)
printf(" ");
}
printf("\n");