mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
btrfs: check quota status earlier and don't do unnecessary frees
Status of quotas should be the first check in btrfs_qgroup_account_extent and we can return immediatelly, no need to do no-op ulist frees. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
53d3235995
commit
81353d50f5
@ -1945,13 +1945,14 @@ btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans,
|
|||||||
u64 nr_old_roots = 0;
|
u64 nr_old_roots = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (new_roots)
|
if (new_roots)
|
||||||
nr_new_roots = new_roots->nnodes;
|
nr_new_roots = new_roots->nnodes;
|
||||||
if (old_roots)
|
if (old_roots)
|
||||||
nr_old_roots = old_roots->nnodes;
|
nr_old_roots = old_roots->nnodes;
|
||||||
|
|
||||||
if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
|
|
||||||
goto out_free;
|
|
||||||
BUG_ON(!fs_info->quota_root);
|
BUG_ON(!fs_info->quota_root);
|
||||||
|
|
||||||
trace_btrfs_qgroup_account_extent(fs_info, bytenr, num_bytes,
|
trace_btrfs_qgroup_account_extent(fs_info, bytenr, num_bytes,
|
||||||
|
Loading…
Reference in New Issue
Block a user