Btrfs: Replace the big fs_mutex with a collection of other locks
Extent alloctions are still protected by a large alloc_mutex.
Objectid allocations are covered by a objectid mutex
Other btree operations are protected by a lock on individual btree nodes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 50891b3..692b8ea 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -519,9 +519,9 @@
struct backing_dev_info bdi;
spinlock_t hash_lock;
struct mutex trans_mutex;
- struct mutex fs_mutex;
struct mutex alloc_mutex;
struct mutex chunk_mutex;
+ struct mutex drop_mutex;
struct list_head trans_list;
struct list_head hashers;
struct list_head dead_roots;
@@ -554,7 +554,7 @@
struct completion kobj_unregister;
int do_barriers;
int closing;
- unsigned long throttles;
+ atomic_t throttles;
u64 total_pinned;
struct list_head dirty_cowonly_roots;
@@ -594,6 +594,7 @@
struct inode *inode;
struct kobject root_kobj;
struct completion kobj_unregister;
+ struct mutex objectid_mutex;
u64 objectid;
u64 last_trans;