| /linux/lib/ |
| H A D | radix-tree.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 24 #include <linux/radix-tree.h> 30 #include "radix-tree.h" 33 * Radix tree node cache. 38 * The radix tree is variable-height, so an insert operation not only has 45 * of RADIX_TREE_MAX_PATH size to be created, with only the root node shared. 48 #define RADIX_TREE_PRELOAD_SIZE (RADIX_TREE_MAX_PATH * 2 - 1) 54 #define IDR_INDEX_BITS (8 /* CHAR_BIT */ * sizeof(int) - 1) 57 #define IDR_PRELOAD_SIZE (IDR_MAX_PATH * 2 - 1) 60 * Per-cpu pool of preloaded nodes [all …]
|
| H A D | rbtree_test.c | 1 // 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"); 28 static struct rb_root_cached root = RB_ROOT_CACHED; variable 33 static void insert(struct test_node *node, struct rb_root_cached *root) in insert() argument 35 struct rb_node **new = &root->rb_root.rb_node, *parent = NULL; in insert() 36 u32 key = node->key; in insert() 40 if (key < rb_entry(parent, struct test_node, rb)->key) in insert() 41 new = &parent->rb_left; in insert() [all …]
|
| H A D | bootconfig.c | 1 // SPDX-License-Identifier: GPL-2.0 31 /* embedded_bootconfig_data is defined in bootconfig-data.S */ 37 *size = embedded_bootconfig_data_end - embedded_bootconfig_data; in xbc_get_embedded_bootconfig() 43 /* embedded_kernel_cmdline is defined in embedded-cmdline.S */ 51 * str_prepend() - Prepend @src in front of the string in @dst, in place 52 * @dst: NUL-terminated destination buffer, currently @dst_len bytes long 54 * @src: bytes to prepend (not NUL-terminated) 69 * xbc_prepend_embedded_cmdline() - Prepend embedded bootconfig cmdline 73 * Prepend the build-time-rendered "kernel" subtree of the embedded 87 size_t embed_len = embedded_kernel_cmdline_end - embedded_kernel_cmdline; in xbc_prepend_embedded_cmdline() [all …]
|
| /linux/scripts/gdb/linux/ |
| H A D | rbtree.py | 1 # SPDX-License-Identifier: GPL-2.0 12 def rb_inorder_for_each(root): argument 13 def inorder(node): argument 14 if node: 15 yield from inorder(node['rb_left']) 16 yield node 17 yield from inorder(node['rb_right']) 19 yield from inorder(root['rb_node']) 21 def rb_inorder_for_each_entry(root, gdbtype, member): argument 22 for node in rb_inorder_for_each(root): [all …]
|
| H A D | radixtree.py | 1 # SPDX-License-Identifier: GPL-2.0 20 def is_internal_node(node): argument 22 …return ((node.cast(long_type) & constants.LX_RADIX_TREE_ENTRY_MASK) == constants.LX_RADIX_TREE_INT… 24 def entry_to_node(node): argument 26 node_type = node.type 27 indirect_ptr = node.cast(long_type) & ~constants.LX_RADIX_TREE_INTERNAL_NODE 30 def node_maxindex(node): argument 31 return (constants.LX_RADIX_TREE_MAP_SIZE << node['shift']) - 1 33 def resolve_root(root): argument 34 if root.type == radix_tree_root_type.get_type(): [all …]
|
| /linux/arch/x86/kernel/ |
| H A D | amd_node.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * AMD Node helper functions and common defines 12 #include <asm/amd/node.h> 18 * The nodes are software-visible through PCI config space. All nodes are enumerated 20 * nodes) with 0x18 corresponding to node 0, 0x19 to node 1, etc. Each node can be a 21 * multi-function device. 23 * On legacy systems, these node devices represent integrated Northbridge functionality. 24 * On Zen-based systems, these node devices represent Data Fabric functionality. 27 * "Processor x86 Core" -> "Configuration Space" section in PPRs. 29 struct pci_dev *amd_node_get_func(u16 node, u8 func) in amd_node_get_func() argument [all …]
|
| /linux/fs/btrfs/ |
| H A D | delayed-inode.c | 1 // SPDX-License-Identifier: GPL-2.0 13 #include "delayed-inode.h" 14 #include "disk-io.h" 18 #include "inode-item.h" 19 #include "space-info.h" 21 #include "file-item.h" 33 return -ENOMEM; in btrfs_delayed_inode_init() 44 atomic_set(&delayed_root->items, 0); in btrfs_init_delayed_root() 45 atomic_set(&delayed_root->items_seq, 0); in btrfs_init_delayed_root() 46 delayed_root->nodes = 0; in btrfs_init_delayed_root() [all …]
|
| H A D | relocation.c | 1 // 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" 29 #include "inode-item.h" 30 #include "space-info.h" [all …]
|
| H A D | backref.c | 1 // SPDX-License-Identifier: GPL-2.0 10 #include "disk-io.h" 14 #include "delayed-ref.h" 17 #include "tree-mod-log.h" 20 #include "extent-tree.h" 22 #include "tree-checker.h" 42 u64 offset = key->offset; in check_extent_in_eb() 48 if (!ctx->ignore_extent_item_pos && in check_extent_in_eb() 56 if (ctx->extent_item_pos < data_offset || in check_extent_in_eb() 57 ctx->extent_item_pos >= data_offset + data_len) in check_extent_in_eb() [all …]
|
| H A D | ref-verify.c | 1 // SPDX-License-Identifier: GPL-2.0 10 #include "disk-io.h" 12 #include "delayed-ref.h" 13 #include "ref-verify.h" 18 * Used to keep track the roots and number of refs each root has for a given 25 struct rb_node node; member 39 struct rb_node node; member 47 * action so we can account for the history properly, and we record the root we 53 u64 root; member 63 * free it until we unmount the file system in order to make sure re-allocations [all …]
|
| /linux/tools/lib/ |
| H A D | rbtree.c | 1 // 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 t 76 __rb_rotate_set_parents(struct rb_node * old,struct rb_node * new,struct rb_root * root,int color) __rb_rotate_set_parents() argument 85 __rb_insert(struct rb_node * node,struct rb_root * root,void (* augment_rotate)(struct rb_node * old,struct rb_node * new)) __rb_insert() argument 227 ____rb_erase_color(struct rb_node * parent,struct rb_root * root,void (* augment_rotate)(struct rb_node * old,struct rb_node * new)) ____rb_erase_color() argument 230 struct rb_node *node = NULL, *sibling, *tmp1, *tmp2; ____rb_erase_color() local 410 __rb_erase_color(struct rb_node * parent,struct rb_root * root,void (* augment_rotate)(struct rb_node * old,struct rb_node * new)) __rb_erase_color() argument 423 dummy_propagate(struct rb_node * node,struct rb_node * stop) dummy_propagate() argument 433 rb_insert_color(struct rb_node * node,struct rb_root * root) rb_insert_color() argument 438 rb_erase(struct rb_node * node,struct rb_root * root) rb_erase() argument 453 __rb_insert_augmented(struct rb_node * node,struct rb_root * root,void (* augment_rotate)(struct rb_node * old,struct rb_node * new)) __rb_insert_augmented() argument 462 rb_first(const struct rb_root * root) rb_first() argument 474 rb_last(const struct rb_root * root) rb_last() argument 486 rb_next(const struct rb_node * node) rb_next() argument 517 rb_prev(const struct rb_node * node) rb_prev() argument 546 rb_replace_node(struct rb_node * victim,struct rb_node * new,struct rb_root * root) rb_replace_node() argument 561 rb_left_deepest_node(const struct rb_node * node) rb_left_deepest_node() argument 573 rb_next_postorder(const struct rb_node * node) rb_next_postorder() argument 591 rb_first_postorder(const struct rb_root * root) rb_first_postorder() argument [all...] |
| /linux/tools/perf/util/ |
| H A D | strfilter.c | 1 // 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 …]
|
| H A D | callchain.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 20 #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace):\n\n" 77 struct callchain_node node; member 148 /* Indicate valid cursor node for LBR stitch */ 160 struct list_head node; member 172 static inline void callchain_init(struct callchain_root *root) in callchain_init() argument 174 INIT_LIST_HEAD(&root->nod in callchain_init() 184 callchain_cumul_hits(struct callchain_node * node) callchain_cumul_hits() argument 189 callchain_cumul_counts(struct callchain_node * node) callchain_cumul_counts() argument [all...] |
| H A D | block-range.c | 1 // SPDX-License-Identifier: GPL-2.0 2 #include "block-range.h" 8 struct rb_root root; member 18 for (rb = rb_first(&block_ranges.root); rb; rb = rb_next(rb)) { in block_range__debug() 19 struct block_range *entry = rb_entry(rb, struct block_range, node); in block_range__debug() 21 assert(old < entry->start); in block_range__debug() 22 assert(entry->start <= entry->en in block_range__debug() 50 rb_link_left_of_node(struct rb_node * left,struct rb_node * node) rb_link_left_of_node() argument 60 rb_link_right_of_node(struct rb_node * right,struct rb_node * node) rb_link_right_of_node() argument [all...] |
| /linux/include/linux/ |
| H A D | rbtree_augmented.h | 1 /* 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 …]
|
| /linux/tools/include/linux/ |
| H A D | rbtree.h | 1 /* 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 …]
|
| H A D | rbtree_augmented.h | 1 /* 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, 49 rb_insert_augmented(struct rb_node * node,struct rb_root * root,const struct rb_augment_callbacks * augment) rb_insert_augmented() argument 56 rb_insert_augmented_cached(struct rb_node * node,struct rb_root_cached * root,bool newleft,const struct rb_augment_callbacks * augment) rb_insert_augmented_cached() argument 57 rb_insert_augmented_cached(struct rb_node * node,struct rb_root_cached * root,bool newleft,const struct rb_augment_callbacks * augment) rb_insert_augmented_cached() argument 172 __rb_change_child(struct rb_node * old,struct rb_node * new,struct rb_node * parent,struct rb_root * root) __rb_change_child() argument 187 __rb_erase_augmented(struct rb_node * node,struct rb_root * root,const struct rb_augment_callbacks * augment) __rb_erase_augmented() argument 291 rb_erase_augmented(struct rb_node * node,struct rb_root * root,const struct rb_augment_callbacks * augment) rb_erase_augmented() argument 300 rb_erase_augmented_cached(struct rb_node * node,struct rb_root_cached * root,const struct rb_augment_callbacks * augment) rb_erase_augmented_cached() argument [all...] |
| /linux/drivers/block/drbd/ |
| H A D | drbd_interval.c | 1 // SPDX-License-Identifier: GPL-2.0-only 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/Documentation/translations/zh_CN/core-api/ |
| H A D | rbtree.rst | 1 .. SPDX-License-Identifier: GPL-2.0 2 .. include:: ../disclaimer-zh_CN.rst 4 :Original: Documentation/core-api/rbtree.rst 19 -------------------------- 42 https://en.wikipedia.org/wiki/Red-black_tree 45 ----------------- 55 -------------- 60 struct rb_node node; 65 宏访问。此外,个体成员可直接用rb_entry(node, type, member)访问。 72 -------------------- [all …]
|
| /linux/fs/nfs/blocklayout/ |
| H A D | extent_tree.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (c) 2014-2016 Christoph Hellwig. 14 ext_node(struct rb_node *node) in ext_node() argument 16 return rb_entry(node, struct pnfs_block_extent, be_node); in ext_node() 20 ext_tree_first(struct rb_root *root) in ext_tree_first() argument 22 struct rb_node *node = rb_first(root); in ext_tree_first() local 23 return node ? ext_node(node) : NULL; in ext_tree_first() 29 struct rb_node *node = rb_prev(&be->be_node); in ext_tree_prev() local 30 return node ? ext_node(node) : NULL; in ext_tree_prev() 36 struct rb_node *node = rb_next(&be->be_node); in ext_tree_next() local [all …]
|
| /linux/drivers/infiniband/hw/hfi1/ |
| H A D | mmu_rb.c | 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 4 * Copyright(c) 2016 - 2017 Intel Corporation. 29 INTERVAL_TREE_DEFINE(struct mmu_rb_node, node, unsigned long, __last, 32 static unsigned long mmu_node_start(struct mmu_rb_node *node) in mmu_node_start() argument 34 return node->addr & PAGE_MASK; in mmu_node_start() 37 static unsigned long mmu_node_last(struct mmu_rb_node *node) in mmu_node_last() argument 39 return PAGE_ALIGN(node->addr + node->len) - 1; in mmu_node_last() 51 free_ptr = kzalloc(sizeof(*h) + cache_line_size() - 1, GFP_KERNEL); in hfi1_mmu_rb_register() 53 return -ENOMEM; in hfi1_mmu_rb_register() 56 h->root = RB_ROOT_CACHED; in hfi1_mmu_rb_register() [all …]
|
| /linux/drivers/net/ethernet/marvell/octeontx2/nic/ |
| H A D | qos.c | 1 // SPDX-License-Identifier: GPL-2.0 28 struct otx2_hw *hw = &pfvf->hw; in otx2_qos_update_tx_netdev_queues() 31 qos_txqs = bitmap_weight(pfvf->qos.qos_sq_bmap, in otx2_qos_update_tx_netdev_queues() 34 tx_queues = hw->tx_queues + qos_txqs; in otx2_qos_update_tx_netdev_queues() 36 err = netif_set_real_num_tx_queues(pfvf->netdev, tx_queues); in otx2_qos_update_tx_netdev_queues() 38 netdev_err(pfvf->netdev, in otx2_qos_update_tx_netdev_queues() 44 static void otx2_qos_get_regaddr(struct otx2_qos_node *node, in otx2_qos_get_regaddr() argument 48 if (node->level == NIX_TXSCH_LVL_SMQ) { in otx2_qos_get_regaddr() 49 cfg->reg[index++] = NIX_AF_MDQX_PARENT(node->schq); in otx2_qos_get_regaddr() 50 cfg->reg[index++] = NIX_AF_MDQX_SCHEDULE(node->schq); in otx2_qos_get_regaddr() [all …]
|
| /linux/drivers/infiniband/hw/usnic/ |
| H A D | usnic_uiom_interval_tree.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 42 #define START(node) ((node)->start) argument 43 #define LAST(node) ((node)->last) argument 45 #define MAKE_NODE(node, start, end, ref_cnt, flags, err, err_out) \ argument 47 node = usnic_uiom_interval_node_alloc(start, \ 49 if (!node) { \ 50 err = -ENOMEM; \ 55 #define MARK_FOR_ADD(node, list) (list_add_tail(&node->link, list)) argument 57 #define MAKE_NODE_AND_APPEND(node, start, end, ref_cnt, flags, err, \ argument [all …]
|
| /linux/tools/net/sunrpc/xdrgen/subcmds/ |
| H A D | source.py | 33 def emit_source_decoder(node: _XdrAst, language: str, peer: str) -> None: 35 if isinstance(node, _XdrEnum): 37 elif isinstance(node, _XdrPointer): 39 elif isinstance(node, _XdrTypedef): 41 elif isinstance(node, _XdrStruct): 43 elif isinstance(node, _XdrUnion): 45 elif isinstance(node, _RpcProgram): 49 gen.emit_decoder(node) 52 def emit_source_encoder(node: _XdrAst, language: str, peer: str) -> None: 54 if isinstance(node, _XdrEnum): [all …]
|
| /linux/tools/testing/radix-tree/ |
| H A D | test.c | 1 // SPDX-License-Identifier: GPL-2.0 12 item_tag_set(struct radix_tree_root *root, unsigned long index, int tag) in item_tag_set() argument 14 return radix_tree_tag_set(root, index, tag); in item_tag_set() 18 item_tag_clear(struct radix_tree_root *root, unsigned long index, int tag) in item_tag_clear() argument 20 return radix_tree_tag_clear(root, index, tag); in item_tag_clear() 23 int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag) in item_tag_get() argument 25 return radix_tree_tag_get(root, index, tag); in item_tag_get() 32 ret->index = index; in item_create() 33 ret->order = order; in item_create() 37 int item_insert(struct radix_tree_root *root, unsigned long index) in item_insert() argument [all …]
|