diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2013-03-11 09:20:58 (GMT) |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-03-14 18:50:19 (GMT) |
commit | a09a0a705dd6c80bc96b5e6f18dc103d4e1a7d63 (patch) | |
tree | 50112ba483bf6994438973db5ead8b145b1437fb /fs/btrfs | |
parent | de3cb945db4d8eb3b046dc7a5ea89a893372750c (diff) | |
download | linux-a09a0a705dd6c80bc96b5e6f18dc103d4e1a7d63.tar.xz |
Btrfs: get better concurrency for snapshot-aware defrag work
Using spinning case instead of blocking will result in better concurrency
overall.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/inode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 13ab4de..1f268888 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2312,6 +2312,7 @@ again: key.type = BTRFS_EXTENT_DATA_KEY; key.offset = start; + path->leave_spinning = 1; if (merge) { struct btrfs_file_extent_item *fi; u64 extent_len; @@ -2368,6 +2369,7 @@ again: btrfs_mark_buffer_dirty(leaf); inode_add_bytes(inode, len); + btrfs_release_path(path); ret = btrfs_inc_extent_ref(trans, root, new->bytenr, new->disk_len, 0, @@ -2381,6 +2383,7 @@ again: ret = 1; out_free_path: btrfs_release_path(path); + path->leave_spinning = 0; btrfs_end_transaction(trans, root); out_unlock: unlock_extent_cached(&BTRFS_I(inode)->io_tree, lock_start, lock_end, |