]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9f21919a9750b804c9a1dd1f9ef78bf1a19fda95
tree3aa02a886bbf42bf0074fc954de3f2c6e1d28998
parent12ec25bf668db52c4b2507f52a57faee058e0eb9
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