summaryrefslogtreecommitdiff
path: root/libbcachefs/subvolume.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-11-30 15:27:31 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2021-11-30 15:27:52 -0500
commit99b12cd3a4cdd19985624b79a8c54716cad649bd (patch)
tree6786273610640092c1f439d002903c235f9f9883 /libbcachefs/subvolume.c
parent1d2315ca0a60e60a04921aece6587e1bfad17ccf (diff)
Update bcachefs sources to 50d6a25d9c bcachefs: Erasure coding fixes
Diffstat (limited to 'libbcachefs/subvolume.c')
-rw-r--r--libbcachefs/subvolume.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libbcachefs/subvolume.c b/libbcachefs/subvolume.c
index 0ef625d2..7e909a11 100644
--- a/libbcachefs/subvolume.c
+++ b/libbcachefs/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)
{