Lines Matching full:gap
141 unsigned long gap[MAPLE_BIG_NODE_GAPS]; member
626 return node->ma64.gap; in ma_gaps()
814 * @offset: The offset of the highest sub-gap in this node.
822 meta->gap = offset; in ma_set_meta()
859 meta->gap = 0; in mt_clear_meta()
877 * ma_meta_gap() - Get the largest gap location of a node from the metadata
882 return mn->ma64.meta.gap; in ma_meta_gap()
886 * ma_set_meta_gap() - Set the largest gap location in a nodes metadata
889 * @offset: The location of the largest gap.
897 meta->gap = offset; in ma_set_meta_gap()
1302 * mas_leaf_max_gap() - Returns the largest gap in a leaf node
1305 * Return: The maximum gap in the leaf.
1310 unsigned long pstart, gap, max_gap; in mas_leaf_max_gap() local
1322 gap = 0; in mas_leaf_max_gap()
1325 if (gap > max_gap) in mas_leaf_max_gap()
1326 max_gap = gap; in mas_leaf_max_gap()
1327 gap = 0; in mas_leaf_max_gap()
1329 gap++; in mas_leaf_max_gap()
1332 if (gap > max_gap) in mas_leaf_max_gap()
1333 max_gap = gap; in mas_leaf_max_gap()
1339 * be skipped if there is a gap in slot 0. in mas_leaf_max_gap()
1352 * Check end implied pivot which can only be a gap on the right most in mas_leaf_max_gap()
1356 gap = ULONG_MAX - pivots[max_piv]; in mas_leaf_max_gap()
1357 if (gap > max_gap) in mas_leaf_max_gap()
1358 max_gap = gap; in mas_leaf_max_gap()
1365 /* data == no gap. */ in mas_leaf_max_gap()
1370 gap = pivots[i] - pstart; in mas_leaf_max_gap()
1371 if (gap > max_gap) in mas_leaf_max_gap()
1372 max_gap = gap; in mas_leaf_max_gap()
1381 * ma_max_gap() - Get the maximum gap in a maple node (non-leaf)
1385 * @off: Pointer to store the offset location of the gap.
1389 * Return: The maximum gap value
1411 * mas_max_gap() - find the largest gap in a non-leaf node and set the slot.
1414 * Return: The gap value.
1435 * mas_parent_gap() - Set the parent gap and any gaps above, as needed
1437 * @offset: The gap offset in the parent to set
1438 * @new: The new gap value.
1440 * Set the parent gap then continue to set the gap upwards, using the metadata
1633 memmove(b_node->gap + shift, b_node->gap, size); in mab_shift_right()
1700 * To support gap tracking, all NULL entries are kept together and a node cannot in mab_calc_split()
1777 memcpy(b_node->gap + mab_start, gaps + mas_start, in mas_mab_cp()
1838 gaps[--j] = b_node->gap[--i]; in mab_mas_cp()
1884 b_node->gap[b_end] = mas->index - 1 - piv; in mas_store_b_node()
1906 b_node->gap[b_end] = piv - mas->last + 1; in mas_store_b_node()
2198 b_node->gap[b_node->b_end] = mas_max_gap(mas); in mab_set_b_end()
2427 * Updates gap as necessary.
3572 bool gap = false; in mas_wr_slot_store() local
3574 gap |= !mt_slot_locked(mas->tree, slots, offset); in mas_wr_slot_store()
3575 gap |= !mt_slot_locked(mas->tree, slots, offset + 1); in mas_wr_slot_store()
3594 gap |= !mt_slot_locked(mas->tree, slots, offset + 2); in mas_wr_slot_store()
3603 * Only update gap when the new entry is empty or there is an empty in mas_wr_slot_store()
3606 if (!wr_mas->entry || gap) in mas_wr_slot_store()
3969 * tree. If the insert fits exactly into an existing gap with a value in mas_insert()
3973 * the new range is within a gap but does not touch any other ranges, in mas_insert()
4429 * highest gap address of a given size in a given node and descend.
4443 unsigned long gap = 0; in mas_rev_awalk() local
4467 gap = 0; in mas_rev_awalk()
4469 gap = gaps[offset]; in mas_rev_awalk()
4471 gap = max - min + 1; in mas_rev_awalk()
4473 if (gap) { in mas_rev_awalk()
4474 if ((size <= gap) && (size <= mas->last - min + 1)) in mas_rev_awalk()
4478 /* Skip the next slot, it cannot be a gap. */ in mas_rev_awalk()
4503 *gap_max = min + gap - 1; in mas_rev_awalk()
4526 unsigned long pivot, min, gap = 0; in mas_anode_descend() local
4553 gap = gaps[offset]; in mas_anode_descend()
4555 gap = min(pivot, mas->last) - max(mas->index, min) + 1; in mas_anode_descend()
4559 if (gap >= size) { in mas_anode_descend()
4667 * mas_awalk() - Allocation walk. Search from low address to high, for a gap of
4670 * @size: The size of the gap required
4672 * Search between @mas->index and @mas->last for a gap of @size.
4682 * no gap found. (return, error == -EBUSY) in mas_awalk()
4683 * found the gap. (return) in mas_awalk()
4695 * searching for a gap in an empty tree.
4699 * @size: The size of the gap
6769 pr_cont("%lx ", node->gap[i]); in mt_dump_arange64()
6772 pr_cont("%lu ", node->gap[i]); in mt_dump_arange64()
6775 pr_cont("| %02X %02X| ", node->meta.end, node->meta.gap); in mt_dump_arange64()
6867 * Calculate the maximum gap in a node and check if that's what is reported in
6875 unsigned long gap = 0, max_gap = 0; in mas_validate_gaps() local
6885 if (gap > max_gap) in mas_validate_gaps()
6886 max_gap = gap; in mas_validate_gaps()
6887 gap = 0; in mas_validate_gaps()
6890 gap++; in mas_validate_gaps()
6901 gap = p_end - p_start + 1; in mas_validate_gaps()
6905 gap = gaps[i]; in mas_validate_gaps()
6908 if (gap > p_end - p_start + 1) { in mas_validate_gaps()
6910 mas_mn(mas), i, gap, p_end, p_start, in mas_validate_gaps()
6912 MT_BUG_ON(mas->tree, gap > p_end - p_start + 1); in mas_validate_gaps()
6916 if (gap > max_gap) in mas_validate_gaps()
6917 max_gap = gap; in mas_validate_gaps()
6929 pr_err("gap offset " PTR_FMT "[%u] is invalid\n", node, offset); in mas_validate_gaps()
6934 pr_err("gap " PTR_FMT "[%u] is not the largest gap %lu\n", in mas_validate_gaps()
6941 pr_err("gap " PTR_FMT "[%u] beyond node limit != 0\n", in mas_validate_gaps()
6955 pr_err("gap " PTR_FMT "[%u] != %lu\n", p_mn, p_slot, max_gap); in mas_validate_gaps()
7148 * 2. The gap is correctly set in the parents