diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-06-25 16:01:30 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:03 -0400 |
commit | a213501153fd66e2359e091b1612841305ba6551 (patch) | |
tree | 1f4c316c9d3cad0eb6d9be14cb0e67e46e815dce /fs/btrfs/xattr.c | |
parent | 925baeddc5b0764a53f2214a1253251bab0e0324 (diff) |
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>
Diffstat (limited to 'fs/btrfs/xattr.c')
-rw-r--r-- | fs/btrfs/xattr.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index f63488dc2f16..3e9eb91c3c89 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -153,7 +153,6 @@ ssize_t btrfs_xattr_get(struct inode *inode, int name_index, | |||
153 | return -ENOMEM; | 153 | return -ENOMEM; |
154 | } | 154 | } |
155 | 155 | ||
156 | mutex_lock(&root->fs_info->fs_mutex); | ||
157 | /* lookup the xattr by name */ | 156 | /* lookup the xattr by name */ |
158 | di = btrfs_lookup_xattr(NULL, root, path, inode->i_ino, name, | 157 | di = btrfs_lookup_xattr(NULL, root, path, inode->i_ino, name, |
159 | strlen(name), 0); | 158 | strlen(name), 0); |
@@ -181,7 +180,6 @@ ssize_t btrfs_xattr_get(struct inode *inode, int name_index, | |||
181 | ret = btrfs_dir_data_len(leaf, di); | 180 | ret = btrfs_dir_data_len(leaf, di); |
182 | 181 | ||
183 | out: | 182 | out: |
184 | mutex_unlock(&root->fs_info->fs_mutex); | ||
185 | kfree(name); | 183 | kfree(name); |
186 | btrfs_free_path(path); | 184 | btrfs_free_path(path); |
187 | return ret; | 185 | return ret; |
@@ -210,7 +208,6 @@ int btrfs_xattr_set(struct inode *inode, int name_index, | |||
210 | return -ENOMEM; | 208 | return -ENOMEM; |
211 | } | 209 | } |
212 | 210 | ||
213 | mutex_lock(&root->fs_info->fs_mutex); | ||
214 | trans = btrfs_start_transaction(root, 1); | 211 | trans = btrfs_start_transaction(root, 1); |
215 | btrfs_set_trans_block_group(trans, inode); | 212 | btrfs_set_trans_block_group(trans, inode); |
216 | 213 | ||
@@ -260,7 +257,6 @@ out: | |||
260 | } | 257 | } |
261 | 258 | ||
262 | btrfs_end_transaction(trans, root); | 259 | btrfs_end_transaction(trans, root); |
263 | mutex_unlock(&root->fs_info->fs_mutex); | ||
264 | kfree(name); | 260 | kfree(name); |
265 | btrfs_free_path(path); | 261 | btrfs_free_path(path); |
266 | 262 | ||
@@ -297,8 +293,6 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size) | |||
297 | return -ENOMEM; | 293 | return -ENOMEM; |
298 | path->reada = 2; | 294 | path->reada = 2; |
299 | 295 | ||
300 | mutex_lock(&root->fs_info->fs_mutex); | ||
301 | |||
302 | /* search for our xattrs */ | 296 | /* search for our xattrs */ |
303 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); | 297 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |
304 | if (ret < 0) | 298 | if (ret < 0) |
@@ -379,15 +373,13 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size) | |||
379 | ret = total_size; | 373 | ret = total_size; |
380 | 374 | ||
381 | err: | 375 | err: |
382 | mutex_unlock(&root->fs_info->fs_mutex); | ||
383 | btrfs_free_path(path); | 376 | btrfs_free_path(path); |
384 | 377 | ||
385 | return ret; | 378 | return ret; |
386 | } | 379 | } |
387 | 380 | ||
388 | /* | 381 | /* |
389 | * delete all the xattrs associated with the inode. fs_mutex should be | 382 | * delete all the xattrs associated with the inode. |
390 | * held when we come into here | ||
391 | */ | 383 | */ |
392 | int btrfs_delete_xattrs(struct btrfs_trans_handle *trans, | 384 | int btrfs_delete_xattrs(struct btrfs_trans_handle *trans, |
393 | struct btrfs_root *root, struct inode *inode) | 385 | struct btrfs_root *root, struct inode *inode) |