diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-20 15:42:51 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-20 15:52:55 -0500 |
commit | dd1a882d17d6302bd3f48f87aec4018b75749de6 (patch) | |
tree | f9bf12bc5cf2e54eaa10da4a0a903464c1cf2b73 /libbcachefs/snapshot.c | |
parent | 3e15e96cb9c90cca6f7fa3465697933c53f51228 (diff) |
Update bcachefs sources to 9736cbbc5cc3 bcachefs: bs > ps support
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/snapshot.c')
-rw-r--r-- | libbcachefs/snapshot.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libbcachefs/snapshot.c b/libbcachefs/snapshot.c index c54091a2..e7f19789 100644 --- a/libbcachefs/snapshot.c +++ b/libbcachefs/snapshot.c @@ -146,8 +146,9 @@ bool __bch2_snapshot_is_ancestor(struct bch_fs *c, u32 id, u32 ancestor) goto out; } - while (id && id < ancestor - IS_ANCESTOR_BITMAP) - id = get_ancestor_below(t, id, ancestor); + if (likely(ancestor >= IS_ANCESTOR_BITMAP)) + while (id && id < ancestor - IS_ANCESTOR_BITMAP) + id = get_ancestor_below(t, id, ancestor); ret = id && id < ancestor ? test_ancestor_bitmap(t, id, ancestor) @@ -389,7 +390,7 @@ static u32 bch2_snapshot_tree_next(struct bch_fs *c, u32 id) return 0; } -static u32 bch2_snapshot_tree_oldest_subvol(struct bch_fs *c, u32 snapshot_root) +u32 bch2_snapshot_tree_oldest_subvol(struct bch_fs *c, u32 snapshot_root) { u32 id = snapshot_root; u32 subvol = 0, s; |