Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ea6e2b5 authored by David Sterba's avatar David Sterba
Browse files

btrfs: remove unnecessary mutex lock in qgroup_account_snapshot



The quota status used to be tracked as a variable, so the mutex was
needed (until "Btrfs: add a flags field to btrfs_fs_info" afcdd129).
Since the status is a bit modified atomically and we don't hold the
mutex beyond the check, we can drop it.

Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 81353d50
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -1364,12 +1364,8 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
	 * enabled. If this check races with the ioctl, rescan will
	 * kick in anyway.
	 */
	mutex_lock(&fs_info->qgroup_ioctl_lock);
	if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) {
		mutex_unlock(&fs_info->qgroup_ioctl_lock);
	if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
		return 0;
	}
	mutex_unlock(&fs_info->qgroup_ioctl_lock);

	/*
	 * We are going to commit transaction, see btrfs_commit_transaction()