• Home
  • Raw
  • Download

Lines Matching full: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()
289 btrfs_free_path(path); in __btrfs_lookup_bio_sums()
308 struct btrfs_path *path; in btrfs_lookup_csums_range() local
322 path = btrfs_alloc_path(); in btrfs_lookup_csums_range()
323 if (!path) in btrfs_lookup_csums_range()
327 path->skip_locking = 1; in btrfs_lookup_csums_range()
328 path->reada = READA_FORWARD; in btrfs_lookup_csums_range()
329 path->search_commit_root = 1; in btrfs_lookup_csums_range()
336 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_lookup_csums_range()
339 if (ret > 0 && path->slots[0] > 0) { in btrfs_lookup_csums_range()
340 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
341 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1); in btrfs_lookup_csums_range()
347 btrfs_item_size_nr(leaf, path->slots[0] - 1)) in btrfs_lookup_csums_range()
348 path->slots[0]--; in btrfs_lookup_csums_range()
353 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
354 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_lookup_csums_range()
355 ret = btrfs_next_leaf(root, path); in btrfs_lookup_csums_range()
360 leaf = path->nodes[0]; in btrfs_lookup_csums_range()
363 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_lookup_csums_range()
372 size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_lookup_csums_range()
375 path->slots[0]++; in btrfs_lookup_csums_range()
380 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_lookup_csums_range()
400 read_extent_buffer(path->nodes[0], in btrfs_lookup_csums_range()
408 path->slots[0]++; in btrfs_lookup_csums_range()
419 btrfs_free_path(path); in btrfs_lookup_csums_range()
521 * key to describe the csum pointed to by the path, and it expects
531 struct btrfs_path *path, in truncate_one_csum() argument
541 leaf = path->nodes[0]; in truncate_one_csum()
542 csum_end = btrfs_item_size_nr(leaf, path->slots[0]) / csum_size; in truncate_one_csum()
555 btrfs_truncate_item(fs_info, path, new_size, 1); in truncate_one_csum()
567 btrfs_truncate_item(fs_info, path, new_size, 0); in truncate_one_csum()
570 btrfs_set_item_key_safe(fs_info, path, key); in truncate_one_csum()
584 struct btrfs_path *path; in btrfs_del_csums() local
596 path = btrfs_alloc_path(); in btrfs_del_csums()
597 if (!path) in btrfs_del_csums()
605 path->leave_spinning = 1; in btrfs_del_csums()
606 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_del_csums()
608 if (path->slots[0] == 0) in btrfs_del_csums()
610 path->slots[0]--; in btrfs_del_csums()
615 leaf = path->nodes[0]; in btrfs_del_csums()
616 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_del_csums()
626 csum_end = btrfs_item_size_nr(leaf, path->slots[0]) / csum_size; in btrfs_del_csums()
643 if (key.offset > bytenr && path->slots[0] > 0) { in btrfs_del_csums()
644 int slot = path->slots[0] - 1; in btrfs_del_csums()
655 path->slots[0] = slot; in btrfs_del_csums()
661 ret = btrfs_del_items(trans, root, path, in btrfs_del_csums()
662 path->slots[0], del_nr); in btrfs_del_csums()
678 * But we can't drop the path because the in btrfs_del_csums()
695 path->slots[0]); in btrfs_del_csums()
705 ret = btrfs_split_item(trans, root, path, &key, offset); in btrfs_del_csums()
713 truncate_one_csum(fs_info, path, &key, bytenr, len); in btrfs_del_csums()
717 btrfs_release_path(path); in btrfs_del_csums()
721 btrfs_free_path(path); in btrfs_del_csums()
732 struct btrfs_path *path; in btrfs_csum_file_blocks() local
747 path = btrfs_alloc_path(); in btrfs_csum_file_blocks()
748 if (!path) in btrfs_csum_file_blocks()
758 item = btrfs_lookup_csum(trans, root, path, bytenr, 1); in btrfs_csum_file_blocks()
761 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
762 item_end = btrfs_item_ptr(leaf, path->slots[0], in btrfs_csum_file_blocks()
765 btrfs_item_size_nr(leaf, path->slots[0])); in btrfs_csum_file_blocks()
775 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
776 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_csum_file_blocks()
783 int slot = path->slots[0] + 1; in btrfs_csum_file_blocks()
785 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_csum_file_blocks()
786 if (!nritems || (path->slots[0] >= nritems - 1)) { in btrfs_csum_file_blocks()
787 ret = btrfs_next_leaf(root, path); in btrfs_csum_file_blocks()
794 slot = path->slots[0]; in btrfs_csum_file_blocks()
796 btrfs_item_key_to_cpu(path->nodes[0], &found_key, slot); in btrfs_csum_file_blocks()
811 btrfs_release_path(path); in btrfs_csum_file_blocks()
812 ret = btrfs_search_slot(trans, root, &file_key, path, in btrfs_csum_file_blocks()
818 if (path->slots[0] == 0) in btrfs_csum_file_blocks()
820 path->slots[0]--; in btrfs_csum_file_blocks()
823 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
824 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_csum_file_blocks()
834 if (csum_offset == btrfs_item_size_nr(leaf, path->slots[0]) / in btrfs_csum_file_blocks()
856 diff = diff - btrfs_item_size_nr(leaf, path->slots[0]); in btrfs_csum_file_blocks()
861 btrfs_extend_item(fs_info, path, diff); in btrfs_csum_file_blocks()
867 btrfs_release_path(path); in btrfs_csum_file_blocks()
883 path->leave_spinning = 1; in btrfs_csum_file_blocks()
884 ret = btrfs_insert_empty_item(trans, root, path, &file_key, in btrfs_csum_file_blocks()
886 path->leave_spinning = 0; in btrfs_csum_file_blocks()
891 leaf = path->nodes[0]; in btrfs_csum_file_blocks()
893 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item); in btrfs_csum_file_blocks()
895 btrfs_item_size_nr(leaf, path->slots[0])); in btrfs_csum_file_blocks()
911 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_csum_file_blocks()
913 btrfs_release_path(path); in btrfs_csum_file_blocks()
918 btrfs_free_path(path); in btrfs_csum_file_blocks()
926 const struct btrfs_path *path, in btrfs_extent_item_to_extent_map() argument
933 struct extent_buffer *leaf = path->nodes[0]; in btrfs_extent_item_to_extent_map()
934 const int slot = path->slots[0]; in btrfs_extent_item_to_extent_map()