diff options
author | Qu Wenruo <wqu@suse.com> | 2017-12-12 15:34:23 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-31 01:41:13 +0200 |
commit | d4e5c92055d8933e9a2030fcbe6d0dbbec538c58 (patch) | |
tree | 3c88b2192178f7725c238049693b7f9752de0281 /fs/btrfs/qgroup.c | |
parent | 0a0d4415e3389b6a2e89896808dea27d2402d154 (diff) | |
download | lwn-d4e5c92055d8933e9a2030fcbe6d0dbbec538c58.tar.gz lwn-d4e5c92055d8933e9a2030fcbe6d0dbbec538c58.zip |
btrfs: qgroup: Skeleton to support separate qgroup reservation type
Instead of single qgroup->reserved, use a new structure btrfs_qgroup_rsv
to store different types of reservation.
This patch only updates the header needed to compile.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/qgroup.c')
-rw-r--r-- | fs/btrfs/qgroup.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 569f9ab65ceb..d6ab07f40f82 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -2434,7 +2434,8 @@ out: } void btrfs_qgroup_free_refroot(struct btrfs_fs_info *fs_info, - u64 ref_root, u64 num_bytes) + u64 ref_root, u64 num_bytes, + enum btrfs_qgroup_rsv_type type) { struct btrfs_root *quota_root; struct btrfs_qgroup *qgroup; @@ -2925,7 +2926,8 @@ static int qgroup_free_reserved_data(struct inode *inode, goto out; freed += changeset.bytes_changed; } - btrfs_qgroup_free_refroot(root->fs_info, root->objectid, freed); + btrfs_qgroup_free_refroot(root->fs_info, root->objectid, freed, + BTRFS_QGROUP_RSV_DATA); ret = freed; out: extent_changeset_release(&changeset); @@ -2957,7 +2959,7 @@ static int __btrfs_qgroup_release_data(struct inode *inode, if (free) btrfs_qgroup_free_refroot(BTRFS_I(inode)->root->fs_info, BTRFS_I(inode)->root->objectid, - changeset.bytes_changed); + changeset.bytes_changed, BTRFS_QGROUP_RSV_DATA); ret = changeset.bytes_changed; out: extent_changeset_release(&changeset); @@ -3034,7 +3036,8 @@ void btrfs_qgroup_free_meta_all(struct btrfs_root *root) if (reserved == 0) return; trace_qgroup_meta_reserve(root, -(s64)reserved); - btrfs_qgroup_free_refroot(fs_info, root->objectid, reserved); + btrfs_qgroup_free_refroot(fs_info, root->objectid, reserved, + BTRFS_QGROUP_RSV_META); } void btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes) @@ -3049,7 +3052,8 @@ void btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes) WARN_ON(atomic64_read(&root->qgroup_meta_rsv) < num_bytes); atomic64_sub(num_bytes, &root->qgroup_meta_rsv); trace_qgroup_meta_reserve(root, -(s64)num_bytes); - btrfs_qgroup_free_refroot(fs_info, root->objectid, num_bytes); + btrfs_qgroup_free_refroot(fs_info, root->objectid, num_bytes, + BTRFS_QGROUP_RSV_META); } /* @@ -3077,7 +3081,7 @@ void btrfs_qgroup_check_reserved_leak(struct inode *inode) } btrfs_qgroup_free_refroot(BTRFS_I(inode)->root->fs_info, BTRFS_I(inode)->root->objectid, - changeset.bytes_changed); + changeset.bytes_changed, BTRFS_QGROUP_RSV_DATA); } extent_changeset_release(&changeset); |