diff options
author | 2021-10-27 13:05:56 -0400 | |
---|---|---|
committer | 2023-10-22 17:09:17 -0400 | |
commit | 9ca4853b98af5fa15a2ddc47a45f8e103027f95d (patch) | |
tree | 28b8be8ce679f0b5503de7fa68d9b0f2c5483bc9 /fs/bcachefs/subvolume.c | |
parent | bcachefs: SECTOR_DIRTY_RESERVED (diff) | |
download | linux-9ca4853b98af5fa15a2ddc47a45f8e103027f95d.tar.gz linux-9ca4853b98af5fa15a2ddc47a45f8e103027f95d.tar.bz2 linux-9ca4853b98af5fa15a2ddc47a45f8e103027f95d.zip |
bcachefs: Fix quota support for snapshots
Quota support was disabled when snapshots were released, because of some
tricky interactions with snpashots. We're sidestepping that for now -
we're simply disabling quota accounting on snapshot subvolumes.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/subvolume.c')
-rw-r--r-- | fs/bcachefs/subvolume.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c index 0ef625d21672..7e909a118189 100644 --- a/fs/bcachefs/subvolume.c +++ b/fs/bcachefs/subvolume.c @@ -789,6 +789,15 @@ int bch2_subvolume_get(struct btree_trans *trans, unsigned subvol, return ret; } +int bch2_snapshot_get_subvol(struct btree_trans *trans, u32 snapshot, + struct bch_subvolume *subvol) +{ + struct bch_snapshot snap; + + return snapshot_lookup(trans, snapshot, &snap) ?: + bch2_subvolume_get(trans, le32_to_cpu(snap.subvol), true, 0, subvol); +} + int bch2_subvolume_get_snapshot(struct btree_trans *trans, u32 subvol, u32 *snapid) { |