mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
bcachefs: Inline bch2_snapshot_is_ancestor() fast path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
813e0cecd1
commit
93de9e92c3
2 changed files with 9 additions and 2 deletions
|
@ -25,7 +25,7 @@ static inline u32 get_ancestor_below(struct snapshot_table *t, u32 id, u32 ances
|
|||
return s->parent;
|
||||
}
|
||||
|
||||
bool bch2_snapshot_is_ancestor(struct bch_fs *c, u32 id, u32 ancestor)
|
||||
bool __bch2_snapshot_is_ancestor(struct bch_fs *c, u32 id, u32 ancestor)
|
||||
{
|
||||
struct snapshot_table *t;
|
||||
bool ret;
|
||||
|
|
|
@ -166,7 +166,14 @@ static inline u32 bch2_snapshot_sibling(struct bch_fs *c, u32 id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool bch2_snapshot_is_ancestor(struct bch_fs *, u32, u32);
|
||||
bool __bch2_snapshot_is_ancestor(struct bch_fs *, u32, u32);
|
||||
|
||||
static inline bool bch2_snapshot_is_ancestor(struct bch_fs *c, u32 id, u32 ancestor)
|
||||
{
|
||||
return id == ancestor
|
||||
? true
|
||||
: __bch2_snapshot_is_ancestor(c, id, ancestor);
|
||||
}
|
||||
|
||||
static inline bool bch2_snapshot_has_children(struct bch_fs *c, u32 id)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue