btrfs: qgroup: Introduce function to convert META_PREALLOC into META_PERTRANS
For meta_prealloc reservation users, after btrfs_join_transaction() caller will modify tree so part (or even all) meta_prealloc reservation should be converted to meta_pertrans until transaction commit time. This patch introduces a new function, btrfs_qgroup_convert_reserved_meta() to do this for META_PREALLOC reservation user. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -332,5 +332,13 @@ static inline void btrfs_qgroup_free_meta_prealloc(struct btrfs_root *root,
|
||||
*/
|
||||
void btrfs_qgroup_free_meta_all_pertrans(struct btrfs_root *root);
|
||||
|
||||
/*
|
||||
* Convert @num_bytes of META_PREALLOCATED reservation to META_PERTRANS.
|
||||
*
|
||||
* This is called when preallocated meta reservation needs to be used.
|
||||
* Normally after btrfs_join_transaction() call.
|
||||
*/
|
||||
void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes);
|
||||
|
||||
void btrfs_qgroup_check_reserved_leak(struct inode *inode);
|
||||
#endif /* __BTRFS_QGROUP__ */
|
||||
|
Reference in New Issue
Block a user