Home
last modified time | relevance | path

Searched +full:root +full:- +full:node (Results 1 – 25 of 1050) sorted by relevance

12345678910>>...42

/Linux-v5.15/lib/
Dradix-tree.c1 // SPDX-License-Identifier: GPL-2.0-or-later
24 #include <linux/radix-tree.h>
31 * Radix tree node cache.
36 * The radix tree is variable-height, so an insert operation not only has
43 * of RADIX_TREE_MAX_PATH size to be created, with only the root node shared.
46 #define RADIX_TREE_PRELOAD_SIZE (RADIX_TREE_MAX_PATH * 2 - 1)
52 #define IDR_INDEX_BITS (8 /* CHAR_BIT */ * sizeof(int) - 1)
55 #define IDR_PRELOAD_SIZE (IDR_MAX_PATH * 2 - 1)
58 * Per-cpu pool of preloaded nodes
80 return parent ? slot - parent->slots : 0; in get_slot_offset()
[all …]
Drbtree_test.c1 // SPDX-License-Identifier: GPL-2.0-only
14 __param(int, nnodes, 100, "Number of nodes in the rb-tree");
15 __param(int, perf_loops, 1000, "Number of iterations modifying the rb-tree");
16 __param(int, check_loops, 100, "Number of iterations modifying and verifying the rb-tree");
27 static struct rb_root_cached root = RB_ROOT_CACHED; variable
32 static void insert(struct test_node *node, struct rb_root_cached *root) in insert() argument
34 struct rb_node **new = &root->rb_root.rb_node, *parent = NULL; in insert()
35 u32 key = node->key; in insert()
39 if (key < rb_entry(parent, struct test_node, rb)->key) in insert()
40 new = &parent->rb_left; in insert()
[all …]
Drbtree.c1 // SPDX-License-Identifier: GPL-2.0-or-later
16 * red-black trees properties: https://en.wikipedia.org/wiki/Rbtree
18 * 1) A node is either red or black
19 * 2) The root is black
21 * 4) Both children of every red node are black
22 * 5) Every simple path from root to leaves contains the same number
26 * consecutive red nodes in a path and every red node is therefore followed by
42 * These two requirements will allow lockless iteration of the tree -- not
47 * and that it will indeed complete -- does not get stuck in a loop.
61 rb->__rb_parent_color |= RB_BLACK; in rb_set_black()
[all …]
Dbootconfig.c1 // SPDX-License-Identifier: GPL-2.0
19 * Extra Boot Config (XBC) is given as tree-structured ascii text of
20 * key-value pairs on memory.
21 * xbc_parse() parses the text to build a simple tree. Each tree node is
22 * simply a key word or a value. A key node may have a next key node or/and
23 * a child node (both key and value). A value node may have a next value
24 * node (for array).
40 xbc_err_pos = (int)(p - xbc_data); in xbc_parse_error()
42 return -EINVAL; in xbc_parse_error()
46 * xbc_root_node() - Get the root node of extended boot config
[all …]
/Linux-v5.15/scripts/gdb/linux/
Drbtree.py1 # SPDX-License-Identifier: GPL-2.0
13 def rb_first(root): argument
14 if root.type == rb_root_type.get_type():
15 node = root.address.cast(rb_root_type.get_type().pointer())
16 elif root.type != rb_root_type.get_type().pointer():
17 raise gdb.GdbError("Must be struct rb_root not {}".format(root.type))
19 node = root['rb_node']
20 if node == 0:
23 while node['rb_left']:
24 node = node['rb_left']
[all …]
/Linux-v5.15/include/linux/
Drbtree_latch.h1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Latched RB-trees
7 * Since RB-trees have non-atomic modifications they're not immediately suited
8 * for RCU/lockless queries. Even though we made RB-tree lookups non-fatal for
11 * The simplest solution is a seqlock + RB-tree, this will allow lockless
17 * employing the latch technique -- see @raw_write_seqcount_latch -- to
18 * implement a latched RB-tree which does allow for unconditional lookups by
26 * Therefore, this does require a lockless RB-tree iteration to be non-fatal;
28 * condition -- not seeing partial stores -- because the latch thing isolates
41 struct rb_node node[2]; member
[all …]
Drbtree.h1 /* SPDX-License-Identifier: GPL-2.0-or-later */
14 See Documentation/core-api/rbtree.rst for documentation and samples.
26 #define rb_parent(r) ((struct rb_node *)((r)->__rb_parent_color & ~3))
30 #define RB_EMPTY_ROOT(root) (READ_ONCE((root)->rb_node) == NULL) argument
33 #define RB_EMPTY_NODE(node) \ argument
34 ((node)->__rb_parent_color == (unsigned long)(node))
35 #define RB_CLEAR_NODE(node) \ argument
36 ((node)->__rb_parent_color = (unsigned long)(node))
49 /* Postorder iteration - always visit the parent after its children */
53 /* Fast replacement of a single node without remove/rebalance/add/rebalance */
[all …]
Drbtree_augmented.h1 /* SPDX-License-Identifier: GPL-2.0-or-later */
20 * Please note - only struct rb_augment_callbacks and the prototypes for
24 * See Documentation/core-api/rbtree.rst for documentation and samples.
28 void (*propagate)(struct rb_node *node, struct rb_node *stop);
33 extern void __rb_insert_augmented(struct rb_node *node, struct rb_root *root,
40 * leading to the inserted node, then call rb_link_node() as usual and
47 rb_insert_augmented(struct rb_node *node, struct rb_root *root, in rb_insert_augmented() argument
50 __rb_insert_augmented(node, root, augment->rotate); in rb_insert_augmented()
54 rb_insert_augmented_cached(struct rb_node *node, in rb_insert_augmented_cached() argument
55 struct rb_root_cached *root, bool newleft, in rb_insert_augmented_cached() argument
[all …]
Dinterval_tree_generic.h1 /* SPDX-License-Identifier: GPL-2.0-or-later */
18 * ITSUBTREE: name of ITTYPE field within ITSTRUCT holding last-in-subtree
19 * ITSTART(n): start endpoint of ITSTRUCT node n
20 * ITLAST(n): last endpoint of ITSTRUCT node n
24 * Note - before using this, please consider if generic version
38 ITSTATIC void ITPREFIX ## _insert(ITSTRUCT *node, \
39 struct rb_root_cached *root) \
41 struct rb_node **link = &root->rb_root.rb_node, *rb_parent = NULL; \
42 ITTYPE start = ITSTART(node), last = ITLAST(node); \
49 if (parent->ITSUBTREE < last) \
[all …]
/Linux-v5.15/fs/btrfs/
Ddelayed-inode.c1 // SPDX-License-Identifier: GPL-2.0
10 #include "delayed-inode.h"
11 #include "disk-io.h"
31 return -ENOMEM; in btrfs_delayed_inode_init()
42 struct btrfs_root *root, u64 inode_id) in btrfs_init_delayed_node() argument
44 delayed_node->root = root; in btrfs_init_delayed_node()
45 delayed_node->inode_id = inode_id; in btrfs_init_delayed_node()
46 refcount_set(&delayed_node->refs, 0); in btrfs_init_delayed_node()
47 delayed_node->ins_root = RB_ROOT_CACHED; in btrfs_init_delayed_node()
48 delayed_node->del_root = RB_ROOT_CACHED; in btrfs_init_delayed_node()
[all …]
Drelocation.c1 // SPDX-License-Identifier: GPL-2.0
12 #include <linux/error-injection.h>
14 #include "disk-io.h"
19 #include "async-thread.h"
20 #include "free-space-cache.h"
22 #include "print-tree.h"
23 #include "delalloc-space.h"
24 #include "block-group.h"
40 * ------------------------------------------------------------------
47 * 1. Mark the target block group read-only
[all …]
Dordered-data.c1 // SPDX-License-Identifier: GPL-2.0
15 #include "disk-io.h"
17 #include "delalloc-space.h"
25 if (entry->file_offset + entry->num_bytes < entry->file_offset) in entry_end()
26 return (u64)-1; in entry_end()
27 return entry->file_offset + entry->num_bytes; in entry_end()
30 /* returns NULL if the insertion worked, or it returns the node it did find
33 static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset, in tree_insert() argument
34 struct rb_node *node) in tree_insert() argument
36 struct rb_node **p = &root->rb_node; in tree_insert()
[all …]
/Linux-v5.15/drivers/net/ethernet/mellanox/mlx5/core/
Dfs_core.c14 * - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
264 static void del_hw_flow_table(struct fs_node *node);
265 static void del_hw_flow_group(struct fs_node *node);
266 static void del_hw_fte(struct fs_node *node);
267 static void del_sw_flow_table(struct fs_node *node);
268 static void del_sw_flow_group(struct fs_node *node);
269 static void del_sw_fte(struct fs_node *node);
270 static void del_sw_prio(struct fs_node *node);
271 static void del_sw_ns(struct fs_node *node);
[all …]
/Linux-v5.15/tools/lib/
Drbtree.c1 // SPDX-License-Identifier: GPL-2.0-or-later
16 * red-black trees properties: https://en.wikipedia.org/wiki/Rbtree
18 * 1) A node is either red or black
19 * 2) The root is black
21 * 4) Both children of every red node are black
22 * 5) Every simple path from root to leaves contains the same number
26 * consecutive red nodes in a path and every red node is therefore followed by
42 * These two requirements will allow lockless iteration of the tree -- not
47 * and that it will indeed complete -- does not get stuck in a loop.
61 rb->__rb_parent_color |= RB_BLACK; in rb_set_black()
[all …]
/Linux-v5.15/tools/perf/util/
Dstrfilter.c1 // SPDX-License-Identifier: GPL-2.0
19 static void strfilter_node__delete(struct strfilter_node *node) in strfilter_node__delete() argument
21 if (node) { in strfilter_node__delete()
22 if (node->p && !is_operator(*node->p)) in strfilter_node__delete()
23 zfree((char **)&node->p); in strfilter_node__delete()
24 strfilter_node__delete(node->l); in strfilter_node__delete()
25 strfilter_node__delete(node->r); in strfilter_node__delete()
26 free(node); in strfilter_node__delete()
33 strfilter_node__delete(filter->root); in strfilter__delete()
56 if (*(p - 1) == '\\' || (*p == '!' && *(p - 1) == '[')) { in get_token()
[all …]
/Linux-v5.15/tools/include/linux/
Drbtree.h1 /* SPDX-License-Identifier: GPL-2.0-or-later */
14 See Documentation/core-api/rbtree.rst for documentation and samples.
34 #define rb_parent(r) ((struct rb_node *)((r)->__rb_parent_color & ~3))
39 #define RB_EMPTY_ROOT(root) (READ_ONCE((root)->rb_node) == NULL) argument
42 #define RB_EMPTY_NODE(node) \ argument
43 ((node)->__rb_parent_color == (unsigned long)(node))
44 #define RB_CLEAR_NODE(node) \ argument
45 ((node)->__rb_parent_color = (unsigned long)(node))
58 /* Postorder iteration - always visit the parent after its children */
62 /* Fast replacement of a single node without remove/rebalance/add/rebalance */
[all …]
Drbtree_augmented.h1 /* SPDX-License-Identifier: GPL-2.0-or-later */
22 * Please note - only struct rb_augment_callbacks and the prototypes for
26 * See Documentation/core-api/rbtree.rst for documentation and samples.
30 void (*propagate)(struct rb_node *node, struct rb_node *stop);
35 extern void __rb_insert_augmented(struct rb_node *node, struct rb_root *root,
42 * leading to the inserted node, then call rb_link_node() as usual and
49 rb_insert_augmented(struct rb_node *node, struct rb_root *root, in rb_insert_augmented() argument
52 __rb_insert_augmented(node, root, augment->rotate); in rb_insert_augmented()
56 rb_insert_augmented_cached(struct rb_node *node, in rb_insert_augmented_cached() argument
57 struct rb_root_cached *root, bool newleft, in rb_insert_augmented_cached() argument
[all …]
/Linux-v5.15/drivers/block/drbd/
Ddrbd_interval.c1 // SPDX-License-Identifier: GPL-2.0
7 * interval_end - return end of @node
10 sector_t interval_end(struct rb_node *node) in interval_end() argument
12 struct drbd_interval *this = rb_entry(node, struct drbd_interval, rb); in interval_end()
13 return this->end; in interval_end()
16 #define NODE_END(node) ((node)->sector + ((node)->size >> 9)) argument
22 * drbd_insert_interval - insert a new interval into a tree
25 drbd_insert_interval(struct rb_root *root, struct drbd_interval *this) in drbd_insert_interval() argument
27 struct rb_node **new = &root->rb_node, *parent = NULL; in drbd_insert_interval()
28 sector_t this_end = this->sector + (this->size >> 9); in drbd_insert_interval()
[all …]
/Linux-v5.15/mm/
Dinterval_tree.c1 // SPDX-License-Identifier: GPL-2.0-only
3 * mm/interval_tree.c - interval tree for mapping->i_mmap
15 return v->vm_pgoff; in vma_start_pgoff()
20 return v->vm_pgoff + vma_pages(v) - 1; in vma_last_pgoff()
27 /* Insert node immediately after prev in the interval tree */
28 void vma_interval_tree_insert_after(struct vm_area_struct *node, in vma_interval_tree_insert_after() argument
30 struct rb_root_cached *root) in vma_interval_tree_insert_after() argument
34 unsigned long last = vma_last_pgoff(node); in vma_interval_tree_insert_after()
36 VM_BUG_ON_VMA(vma_start_pgoff(node) != vma_start_pgoff(prev), node); in vma_interval_tree_insert_after()
38 if (!prev->shared.rb.rb_right) { in vma_interval_tree_insert_after()
[all …]
/Linux-v5.15/drivers/infiniband/hw/hfi1/
Dmmu_rb.c1 // SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause
4 * Copyright(c) 2016 - 2017 Intel Corporation.
30 INTERVAL_TREE_DEFINE(struct mmu_rb_node, node, unsigned long, __last,
33 static unsigned long mmu_node_start(struct mmu_rb_node *node) in mmu_node_start() argument
35 return node->addr & PAGE_MASK; in mmu_node_start()
38 static unsigned long mmu_node_last(struct mmu_rb_node *node) in mmu_node_last() argument
40 return PAGE_ALIGN(node->addr + node->len) - 1; in mmu_node_last()
53 return -ENOMEM; in hfi1_mmu_rb_register()
55 h->root = RB_ROOT_CACHED; in hfi1_mmu_rb_register()
56 h->ops = ops; in hfi1_mmu_rb_register()
[all …]
/Linux-v5.15/fs/nfs/blocklayout/
Dextent_tree.c1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2014-2016 Christoph Hellwig.
13 ext_node(struct rb_node *node) in ext_node() argument
15 return rb_entry(node, struct pnfs_block_extent, be_node); in ext_node()
19 ext_tree_first(struct rb_root *root) in ext_tree_first() argument
21 struct rb_node *node = rb_first(root); in ext_tree_first() local
22 return node ? ext_node(node) : NULL; in ext_tree_first()
28 struct rb_node *node = rb_prev(&be->be_node); in ext_tree_prev() local
29 return node ? ext_node(node) : NULL; in ext_tree_prev()
35 struct rb_node *node = rb_next(&be->be_node); in ext_tree_next() local
[all …]
/Linux-v5.15/Documentation/core-api/
Drbtree.rst2 Red-black Trees (rbtree) in Linux
9 What are red-black trees, and what are they for?
10 ------------------------------------------------
12 Red-black trees are a type of self-balancing binary search tree, used for
19 Red-black trees are similar to AVL trees, but provide faster real-time bounded
26 There are a number of red-black trees in use in the kernel.
29 The high-resolution timer code uses an rbtree to organize outstanding
31 red-black tree. Virtual memory areas (VMAs) are tracked with red-black
38 Linux Weekly News article on red-black trees
41 Wikipedia entry on red-black trees
[all …]
/Linux-v5.15/drivers/of/
Dplatform.c1 // SPDX-License-Identifier: GPL-2.0+
16 #include <linux/dma-mapping.h>
25 { .compatible = "simple-bus", },
26 { .compatible = "simple-mfd", },
29 { .compatible = "arm,amba-bus", },
35 { .compatible = "operating-points-v2", },
40 * of_find_device_by_node - Find the platform_device associated with a node
41 * @np: Pointer to device tree node
60 * each applicable node.
67 * of_device_make_bus_id - Use the device node data to assign a unique name
[all …]
/Linux-v5.15/net/netfilter/
Dnf_conncount.c1 // SPDX-License-Identifier: GPL-2.0-only
42 struct list_head node; member
50 struct rb_node node; member
60 struct rb_root root[CONNCOUNT_SLOTS]; member
74 return conn->proto.tcp.state == TCP_CONNTRACK_TIME_WAIT || in already_closed()
75 conn->proto.tcp.state == TCP_CONNTRACK_CLOSE; in already_closed()
88 lockdep_assert_held(&list->list_lock); in conn_free()
90 list->count--; in conn_free()
91 list_del(&conn->node); in conn_free()
105 found = nf_conntrack_find_get(net, &conn->zone, &conn->tuple); in find_or_evict()
[all …]
/Linux-v5.15/drivers/acpi/
Dpci_root.c1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * pci_root.c - ACPI PCI Root Bridge Driver ($Revision: 40 $)
19 #include <linux/pci-acpi.h>
30 #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge"
62 * acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
63 * @handle: the ACPI CA node in question.
98 res->start = address.address.minimum; in get_root_bridge_busnr_callback()
99 res->end = address.address.minimum + address.address.address_length - 1; in get_root_bridge_busnr_callback()
110 res->start = -1; in try_get_root_bridge_busnr()
116 if (res->start == -1) in try_get_root_bridge_busnr()
[all …]

12345678910>>...42