diff options
author | Dongsheng Yang <yangds.fnst@cn.fujitsu.com> | 2015-02-06 16:26:52 +0100 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-04-13 16:52:50 +0200 |
commit | e2d1f92399afb6ec518b68867ed10db2585b283a (patch) | |
tree | a6964e3b445268bf5c67c4b482de6c98b03571c8 /fs/btrfs/qgroup.h | |
parent | Btrfs: qgroup, Account data space in more proper timings. (diff) | |
download | linux-e2d1f92399afb6ec518b68867ed10db2585b283a.tar.xz linux-e2d1f92399afb6ec518b68867ed10db2585b283a.zip |
btrfs: qgroup: do a reservation in a higher level.
There are two problems in qgroup:
a). The PAGE_CACHE is 4K, even when we are writing a data of 1K,
qgroup will reserve a 4K size. It will cause the last 3K in a qgroup
is not available to user.
b). When user is writing a inline data, qgroup will not reserve it,
it means this is a window we can exceed the limit of a qgroup.
The main idea of this patch is reserving the data size of write_bytes
rather than the reserve_bytes. It means qgroup will not care about
the data size btrfs will reserve for user, but only care about the
data size user is going to write. Then reserve it when user want to
write and release it in transaction committed.
In this way, qgroup can be released from the complex procedure in
btrfs and only do the reserve when user want to write and account
when the data is written in commit_transaction().
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/qgroup.h')
-rw-r--r-- | fs/btrfs/qgroup.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h index 64d49b8482b3..c5242aa9a4b2 100644 --- a/fs/btrfs/qgroup.h +++ b/fs/btrfs/qgroup.h @@ -94,10 +94,6 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans, int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info, u64 srcid, u64 objectid, struct btrfs_qgroup_inherit *inherit); -int btrfs_qgroup_update_reserved_bytes(struct btrfs_fs_info *fs_info, - u64 ref_root, - u64 num_bytes, - int sign); int btrfs_qgroup_reserve(struct btrfs_root *root, u64 num_bytes); void btrfs_qgroup_free(struct btrfs_root *root, u64 num_bytes); |