summaryrefslogtreecommitdiff
path: root/fs/bcachefs/subvolume.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-04-28 10:50:57 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:10:01 +0300
commitcb1b479dc1c78d1d224e4aa6aba212a7bd3263a4 (patch)
tree513bb9bfc7c62be3eadc1ec622f420b4497d9d28 /fs/bcachefs/subvolume.c
parent653693beea8ac93e57fc17afc7353bd158bcd5ff (diff)
downloadlinux-cb1b479dc1c78d1d224e4aa6aba212a7bd3263a4.tar.xz
bcachefs: Fix quotas + snapshots
Now that we can reliably designate and find the master subvolume out of a tree of snapshots, we can finally make quotas work with snapshots: That is - quotas will now _ignore_ snapshot subvolumes, and only be in effect for the master (non snapshot) subvolume. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/subvolume.c')
-rw-r--r--fs/bcachefs/subvolume.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c
index 922360dec627..388fa12bbd8b 100644
--- a/fs/bcachefs/subvolume.c
+++ b/fs/bcachefs/subvolume.c
@@ -34,8 +34,8 @@ int bch2_snapshot_tree_invalid(const struct bch_fs *c, struct bkey_s_c k,
return 0;
}
-static int snapshot_tree_lookup(struct btree_trans *trans, u32 id,
- struct bch_snapshot_tree *s)
+int bch2_snapshot_tree_lookup(struct btree_trans *trans, u32 id,
+ struct bch_snapshot_tree *s)
{
return bch2_bkey_get_val_typed(trans, BTREE_ID_snapshot_trees, POS(0, id),
BTREE_ITER_WITH_UPDATES, snapshot_tree, s);
@@ -426,7 +426,7 @@ static int snapshot_tree_ptr_good(struct btree_trans *trans,
u32 snap_id, u32 tree_id)
{
struct bch_snapshot_tree s_t;
- int ret = snapshot_tree_lookup(trans, tree_id, &s_t);
+ int ret = bch2_snapshot_tree_lookup(trans, tree_id, &s_t);
if (bch2_err_matches(ret, ENOENT))
return 0;
@@ -462,7 +462,7 @@ static int snapshot_tree_ptr_repair(struct btree_trans *trans,
tree_id = le32_to_cpu(root.v->tree);
- ret = snapshot_tree_lookup(trans, tree_id, &s_t);
+ ret = bch2_snapshot_tree_lookup(trans, tree_id, &s_t);
if (ret && !bch2_err_matches(ret, ENOENT))
return ret;
@@ -659,7 +659,7 @@ static int check_subvol(struct btree_trans *trans,
u32 snapshot_tree = snapshot_t(c, snapshot_root)->tree;
struct bch_snapshot_tree st;
- ret = snapshot_tree_lookup(trans, snapshot_tree, &st);
+ ret = bch2_snapshot_tree_lookup(trans, snapshot_tree, &st);
bch2_fs_inconsistent_on(bch2_err_matches(ret, ENOENT), c,
"%s: snapshot tree %u not found", __func__, snapshot_tree);