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, 28 Feb 2022 15:19:51 +0000 (16:19 +0100)
commitc7250015a594cd01cae26af5d4bbfd7e8b2fbce1
tree03f198e382858f7dc7effbd24358a18b3cdced44
parent136f879b52cd4523bb92969dd066bce1ab560384
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