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 Mar 2022 12:13:50 +0000 (13:13 +0100)
commita8f6f619e44402f7005da79470835b98dc88450f
tree3aa02a886bbf42bf0074fc954de3f2c6e1d28998
parentdc4a4bdb3f22f9a97a59cdf3c6a1257435ff3700
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