btrfs: extent-tree: Add new version of btrfs_check_data_free_space and btrfs_free_res...
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 8 Sep 2015 09:22:42 +0000 (17:22 +0800)
committerChris Mason <clm@fb.com>
Thu, 22 Oct 2015 01:41:03 +0000 (18:41 -0700)
commit4ceff0792d36256a5f879cec51c56e44db90b8ec
treed894475934305dbbed66bc7f3f9a119c026db944
parent7174109c6548c4db85a383b8ae9d01469cddd110
btrfs: extent-tree: Add new version of btrfs_check_data_free_space and btrfs_free_reserved_data_space.

Add new functions __btrfs_check_data_free_space() and
__btrfs_free_reserved_data_space() to work with new accurate qgroup
reserved space framework.

The new function will replace old btrfs_check_data_free_space() and
btrfs_free_reserved_data_space() respectively, but until all the change
is done, let's just use the new name.

Also, export internal use function btrfs_alloc_data_chunk_ondemand(), as
now qgroup reserve requires precious bytes, some operation can't get the
accurate number in advance(like fallocate).
But data space info check and data chunk allocate doesn't need to be
that accurate, and can be called at the beginning.

So export it for later operations.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c