25 #ifndef __MOTR_LIB_LIST_H__ 26 #define __MOTR_LIB_LIST_H__ 193 return head->l_head !=
217 #define m0_list_entry(link, type, member) \ 218 container_of(link, type, member) 226 #define m0_list_for_each(head, pos) \ 227 for (pos = (head)->l_head; pos != (void *)(head); \ 228 pos = (pos)->ll_next) 235 #define m0_list_for_each_entry(head, pos, type, member) \ 236 for (pos = m0_list_entry((head)->l_head, type, member); \ 237 &(pos->member) != (void *)head; \ 238 pos = m0_list_entry((pos)->member.ll_next, type, member)) 247 #define m0_list_for_each_entry_safe(head, pos, next, type, member) \ 248 for (pos = m0_list_entry((head)->l_head, type, member), \ 249 next = m0_list_entry((pos)->member.ll_next, type, member); \ 250 &(pos)->member != (void *)head; \ 252 next = m0_list_entry((next)->member.ll_next, type, member)) 279 #define m0_list_forall(var, head, ...) \ 281 struct m0_list_link *var; \ 283 m0_list_for_each(head, var) { \ 284 if (!({ __VA_ARGS__ ; })) \ 287 var == (void *)head; \ 313 #define m0_list_entry_forall(var, head, type, member, ...) \ 318 m0_list_for_each_entry_safe(head, var, next, type, member) { \ 319 if (!({ __VA_ARGS__ ; })) \ 322 &var->member == (void *)head; \ 334 #define m0_list_teardown(head, pos, type, member) \ 335 while (!m0_list_is_empty((head)) && \ 336 ((pos) = m0_list_entry((head)->l_head, type, member)) && \ 337 (m0_list_del(&(pos)->member), true)) M0_INTERNAL void m0_list_link_fini(struct m0_list_link *link)
M0_INTERNAL bool m0_list_invariant(const struct m0_list *list)
M0_INTERNAL void m0_list_add(struct m0_list *head, struct m0_list_link *next)
static struct m0_list list
M0_INTERNAL void m0_list_add_before(struct m0_list_link *anchor, struct m0_list_link *next)
M0_INTERNAL void m0_list_init(struct m0_list *head)
struct m0_list_link * l_tail
M0_INTERNAL void m0_list_fini(struct m0_list *head)
M0_INTERNAL void m0_list_del(struct m0_list_link *old)
enum m0_be_list_op M0_XCA_DOMAIN
struct m0_list_link * ll_prev
struct m0_list_link * ll_prev
static int head(struct m0_sm *mach)
struct m0_list_link * l_tail
M0_INTERNAL size_t m0_list_length(const struct m0_list *list)
struct m0_list_link * l_head
struct m0_list_link * l_head
struct m0_list_link * ll_next
M0_INTERNAL bool m0_list_contains(const struct m0_list *list, const struct m0_list_link *link)
M0_INTERNAL bool m0_list_is_empty(const struct m0_list *head)
M0_INTERNAL bool m0_list_link_is_in(const struct m0_list_link *link)
struct m0_list_link * ll_next
M0_INTERNAL bool m0_list_link_invariant(const struct m0_list_link *link)
M0_INTERNAL void m0_list_add_after(struct m0_list_link *anchor, struct m0_list_link *next)
M0_INTERNAL void m0_list_move(struct m0_list *head, struct m0_list_link *next)
M0_INTERNAL void m0_list_move_tail(struct m0_list *head, struct m0_list_link *next)
M0_BASSERT(offsetof(struct m0_list, l_head)==offsetof(struct m0_list_link, ll_next))
M0_INTERNAL bool m0_list_link_is_last(const struct m0_list_link *link, const struct m0_list *head)
M0_INTERNAL void m0_list_link_init(struct m0_list_link *link)
static struct m0_list_link * m0_list_first(const struct m0_list *head)
M0_INTERNAL void m0_list_add_tail(struct m0_list *head, struct m0_list_link *next)
#define offsetof(typ, memb)
static struct m0_be_ut_backend be