Lines Matching defs:mas

260 #define mtree_lock_nested(mas, subclass) \
442 struct ma_state *mas;
443 struct maple_node *node; /* Decoded mas->node */
446 enum maple_type type; /* mas->node type */
448 unsigned long *pivots; /* mas->node->pivots pointer */
450 void __rcu **slots; /* mas->node->slots pointer */
455 #define mas_lock(mas) spin_lock(&((mas)->tree->ma_lock))
456 #define mas_lock_nested(mas, subclass) \
457 spin_lock_nested(&((mas)->tree->ma_lock), subclass)
458 #define mas_unlock(mas) spin_unlock(&((mas)->tree->ma_lock))
484 .mas = ma_state, \
496 void *mas_walk(struct ma_state *mas);
497 void *mas_store(struct ma_state *mas, void *entry);
498 void *mas_erase(struct ma_state *mas);
499 int mas_store_gfp(struct ma_state *mas, void *entry, gfp_t gfp);
500 void mas_store_prealloc(struct ma_state *mas, void *entry);
501 void *mas_find(struct ma_state *mas, unsigned long max);
502 void *mas_find_range(struct ma_state *mas, unsigned long max);
503 void *mas_find_rev(struct ma_state *mas, unsigned long min);
504 void *mas_find_range_rev(struct ma_state *mas, unsigned long max);
505 int mas_preallocate(struct ma_state *mas, void *entry, gfp_t gfp);
506 int mas_alloc_cyclic(struct ma_state *mas, unsigned long *startp,
510 bool mas_nomem(struct ma_state *mas, gfp_t gfp);
511 void mas_pause(struct ma_state *mas);
513 void mas_destroy(struct ma_state *mas);
514 int mas_expected_entries(struct ma_state *mas, unsigned long nr_entries);
516 void *mas_prev(struct ma_state *mas, unsigned long min);
517 void *mas_prev_range(struct ma_state *mas, unsigned long max);
518 void *mas_next(struct ma_state *mas, unsigned long max);
519 void *mas_next_range(struct ma_state *mas, unsigned long max);
521 int mas_empty_area(struct ma_state *mas, unsigned long min, unsigned long max,
527 int mas_empty_area_rev(struct ma_state *mas, unsigned long min,
530 static inline void mas_init(struct ma_state *mas, struct maple_tree *tree,
533 memset(mas, 0, sizeof(struct ma_state));
534 mas->tree = tree;
535 mas->index = mas->last = addr;
536 mas->max = ULONG_MAX;
537 mas->status = ma_start;
538 mas->node = NULL;
541 static inline bool mas_is_active(struct ma_state *mas)
543 return mas->status == ma_active;
546 static inline bool mas_is_err(struct ma_state *mas)
548 return mas->status == ma_error;
553 * @mas: Maple Tree operation state.
555 * Resets the error or walk state of the @mas so future walks of the
561 static __always_inline void mas_reset(struct ma_state *mas)
563 mas->status = ma_start;
564 mas->node = NULL;
573 * When returned, mas->index and mas->last will hold the entire range for the
591 void mas_dump(const struct ma_state *mas);
632 mas_dump((__wrmas)->mas); \
633 mt_dump((__wrmas)->mas->tree, mt_dump_hex); \
685 mas_dump((__wrmas)->mas); \
686 mt_dump((__wrmas)->mas->tree, mt_dump_hex); \
708 * @mas: Maple Tree operation state.
715 static inline void __mas_set_range(struct ma_state *mas, unsigned long start,
719 MAS_WARN_ON(mas, mas_is_active(mas) &&
720 (mas->index > start || mas->last < start));
721 mas->index = start;
722 mas->last = last;
727 * @mas: Maple Tree operation state.
736 void mas_set_range(struct ma_state *mas, unsigned long start, unsigned long last)
738 mas_reset(mas);
739 __mas_set_range(mas, start, last);
744 * @mas: Maple Tree operation state.
751 static inline void mas_set(struct ma_state *mas, unsigned long index)
754 mas_set_range(mas, index, index);