diff options
author | David Sterba <dsterba@suse.com> | 2017-02-13 08:05:24 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-02-17 06:03:50 -0500 |
commit | 81353d50f5274e435105391b669e05aaf62c8609 (patch) | |
tree | d730cd3645cb057c4d57bbe01a39b6d61dea2bd1 | |
parent | 53d3235995b3f87754a42de24d707f158c1b3b40 (diff) |
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>
-rw-r--r-- | fs/btrfs/qgroup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 627126daf25b..0d3c9a1062b0 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c | |||
@@ -1945,13 +1945,14 @@ btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, | |||
1945 | u64 nr_old_roots = 0; | 1945 | u64 nr_old_roots = 0; |
1946 | int ret = 0; | 1946 | int ret = 0; |
1947 | 1947 | ||
1948 | if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) | ||
1949 | return 0; | ||
1950 | |||
1948 | if (new_roots) | 1951 | if (new_roots) |
1949 | nr_new_roots = new_roots->nnodes; | 1952 | nr_new_roots = new_roots->nnodes; |
1950 | if (old_roots) | 1953 | if (old_roots) |
1951 | nr_old_roots = old_roots->nnodes; | 1954 | nr_old_roots = old_roots->nnodes; |
1952 | 1955 | ||
1953 | if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) | ||
1954 | goto out_free; | ||
1955 | BUG_ON(!fs_info->quota_root); | 1956 | BUG_ON(!fs_info->quota_root); |
1956 | 1957 | ||
1957 | trace_btrfs_qgroup_account_extent(fs_info, bytenr, num_bytes, | 1958 | trace_btrfs_qgroup_account_extent(fs_info, bytenr, num_bytes, |