Btrfs: Add a per-inode csum mutex to avoid races creating csum items

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2008-06-25 16:01:31 -04:00
parent 079899c238
commit 1b1e2135dc
6 changed files with 21 additions and 6 deletions

View File

@ -38,8 +38,15 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
u64 last_ret = 0;
if (root->fs_info->extent_root == root) {
/*
* there's recursion here right now in the tree locking,
* we can't defrag the extent root without deadlock
*/
goto out;
#if 0
mutex_lock(&root->fs_info->alloc_mutex);
is_extent = 1;
#endif
}
if (root->ref_cows == 0 && !is_extent)