Lines Matching defs:path
435 struct btrfs_path *path = NULL;
446 path = btrfs_alloc_path();
447 if (!path) {
474 path->keep_locks = true;
476 ret = btrfs_search_forward(root, &key, path, BTRFS_OLDEST_GENERATION);
483 btrfs_release_path(path);
486 * leafs from path->nodes[1], so set lowest_level to 1 to avoid later
489 path->lowest_level = 1;
490 wret = btrfs_search_slot(trans, root, &key, path, 0, 1);
496 if (!path->nodes[1]) {
501 * The node at level 1 must always be locked when our path has
503 * path->slots[1].
505 ASSERT(path->locks[1] != 0);
507 path->nodes[1], 0,
516 * btrfs_find_next_key() can release our path and do another search
517 * without COWing, this is because even with path->keep_locks == true,
519 * node when path->slots[node_level - 1] does not point to the last
523 path->slots[1] = btrfs_header_nritems(path->nodes[1]);
524 next_key_ret = btrfs_find_next_key(root, path, &key, 1,
531 btrfs_free_path(path);
612 struct btrfs_path path = { 0 };
629 ret = btrfs_search_forward(root, &key, &path, newer_than);
636 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0);
640 if (path.slots[0] >= btrfs_header_nritems(path.nodes[0])) {
642 * If btrfs_search_slot() makes path to point beyond nritems,
646 ASSERT(btrfs_header_nritems(path.nodes[0]));
647 path.slots[0] = btrfs_header_nritems(path.nodes[0]) - 1;
649 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
656 if (path.slots[0] > 0) {
657 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
659 path.slots[0]--;
663 /* Iterate through the path to find a file extent covering @start */
667 if (path.slots[0] >= btrfs_header_nritems(path.nodes[0]))
670 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
700 fi = btrfs_item_ptr(path.nodes[0], path.slots[0],
702 extent_end = btrfs_file_extent_end(&path);
714 btrfs_extent_item_to_extent_map(inode, &path, fi, em);
717 ret = btrfs_next_item(root, &path);
723 btrfs_release_path(&path);
727 btrfs_release_path(&path);
732 btrfs_release_path(&path);