Lines Matching defs:path

24 	struct btrfs_path path;
32 btrfs_init_path(&path);
34 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0);
41 fi = btrfs_item_ptr(path.nodes[0], path.slots[0],
43 if (btrfs_file_extent_type(path.nodes[0], fi) !=
49 if (btrfs_file_extent_compression(path.nodes[0], fi) !=
55 if (btrfs_file_extent_ram_bytes(path.nodes[0], fi) >=
59 ino, btrfs_file_extent_ram_bytes(path.nodes[0], fi));
62 read_extent_buffer(path.nodes[0], target,
64 btrfs_file_extent_ram_bytes(path.nodes[0], fi));
65 ret = btrfs_file_extent_ram_bytes(path.nodes[0], fi);
67 btrfs_release_path(&path);
76 struct btrfs_path path;
80 btrfs_init_path(&path);
85 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0);
93 ret = btrfs_previous_item(root, &path, rootid, BTRFS_ROOT_BACKREF_KEY);
100 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
101 root_ref = btrfs_item_ptr(path.nodes[0], path.slots[0],
104 *dir_ret = btrfs_root_ref_dirid(path.nodes[0], root_ref);
106 btrfs_release_path(&path);
123 struct btrfs_path path;
152 btrfs_init_path(&path);
157 ret = btrfs_search_slot(NULL, root, &key, &path, 0, 0);
165 ret = btrfs_previous_item(root, &path, ino, BTRFS_INODE_REF_KEY);
172 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
176 btrfs_release_path(&path);
180 static inline int next_length(const char *path)
183 while (*path != '\0' && *path != '/') {
185 ++path;
220 struct btrfs_path path;
223 btrfs_init_path(&path);
225 dir_item = btrfs_lookup_dir_item(NULL, root, &path, ino, name,
232 btrfs_dir_item_key_to_cpu(path.nodes[0], dir_item, key_ret);
233 *type_ret = btrfs_dir_type(path.nodes[0], dir_item);
235 btrfs_release_path(&path);
240 * Resolve a full path @filename. The start point is @ino of @root.
258 /* If the path is absolute path, also search from fs root */
361 int btrfs_read_extent_inline(struct btrfs_path *path,
364 struct extent_buffer *leaf = path->nodes[0];
365 int slot = path->slots[0];
420 int btrfs_read_extent_reg(struct btrfs_path *path,
424 struct extent_buffer *leaf = path->nodes[0];
437 int slot = path->slots[0];
529 * return 0 for found, and path points to the file extent.
534 static int lookup_data_extent(struct btrfs_root *root, struct btrfs_path *path,
547 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
552 ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY);
558 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
563 fi = btrfs_item_ptr(path->nodes[0], path->slots[0],
565 extent_type = btrfs_file_extent_type(path->nodes[0], fi);
576 btrfs_file_extent_num_bytes(path->nodes[0], fi) > file_offset)
579 ret = btrfs_next_item(root, path);
587 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
588 fi = btrfs_item_ptr(path->nodes[0], path->slots[0],
603 btrfs_file_extent_num_bytes(path->nodes[0], fi) > file_offset)
606 ret = btrfs_next_item(root, path);
613 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
622 static int read_and_truncate_page(struct btrfs_path *path,
626 struct extent_buffer *leaf = path->nodes[0];
642 ret = btrfs_read_extent_inline(path, fi, buf);
648 ret = btrfs_read_extent_reg(path, fi,
665 struct btrfs_path path;
673 btrfs_init_path(&path);
680 ret = lookup_data_extent(root, &path, ino, aligned_start,
686 fi = btrfs_item_ptr(path.nodes[0], path.slots[0],
688 ret = read_and_truncate_page(&path, fi, file_offset,
709 btrfs_release_path(&path);
710 ret = lookup_data_extent(root, &path, ino, cur, &next_offset);
728 fi = btrfs_item_ptr(path.nodes[0], path.slots[0],
730 btrfs_item_key_to_cpu(path.nodes[0], &key, path.slots[0]);
731 type = btrfs_file_extent_type(path.nodes[0], fi);
733 ret = btrfs_read_extent_inline(&path, fi, dest);
738 btrfs_file_extent_disk_bytenr(path.nodes[0], fi) == 0) {
740 path.nodes[0], fi);
745 extent_num_bytes = btrfs_file_extent_num_bytes(path.nodes[0],
747 ret = btrfs_read_extent_reg(&path, fi, cur,
757 btrfs_release_path(&path);
758 ret = lookup_data_extent(root, &path, ino, aligned_end,
763 fi = btrfs_item_ptr(path.nodes[0], path.slots[0],
765 ret = read_and_truncate_page(&path, fi, aligned_end,
770 btrfs_release_path(&path);