OSDN Git Service

Btrfs: remove some unnecessary spin_lock usages
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>
Sun, 7 Apr 2013 10:50:17 +0000 (10:50 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:54:39 +0000 (15:54 -0400)
commit58400fce5ac5939aadac8ce682edc192c6172f80
treee50f657851833043afaf1ece49bc5e2b348c58a5
parentf2f6ed3d54648ec19dcdeec30f66843cf7a38487
Btrfs: remove some unnecessary spin_lock usages

We use mutex lock to protect all the user change operations.
So when we are calling find_qgroup_rb() to check whether qgroup
exists, we don't have to hold spin_lock.

Besides, when enabling/disabling quota, it must be single thread
when operations come here. spin lock must be firstly used to
clear quota_root when disabling quota, while enabling quota, spin
lock must be used to complete the last assign work.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/qgroup.c