Btrfs: only adjust outstanding_extents when we do a short write
authorJosef Bacik <jbacik@fb.com>
Wed, 11 Feb 2015 20:08:57 +0000 (15:08 -0500)
committerChris Mason <clm@fb.com>
Sat, 14 Feb 2015 16:19:14 +0000 (08:19 -0800)
commitb4ee01082e784c82d1fd72d4fcb2f0575cacc0c8
tree42d22d2d53c7764f14ccb0f70c25171b06209fe5
parent4e842b7cb3e9286a65873b9aa986f7017ef1dbe4
Btrfs: only adjust outstanding_extents when we do a short write

We have this weird dance where we always inc outstanding_extents when we do a
O_DIRECT write, even if we allocate the entire range.  To get around this we
also drop the metadata space if we successfully write.  This is an unnecessary
dance, we only need to jack up outstanding_extents if we don't satisfy the
entire range request in get_blocks_direct, otherwise we are good using our
original reservation.  So drop the unconditional inc and the drop of the
metadata space that we have for the unconditional inc.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/inode.c