diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-16 23:42:09 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:53 -0400 |
commit | f2a53270c7d6bceae5441ed180516d3b76799680 (patch) | |
tree | 07258e950c5ec9771ffe75a0cff325407fe0049c /fs/bcachefs/subvolume.h | |
parent | 19d6521964ed0439a7a03776d8cf0451afb63c1d (diff) | |
download | lwn-f2a53270c7d6bceae5441ed180516d3b76799680.tar.gz lwn-f2a53270c7d6bceae5441ed180516d3b76799680.zip |
bcachefs: Fix insert_snapshot_whiteouts()
- We were failing to set the key type on the whiteouts it was creating,
oops.
- Also, we need to create whiteouts when generating front splits, not
just back splits.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/subvolume.h')
-rw-r--r-- | fs/bcachefs/subvolume.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/subvolume.h b/fs/bcachefs/subvolume.h index 65f108a83835..7c488c3d78e0 100644 --- a/fs/bcachefs/subvolume.h +++ b/fs/bcachefs/subvolume.h @@ -68,6 +68,13 @@ static inline bool bch2_snapshot_is_ancestor(struct bch_fs *c, u32 id, u32 ances return id == ancestor; } +static inline bool bch2_snapshot_has_children(struct bch_fs *c, u32 id) +{ + struct snapshot_t *t = snapshot_t(c, id); + + return (t->children[0]|t->children[1]) != 0; +} + static inline bool snapshot_list_has_id(snapshot_id_list *s, u32 id) { u32 *i; |