Lines Matching refs:path

349 	struct btrfs_path *path = NULL;
360 path = btrfs_alloc_path();
361 if (!path) {
388 path->keep_locks = 1;
390 ret = btrfs_search_forward(root, &key, path, BTRFS_OLDEST_GENERATION);
397 btrfs_release_path(path);
400 * leafs from path->nodes[1], so set lowest_level to 1 to avoid later
403 path->lowest_level = 1;
404 wret = btrfs_search_slot(trans, root, &key, path, 0, 1);
410 if (!path->nodes[1]) {
415 * The node at level 1 must always be locked when our path has
417 * path->slots[1].
419 BUG_ON(path->locks[1] == 0);
421 path->nodes[1], 0,
430 * btrfs_find_next_key() can release our path and do another search
431 * without COWing, this is because even with path->keep_locks = 1,
433 * node when path->slots[node_level - 1] does not point to the last
437 path->slots[1] = btrfs_header_nritems(path->nodes[1]);
438 next_key_ret = btrfs_find_next_key(root, path, &key, 1,
445 btrfs_free_path(path);
487 struct btrfs_path path = { 0 };
504 ret = btrfs_search_forward(root, &key, &path, newer_than);
511 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0);
515 if (path.slots[0] >= btrfs_header_nritems(path.nodes[0])) {
517 * If btrfs_search_slot() makes path to point beyond nritems,
521 ASSERT(btrfs_header_nritems(path.nodes[0]));
522 path.slots[0] = btrfs_header_nritems(path.nodes[0]) - 1;
524 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
531 if (path.slots[0] > 0) {
532 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
534 path.slots[0]--;
538 /* Iterate through the path to find a file extent covering @start */
542 if (path.slots[0] >= btrfs_header_nritems(path.nodes[0]))
545 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
573 fi = btrfs_item_ptr(path.nodes[0], path.slots[0],
575 extent_end = btrfs_file_extent_end(&path);
587 btrfs_extent_item_to_extent_map(inode, &path, fi, em);
590 ret = btrfs_next_item(root, &path);
596 btrfs_release_path(&path);
600 btrfs_release_path(&path);
605 btrfs_release_path(&path);