Skip to content

Commit

Permalink
Btrfs: do not hold the file extent leaf locked when adding extent item
Browse files Browse the repository at this point in the history
For some reason we unlock everything except the leaf we are on, set the path
blocking and then add the extent item for the extent we just finished
writing.  I can't for the life of me figure out why we would want to do
this, and the history doesn't really indicate that there was a real reason
for it, so just remove it.  This will reduce our tree lock contention on
heavy writes.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Oct 9, 2012
1 parent de0022b commit ce19533
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,10 +1822,8 @@ static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
btrfs_set_file_extent_encryption(leaf, fi, encryption);
btrfs_set_file_extent_other_encoding(leaf, fi, other_encoding);

btrfs_unlock_up_safe(path, 1);
btrfs_set_lock_blocking(leaf);

btrfs_mark_buffer_dirty(leaf);
btrfs_release_path(path);

inode_add_bytes(inode, num_bytes);

Expand Down

0 comments on commit ce19533

Please sign in to comment.