btrfs: qgroup: remove duplicated check in adding qgroup relations
authorSidong Yang <realwakka@gmail.com>
Sun, 6 Feb 2022 12:52:48 +0000 (12:52 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Feb 2022 15:36:04 +0000 (16:36 +0100)
commitb6a98303810dc80313f421b2321ae8b04299e1ee
treec5a0f98ce7698f163bacf2059e2c4b8f9f6f5e38
parent48b433a2ef82a03e5ea89f2bea0eb22458ead3fc
btrfs: qgroup: remove duplicated check in adding qgroup relations

Removes duplicated check when adding qgroup relations.
btrfs_add_qgroup_relations function adds relations by calling
add_relation_rb(). add_relation_rb() checks that member/parentid exists
in current qgroup_tree. But it already checked before calling the
function. It seems that we don't need to double check.

Add new function __add_relation_rb() that adds relations with
qgroup structures and makes old function use the new one. And it makes
btrfs_add_qgroup_relation() function work without double checks by
calling the new function.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ add comments ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c