Home
last modified time | relevance | path

Searched refs:rb_node (Results 1 – 25 of 467) sorted by relevance

12345678910>>...19

/linux-6.6.21/include/linux/
Drbtree.h26 #define rb_parent(r) ((struct rb_node *)((r)->__rb_parent_color & ~3))
30 #define RB_EMPTY_ROOT(root) (READ_ONCE((root)->rb_node) == NULL)
39 extern void rb_insert_color(struct rb_node *, struct rb_root *);
40 extern void rb_erase(struct rb_node *, struct rb_root *);
44 extern struct rb_node *rb_next(const struct rb_node *);
45 extern struct rb_node *rb_prev(const struct rb_node *);
46 extern struct rb_node *rb_first(const struct rb_root *);
47 extern struct rb_node *rb_last(const struct rb_root *);
50 extern struct rb_node *rb_first_postorder(const struct rb_root *);
51 extern struct rb_node *rb_next_postorder(const struct rb_node *);
[all …]
Drbtree_augmented.h28 void (*propagate)(struct rb_node *node, struct rb_node *stop);
29 void (*copy)(struct rb_node *old, struct rb_node *new);
30 void (*rotate)(struct rb_node *old, struct rb_node *new);
33 extern void __rb_insert_augmented(struct rb_node *node, struct rb_root *root,
34 void (*augment_rotate)(struct rb_node *old, struct rb_node *new));
47 rb_insert_augmented(struct rb_node *node, struct rb_root *root, in rb_insert_augmented()
54 rb_insert_augmented_cached(struct rb_node *node, in rb_insert_augmented_cached()
63 static __always_inline struct rb_node *
64 rb_add_augmented_cached(struct rb_node *node, struct rb_root_cached *tree, in rb_add_augmented_cached()
65 bool (*less)(struct rb_node *, const struct rb_node *), in rb_add_augmented_cached() argument
[all …]
Drbtree_types.h5 struct rb_node { struct
7 struct rb_node *rb_right; argument
8 struct rb_node *rb_left; argument
13 struct rb_node *rb_node; member
28 struct rb_node *rb_leftmost;
/linux-6.6.21/tools/include/linux/
Drbtree.h23 struct rb_node { struct
25 struct rb_node *rb_right; argument
26 struct rb_node *rb_left; argument
31 struct rb_node *rb_node; member
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)
48 extern void rb_insert_color(struct rb_node *, struct rb_root *);
49 extern void rb_erase(struct rb_node *, struct rb_root *);
53 extern struct rb_node *rb_next(const struct rb_node *);
54 extern struct rb_node *rb_prev(const struct rb_node *);
[all …]
Drbtree_augmented.h30 void (*propagate)(struct rb_node *node, struct rb_node *stop);
31 void (*copy)(struct rb_node *old, struct rb_node *new);
32 void (*rotate)(struct rb_node *old, struct rb_node *new);
35 extern void __rb_insert_augmented(struct rb_node *node, struct rb_root *root,
36 void (*augment_rotate)(struct rb_node *old, struct rb_node *new));
49 rb_insert_augmented(struct rb_node *node, struct rb_root *root, in rb_insert_augmented()
56 rb_insert_augmented_cached(struct rb_node *node, in rb_insert_augmented_cached()
79 RBNAME ## _propagate(struct rb_node *rb, struct rb_node *stop) \
89 RBNAME ## _copy(struct rb_node *rb_old, struct rb_node *rb_new) \
96 RBNAME ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new) \
[all …]
/linux-6.6.21/tools/lib/
Drbtree.c59 static inline void rb_set_black(struct rb_node *rb) in rb_set_black()
64 static inline struct rb_node *rb_red_parent(struct rb_node *red) in rb_red_parent()
66 return (struct rb_node *)red->__rb_parent_color; in rb_red_parent()
75 __rb_rotate_set_parents(struct rb_node *old, struct rb_node *new, in __rb_rotate_set_parents()
78 struct rb_node *parent = rb_parent(old); in __rb_rotate_set_parents()
85 __rb_insert(struct rb_node *node, struct rb_root *root, in __rb_insert()
86 void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) in __rb_insert()
88 struct rb_node *parent = rb_red_parent(node), *gparent, *tmp; in __rb_insert()
227 ____rb_erase_color(struct rb_node *parent, struct rb_root *root, in ____rb_erase_color()
228 void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) in ____rb_erase_color()
[all …]
/linux-6.6.21/lib/
Drbtree.c59 static inline void rb_set_black(struct rb_node *rb) in rb_set_black()
64 static inline struct rb_node *rb_red_parent(struct rb_node *red) in rb_red_parent()
66 return (struct rb_node *)red->__rb_parent_color; in rb_red_parent()
75 __rb_rotate_set_parents(struct rb_node *old, struct rb_node *new, in __rb_rotate_set_parents()
78 struct rb_node *parent = rb_parent(old); in __rb_rotate_set_parents()
85 __rb_insert(struct rb_node *node, struct rb_root *root, in __rb_insert()
86 void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) in __rb_insert()
88 struct rb_node *parent = rb_red_parent(node), *gparent, *tmp; in __rb_insert()
227 ____rb_erase_color(struct rb_node *parent, struct rb_root *root, in ____rb_erase_color()
228 void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) in ____rb_erase_color()
[all …]
/linux-6.6.21/tools/perf/util/
Dintlist.c13 static struct rb_node *intlist__node_new(struct rblist *rblist __maybe_unused, in intlist__node_new()
17 struct rb_node *rc = NULL; in intlist__node_new()
23 rc = &node->rb_node; in intlist__node_new()
35 struct rb_node *rb_node) in intlist__node_delete() argument
37 struct int_node *node = container_of(rb_node, struct int_node, rb_node); in intlist__node_delete()
42 static int intlist__node_cmp(struct rb_node *rb_node, const void *entry) in intlist__node_cmp() argument
45 struct int_node *node = container_of(rb_node, struct int_node, rb_node); in intlist__node_cmp()
62 rblist__remove_node(&ilist->rblist, &node->rb_node); in intlist__remove()
69 struct rb_node *rb_node; in __intlist__findnew() local
75 rb_node = rblist__findnew(&ilist->rblist, (void *)i); in __intlist__findnew()
[all …]
Dstrlist.c15 struct rb_node *strlist__node_new(struct rblist *rblist, const void *entry) in strlist__node_new()
18 struct rb_node *rc = NULL; in strlist__node_new()
29 rc = &snode->rb_node; in strlist__node_new()
47 void strlist__node_delete(struct rblist *rblist, struct rb_node *rb_node) in strlist__node_delete() argument
50 struct str_node *snode = container_of(rb_node, struct str_node, rb_node); in strlist__node_delete()
55 static int strlist__node_cmp(struct rb_node *rb_node, const void *entry) in strlist__node_cmp() argument
58 struct str_node *snode = container_of(rb_node, struct str_node, rb_node); in strlist__node_cmp()
97 rblist__remove_node(&slist->rblist, &snode->rb_node); in strlist__remove()
103 struct rb_node *rb_node = rblist__find(&slist->rblist, entry); in strlist__find() local
105 if (rb_node) in strlist__find()
[all …]
Drblist.c15 struct rb_node **p = &rblist->entries.rb_root.rb_node; in rblist__add_node()
16 struct rb_node *parent = NULL, *new_node; in rblist__add_node()
46 void rblist__remove_node(struct rblist *rblist, struct rb_node *rb_node) in rblist__remove_node() argument
48 rb_erase_cached(rb_node, &rblist->entries); in rblist__remove_node()
50 rblist->node_delete(rblist, rb_node); in rblist__remove_node()
53 static struct rb_node *__rblist__findnew(struct rblist *rblist, in __rblist__findnew()
57 struct rb_node **p = &rblist->entries.rb_root.rb_node; in __rblist__findnew()
58 struct rb_node *parent = NULL, *new_node = NULL; in __rblist__findnew()
90 struct rb_node *rblist__find(struct rblist *rblist, const void *entry) in rblist__find()
95 struct rb_node *rblist__findnew(struct rblist *rblist, const void *entry) in rblist__findnew()
[all …]
Dmaps.c38 struct rb_node **p = &maps__entries(maps)->rb_node; in __maps__insert()
39 struct rb_node *parent = NULL; in __maps__insert()
47 RB_CLEAR_NODE(&new_rb_node->rb_node); in __maps__insert()
52 m = rb_entry(parent, struct map_rb_node, rb_node); in __maps__insert()
59 rb_link_node(&new_rb_node->rb_node, parent, p); in __maps__insert()
60 rb_insert_color(&new_rb_node->rb_node, maps__entries(maps)); in __maps__insert()
113 static void __maps__remove(struct maps *maps, struct map_rb_node *rb_node) in __maps__remove() argument
115 rb_erase_init(&rb_node->rb_node, maps__entries(maps)); in __maps__remove()
116 map__put(rb_node->map); in __maps__remove()
117 free(rb_node); in __maps__remove()
[all …]
Drb_resort.h57 struct rb_node rb_node; \
60 static void __name##_sorted__init_entry(struct rb_node *nd, \
63 static int __name##_sorted__cmp(struct rb_node *nda, struct rb_node *ndb) \
66 a = rb_entry(nda, struct __name##_sorted_entry, rb_node); \
67 b = rb_entry(ndb, struct __name##_sorted_entry, rb_node); \
77 struct rb_node *sorted_nd) \
79 struct rb_node **p = &sorted->entries.rb_node, *parent = NULL; \
94 struct rb_node *nd; \
99 __name##_sorted__insert(sorted, &snd->rb_node); \
120 static void __name##_sorted__init_entry(struct rb_node *nd, \
[all …]
Drblist.h26 int (*node_cmp)(struct rb_node *rbn, const void *entry);
27 struct rb_node *(*node_new)(struct rblist *rlist, const void *new_entry);
28 void (*node_delete)(struct rblist *rblist, struct rb_node *rb_node);
35 void rblist__remove_node(struct rblist *rblist, struct rb_node *rb_node);
36 struct rb_node *rblist__find(struct rblist *rblist, const void *entry);
37 struct rb_node *rblist__findnew(struct rblist *rblist, const void *entry);
38 struct rb_node *rblist__entry(const struct rblist *rblist, unsigned int idx);
Dmem2node.c12 struct rb_node rb_node; member
20 struct rb_node **p = &root->rb_node; in phys_entry__insert()
21 struct rb_node *parent = NULL; in phys_entry__insert()
26 e = rb_entry(parent, struct phys_entry, rb_node); in phys_entry__insert()
34 rb_link_node(&entry->rb_node, parent, p); in phys_entry__insert()
35 rb_insert_color(&entry->rb_node, root); in phys_entry__insert()
44 RB_CLEAR_NODE(&entry->rb_node); in phys_entry__init()
121 struct rb_node **p, *parent = NULL; in mem2node__node()
124 p = &map->root.rb_node; in mem2node__node()
127 entry = rb_entry(parent, struct phys_entry, rb_node); in mem2node__node()
Dcomm.c14 struct rb_node rb_node; member
34 rb_erase(&cs->rb_node, &comm_str_root); in comm_str__put()
63 struct rb_node **p = &root->rb_node; in __comm_str__findnew()
64 struct rb_node *parent = NULL; in __comm_str__findnew()
70 iter = rb_entry(parent, struct comm_str, rb_node); in __comm_str__findnew()
91 rb_link_node(&new->rb_node, parent, p); in __comm_str__findnew()
92 rb_insert_color(&new->rb_node, root); in __comm_str__findnew()
/linux-6.6.21/Documentation/translations/zh_CN/core-api/
Drbtree.rst50 每个rb_node结构体的实例嵌入在它管理的数据结构中,因此不需要靠指针来分离rb_node和它
57 红黑树中的数据结点是包含rb_node结构体成员的结构体::
60 struct rb_node node;
64 当处理一个指向内嵌rb_node结构体的指针时,包住rb_node的结构体可用标准的container_of()
81 struct rb_node *node = root->rb_node;
112 struct rb_node **new = &(root->rb_node), *parent = NULL;
140 void rb_erase(struct rb_node *victim, struct rb_root *tree);
153 void rb_replace_node(struct rb_node *old, struct rb_node *new,
165 struct rb_node *rb_first(struct rb_root *tree);
166 struct rb_node *rb_last(struct rb_root *tree);
[all …]
/linux-6.6.21/fs/btrfs/
Dmisc.h63 struct rb_node rb_node; member
67 static inline struct rb_node *rb_simple_search(struct rb_root *root, u64 bytenr) in rb_simple_search()
69 struct rb_node *node = root->rb_node; in rb_simple_search()
73 entry = rb_entry(node, struct rb_simple_node, rb_node); in rb_simple_search()
94 static inline struct rb_node *rb_simple_search_first(struct rb_root *root, in rb_simple_search_first()
97 struct rb_node *node = root->rb_node, *ret = NULL; in rb_simple_search_first()
101 entry = rb_entry(node, struct rb_simple_node, rb_node); in rb_simple_search_first()
120 static inline struct rb_node *rb_simple_insert(struct rb_root *root, u64 bytenr, in rb_simple_insert()
121 struct rb_node *node) in rb_simple_insert()
123 struct rb_node **p = &root->rb_node; in rb_simple_insert()
[all …]
Dextent_map.c52 RB_CLEAR_NODE(&em->rb_node); in alloc_extent_map()
86 struct rb_node **p = &root->rb_root.rb_node; in tree_insert()
87 struct rb_node *parent = NULL; in tree_insert()
89 struct rb_node *orig_parent = NULL; in tree_insert()
95 entry = rb_entry(parent, struct extent_map, rb_node); in tree_insert()
110 entry = rb_entry(parent, struct extent_map, rb_node); in tree_insert()
117 entry = rb_entry(parent, struct extent_map, rb_node); in tree_insert()
120 entry = rb_entry(parent, struct extent_map, rb_node); in tree_insert()
126 rb_link_node(&em->rb_node, orig_parent, p); in tree_insert()
127 rb_insert_color_cached(&em->rb_node, root, leftmost); in tree_insert()
[all …]
Dordered-data.c36 static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset, in tree_insert()
37 struct rb_node *node) in tree_insert()
39 struct rb_node **p = &root->rb_node; in tree_insert()
40 struct rb_node *parent = NULL; in tree_insert()
45 entry = rb_entry(parent, struct btrfs_ordered_extent, rb_node); in tree_insert()
64 static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, in __tree_search()
65 struct rb_node **prev_ret) in __tree_search()
67 struct rb_node *n = root->rb_node; in __tree_search()
68 struct rb_node *prev = NULL; in __tree_search()
69 struct rb_node *test; in __tree_search()
[all …]
/linux-6.6.21/tools/perf/tests/
Dhists_output.c100 struct rb_node *node; in del_hist_entries()
112 he = rb_entry(node, struct hist_entry, rb_node); in del_hist_entries()
144 struct rb_node *node; in test1()
180 he = rb_entry(node, struct hist_entry, rb_node); in test1()
186 he = rb_entry(node, struct hist_entry, rb_node); in test1()
192 he = rb_entry(node, struct hist_entry, rb_node); in test1()
198 he = rb_entry(node, struct hist_entry, rb_node); in test1()
204 he = rb_entry(node, struct hist_entry, rb_node); in test1()
210 he = rb_entry(node, struct hist_entry, rb_node); in test1()
216 he = rb_entry(node, struct hist_entry, rb_node); in test1()
[all …]
/linux-6.6.21/arch/powerpc/kernel/
Deeh_cache.c41 struct rb_node rb_node; member
56 struct rb_node *n = pci_io_addr_cache_root.rb_root.rb_node; in __eeh_addr_cache_get_device()
60 piar = rb_entry(n, struct pci_io_addr_range, rb_node); in __eeh_addr_cache_get_device()
100 struct rb_node *n; in eeh_addr_cache_print()
106 piar = rb_entry(n, struct pci_io_addr_range, rb_node); in eeh_addr_cache_print()
121 struct rb_node **p = &pci_io_addr_cache_root.rb_root.rb_node; in eeh_addr_cache_insert()
122 struct rb_node *parent = NULL; in eeh_addr_cache_insert()
128 piar = rb_entry(parent, struct pci_io_addr_range, rb_node); in eeh_addr_cache_insert()
154 rb_link_node(&piar->rb_node, parent, p); in eeh_addr_cache_insert()
155 rb_insert_color(&piar->rb_node, &pci_io_addr_cache_root.rb_root); in eeh_addr_cache_insert()
[all …]
/linux-6.6.21/arch/sh/kernel/
Ddwarf.c305 struct rb_node **rb_node = &cie_root.rb_node; in dwarf_lookup_cie() local
320 while (*rb_node) { in dwarf_lookup_cie()
323 cie_tmp = rb_entry(*rb_node, struct dwarf_cie, node); in dwarf_lookup_cie()
332 rb_node = &(*rb_node)->rb_left; in dwarf_lookup_cie()
334 rb_node = &(*rb_node)->rb_right; in dwarf_lookup_cie()
349 struct rb_node **rb_node = &fde_root.rb_node; in dwarf_lookup_fde() local
355 while (*rb_node) { in dwarf_lookup_fde()
359 fde_tmp = rb_entry(*rb_node, struct dwarf_fde, node); in dwarf_lookup_fde()
366 rb_node = &(*rb_node)->rb_left; in dwarf_lookup_fde()
372 rb_node = &(*rb_node)->rb_right; in dwarf_lookup_fde()
[all …]
/linux-6.6.21/net/bridge/
Dbr_multicast_eht.c47 struct rb_node *node = pg->eht_host_tree.rb_node; in br_multicast_eht_host_lookup()
54 rb_node); in br_multicast_eht_host_lookup()
83 struct rb_node *node = eht_set->entry_tree.rb_node; in br_multicast_eht_set_entry_lookup()
90 rb_node); in br_multicast_eht_set_entry_lookup()
107 struct rb_node *node = pg->eht_set_tree.rb_node; in br_multicast_eht_set_lookup()
114 rb_node); in br_multicast_eht_set_lookup()
133 rb_erase(&eht_host->rb_node, &eht_host->pg->eht_host_tree); in __eht_destroy_host()
134 RB_CLEAR_NODE(&eht_host->rb_node); in __eht_destroy_host()
143 WARN_ON(!RB_EMPTY_NODE(&set_h->rb_node)); in br_multicast_destroy_eht_set_entry()
154 WARN_ON(!RB_EMPTY_NODE(&eht_set->rb_node)); in br_multicast_destroy_eht_set()
[all …]
/linux-6.6.21/security/keys/
Dproc.c64 static struct rb_node *key_serial_next(struct seq_file *p, struct rb_node *n) in key_serial_next()
81 struct rb_node *n = key_serial_tree.rb_node; in find_ge_key()
129 static inline key_serial_t key_node_serial(struct rb_node *n) in key_node_serial()
137 struct rb_node *n; in proc_keys_next()
155 struct rb_node *_p = v; in proc_keys_show()
252 static struct rb_node *__key_user_next(struct user_namespace *user_ns, struct rb_node *n) in __key_user_next()
263 static struct rb_node *key_user_next(struct user_namespace *user_ns, struct rb_node *n) in key_user_next()
268 static struct rb_node *key_user_first(struct user_namespace *user_ns, struct rb_root *r) in key_user_first()
270 struct rb_node *n = rb_first(r); in key_user_first()
277 struct rb_node *_p; in proc_key_users_start()
[all …]
/linux-6.6.21/fs/ext4/
Dextents_status.c182 struct rb_node *node; in ext4_es_print_tree()
189 es = rb_entry(node, struct extent_status, rb_node); in ext4_es_print_tree()
214 struct rb_node *node = root->rb_node; in __es_tree_search()
218 es = rb_entry(node, struct extent_status, rb_node); in __es_tree_search()
231 node = rb_next(&es->rb_node); in __es_tree_search()
232 return node ? rb_entry(node, struct extent_status, rb_node) : in __es_tree_search()
264 struct rb_node *node; in __es_find_extent_range()
285 while ((node = rb_next(&es1->rb_node)) != NULL) { in __es_find_extent_range()
286 es1 = rb_entry(node, struct extent_status, rb_node); in __es_find_extent_range()
571 struct rb_node *node; in ext4_es_try_to_merge_left()
[all …]

12345678910>>...19