Lines Matching refs:path

38 	struct btrfs_path *path;  in btrfs_insert_file_extent()  local
41 path = btrfs_alloc_path(); in btrfs_insert_file_extent()
42 if (!path) in btrfs_insert_file_extent()
48 path->leave_spinning = 1; in btrfs_insert_file_extent()
49 ret = btrfs_insert_empty_item(trans, root, path, &file_key, in btrfs_insert_file_extent()
54 leaf = path->nodes[0]; in btrfs_insert_file_extent()
55 item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_insert_file_extent()
70 btrfs_free_path(path); in btrfs_insert_file_extent()
77 struct btrfs_path *path, in btrfs_lookup_csum() argument
93 ret = btrfs_search_slot(trans, root, &file_key, path, 0, cow); in btrfs_lookup_csum()
96 leaf = path->nodes[0]; in btrfs_lookup_csum()
99 if (path->slots[0] == 0) in btrfs_lookup_csum()
101 path->slots[0]--; in btrfs_lookup_csum()
102 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_lookup_csum()
108 csums_in_item = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_lookup_csum()
118 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item); in btrfs_lookup_csum()
130 struct btrfs_path *path, u64 objectid, in btrfs_lookup_file_extent() argument
141 ret = btrfs_search_slot(trans, root, &file_key, path, ins_len, cow); in btrfs_lookup_file_extent()
159 struct btrfs_path *path; in __btrfs_lookup_bio_sums() local
171 path = btrfs_alloc_path(); in __btrfs_lookup_bio_sums()
172 if (!path) in __btrfs_lookup_bio_sums()
181 btrfs_free_path(path); in __btrfs_lookup_bio_sums()
195 path->reada = READA_FORWARD; in __btrfs_lookup_bio_sums()
204 path->search_commit_root = 1; in __btrfs_lookup_bio_sums()
205 path->skip_locking = 1; in __btrfs_lookup_bio_sums()
230 btrfs_release_path(path); in __btrfs_lookup_bio_sums()
232 path, disk_bytenr, 0); in __btrfs_lookup_bio_sums()
247 btrfs_release_path(path); in __btrfs_lookup_bio_sums()
250 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in __btrfs_lookup_bio_sums()
251 path->slots[0]); in __btrfs_lookup_bio_sums()
254 item_size = btrfs_item_size_nr(path->nodes[0], in __btrfs_lookup_bio_sums()
255 path->slots[0]); in __btrfs_lookup_bio_sums()
259 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in __btrfs_lookup_bio_sums()
271 read_extent_buffer(path->nodes[0], csum, in __btrfs_lookup_bio_sums()
288 btrfs_free_path(path); in __btrfs_lookup_bio_sums()
307 struct btrfs_path *path; in btrfs_lookup_csums_range() local
321 path = btrfs_alloc_path(); in btrfs_lookup_csums_range()
322 if (!path) in btrfs_lookup_csums_range()
326 path->skip_locking = 1; in btrfs_lookup_csums_range()
327 path->reada = READA_FORWARD; in btrfs_lookup_csums_range()
328 path->search_commit_root = 1; in btrfs_lookup_csums_range()
335 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_lookup_csums_range()
338 if (ret > 0 && path->slots[0] > 0) { in btrfs_lookup_csums_range()
339 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
340 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1); in btrfs_lookup_csums_range()
346 btrfs_item_size_nr(leaf, path->slots[0] - 1)) in btrfs_lookup_csums_range()
347 path->slots[0]--; in btrfs_lookup_csums_range()
352 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
353 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_lookup_csums_range()
354 ret = btrfs_next_leaf(root, path); in btrfs_lookup_csums_range()
359 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
362 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_lookup_csums_range()
371 size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_lookup_csums_range()
374 path->slots[0]++; in btrfs_lookup_csums_range()
379 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_lookup_csums_range()
399 read_extent_buffer(path->nodes[0], in btrfs_lookup_csums_range()
407 path->slots[0]++; in btrfs_lookup_csums_range()
418 btrfs_free_path(path); in btrfs_lookup_csums_range()
530 struct btrfs_path *path, in truncate_one_csum() argument
540 leaf = path->nodes[0]; in truncate_one_csum()
541 csum_end = btrfs_item_size_nr(leaf, path->slots[0]) / csum_size; in truncate_one_csum()
554 btrfs_truncate_item(fs_info, path, new_size, 1); in truncate_one_csum()
566 btrfs_truncate_item(fs_info, path, new_size, 0); in truncate_one_csum()
569 btrfs_set_item_key_safe(fs_info, path, key); in truncate_one_csum()
583 struct btrfs_path *path; in btrfs_del_csums() local
592 path = btrfs_alloc_path(); in btrfs_del_csums()
593 if (!path) in btrfs_del_csums()
601 path->leave_spinning = 1; in btrfs_del_csums()
602 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_csums()
604 if (path->slots[0] == 0) in btrfs_del_csums()
606 path->slots[0]--; in btrfs_del_csums()
611 leaf = path->nodes[0]; in btrfs_del_csums()
612 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_del_csums()
622 csum_end = btrfs_item_size_nr(leaf, path->slots[0]) / csum_size; in btrfs_del_csums()
639 if (key.offset > bytenr && path->slots[0] > 0) { in btrfs_del_csums()
640 int slot = path->slots[0] - 1; in btrfs_del_csums()
651 path->slots[0] = slot; in btrfs_del_csums()
657 ret = btrfs_del_items(trans, root, path, in btrfs_del_csums()
658 path->slots[0], del_nr); in btrfs_del_csums()
691 path->slots[0]); in btrfs_del_csums()
701 ret = btrfs_split_item(trans, root, path, &key, offset); in btrfs_del_csums()
709 truncate_one_csum(fs_info, path, &key, bytenr, len); in btrfs_del_csums()
713 btrfs_release_path(path); in btrfs_del_csums()
717 btrfs_free_path(path); in btrfs_del_csums()
728 struct btrfs_path *path; in btrfs_csum_file_blocks() local
743 path = btrfs_alloc_path(); in btrfs_csum_file_blocks()
744 if (!path) in btrfs_csum_file_blocks()
754 item = btrfs_lookup_csum(trans, root, path, bytenr, 1); in btrfs_csum_file_blocks()
757 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
758 item_end = btrfs_item_ptr(leaf, path->slots[0], in btrfs_csum_file_blocks()
761 btrfs_item_size_nr(leaf, path->slots[0])); in btrfs_csum_file_blocks()
771 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
772 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_csum_file_blocks()
779 int slot = path->slots[0] + 1; in btrfs_csum_file_blocks()
781 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_csum_file_blocks()
782 if (!nritems || (path->slots[0] >= nritems - 1)) { in btrfs_csum_file_blocks()
783 ret = btrfs_next_leaf(root, path); in btrfs_csum_file_blocks()
788 slot = path->slots[0]; in btrfs_csum_file_blocks()
790 btrfs_item_key_to_cpu(path->nodes[0], &found_key, slot); in btrfs_csum_file_blocks()
805 btrfs_release_path(path); in btrfs_csum_file_blocks()
806 ret = btrfs_search_slot(trans, root, &file_key, path, in btrfs_csum_file_blocks()
812 if (path->slots[0] == 0) in btrfs_csum_file_blocks()
814 path->slots[0]--; in btrfs_csum_file_blocks()
817 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
818 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_csum_file_blocks()
828 if (csum_offset == btrfs_item_size_nr(leaf, path->slots[0]) / in btrfs_csum_file_blocks()
850 diff = diff - btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_csum_file_blocks()
855 btrfs_extend_item(fs_info, path, diff); in btrfs_csum_file_blocks()
861 btrfs_release_path(path); in btrfs_csum_file_blocks()
877 path->leave_spinning = 1; in btrfs_csum_file_blocks()
878 ret = btrfs_insert_empty_item(trans, root, path, &file_key, in btrfs_csum_file_blocks()
880 path->leave_spinning = 0; in btrfs_csum_file_blocks()
885 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
887 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item); in btrfs_csum_file_blocks()
889 btrfs_item_size_nr(leaf, path->slots[0])); in btrfs_csum_file_blocks()
905 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_csum_file_blocks()
907 btrfs_release_path(path); in btrfs_csum_file_blocks()
912 btrfs_free_path(path); in btrfs_csum_file_blocks()
920 const struct btrfs_path *path, in btrfs_extent_item_to_extent_map() argument
927 struct extent_buffer *leaf = path->nodes[0]; in btrfs_extent_item_to_extent_map()
928 const int slot = path->slots[0]; in btrfs_extent_item_to_extent_map()