Lines Matching refs:path

50 	struct btrfs_path *path;  in btrfs_insert_file_extent()  local
53 path = btrfs_alloc_path(); in btrfs_insert_file_extent()
54 if (!path) in btrfs_insert_file_extent()
60 path->leave_spinning = 1; in btrfs_insert_file_extent()
61 ret = btrfs_insert_empty_item(trans, root, path, &file_key, in btrfs_insert_file_extent()
66 leaf = path->nodes[0]; in btrfs_insert_file_extent()
67 item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_insert_file_extent()
82 btrfs_free_path(path); in btrfs_insert_file_extent()
89 struct btrfs_path *path, in btrfs_lookup_csum() argument
104 ret = btrfs_search_slot(trans, root, &file_key, path, 0, cow); in btrfs_lookup_csum()
107 leaf = path->nodes[0]; in btrfs_lookup_csum()
110 if (path->slots[0] == 0) in btrfs_lookup_csum()
112 path->slots[0]--; in btrfs_lookup_csum()
113 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_lookup_csum()
119 csums_in_item = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_lookup_csum()
129 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item); in btrfs_lookup_csum()
141 struct btrfs_path *path, u64 objectid, in btrfs_lookup_file_extent() argument
152 ret = btrfs_search_slot(trans, root, &file_key, path, ins_len, cow); in btrfs_lookup_file_extent()
169 struct btrfs_path *path; in __btrfs_lookup_bio_sums() local
181 path = btrfs_alloc_path(); in __btrfs_lookup_bio_sums()
182 if (!path) in __btrfs_lookup_bio_sums()
191 btrfs_free_path(path); in __btrfs_lookup_bio_sums()
205 path->reada = 2; in __btrfs_lookup_bio_sums()
216 path->search_commit_root = 1; in __btrfs_lookup_bio_sums()
217 path->skip_locking = 1; in __btrfs_lookup_bio_sums()
237 btrfs_release_path(path); in __btrfs_lookup_bio_sums()
239 path, disk_bytenr, 0); in __btrfs_lookup_bio_sums()
254 btrfs_release_path(path); in __btrfs_lookup_bio_sums()
257 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in __btrfs_lookup_bio_sums()
258 path->slots[0]); in __btrfs_lookup_bio_sums()
261 item_size = btrfs_item_size_nr(path->nodes[0], in __btrfs_lookup_bio_sums()
262 path->slots[0]); in __btrfs_lookup_bio_sums()
266 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in __btrfs_lookup_bio_sums()
278 read_extent_buffer(path->nodes[0], csum, in __btrfs_lookup_bio_sums()
291 btrfs_free_path(path); in __btrfs_lookup_bio_sums()
311 struct btrfs_path *path; in btrfs_lookup_csums_range() local
325 path = btrfs_alloc_path(); in btrfs_lookup_csums_range()
326 if (!path) in btrfs_lookup_csums_range()
330 path->skip_locking = 1; in btrfs_lookup_csums_range()
331 path->reada = 2; in btrfs_lookup_csums_range()
332 path->search_commit_root = 1; in btrfs_lookup_csums_range()
339 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_lookup_csums_range()
342 if (ret > 0 && path->slots[0] > 0) { in btrfs_lookup_csums_range()
343 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
344 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1); in btrfs_lookup_csums_range()
350 btrfs_item_size_nr(leaf, path->slots[0] - 1)) in btrfs_lookup_csums_range()
351 path->slots[0]--; in btrfs_lookup_csums_range()
356 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
357 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_lookup_csums_range()
358 ret = btrfs_next_leaf(root, path); in btrfs_lookup_csums_range()
363 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
366 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_lookup_csums_range()
375 size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_lookup_csums_range()
378 path->slots[0]++; in btrfs_lookup_csums_range()
383 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_lookup_csums_range()
403 read_extent_buffer(path->nodes[0], in btrfs_lookup_csums_range()
411 path->slots[0]++; in btrfs_lookup_csums_range()
422 btrfs_free_path(path); in btrfs_lookup_csums_range()
517 struct btrfs_path *path, in truncate_one_csum() argument
527 leaf = path->nodes[0]; in truncate_one_csum()
528 csum_end = btrfs_item_size_nr(leaf, path->slots[0]) / csum_size; in truncate_one_csum()
541 btrfs_truncate_item(root, path, new_size, 1); in truncate_one_csum()
553 btrfs_truncate_item(root, path, new_size, 0); in truncate_one_csum()
556 btrfs_set_item_key_safe(root->fs_info, path, key); in truncate_one_csum()
569 struct btrfs_path *path; in btrfs_del_csums() local
580 path = btrfs_alloc_path(); in btrfs_del_csums()
581 if (!path) in btrfs_del_csums()
589 path->leave_spinning = 1; in btrfs_del_csums()
590 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_csums()
592 if (path->slots[0] == 0) in btrfs_del_csums()
594 path->slots[0]--; in btrfs_del_csums()
599 leaf = path->nodes[0]; in btrfs_del_csums()
600 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_del_csums()
610 csum_end = btrfs_item_size_nr(leaf, path->slots[0]) / csum_size; in btrfs_del_csums()
620 ret = btrfs_del_item(trans, root, path); in btrfs_del_csums()
653 path->slots[0]); in btrfs_del_csums()
663 ret = btrfs_split_item(trans, root, path, &key, offset); in btrfs_del_csums()
671 truncate_one_csum(root, path, &key, bytenr, len); in btrfs_del_csums()
675 btrfs_release_path(path); in btrfs_del_csums()
679 btrfs_free_path(path); in btrfs_del_csums()
689 struct btrfs_path *path; in btrfs_csum_file_blocks() local
704 path = btrfs_alloc_path(); in btrfs_csum_file_blocks()
705 if (!path) in btrfs_csum_file_blocks()
715 item = btrfs_lookup_csum(trans, root, path, bytenr, 1); in btrfs_csum_file_blocks()
718 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
719 item_end = btrfs_item_ptr(leaf, path->slots[0], in btrfs_csum_file_blocks()
722 btrfs_item_size_nr(leaf, path->slots[0])); in btrfs_csum_file_blocks()
732 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
733 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_csum_file_blocks()
740 int slot = path->slots[0] + 1; in btrfs_csum_file_blocks()
742 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_csum_file_blocks()
743 if (!nritems || (path->slots[0] >= nritems - 1)) { in btrfs_csum_file_blocks()
744 ret = btrfs_next_leaf(root, path); in btrfs_csum_file_blocks()
749 slot = path->slots[0]; in btrfs_csum_file_blocks()
751 btrfs_item_key_to_cpu(path->nodes[0], &found_key, slot); in btrfs_csum_file_blocks()
766 btrfs_release_path(path); in btrfs_csum_file_blocks()
767 ret = btrfs_search_slot(trans, root, &file_key, path, in btrfs_csum_file_blocks()
773 if (path->slots[0] == 0) in btrfs_csum_file_blocks()
775 path->slots[0]--; in btrfs_csum_file_blocks()
778 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
779 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_csum_file_blocks()
789 if (csum_offset == btrfs_item_size_nr(leaf, path->slots[0]) / in btrfs_csum_file_blocks()
810 diff = diff - btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_csum_file_blocks()
815 btrfs_extend_item(root, path, diff); in btrfs_csum_file_blocks()
821 btrfs_release_path(path); in btrfs_csum_file_blocks()
837 path->leave_spinning = 1; in btrfs_csum_file_blocks()
838 ret = btrfs_insert_empty_item(trans, root, path, &file_key, in btrfs_csum_file_blocks()
840 path->leave_spinning = 0; in btrfs_csum_file_blocks()
845 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
847 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item); in btrfs_csum_file_blocks()
849 btrfs_item_size_nr(leaf, path->slots[0])); in btrfs_csum_file_blocks()
865 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_csum_file_blocks()
867 btrfs_release_path(path); in btrfs_csum_file_blocks()
872 btrfs_free_path(path); in btrfs_csum_file_blocks()
880 const struct btrfs_path *path, in btrfs_extent_item_to_extent_map() argument
886 struct extent_buffer *leaf = path->nodes[0]; in btrfs_extent_item_to_extent_map()
887 const int slot = path->slots[0]; in btrfs_extent_item_to_extent_map()