Skip to content

Commit

Permalink
btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s el…
Browse files Browse the repository at this point in the history
…se branch

There is no reason to put this check in (!qgroup)'s else branch because
if qgroup is null, it will goto out directly. So move it out to reduce
indentation level.  No functional change.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Lu Fengqi authored and David Sterba committed Oct 15, 2018
1 parent 06bbf67 commit b90e22b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,13 +1416,14 @@ int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid)
if (!qgroup) {
ret = -ENOENT;
goto out;
} else {
/* check if there are no children of this qgroup */
if (!list_empty(&qgroup->members)) {
ret = -EBUSY;
goto out;
}
}

/* Check if there are no children of this qgroup */
if (!list_empty(&qgroup->members)) {
ret = -EBUSY;
goto out;
}

ret = del_qgroup_item(trans, qgroupid);
if (ret && ret != -ENOENT)
goto out;
Expand Down

0 comments on commit b90e22b

Please sign in to comment.