Lines Matching refs:path

2458 	 * btrfs_next_leaf() releases the path, there's an ordered extent that
2464 * will leave us with a path pointing to the new extent item, for the
2473 * it, but after btrfs_next_leaf() released the path, delalloc was
2609 static int fiemap_next_leaf_item(struct btrfs_inode *inode, struct btrfs_path *path)
2616 path->slots[0]++;
2617 if (path->slots[0] < btrfs_header_nritems(path->nodes[0]))
2620 ret = btrfs_next_leaf(inode->root, path);
2628 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
2633 clone = btrfs_clone_extent_buffer(path->nodes[0]);
2637 slot = path->slots[0];
2638 btrfs_release_path(path);
2639 path->nodes[0] = clone;
2640 path->slots[0] = slot;
2650 static int fiemap_search_slot(struct btrfs_inode *inode, struct btrfs_path *path,
2664 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2668 if (ret > 0 && path->slots[0] > 0) {
2669 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0] - 1);
2671 path->slots[0]--;
2674 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) {
2675 ret = btrfs_next_leaf(root, path);
2679 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
2700 clone = btrfs_clone_extent_buffer(path->nodes[0]);
2704 slot = path->slots[0];
2705 btrfs_release_path(path);
2706 path->nodes[0] = clone;
2707 path->slots[0] = slot;
2836 struct btrfs_path *path,
2851 ret = btrfs_lookup_file_extent(NULL, root, path, ino, (u64)-1, 0);
2863 ASSERT(path->slots[0] > 0);
2864 path->slots[0]--;
2865 leaf = path->nodes[0];
2866 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
2878 ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item);
2880 *last_extent_end_ret = btrfs_file_extent_end(path);
2893 ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY);
2901 leaf = path->nodes[0];
2902 ei = btrfs_item_ptr(leaf, path->slots[0],
2907 *last_extent_end_ret = btrfs_file_extent_end(path);
2917 struct btrfs_path *path;
2928 path = btrfs_alloc_path();
2929 if (!backref_ctx || !path) {
2941 ret = fiemap_find_last_extent_offset(inode, path, &last_extent_end);
2944 btrfs_release_path(path);
2946 path->reada = READA_FORWARD;
2947 ret = fiemap_search_slot(inode, path, lockstart);
2960 struct extent_buffer *leaf = path->nodes[0];
2972 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
2976 extent_end = btrfs_file_extent_end(path);
3011 ei = btrfs_item_ptr(leaf, path->slots[0],
3077 ret = fiemap_next_leaf_item(inode, path);
3089 * Release (and free) the path before emitting any final entries to
3095 btrfs_free_path(path);
3096 path = NULL;
3136 btrfs_free_path(path);
3648 * Thus needs no special handling in error path.