Lines Matching defs:slot
80 get_slot_offset(const struct radix_tree_node *parent, void __rcu **slot)
82 return parent ? slot - parent->slots : 0;
149 * Returns 1 if any slot in the node has this tag set.
482 * is not at the leftmost slot, we cannot shrink.
513 * We have a dilemma here. The node's slot[0] must not be
516 * then it may be subject to the slot pointer being visible
518 * slot[0] is subsequently deleted, these callers would expect
519 * their slot to become empty sooner or later.
521 * For example, lockless pagecache will look up a slot, deref
525 * to retry the entire slot lookup -- the indirect pointer
527 * also results in a stale slot). So tag the slot as indirect
583 * __radix_tree_create - create a slot in a radix tree
587 * @slotp: returns slot
589 * Create, if necessary, and return the node and slot for an item
593 * allocated and @root->xa_head is used as a direct slot instead of
603 void __rcu **slot = (void __rcu **)&root->xa_head;
628 rcu_assign_pointer(*slot, node_to_entry(child));
637 slot = &node->slots[offset];
643 *slotp = slot;
682 void __rcu **slot, void *item)
684 if (*slot)
686 rcu_assign_pointer(*slot, item);
707 void __rcu **slot;
712 error = __radix_tree_create(root, index, &node, &slot);
716 error = insert_entries(node, slot, item);
721 unsigned offset = get_slot_offset(node, slot);
738 * @slotp: returns slot
744 * allocated and @root->xa_head is used as a direct slot instead of
753 void __rcu **slot;
757 slot = (void __rcu **)&root->xa_head;
767 slot = parent->slots + offset;
777 *slotp = slot;
782 * radix_tree_lookup_slot - lookup a slot in a radix tree
786 * Returns: the slot corresponding to the position @index in the
789 * This function can be called under rcu_read_lock iff the slot is not
791 * exclusive from other writers. Any dereference of the slot must be done
797 void __rcu **slot;
799 if (!__radix_tree_lookup(root, index, NULL, &slot))
801 return slot;
823 static void replace_slot(void __rcu **slot, void *item,
831 rcu_assign_pointer(*slot, item);
844 * IDR users want to be able to store NULL in the tree, so if the slot isn't
851 struct radix_tree_node *node, void __rcu **slot,
855 unsigned offset = get_slot_offset(node, slot);
866 * __radix_tree_replace - replace item in a slot
869 * @slot: pointer to slot in @node
870 * @item: new item to store in the slot.
873 * across slot lookup and replacement.
877 void __rcu **slot, void *item)
879 void *old = rcu_dereference_raw(*slot);
881 int count = calculate_count(root, node, slot, item, old);
886 * node unless the slot is root->xa_head.
888 WARN_ON_ONCE(!node && (slot != (void __rcu **)&root->xa_head) &&
890 replace_slot(slot, item, node, count, values);
899 * radix_tree_replace_slot - replace item in a slot
901 * @slot: pointer to slot
902 * @item: new item to store in the slot.
906 * across slot lookup and replacement.
915 void __rcu **slot, void *item)
917 __radix_tree_replace(root, NULL, slot, item);
922 * radix_tree_iter_replace - replace item in a slot
925 * @slot: pointer to slot
926 * @item: new item to store in the slot.
933 void __rcu **slot, void *item)
935 __radix_tree_replace(root, iter->node, slot, item);
1136 void __rcu **radix_tree_iter_resume(void __rcu **slot,
1152 * Returns: pointer to chunk first slot, or NULL if iteration is over
1185 /* Single-slot tree */
1208 void *slot = rcu_dereference_raw(
1210 if (slot)
1266 void __rcu **slot;
1272 radix_tree_for_each_slot(slot, root, &iter, first_index) {
1273 results[ret] = rcu_dereference_raw(*slot);
1277 slot = radix_tree_iter_retry(&iter);
1307 void __rcu **slot;
1313 radix_tree_for_each_tagged(slot, root, &iter, first_index, tag) {
1314 results[ret] = rcu_dereference_raw(*slot);
1318 slot = radix_tree_iter_retry(&iter);
1330 * radix_tree_gang_lookup_tag_slot - perform multiple slot lookup on a
1348 void __rcu **slot;
1354 radix_tree_for_each_tagged(slot, root, &iter, first_index, tag) {
1355 results[ret] = slot;
1365 struct radix_tree_node *node, void __rcu **slot)
1367 void *old = rcu_dereference_raw(*slot);
1369 unsigned offset = get_slot_offset(node, slot);
1378 replace_slot(slot, NULL, node, -1, values);
1386 * @slot: pointer to slot
1395 struct radix_tree_iter *iter, void __rcu **slot)
1397 if (__radix_tree_delete(root, iter->node, slot))
1417 void __rcu **slot = NULL;
1420 entry = __radix_tree_lookup(root, index, &node, &slot);
1421 if (!slot)
1424 get_slot_offset(node, slot))))
1430 __radix_tree_delete(root, node, slot);
1481 void __rcu **slot = (void __rcu **)&root->xa_head;
1511 rcu_assign_pointer(*slot, node_to_entry(child));
1534 slot = &node->slots[offset];
1545 return slot;