Lines Matching defs:last
43 * a slot, but the last offset has an implied pivot from the node above (or
388 * a reuse of the last bit in the node type. This is possible by using bit 1 to
525 * Okay to use MAPLE_PARENT_16B_SLOT_MASK as the last bit will be lost
1426 * Return: The zero indexed last slot with data (may be null).
1458 * Return: The zero indexed last slot with data (may be null).
1997 * source. This is fine since the metadata is the last thing to be stored in a
2132 b_node->pivot[b_end] = mas->last;
2135 if (mas->last >= mas->max)
2140 if (piv > mas->last) {
2150 b_node->gap[b_end] = piv - mas->last + 1;
2197 MA_STATE(parent, mas->tree, mas->index, mas->last);
2271 mast->orig_r->last = mast->orig_r->max;
2356 /* last should be larger than or equal to index */
2357 if (mast->orig_r->last < mast->orig_r->index)
2358 mast->orig_r->last = mast->orig_r->index;
2572 * [index, last] are dead subtrees, others need to be freed and followed.
2640 (tmp_next[n].max <= tmp_next->last)) {
2754 mast->orig_r->last = mast->orig_r->max;
2788 struct maple_enode *next, *last;
2800 last = next;
2834 mas->last = max;
2837 mas->node = last;
2855 * nodes that will remain active by using orig_l_mas->index and orig_l_mas->last
2857 * orig_l_mas->last is used in mas_consume to find the slots that will need to
2861 * Return: the number of elements in b_node during the last loop.
2872 MA_STATE(r_mas, mas->tree, mas->index, mas->last);
2932 mast->orig_l->last = mast->orig_l->max;
2990 * Return: the number of elements in b_node during the last loop.
2999 MA_STATE(l_mas, mas->tree, mas->index, mas->last);
3000 MA_STATE(r_mas, mas->tree, mas->index, mas->last);
3026 r_mas.last = r_mas.index = r_mas.max;
3034 l_mas.index = l_mas.last = l_mas.min;
3059 MA_STATE(l_mas, mas->tree, mas->index, mas->last);
3286 MA_STATE(tmp_mas, mas->tree, mas->index, mas->last);
3372 MA_STATE(l_mas, mas->tree, mas->index, mas->last);
3373 MA_STATE(r_mas, mas->tree, mas->index, mas->last);
3374 MA_STATE(prev_l_mas, mas->tree, mas->index, mas->last);
3375 MA_STATE(prev_r_mas, mas->tree, mas->index, mas->last);
3536 pivots[slot] = mas->last;
3537 if (mas->last != ULONG_MAX)
3550 if (likely((mas->last != 0) || (mas->index != 0)))
3576 unsigned long last = wr_mas->mas->last;
3581 if (last < max)
3586 if (last < max)
3590 if (last == max) {
3592 * The last entry of leaf node cannot be NULL unless it is the
3595 if (entry || last == ULONG_MAX)
3689 if (r_mas->last < r_wr_mas->r_max)
3690 r_mas->last = r_wr_mas->r_max;
3692 } else if ((r_mas->last == r_wr_mas->r_max) &&
3693 (r_mas->last < r_mas->max) &&
3695 r_mas->last = mas_safe_pivot(r_mas, r_wr_mas->pivots,
3772 * Only valid when the index == 0 and the last == ULONG_MAX
3784 if (!entry && !mas->index && mas->last == ULONG_MAX) {
3802 pivots[0] = mas->last;
3840 * to ``index``, the duplicate walks the right tree path to ``last``.
3843 * written to the last entry of a node is considered a spanning store as
3850 if (unlikely(!mas->index && mas->last == ULONG_MAX))
3868 if (r_mas.last + 1)
3869 r_mas.last++;
3871 r_mas.index = r_mas.last;
3873 r_mas.last = r_mas.index = mas->last;
3883 mas->last = l_mas.last = r_mas.last;
3887 if (!l_mas.index && r_mas.last == ULONG_MAX) {
3903 l_mas.index = l_mas.last = mas->index;
3936 if (mas->last == wr_mas->end_piv)
3968 dst_pivots[mas->offset] = mas->last;
4024 wr_mas->pivots[offset] = mas->last;
4039 wr_mas->pivots[offset + 1] = mas->last;
4062 mas->last = wr_mas->end_piv;
4065 if ((mas->last == wr_mas->end_piv) &&
4070 mas->last = mas->max;
4072 mas->last = wr_mas->pivots[wr_mas->offset_end];
4073 wr_mas->end_piv = mas->last;
4095 (wr_mas->mas->last > wr_mas->pivots[wr_mas->offset_end]))
4116 if (wr_mas->end_piv == mas->last)
4158 if (mas->last == wr_mas->r_max) {
4166 wr_mas->pivots[end] = mas->last;
4172 wr_mas->pivots[end + 1] = mas->last;
4207 if (wr_mas->r_min == mas->index && wr_mas->r_max == mas->last) {
4264 if (unlikely(!mas->index && mas->last == ULONG_MAX)) {
4316 if (wr_mas.content || (mas->last > wr_mas.r_max))
4470 mas->last = mas->index - 1;
4481 mas->last = mas->max;
4612 unsigned long save_point = mas->last;
4641 mas->last = pivots[mas->offset];
4643 mas->last = mas->max;
4661 mas->last = pivots[0];
4673 if (mas->last >= max)
4676 mas->index = mas->last + 1;
4696 * Sets @mas->index and @mas->last to the range, Does not update @mas->index and
4697 * @mas->last on overflow.
4704 if (mas->last >= limit) {
4747 while (mas->last < min)
4759 if ((size <= gap) && (size <= mas->last - min + 1))
4840 gap = min(pivot, mas->last) - max(mas->index, min) + 1;
4859 if (mas->last <= pivot) {
4876 * mas->index and mas->last will be set to the range if there is a value. If
4893 mas->last = ULONG_MAX;
4896 mas->last = 0;
4901 mas->last = ULONG_MAX;
4961 * Search between @mas->index and @mas->last for a gap of @size.
4965 struct maple_enode *last = NULL;
4975 if (last == mas->node)
4978 last = mas->node;
5007 mas->last = min + size - 1;
5009 mas->last = max;
5049 mas->last = max;
5064 mas->last = mas->index + size - 1;
5080 struct maple_enode *last = mas->node;
5103 mas->last = max;
5106 if (last == mas->node) {
5110 last = mas->node;
5121 if (max < mas->last)
5122 mas->last = max;
5124 mas->index = mas->last - size + 1;
5364 if (wr_mas->mas->last > wr_mas->mas->max)
5371 wr_mas->mas->last == wr_mas->mas->max)
5387 * The @mas->index and @mas->last is used to set the range for the @entry.
5391 * Return: the first entry between mas->index and mas->last or %NULL.
5399 if (MAS_WARN_ON(mas, mas->index > mas->last))
5400 pr_err("Error %lX > %lX %p\n", mas->index, mas->last, entry);
5402 if (mas->index > mas->last) {
5482 if (unlikely(!mas->index && mas->last == ULONG_MAX))
5499 if (wr_mas.r_min == mas->index && wr_mas.r_max == mas->last)
5662 if (unlikely(mas->last >= max)) {
5688 mas->index = mas->last = 0;
5692 mas->last = ULONG_MAX;
5731 * Sets @mas->index and @mas->last to the range.
5804 mas->index = mas->last = 0;
5812 mas->index = mas->last = 0;
5854 * Sets @mas->index and @mas->last to the range.
5927 if (mas->last < max)
5934 if (unlikely(mas->last >= max))
5937 mas->index = ++mas->last;
5940 if (unlikely(mas->last >= max))
5943 mas->index = mas->last;
5980 mas->last = ULONG_MAX;
5991 * If an entry exists, last and index are updated accordingly.
6015 * If an entry exists, last and index are updated accordingly.
6056 mas->last = --mas->index;
6061 mas->last = mas->index;
6064 if (mas->last <= min) {
6091 mas->last = mas->index = 0;
6116 * If an entry exists, last and index are updated accordingly.
6142 * If an entry exists, last and index are updated accordingly.
6165 * Searches for @mas->index, sets @mas->index and @mas->last to the range and
6168 * Return: the entry that was erased or %NULL, @mas->index and @mas->last are updated.
6184 /* Must reset to ensure spanning writes of last slot are detected */
6274 * @last: The end of the range
6282 unsigned long last, void *entry, gfp_t gfp)
6284 MA_STATE(mas, mt, index, last);
6291 if (index > last)
6329 * @last: The end of the range
6337 unsigned long last, void *entry, gfp_t gfp)
6339 MA_STATE(ms, mt, first, last);
6344 if (first > last)
6552 while (mas_searchable(&mas) && (mas.last < max)) {
6563 *index = mas.last + 1;
6779 unsigned long last = max;
6782 last = node->pivot[i];
6785 if (last == 0 && i > 0)
6789 first, last, depth + 1, format);
6792 first, last, depth + 1, format);
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);
6808 first = last + 1;
6845 unsigned long last = max;
6848 last = node->pivot[i];
6851 if (last == 0 && i > 0)
6855 first, last, depth + 1, format);
6858 first, last, depth + 1, format);
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);
6867 first = last + 1;
7134 pr_err("node%p: data_end %u != the last slot offset %u\n",
7163 void *entry, *last = (void *)1;
7178 if (!last && !entry) {
7182 MT_BUG_ON(mt, !last && !entry);
7183 last = entry;
7250 pr_err("[%u] index=%lx last=%lx\n", mas->offset, mas->index, mas->last);
7253 if (mas->index > mas->last)
7254 pr_err("Check index & last\n");