Lines Matching full:gap
127 unsigned long gap[MAPLE_BIG_NODE_GAPS]; member
673 return node->ma64.gap; in ma_gaps()
890 * @offset: The offset of the highest sub-gap in this node.
898 meta->gap = offset; in ma_set_meta()
907 * @offset: The offset of the highest sub-gap in this node.
937 meta->gap = 0; in mt_clear_meta()
955 * ma_meta_gap() - Get the largest gap location of a node from the metadata
962 return mn->ma64.meta.gap; in ma_meta_gap()
966 * ma_set_meta_gap() - Set the largest gap location in a nodes metadata
969 * @offset: The location of the largest gap.
977 meta->gap = offset; in ma_set_meta_gap()
1051 * mte_set_gap() - Set a maple node gap.
1053 * @gap: The offset of the gap to set
1054 * @val: The gap value
1057 unsigned char gap, unsigned long val) in mte_set_gap() argument
1063 mte_to_node(mn)->ma64.gap[gap] = val; in mte_set_gap()
1487 * mas_leaf_max_gap() - Returns the largest gap in a leaf node
1490 * Return: The maximum gap in the leaf.
1495 unsigned long pstart, gap, max_gap; in mas_leaf_max_gap() local
1507 gap = 0; in mas_leaf_max_gap()
1510 if (gap > max_gap) in mas_leaf_max_gap()
1511 max_gap = gap; in mas_leaf_max_gap()
1512 gap = 0; in mas_leaf_max_gap()
1514 gap++; in mas_leaf_max_gap()
1517 if (gap > max_gap) in mas_leaf_max_gap()
1518 max_gap = gap; in mas_leaf_max_gap()
1524 * be skipped if there is a gap in slot 0. in mas_leaf_max_gap()
1537 * Check end implied pivot which can only be a gap on the right most in mas_leaf_max_gap()
1541 gap = ULONG_MAX - pivots[max_piv]; in mas_leaf_max_gap()
1542 if (gap > max_gap) in mas_leaf_max_gap()
1543 max_gap = gap; in mas_leaf_max_gap()
1547 /* data == no gap. */ in mas_leaf_max_gap()
1552 gap = pivots[i] - pstart; in mas_leaf_max_gap()
1553 if (gap > max_gap) in mas_leaf_max_gap()
1554 max_gap = gap; in mas_leaf_max_gap()
1563 * ma_max_gap() - Get the maximum gap in a maple node (non-leaf)
1567 * @*off: Pointer to store the offset location of the gap.
1571 * Return: The maximum gap value
1593 * mas_max_gap() - find the largest gap in a non-leaf node and set the slot.
1596 * Return: The gap value.
1617 * mas_parent_gap() - Set the parent gap and any gaps above, as needed
1619 * @offset: The gap offset in the parent to set
1620 * @new: The new gap value.
1622 * Set the parent gap then continue to set the gap upwards, using the metadata
1813 memmove(b_node->gap + shift, b_node->gap, size); in mab_shift_right()
1880 * To support gap tracking, all NULL entries are kept together and a node cannot in mab_calc_split()
1983 memcpy(b_node->gap + mab_start, gaps + mas_start, in mas_mab_cp()
2058 gaps[--j] = b_node->gap[--i]; in mab_mas_cp()
2125 b_node->gap[b_end] = mas->index - 1 - piv; in mas_store_b_node()
2150 b_node->gap[b_end] = piv - mas->last + 1; in mas_store_b_node()
2445 b_node->gap[b_node->b_end] = mas_max_gap(mas); in mab_set_b_end()
2674 * Updates gap as necessary.
3058 unsigned long *l_pivs, *pivs, gap; in mas_destroy_rebalance() local
3152 gap = mas_leaf_max_gap(mas); in mas_destroy_rebalance()
3153 mte_set_gap(eparent, mte_parent_slot(mas->node), gap); in mas_destroy_rebalance()
3154 gap = mas_leaf_max_gap(&l_mas); in mas_destroy_rebalance()
3155 mte_set_gap(eparent, mte_parent_slot(l_mas.node), gap); in mas_destroy_rebalance()
3212 memset(mast->bn->gap, 0, sizeof(unsigned long) * ARRAY_SIZE(mast->bn->gap)); in mast_fill_bnode()
4026 bool gap = false; in mas_wr_slot_store() local
4028 gap |= !mt_slot_locked(mas->tree, slots, offset); in mas_wr_slot_store()
4029 gap |= !mt_slot_locked(mas->tree, slots, offset + 1); in mas_wr_slot_store()
4047 gap |= !mt_slot_locked(mas->tree, slots, offset + 2); in mas_wr_slot_store()
4058 * Only update gap when the new entry is empty or there is an empty in mas_wr_slot_store()
4061 if (!wr_mas->entry || gap) in mas_wr_slot_store()
4298 * tree. If the insert fits exactly into an existing gap with a value in mas_insert()
4302 * the new range is within a gap but does not touch any other ranges, in mas_insert()
4725 * highest gap address of a given size in a given node and descend.
4739 unsigned long gap = 0; in mas_rev_awalk() local
4763 gap = 0; in mas_rev_awalk()
4765 gap = gaps[offset]; in mas_rev_awalk()
4767 gap = max - min + 1; in mas_rev_awalk()
4769 if (gap) { in mas_rev_awalk()
4770 if ((size <= gap) && (size <= mas->last - min + 1)) in mas_rev_awalk()
4774 /* Skip the next slot, it cannot be a gap. */ in mas_rev_awalk()
4799 *gap_max = min + gap - 1; in mas_rev_awalk()
4822 unsigned long pivot, min, gap = 0; in mas_anode_descend() local
4849 gap = gaps[offset]; in mas_anode_descend()
4851 gap = min(pivot, mas->last) - max(mas->index, min) + 1; in mas_anode_descend()
4855 if (gap >= size) { in mas_anode_descend()
4967 * mas_awalk() - Allocation walk. Search from low address to high, for a gap of
4970 * @size: The size of the gap required
4972 * Search between @mas->index and @mas->last for a gap of @size.
4982 * no gap found. (return, slot == MAPLE_NODE_SLOTS) in mas_awalk()
4983 * found the gap. (return, slot != MAPLE_NODE_SLOTS) in mas_awalk()
4995 * searching for a gap in an empty tree.
4999 * @size: The size of the gap
5639 * Avoid overflow, assume a gap between each entry and a trailing null. in mas_expected_entries()
6836 pr_cont("%lx ", node->gap[i]); in mt_dump_arange64()
6840 pr_cont("%lu ", node->gap[i]); in mt_dump_arange64()
6843 pr_cont("| %02X %02X| ", node->meta.end, node->meta.gap); in mt_dump_arange64()
6931 * Calculate the maximum gap in a node and check if that's what is reported in
6939 unsigned long gap = 0, max_gap = 0; in mas_validate_gaps() local
6949 if (gap > max_gap) in mas_validate_gaps()
6950 max_gap = gap; in mas_validate_gaps()
6951 gap = 0; in mas_validate_gaps()
6954 gap++; in mas_validate_gaps()
6965 gap = p_end - p_start + 1; in mas_validate_gaps()
6969 gap = gaps[i]; in mas_validate_gaps()
6972 if (gap > p_end - p_start + 1) { in mas_validate_gaps()
6974 mas_mn(mas), i, gap, p_end, p_start, in mas_validate_gaps()
6976 MT_BUG_ON(mas->tree, gap > p_end - p_start + 1); in mas_validate_gaps()
6980 if (gap > max_gap) in mas_validate_gaps()
6981 max_gap = gap; in mas_validate_gaps()
6992 pr_err("gap offset %p[%u] is invalid\n", node, offset); in mas_validate_gaps()
6997 pr_err("gap %p[%u] is not the largest gap %lu\n", in mas_validate_gaps()
7005 pr_err("gap %p[%u] beyond node limit != 0\n", in mas_validate_gaps()
7019 pr_err("gap %p[%u] != %lu\n", p_mn, p_slot, max_gap); in mas_validate_gaps()
7212 * 2. The gap is correctly set in the parents