Lines Matching refs:node

114  * safely gets a reference on the root node of a tree.  A lock
115 * is not taken, so a concurrent writer may put a different node
129 eb = rcu_dereference(root->node);
132 * RCU really hurts here, we could free up the root node because
133 * it was COWed but we may not get the new root node yet so do
175 * a given objectid. The buffer with the new root node is returned in
252 struct rb_node node;
310 struct rb_node *node;
344 for (node = rb_first(tm_root); node; node = next) {
345 next = rb_next(node);
346 tm = rb_entry(node, struct tree_mod_elem, node);
349 rb_erase(node, tm_root);
357 * node/leaf start address -> sequence
359 * The 'start address' is the logical address of the *new* root node
378 cur = rb_entry(*new, struct tree_mod_elem, node);
392 rb_link_node(&tm->node, parent, new);
393 rb_insert_color(&tm->node, tm_root);
451 RB_CLEAR_NODE(&tm->node);
543 if (tm_list[i] && !RB_EMPTY_NODE(&tm_list[i]->node))
544 rb_erase(&tm_list[i]->node, &eb->fs_info->tree_mod_log);
567 rb_erase(&tm_list[j]->node,
650 struct rb_node *node;
656 node = tm_root->rb_node;
657 while (node) {
658 cur = rb_entry(node, struct tree_mod_elem, node);
660 node = node->rb_left;
662 node = node->rb_right;
664 node = node->rb_left;
666 /* we want the node with the highest seq */
670 node = node->rb_left;
672 /* we want the node with the smallest seq */
676 node = node->rb_right;
770 if (tm_list[i] && !RB_EMPTY_NODE(&tm_list[i]->node))
771 rb_erase(&tm_list[i]->node, &fs_info->tree_mod_log);
839 buf != root->node && buf != root->commit_root &&
971 * If we are COWing a node/leaf from the extent, chunk, device or free
982 * groups when splitting a leaf or node, from one of those trees, since
984 * new root node for one of those trees.
1086 if (buf == root->node) {
1093 ret = tree_mod_log_insert_root(root->node, cow, 1);
1095 rcu_assign_pointer(root->node, cow);
1241 * for non-roots, this operation may exist if the node
1249 next = rb_next(&tm->node);
1252 tm = rb_entry(next, struct tree_mod_elem, node);
1323 * get_old_root() rewinds the state of @root's root node to the given @time_seq
1532 * node are actually close by
1595 * leaves pointed to by a node and reallocate them so that
1812 /* given a node and slot number, this reads the blocks it points to. The
1840 * node level balancing, used to make sure nodes are in proper order for
1842 * that a deletion won't leave an node completely empty later on.
1876 * by promoting the node below to a root
1902 ret = tree_mod_log_insert_root(root->node, child, 1);
1904 rcu_assign_pointer(root->node, child);
1993 * we're not allowed to leave a node with one item in the
1995 * could try to delete the only pointer in this node.
2214 * readahead one full node of leaves, finding things that are close
2221 struct extent_buffer *node;
2238 node = path->nodes[level];
2240 search = btrfs_node_blockptr(node, slot);
2250 nritems = btrfs_header_nritems(node);
2264 btrfs_node_key(node, &disk_key, nr);
2268 search = btrfs_node_blockptr(node, nr);
2450 * level because we need to walk this node to figure
2482 * for node-level blocks and does any balancing required based on
2641 * We don't know the level of the root node until we actually
2688 * @root: The root node of the tree
2779 * must have write locks on this node and the
2838 * lowest key in the child node, thus we can skip searching
3139 * making sure the right key of each node is points to 'key'.
3141 * fixing up pointers when a given leaf/node is not in slot 0 of the
3273 * try to push data from one node into the next node left in the
3304 /* leave at least 8 pointers in the node if
3351 * try to push data from one node into the next node right in the
3357 * this will only push up to 1/2 the contents of the left node over
3383 /* don't try to empty the node */
3425 * A new node is allocated, and a single item is inserted to
3443 BUG_ON(path->nodes[level-1] != root->node);
3452 root->node->start, 0,
3469 old = root->node;
3470 ret = tree_mod_log_insert_root(root->node, c, 0);
3472 rcu_assign_pointer(root->node, c);
3474 /* the super has an extra ref to root->node */
3486 * worker function to insert a single pointer in a node.
3487 * the node should have enough room for the pointer already
3532 * split the node at the specified level in path in two.
3533 * The path is corrected to point to the appropriate node after the split
3535 * Before splitting this tries to make some room in the node by pushing
3554 if (c == root->node) {
3560 * normal node. We are going to log removal of half of the
3817 * returns 1 if the push failed because the other node didn't have enough
3848 * slot + 1 is not valid or we fail to read the right node,
3996 /* fixup right node */
4088 * slot - 1 is not valid or we fail to read the left node,
4580 * new item is going to be in the same node as the old one.
4967 * delete the pointer from a given node.
4970 * empty a node.
4999 if (nritems == 0 && parent == root->node) {
5000 BUG_ON(btrfs_header_level(root->node) != 1);
5002 btrfs_set_header_level(root->node, 0);
5095 if (leaf == root->node) {
5301 * check this node pointer against the min_trans parameters.
5316 * we didn't find a candidate key in this node, walk forward