diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-09-08 12:22:43 +0300 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-22 04:41:04 +0300 |
commit | d9d8b2a51a404c2d45b9dc4c755f62cb3ddb7c79 (patch) | |
tree | 4405c3e139e22e0ae72f3080340eb7ce1da28d89 /fs/btrfs/relocation.c | |
parent | 4ceff0792d36256a5f879cec51c56e44db90b8ec (diff) | |
download | linux-d9d8b2a51a404c2d45b9dc4c755f62cb3ddb7c79.tar.xz |
btrfs: extent-tree: Switch to new check_data_free_space and free_reserved_data_space
Use new reserve/free for buffered write and inode cache.
For buffered write case, as nodatacow write won't increase quota account,
so unlike old behavior which does reserve before check nocow, now we
check nocow first and then only reserve data if we can't do nocow write.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 58ede0a56456..490c9e298c58 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3034,8 +3034,8 @@ int prealloc_file_extent_cluster(struct inode *inode, BUG_ON(cluster->start != cluster->boundary[0]); mutex_lock(&inode->i_mutex); - ret = btrfs_check_data_free_space(inode, cluster->end + - 1 - cluster->start, 0); + ret = __btrfs_check_data_free_space(inode, cluster->start, + cluster->end + 1 - cluster->start); if (ret) goto out; @@ -3056,8 +3056,8 @@ int prealloc_file_extent_cluster(struct inode *inode, break; nr++; } - btrfs_free_reserved_data_space(inode, cluster->end + - 1 - cluster->start); + __btrfs_free_reserved_data_space(inode, cluster->start, + cluster->end + 1 - cluster->start); out: mutex_unlock(&inode->i_mutex); return ret; |