btrfs: qgroup: Introduce helpers to update and access new qgroup rsv
authorQu Wenruo <wqu@suse.com>
Tue, 12 Dec 2017 07:34:24 +0000 (15:34 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Mar 2018 23:41:13 +0000 (01:41 +0200)
commitf59c0347d4be22dad5812b5b14bf94ac0efd371a
tree526802d8f61876cde2d2ebe69e34e6fef633bda6
parentd4e5c92055d8933e9a2030fcbe6d0dbbec538c58
btrfs: qgroup: Introduce helpers to update and access new qgroup rsv

Introduce helpers to:

1) Get total reserved space
   For limit calculation
2) Add/release reserved space for given type
   With underflow detection and warning
3) Add/release reserved space according to child qgroup

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c