mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 18:09:57 +00:00
Btrfs: don't set and clear delalloc for O_DIRECT writes
We do this to get the space accounting, but this is just needless churn on the io_tree, so just drop setting/clearing delalloc and just drop the reserved data space when we have a successfull allocation. 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>
This commit is contained in:
parent
3e05bde8c3
commit
3266789f9d
1 changed files with 2 additions and 6 deletions
|
@ -7160,7 +7160,7 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
|
|||
int ret = 0;
|
||||
|
||||
if (create)
|
||||
unlock_bits |= EXTENT_DELALLOC | EXTENT_DIRTY;
|
||||
unlock_bits |= EXTENT_DIRTY;
|
||||
else
|
||||
len = min_t(u64, len, root->sectorsize);
|
||||
|
||||
|
@ -7296,11 +7296,7 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
|
|||
BTRFS_I(inode)->outstanding_extents++;
|
||||
spin_unlock(&BTRFS_I(inode)->lock);
|
||||
}
|
||||
|
||||
ret = set_extent_bit(&BTRFS_I(inode)->io_tree, lockstart,
|
||||
lockstart + len - 1, EXTENT_DELALLOC, NULL,
|
||||
&cached_state, GFP_NOFS);
|
||||
BUG_ON(ret);
|
||||
btrfs_free_reserved_data_space(inode, len);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue