Lines Matching defs:path
472 struct btrfs_root *root, struct btrfs_path *path,
491 eb = path->nodes[level];
499 * 1. We normally enter this function with the path already pointing to
508 eb = path->nodes[0];
509 if (path->slots[0] >= btrfs_header_nritems(eb) ||
513 ret = btrfs_next_leaf(root, path);
515 ret = btrfs_next_old_leaf(root, path, ctx->time_seq);
519 eb = path->nodes[0];
520 slot = path->slots[0];
537 ret = btrfs_next_leaf(root, path);
539 ret = btrfs_next_old_leaf(root, path, ctx->time_seq);
577 ret = btrfs_next_item(root, path);
579 ret = btrfs_next_old_item(root, path, ctx->time_seq);
595 struct btrfs_path *path,
614 if (path->search_commit_root)
615 root = btrfs_get_fs_root_commit_root(ctx->fs_info, path, ref->root_id);
623 if (!path->search_commit_root &&
634 if (path->search_commit_root)
666 path->lowest_level = level;
668 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
670 ret = btrfs_search_old_slot(root, &search_key, path, ctx->time_seq);
680 eb = path->nodes[level];
687 eb = path->nodes[level];
690 ret = add_all_parents(ctx, root, path, parents, preftrees, ref, level);
694 path->lowest_level = 0;
695 btrfs_release_path(path);
736 struct btrfs_path *path,
780 err = resolve_indirect_ref(ctx, path, preftrees, ref, parents);
1017 struct btrfs_path *path,
1035 leaf = path->nodes[0];
1036 slot = path->slots[0];
1150 struct btrfs_path *path,
1161 ret = btrfs_next_item(extent_root, path);
1169 slot = path->slots[0];
1170 leaf = path->nodes[0];
1359 * extent buffers below it to true. As nodes in the path are COWed,
1392 struct btrfs_path *path;
1417 path = btrfs_alloc_path();
1418 if (!path)
1421 path->search_commit_root = 1;
1422 path->skip_locking = 1;
1426 path->skip_locking = 1;
1431 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
1445 * means we have the path lock, we need to grab the ref head and
1457 btrfs_release_path(path);
1479 if (path->slots[0]) {
1483 path->slots[0]--;
1484 leaf = path->nodes[0];
1485 slot = path->slots[0];
1490 ret = add_inline_refs(ctx, path, &info_level,
1494 ret = add_keyed_refs(ctx, root, path, info_level,
1518 * multiple reference items), so we have to check if a path in the fs
1521 * of the extent buffers in the path is referenced by other trees.
1529 * determining the extent buffers for the path from the fs tree
1543 * indirect references for a data extent, since the fs tree path
1544 * is the same (same leaf, so same path). We skip as long as the
1568 btrfs_release_path(path);
1570 ret = add_missing_keys(ctx->fs_info, &preftrees, path->skip_locking == 0);
1576 ret = resolve_indirect_refs(ctx, path, &preftrees, sc);
1629 if (!path->skip_locking)
1632 if (!path->skip_locking)
1683 btrfs_free_path(path);
1946 * use the path cache which is made for a single path. Multiple
1960 * cache only works for a single path (by far the most common
2000 * If the path cache is disabled, then it means at some tree level we
2050 u64 start_off, struct btrfs_path *path,
2065 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2070 leaf = path->nodes[0];
2071 slot = path->slots[0];
2082 ret = btrfs_next_leaf(root, path);
2106 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
2118 * this iterates to turn a name (from iref/extref) into a full filesystem path.
2119 * Elements of the path are separated by '/' and the path is guaranteed to be
2120 * 0-terminated. the path is only given within the current file system.
2125 * in case the path buffer would overflow, the pointer is decremented further
2128 * required for the path to fit into the buffer. in that case, the returned
2131 char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path,
2153 if (!path->skip_locking)
2157 ret = btrfs_find_item(fs_root, path, parent, 0,
2170 slot = path->slots[0];
2171 eb = path->nodes[0];
2172 /* make sure we can use eb after releasing the path */
2174 path->nodes[0] = NULL;
2175 path->locks[0] = 0;
2177 btrfs_release_path(path);
2189 btrfs_release_path(path);
2198 * this makes the path point to (logical EXTENT_ITEM *)
2203 struct btrfs_path *path, struct btrfs_key *found_key,
2222 ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0);
2226 ret = btrfs_previous_extent_item(extent_root, path, 0);
2232 btrfs_item_key_to_cpu(path->nodes[0], found_key, path->slots[0]);
2245 eb = path->nodes[0];
2246 item_size = btrfs_item_size(eb, path->slots[0]);
2249 ei = btrfs_item_ptr(eb, path->slots[0], struct btrfs_extent_item);
2551 struct btrfs_path *path,
2558 int search_commit_root = path->search_commit_root;
2560 ret = extent_from_logical(fs_info, logical, path, &found_key, &flags);
2561 btrfs_release_path(path);
2591 struct btrfs_path *path = ipath->btrfs_path;
2597 ret = btrfs_find_item(fs_root, path, inum,
2610 slot = path->slots[0];
2611 eb = btrfs_clone_extent_buffer(path->nodes[0]);
2616 btrfs_release_path(path);
2622 /* path must be released before calling iterate()! */
2637 btrfs_release_path(path);
2650 struct btrfs_path *path = ipath->btrfs_path;
2658 ret = btrfs_find_one_extref(fs_root, inum, offset, path, &extref,
2668 slot = path->slots[0];
2669 eb = btrfs_clone_extent_buffer(path->nodes[0]);
2674 btrfs_release_path(path);
2699 btrfs_release_path(path);
2705 * returns 0 if the path could be dumped (probably truncated)
2741 * is has been created large enough. each path is zero-terminated and accessed
2793 * total_bytes to allocate are passed, note that space usable for actual path
2798 struct btrfs_path *path)
2813 ifp->btrfs_path = path;
2836 ret->path = btrfs_alloc_path();
2837 if (!ret->path) {
2843 ret->path->search_commit_root = 1;
2844 ret->path->skip_locking = 1;
2854 struct btrfs_path *path = iter->path;
2864 ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0);
2871 if (path->slots[0] == 0) {
2876 path->slots[0]--;
2878 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
2885 iter->item_ptr = (u32)btrfs_item_ptr_offset(path->nodes[0],
2886 path->slots[0]);
2888 btrfs_item_size(path->nodes[0], path->slots[0]));
2889 ei = btrfs_item_ptr(path->nodes[0], path->slots[0],
2899 if (btrfs_extent_flags(path->nodes[0], ei) & BTRFS_EXTENT_FLAG_DATA) {
2907 ret = btrfs_next_item(extent_root, path);
2917 btrfs_item_key_to_cpu(path->nodes[0], &iter->cur_key,
2918 path->slots[0]);
2925 iter->cur_ptr = (u32)btrfs_item_ptr_offset(path->nodes[0],
2926 path->slots[0]);
2929 path->nodes[0], path->slots[0]));
2952 struct btrfs_path *path = iter->path;
2983 ret = btrfs_next_item(extent_root, iter->path);
2987 btrfs_item_key_to_cpu(path->nodes[0], &iter->cur_key, path->slots[0]);
2992 iter->item_ptr = (u32)btrfs_item_ptr_offset(path->nodes[0],
2993 path->slots[0]);
2995 iter->end_ptr = iter->item_ptr + (u32)btrfs_item_size(path->nodes[0],
2996 path->slots[0]);
3051 * upper edges and any uncached nodes in the path.
3202 * @path: A clean (released) path, to avoid allocating path every time
3207 struct btrfs_path *path,
3254 path->search_commit_root = 1;
3255 path->skip_locking = 1;
3256 path->lowest_level = level;
3257 ret = btrfs_search_slot(NULL, root, tree_key, path, 0, 0);
3258 path->lowest_level = 0;
3263 if (ret > 0 && path->slots[level] > 0)
3264 path->slots[level]--;
3266 eb = path->nodes[level];
3267 if (btrfs_node_blockptr(eb, path->slots[level]) != cur->bytenr) {
3278 /* Add all nodes and edges in the path */
3280 if (!path->nodes[level]) {
3301 eb = path->nodes[level];
3357 btrfs_release_path(path);
3369 * @path: Released path for indirect tree backref lookup
3375 struct btrfs_path *path,
3474 ret = handle_indirect_tree_backref(trans, cache, path,