summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/qgroup.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2017-12-12 08:34:31 +0100
committerDavid Sterba <dsterba@suse.com>2018-03-31 01:41:14 +0200
commit64cfaef6362fc756972f477372997fbe117d79cb (patch)
tree226ac6bfc09822f57aeb5809880e43d094ad78c9 /fs/btrfs/qgroup.h
parentbtrfs: qgroup: Don't use root->qgroup_meta_rsv for qgroup (diff)
downloadlinux-64cfaef6362fc756972f477372997fbe117d79cb.tar.xz
linux-64cfaef6362fc756972f477372997fbe117d79cb.zip
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>
Diffstat (limited to 'fs/btrfs/qgroup.h')
-rw-r--r--fs/btrfs/qgroup.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h
index 987a5a49deb8..e63e2d497a8e 100644
--- a/fs/btrfs/qgroup.h
+++ b/fs/btrfs/qgroup.h
@@ -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__ */