Lines Matching refs:piv

683  * mas_pivot() - Get the pivot at @piv of the maple encoded node.
685 * @piv: The pivot.
687 * Return: the pivot at @piv of @mn.
689 static inline unsigned long mas_pivot(struct ma_state *mas, unsigned char piv)
694 if (MAS_WARN_ON(mas, piv >= mt_pivots[type])) {
701 return node->ma64.pivot[piv];
704 return node->mr64.pivot[piv];
712 * mas_safe_pivot() - get the pivot at @piv or mas->max.
715 * @piv: The pivot to fetch
718 * Return: The pivot at @piv within the limit of the @pivots array, @mas->max
723 unsigned char piv, enum maple_type type)
725 if (piv >= mt_pivots[type])
728 return pivots[piv];
751 * @piv: The pivot offset
754 static inline void mte_set_pivot(struct maple_enode *mn, unsigned char piv,
760 BUG_ON(piv >= mt_pivots[type]);
765 node->mr64.pivot[piv] = val;
768 node->ma64.pivot[piv] = val;
2106 /* Possible underflow of piv will wrap back to 0 before use. */
2107 unsigned long piv;
2117 piv = b_node->pivot[b_end - 1];
2119 piv = mas->min - 1;
2121 if (piv + 1 < mas->index) {
2125 b_node->gap[b_end] = mas->index - 1 - piv;
2139 piv = mas_safe_pivot(mas, wr_mas->pivots, offset_end, wr_mas->type);
2140 if (piv > mas->last) {
2141 if (piv == ULONG_MAX)
2150 b_node->gap[b_end] = piv - mas->last + 1;
2151 b_node->pivot[b_end] = piv;
3564 * @piv: The pivot value being written
7102 unsigned long piv;
7104 piv = mas_safe_pivot(mas, pivots, i, type);
7106 if (!piv && (i != 0)) {
7112 if (prev_piv > piv) {
7113 pr_err("%p[%u] piv %lu < prev_piv %lu\n",
7114 mas_mn(mas), i, piv, prev_piv);
7115 MAS_WARN_ON(mas, piv < prev_piv);
7118 if (piv < mas->min) {
7120 piv, mas->min);
7121 MAS_WARN_ON(mas, piv < mas->min);
7123 if (piv > mas->max) {
7125 piv, mas->max);
7126 MAS_WARN_ON(mas, piv > mas->max);
7128 prev_piv = piv;
7129 if (piv == mas->max)
7149 unsigned long piv = pivots[i];
7151 if (!piv)
7154 pr_err("%p[%u] should not have piv %lu\n",
7155 mas_mn(mas), i, piv);