Lines Matching defs:path

49 	struct btrfs_path *path;
50 path = kzalloc(sizeof(struct btrfs_path), GFP_NOFS);
51 return path;
216 struct btrfs_path *path, int level)
223 if (path->nodes[level + 1]) {
224 parent = path->nodes[level + 1];
225 btrfs_node_key(parent, &key, path->slots[level + 1]);
229 ret = btrfs_check_leaf(fs_info, key_ptr, path->nodes[0]);
231 ret = btrfs_check_node(fs_info, key_ptr, path->nodes[level]);
335 struct btrfs_path *path;
342 path = btrfs_alloc_path();
343 if (!path)
346 path = found_path;
348 ret = btrfs_search_slot(NULL, fs_root, &key, path, 0, 0);
352 eb = path->nodes[0];
353 if (ret && path->slots[0] >= btrfs_header_nritems(eb)) {
354 ret = btrfs_next_leaf(fs_root, path);
357 eb = path->nodes[0];
360 btrfs_item_key_to_cpu(eb, found_key, path->slots[0]);
368 if (path != found_path)
369 btrfs_free_path(path);
374 * look for key in the tree. path is filled in with nodes along the way
376 * level of the path (level 0)
378 * If the key isn't found, the path points to the slot where it should
509 * A return value of 1 means the path is at the position where the item
511 * case the previous item is the last in a leaf, path points to the
605 int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
614 if (!path->nodes[level])
617 slot = path->slots[level];
618 c = path->nodes[level];
635 path->slots[level] = slot;
638 c = path->nodes[level];
643 path->nodes[level] = next;
644 path->slots[level] = slot;
660 * if @path->lowest_level is not 0.
666 struct btrfs_path *path)
669 int level = path->lowest_level + 1;
673 BUG_ON(path->lowest_level + 1 >= BTRFS_MAX_LEVEL);
675 if (!path->nodes[level])
678 slot = path->slots[level] + 1;
679 c = path->nodes[level];
692 path->slots[level] = slot;
695 c = path->nodes[level];
697 path->nodes[level] = next;
698 path->slots[level] = 0;
699 if (level == path->lowest_level)
709 struct btrfs_path *path, u64 min_objectid,
718 if (path->slots[0] == 0) {
719 ret = btrfs_prev_leaf(root, path);
723 path->slots[0]--;
725 leaf = path->nodes[0];
729 if (path->slots[0] == nritems)
730 path->slots[0]--;
732 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);