Lines Matching defs:max

375 	return !mas->min && mas->max == ULONG_MAX;
712 * mas_safe_pivot() - get the pivot at @piv or mas->max.
718 * Return: The pivot at @piv within the limit of the @pivots array, @mas->max
726 return mas->max;
1046 mas->max = mas_safe_pivot(mas, pivots, mas->offset, type);
1072 * Sets the @mas->max and @mas->min to the correct values when walking up. This
1073 * may cause several levels of walking up to find the correct min and max.
1085 unsigned long min, max;
1110 mas->max = ULONG_MAX;
1118 if (mas->max == ULONG_MAX)
1122 max = ULONG_MAX;
1141 max = pivots[a_slot];
1152 mas->max = max;
1366 * If mas->node == MAS_START, then set the min, max and depth to
1381 mas->max = ULONG_MAX;
1423 * @max: The maximum value in the node
1431 unsigned long max)
1445 if (likely(pivots[offset] == max))
1480 if (likely(pivots[offset] == mas->max))
1535 max_piv = ma_data_end(mn, mt, pivots, mas->max) - 1;
1540 if (unlikely(mas->max == ULONG_MAX) && !slots[max_piv + 1]) {
1714 offset = ma_data_end(node, type, pivots, mas->max);
1784 end = ma_data_end(node, mt, pivots, mas->max);
1852 * If the split is less than the max slot && the right side will
1969 if (unlikely(mas->max == b_node->pivot[j]))
2008 if (pivots[end] && pivots[end] < mas->max)
2049 mas->max = b_node->pivot[i - 1];
2135 if (mas->last >= mas->max)
2249 wr_mas->pivots, mas->max);
2255 wr_mas->r_max = offset < count ? wr_mas->pivots[offset] : mas->max;
2271 mast->orig_r->last = mast->orig_r->max;
2355 mast->orig_r->index = mast->r->max;
2431 * @mas - the maple state to get the pivot (mas->max)
2444 b_node->pivot[b_node->b_end++] = mas->max;
2640 (tmp_next[n].max <= tmp_next->last)) {
2707 mast->l->max = mast->orig_r->max;
2719 mast->r->max = mast->orig_r->max;
2748 if (mast->bn->pivot[mast->bn->b_end - 1] >= mast->orig_r->max)
2754 mast->orig_r->last = mast->orig_r->max;
2792 unsigned long max, min;
2797 max = mas->max;
2804 end = ma_data_end(node, type, pivots, max);
2809 prev_max = max;
2811 max = pivots[offset];
2821 prev_max = max;
2823 max = pivots[offset];
2834 mas->last = max;
2836 mas->max = prev_max;
2885 if (((mast->orig_l->min != 0) || (mast->orig_r->max != ULONG_MAX)) &&
2932 mast->orig_l->last = mast->orig_l->max;
2975 mas->max = l_mas.max;
3026 r_mas.last = r_mas.index = r_mas.max;
3089 pivs[tmp] = l_mas.max;
3093 l_mas.max = l_pivs[split];
3094 mas->min = l_mas.max + 1;
3147 pivs[offset - 1] = l_mas.max;
3229 if (mast->bn->pivot[mast->bn->b_end - 1] == mas->max)
3253 mte_set_pivot(mast->r->node, 0, mast->r->max);
3256 mast->l->max = mast->bn->pivot[split];
3257 mast->r->min = mast->l->max + 1;
3302 if (mas->max == ULONG_MAX)
3418 * r->max.
3420 mast.r->max = mas->max;
3575 unsigned long max = wr_mas->r_max;
3581 if (last < max)
3585 max = wr_mas->mas->max;
3586 if (last < max)
3590 if (last == max) {
3612 wr_mas->mas->max = wr_mas->r_max;
3693 (r_mas->last < r_mas->max) &&
3733 unsigned long max;
3736 max = ULONG_MAX;
3742 end = ma_data_end(node, type, pivots, max);
3747 max = pivots[offset];
3987 dst_pivots[new_end] = mas->max;
4070 mas->last = mas->max;
4101 wr_mas->end_piv = wr_mas->mas->max;
4366 unsigned long max;
4372 max = mas->min - 1;
4373 if (max < min)
4401 offset = ma_data_end(node, mt, pivots, max);
4414 mas->max = max;
4433 * @max: The minimum starting range
4481 mas->last = mas->max;
4514 * @max: The maximum pivot value to check.
4520 unsigned long max)
4530 if (mas->max >= max)
4533 min = mas->max + 1;
4547 node_end = ma_data_end(node, mt, pivots, mas->max);
4576 mas->max = mas_safe_pivot(mas, pivots, mas->offset, mt);
4596 * @max: The maximum starting range
4603 static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty,
4619 data_end = ma_data_end(node, type, pivots, mas->max);
4623 if (mas->max >= max) {
4632 if (pivot >= max)
4643 mas->last = mas->max;
4645 if (mas_next_node(mas, node, max)) {
4673 if (mas->last >= max)
4729 unsigned long max, min;
4750 max = mas_safe_pivot(mas, pivots, offset, type);
4751 while (mas->index <= max) {
4756 gap = max - min + 1;
4768 max = pivots[offset];
4778 max = min - 1;
4782 if (unlikely((mas->index > max) || (size - 1 > max - mas->index)))
4795 mas->max = max;
4829 data_end = ma_data_end(node, type, pivots, mas->max);
4840 gap = min(pivot, mas->last) - max(mas->index, min) + 1;
4852 mas->max = pivot;
4987 * @max: The maximum range
4992 unsigned long max, unsigned long size, bool fwd)
5000 if (min > max || max - min + 1 < size)
5009 mas->last = max;
5010 mas->index = max - size + 1;
5020 * @max: The highest value of the range
5024 unsigned long max, unsigned long size)
5030 if (min > max)
5033 if (size == 0 || max - min < size - 1)
5045 return mas_sparse_area(mas, min, max, size, true);
5049 mas->last = max;
5074 * @max: The highest value of the range
5078 unsigned long max, unsigned long size)
5082 if (min > max)
5085 if (size == 0 || max - min < size - 1)
5099 return mas_sparse_area(mas, min, max, size, false);
5103 mas->last = max;
5105 while (!mas_rev_awalk(mas, size, &min, &max)) {
5120 /* Trim the upper limit to the max. */
5121 if (max < mas->last)
5122 mas->last = max;
5364 if (wr_mas->mas->last > wr_mas->mas->max)
5371 wr_mas->mas->last == wr_mas->mas->max)
5632 nr_nodes = max(nr_entries, nr_entries * 2 + 1);
5657 static inline bool mas_next_setup(struct ma_state *mas, unsigned long max,
5662 if (unlikely(mas->last >= max)) {
5673 /* Overflowed before, but the max changed */
5706 * @max: The maximum index to check.
5714 void *mas_next(struct ma_state *mas, unsigned long max)
5718 if (mas_next_setup(mas, max, &entry))
5722 return mas_next_slot(mas, max, false, true);
5729 * @max: The maximum index to check.
5737 void *mas_next_range(struct ma_state *mas, unsigned long max)
5741 if (mas_next_setup(mas, max, &entry))
5745 return mas_next_slot(mas, max, true, true);
5753 * @max: The maximum index to check
5761 void *mt_next(struct maple_tree *mt, unsigned long index, unsigned long max)
5767 entry = mas_next(&mas, max);
5918 * @max: The maximum index
5923 static inline bool mas_find_setup(struct ma_state *mas, unsigned long max,
5927 if (mas->last < max)
5934 if (unlikely(mas->last >= max))
5940 if (unlikely(mas->last >= max))
5946 if (mas->index > max) {
5956 if (mas->index > max)
5972 if (mas->index == max)
5986 * %max. Otherwise, find the entry after mas->index.
5988 * @max: The maximum value to check.
5996 void *mas_find(struct ma_state *mas, unsigned long max)
6000 if (mas_find_setup(mas, max, &entry))
6004 return mas_next_slot(mas, max, false, false);
6010 * mas->index up to %max. Otherwise, advance to the next slot mas->index.
6012 * @max: The maximum value to check.
6020 void *mas_find_range(struct ma_state *mas, unsigned long max)
6024 if (mas_find_setup(mas, max, &entry))
6028 return mas_next_slot(mas, max, true, false);
6380 unsigned long max, gfp_t gfp)
6393 ret = mas_empty_area(&mas, min, max, size);
6418 unsigned long max, gfp_t gfp)
6431 ret = mas_empty_area_rev(&mas, min, max, size);
6515 * @max: The maximum value of the search range
6527 void *mt_find(struct maple_tree *mt, unsigned long *index, unsigned long max)
6537 if ((*index) > max)
6552 while (mas_searchable(&mas) && (mas.last < max)) {
6553 entry = mas_next_entry(&mas, max);
6579 * @max: The maximum value to check
6588 unsigned long max)
6593 return mt_find(mt, index, max);
6689 static void mas_dfs_postorder(struct ma_state *mas, unsigned long max)
6695 mas_next_node(mas, mas_mn(mas), max);
6707 p_max = mas->max;
6712 mas->max = p_max;
6718 unsigned long min, unsigned long max, unsigned int depth,
6720 static void mt_dump_range(unsigned long min, unsigned long max,
6727 if (min == max)
6730 pr_info("%.*s%lx-%lx: ", depth * 2, spaces, min, max);
6734 if (min == max)
6737 pr_info("%.*s%lu-%lu: ", depth * 2, spaces, min, max);
6741 static void mt_dump_entry(void *entry, unsigned long min, unsigned long max,
6744 mt_dump_range(min, max, depth, format);
6758 unsigned long min, unsigned long max, unsigned int depth,
6779 unsigned long last = max;
6783 else if (!node->slot[i] && max != mt_node_max(entry))
6794 if (last == max)
6796 if (last > max) {
6799 pr_err("node %p last (%lx) > max (%lx) at pivot %d!\n",
6800 node, last, max, i);
6804 pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n",
6805 node, last, max, i);
6813 unsigned long min, unsigned long max, unsigned int depth,
6845 unsigned long last = max;
6860 if (last == max)
6862 if (last > max) {
6863 pr_err("node %p last (%lu) > max (%lu) at pivot %d!\n",
6864 node, last, max, i);
6872 unsigned long min, unsigned long max, unsigned int depth,
6879 mt_dump_range(min, max, depth, format);
6887 if (min + i > max)
6895 mt_dump_range64(mt, entry, min, max, depth, format);
6898 mt_dump_arange64(mt, entry, min, max, depth, format);
6973 if (p_end >= mas->max)
7006 MT_BUG_ON(mas->tree, max_gap > mas->max);
7083 if (i < mt_pivots[type] && pivots[i] == mas->max)
7089 * Validate all pivots are within mas->min and mas->max, check metadata ends
7123 if (piv > mas->max) {
7125 piv, mas->max);
7126 MAS_WARN_ON(mas, piv > mas->max);
7129 if (piv == mas->max)
7200 * 1. The limits (pivots are within mas->min to mas->max)
7220 (mas.max != ULONG_MAX))) {
7251 pr_err(" min=%lx max=%lx alloc=%p, depth=%u, flags=%x\n",
7252 mas->min, mas->max, mas->alloc, mas->depth, mas->mas_flags);