summaryrefslogtreecommitdiff
path: root/fs/btrfs/qgroup.c
diff options
context:
space:
mode:
authorBoris Burkov <boris@bur.io>2023-05-17 02:33:55 +0300
committerDavid Sterba <dsterba@suse.com>2023-10-12 17:44:10 +0300
commit6b0cd63bc75c22b49b6b1ef3d39b5850241340c0 (patch)
tree5ef03b9f852039ea96ee49e56fcf841e164e49f5 /fs/btrfs/qgroup.c
parent078b8b90b8ffec54f7dc1e8ef6c1078d1e7d3dae (diff)
downloadlinux-6b0cd63bc75c22b49b6b1ef3d39b5850241340c0.tar.xz
btrfs: qgroup: introduce quota mode
In preparation for introducing simple quotas, change from a binary setting for quotas to an enum based mode. Initially, the possible modes are disabled/full. Full quotas is normal btrfs qgroups. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Boris Burkov <boris@bur.io> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/qgroup.c')
-rw-r--r--fs/btrfs/qgroup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 07716332603b..69787b87a4f8 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -30,6 +30,13 @@
#include "root-tree.h"
#include "tree-checker.h"
+enum btrfs_qgroup_mode btrfs_qgroup_mode(struct btrfs_fs_info *fs_info)
+{
+ if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
+ return BTRFS_QGROUP_MODE_DISABLED;
+ return BTRFS_QGROUP_MODE_FULL;
+}
+
/*
* Helpers to access qgroup reservation
*