mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
maple_tree: relocate mas_rewalk() and mas_rewalk_if_dead()
These functions need to move for future use. Link: https://lkml.kernel.org/r/20230518145544.1722059-30-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> Cc: David Binderman <dcb314@hotmail.com> Cc: Peng Zhang <zhangpeng.00@bytedance.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Cc: Vernon Yang <vernon2gm@gmail.com> Cc: Wei Yang <richard.weiyang@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
6169b55319
commit
de6e386c06
@ -4498,6 +4498,25 @@ exists:
|
||||
|
||||
}
|
||||
|
||||
static inline void mas_rewalk(struct ma_state *mas, unsigned long index)
|
||||
{
|
||||
retry:
|
||||
mas_set(mas, index);
|
||||
mas_state_walk(mas);
|
||||
if (mas_is_start(mas))
|
||||
goto retry;
|
||||
}
|
||||
|
||||
static inline bool mas_rewalk_if_dead(struct ma_state *mas,
|
||||
struct maple_node *node, const unsigned long index)
|
||||
{
|
||||
if (unlikely(ma_dead_node(node))) {
|
||||
mas_rewalk(mas, index);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* mas_prev_node() - Find the prev non-null entry at the same level in the
|
||||
* tree. The prev value will be mas->node[mas->offset] or MAS_NONE.
|
||||
@ -4677,25 +4696,6 @@ no_entry:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mas_rewalk(struct ma_state *mas, unsigned long index)
|
||||
{
|
||||
retry:
|
||||
mas_set(mas, index);
|
||||
mas_state_walk(mas);
|
||||
if (mas_is_start(mas))
|
||||
goto retry;
|
||||
}
|
||||
|
||||
static inline bool mas_rewalk_if_dead(struct ma_state *mas,
|
||||
struct maple_node *node, const unsigned long index)
|
||||
{
|
||||
if (unlikely(ma_dead_node(node))) {
|
||||
mas_rewalk(mas, index);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* mas_next_slot() - Get the entry in the next slot
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user