Lines Matching refs:path
96 struct btrfs_path *path, u64 objectid);
100 struct btrfs_path *path,
327 struct btrfs_path *path, in overwrite_item() argument
348 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in overwrite_item()
355 u32 dst_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
356 path->slots[0]); in overwrite_item()
361 btrfs_release_path(path); in overwrite_item()
367 btrfs_release_path(path); in overwrite_item()
375 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in overwrite_item()
376 read_extent_buffer(path->nodes[0], dst_copy, dst_ptr, in overwrite_item()
389 btrfs_release_path(path); in overwrite_item()
402 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in overwrite_item()
404 nbytes = btrfs_inode_nbytes(path->nodes[0], item); in overwrite_item()
439 btrfs_release_path(path); in overwrite_item()
441 path->skip_release_on_error = 1; in overwrite_item()
442 ret = btrfs_insert_empty_item(trans, root, path, in overwrite_item()
444 path->skip_release_on_error = 0; in overwrite_item()
449 found_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
450 path->slots[0]); in overwrite_item()
452 btrfs_truncate_item(fs_info, path, item_size, 1); in overwrite_item()
454 btrfs_extend_item(fs_info, path, in overwrite_item()
459 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], in overwrite_item()
460 path->slots[0]); in overwrite_item()
479 struct extent_buffer *dst_eb = path->nodes[0]; in overwrite_item()
503 S_ISDIR(btrfs_inode_mode(path->nodes[0], dst_item))) { in overwrite_item()
505 saved_i_size = btrfs_inode_size(path->nodes[0], in overwrite_item()
510 copy_extent_buffer(path->nodes[0], eb, dst_ptr, in overwrite_item()
516 btrfs_set_inode_size(path->nodes[0], dst_item, saved_i_size); in overwrite_item()
523 if (btrfs_inode_generation(path->nodes[0], dst_item) == 0) { in overwrite_item()
524 btrfs_set_inode_generation(path->nodes[0], dst_item, in overwrite_item()
529 btrfs_mark_buffer_dirty(path->nodes[0]); in overwrite_item()
530 btrfs_release_path(path); in overwrite_item()
567 struct btrfs_path *path, in replay_one_extent() argument
616 ret = btrfs_lookup_file_extent(trans, root, path, in replay_one_extent()
627 leaf = path->nodes[0]; in replay_one_extent()
628 existing = btrfs_item_ptr(leaf, path->slots[0], in replay_one_extent()
641 btrfs_release_path(path); in replay_one_extent()
645 btrfs_release_path(path); in replay_one_extent()
662 ret = btrfs_insert_empty_item(trans, root, path, key, in replay_one_extent()
666 dest_offset = btrfs_item_ptr_offset(path->nodes[0], in replay_one_extent()
667 path->slots[0]); in replay_one_extent()
668 copy_extent_buffer(path->nodes[0], eb, dest_offset, in replay_one_extent()
719 btrfs_release_path(path); in replay_one_extent()
803 btrfs_release_path(path); in replay_one_extent()
807 ret = overwrite_item(trans, root, path, eb, slot, key); in replay_one_extent()
831 struct btrfs_path *path, in drop_one_dir_item() argument
842 leaf = path->nodes[0]; in drop_one_dir_item()
851 btrfs_release_path(path); in drop_one_dir_item()
859 ret = link_to_fixup_dir(trans, root, path, location.objectid); in drop_one_dir_item()
881 struct btrfs_path *path, in inode_in_dir() argument
889 di = btrfs_lookup_dir_index_item(NULL, root, path, dirid, in inode_in_dir()
892 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
897 btrfs_release_path(path); in inode_in_dir()
899 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); in inode_in_dir()
901 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
908 btrfs_release_path(path); in inode_in_dir()
927 struct btrfs_path *path; in backref_in_log() local
937 path = btrfs_alloc_path(); in backref_in_log()
938 if (!path) in backref_in_log()
941 ret = btrfs_search_slot(NULL, log, key, path, 0, 0); in backref_in_log()
945 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in backref_in_log()
948 if (btrfs_find_name_in_ext_backref(path->nodes[0], in backref_in_log()
949 path->slots[0], in backref_in_log()
957 item_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]); in backref_in_log()
961 found_name_len = btrfs_inode_ref_name_len(path->nodes[0], ref); in backref_in_log()
964 ret = memcmp_extent_buffer(path->nodes[0], name, in backref_in_log()
974 btrfs_free_path(path); in backref_in_log()
980 struct btrfs_path *path, in __add_inode_ref() argument
1001 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in __add_inode_ref()
1007 leaf = path->nodes[0]; in __add_inode_ref()
1019 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1020 ptr_end = ptr + btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1038 btrfs_release_path(path); in __add_inode_ref()
1062 btrfs_release_path(path); in __add_inode_ref()
1065 extref = btrfs_lookup_inode_extref(NULL, root, path, name, namelen, in __add_inode_ref()
1074 leaf = path->nodes[0]; in __add_inode_ref()
1076 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1077 base = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1107 btrfs_release_path(path); in __add_inode_ref()
1131 btrfs_release_path(path); in __add_inode_ref()
1134 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1137 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1141 btrfs_release_path(path); in __add_inode_ref()
1144 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1147 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1151 btrfs_release_path(path); in __add_inode_ref()
1209 struct btrfs_path *path, in unlink_old_inode_refs() argument
1221 btrfs_release_path(path); in unlink_old_inode_refs()
1222 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in unlink_old_inode_refs()
1230 eb = path->nodes[0]; in unlink_old_inode_refs()
1231 ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]); in unlink_old_inode_refs()
1232 ref_end = ref_ptr + btrfs_item_size_nr(eb, path->slots[0]); in unlink_old_inode_refs()
1260 btrfs_release_path(path); in unlink_old_inode_refs()
1285 btrfs_release_path(path); in unlink_old_inode_refs()
1294 struct btrfs_path *path; in btrfs_inode_ref_exists() local
1298 path = btrfs_alloc_path(); in btrfs_inode_ref_exists()
1299 if (!path) in btrfs_inode_ref_exists()
1309 ret = btrfs_search_slot(NULL, BTRFS_I(inode)->root, &key, path, 0, 0); in btrfs_inode_ref_exists()
1317 ret = btrfs_find_name_in_ext_backref(path->nodes[0], in btrfs_inode_ref_exists()
1318 path->slots[0], parent_id, in btrfs_inode_ref_exists()
1321 ret = btrfs_find_name_in_backref(path->nodes[0], path->slots[0], in btrfs_inode_ref_exists()
1325 btrfs_free_path(path); in btrfs_inode_ref_exists()
1338 struct btrfs_path *path, in add_inode_ref() argument
1412 if (!inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), in add_inode_ref()
1424 ret = __add_inode_ref(trans, root, path, log, in add_inode_ref()
1491 ret = unlink_old_inode_refs(trans, root, path, BTRFS_I(inode), eb, slot, in add_inode_ref()
1497 ret = overwrite_item(trans, root, path, eb, slot, key); in add_inode_ref()
1499 btrfs_release_path(path); in add_inode_ref()
1519 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_extrefs() argument
1533 ret = btrfs_find_one_extref(root, inode_objectid, offset, path, in count_inode_extrefs()
1538 leaf = path->nodes[0]; in count_inode_extrefs()
1539 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in count_inode_extrefs()
1540 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in count_inode_extrefs()
1553 btrfs_release_path(path); in count_inode_extrefs()
1555 btrfs_release_path(path); in count_inode_extrefs()
1563 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_refs() argument
1578 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in count_inode_refs()
1582 if (path->slots[0] == 0) in count_inode_refs()
1584 path->slots[0]--; in count_inode_refs()
1587 btrfs_item_key_to_cpu(path->nodes[0], &key, in count_inode_refs()
1588 path->slots[0]); in count_inode_refs()
1592 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in count_inode_refs()
1593 ptr_end = ptr + btrfs_item_size_nr(path->nodes[0], in count_inode_refs()
1594 path->slots[0]); in count_inode_refs()
1599 name_len = btrfs_inode_ref_name_len(path->nodes[0], in count_inode_refs()
1607 if (path->slots[0] > 0) { in count_inode_refs()
1608 path->slots[0]--; in count_inode_refs()
1612 btrfs_release_path(path); in count_inode_refs()
1614 btrfs_release_path(path); in count_inode_refs()
1633 struct btrfs_path *path; in fixup_inode_link_count() local
1638 path = btrfs_alloc_path(); in fixup_inode_link_count()
1639 if (!path) in fixup_inode_link_count()
1642 ret = count_inode_refs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1648 ret = count_inode_extrefs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1664 ret = replay_dir_deletes(trans, root, NULL, path, in fixup_inode_link_count()
1673 btrfs_free_path(path); in fixup_inode_link_count()
1679 struct btrfs_path *path) in fixup_inode_link_counts() argument
1689 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in fixup_inode_link_counts()
1694 if (path->slots[0] == 0) in fixup_inode_link_counts()
1696 path->slots[0]--; in fixup_inode_link_counts()
1699 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in fixup_inode_link_counts()
1704 ret = btrfs_del_item(trans, root, path); in fixup_inode_link_counts()
1708 btrfs_release_path(path); in fixup_inode_link_counts()
1727 btrfs_release_path(path); in fixup_inode_link_counts()
1739 struct btrfs_path *path, in link_to_fixup_dir() argument
1754 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in link_to_fixup_dir()
1756 btrfs_release_path(path); in link_to_fixup_dir()
1850 struct btrfs_path *path, in replay_one_name() argument
1883 exists = btrfs_lookup_inode(trans, root, path, &log_key, 0); in replay_one_name()
1888 btrfs_release_path(path); in replay_one_name()
1891 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, in replay_one_name()
1894 dst_di = btrfs_lookup_dir_index_item(trans, root, path, in replay_one_name()
1912 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key); in replay_one_name()
1917 btrfs_dir_type(path->nodes[0], dst_di) == log_type) { in replay_one_name()
1929 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), dst_di); in replay_one_name()
1936 btrfs_release_path(path); in replay_one_name()
1955 btrfs_release_path(path); in replay_one_name()
1975 struct btrfs_path *path, in replay_one_dir_item() argument
1992 ret = replay_one_name(trans, root, path, eb, di, key); in replay_one_dir_item()
2060 struct btrfs_path *path, in find_dir_range() argument
2077 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_dir_range()
2081 if (path->slots[0] == 0) in find_dir_range()
2083 path->slots[0]--; in find_dir_range()
2086 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2092 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2094 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2105 nritems = btrfs_header_nritems(path->nodes[0]); in find_dir_range()
2106 path->slots[0]++; in find_dir_range()
2107 if (path->slots[0] >= nritems) { in find_dir_range()
2108 ret = btrfs_next_leaf(root, path); in find_dir_range()
2113 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2119 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2121 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2126 btrfs_release_path(path); in find_dir_range()
2138 struct btrfs_path *path, in check_item_in_log() argument
2157 eb = path->nodes[0]; in check_item_in_log()
2158 slot = path->slots[0]; in check_item_in_log()
2186 btrfs_release_path(path); in check_item_in_log()
2195 path, location.objectid); in check_item_in_log()
2215 ret = btrfs_search_slot(NULL, root, dir_key, path, in check_item_in_log()
2233 btrfs_release_path(path); in check_item_in_log()
2241 struct btrfs_path *path, in replay_xattr_deletes() argument
2258 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in replay_xattr_deletes()
2262 nritems = btrfs_header_nritems(path->nodes[0]); in replay_xattr_deletes()
2263 for (i = path->slots[0]; i < nritems; i++) { in replay_xattr_deletes()
2270 btrfs_item_key_to_cpu(path->nodes[0], &key, i); in replay_xattr_deletes()
2276 di = btrfs_item_ptr(path->nodes[0], i, struct btrfs_dir_item); in replay_xattr_deletes()
2277 total_size = btrfs_item_size_nr(path->nodes[0], i); in replay_xattr_deletes()
2280 u16 name_len = btrfs_dir_name_len(path->nodes[0], di); in replay_xattr_deletes()
2281 u16 data_len = btrfs_dir_data_len(path->nodes[0], di); in replay_xattr_deletes()
2290 read_extent_buffer(path->nodes[0], name, in replay_xattr_deletes()
2298 btrfs_release_path(path); in replay_xattr_deletes()
2299 di = btrfs_lookup_xattr(trans, root, path, ino, in replay_xattr_deletes()
2308 path, di); in replay_xattr_deletes()
2311 btrfs_release_path(path); in replay_xattr_deletes()
2324 ret = btrfs_next_leaf(root, path); in replay_xattr_deletes()
2331 btrfs_release_path(path); in replay_xattr_deletes()
2349 struct btrfs_path *path, in replay_dir_deletes() argument
2383 ret = find_dir_range(log, path, dirid, key_type, in replay_dir_deletes()
2392 ret = btrfs_search_slot(NULL, root, &dir_key, path, in replay_dir_deletes()
2397 nritems = btrfs_header_nritems(path->nodes[0]); in replay_dir_deletes()
2398 if (path->slots[0] >= nritems) { in replay_dir_deletes()
2399 ret = btrfs_next_leaf(root, path); in replay_dir_deletes()
2405 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in replay_dir_deletes()
2406 path->slots[0]); in replay_dir_deletes()
2414 ret = check_item_in_log(trans, root, log, path, in replay_dir_deletes()
2423 btrfs_release_path(path); in replay_dir_deletes()
2434 btrfs_release_path(path); in replay_dir_deletes()
2438 btrfs_release_path(path); in replay_dir_deletes()
2459 struct btrfs_path *path; in replay_one_buffer() local
2474 path = btrfs_alloc_path(); in replay_one_buffer()
2475 if (!path) in replay_one_buffer()
2491 path, key.objectid); in replay_one_buffer()
2497 root, log, path, key.objectid, 0); in replay_one_buffer()
2501 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2546 path, key.objectid); in replay_one_buffer()
2553 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2564 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2570 ret = add_inode_ref(wc->trans, root, log, path, in replay_one_buffer()
2576 ret = replay_one_extent(wc->trans, root, path, in replay_one_buffer()
2581 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2587 btrfs_free_path(path); in replay_one_buffer()
2593 struct btrfs_path *path, int *level, in walk_down_log_tree() argument
2614 cur = path->nodes[*level]; in walk_down_log_tree()
2618 if (path->slots[*level] >= in walk_down_log_tree()
2622 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_log_tree()
2623 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_log_tree()
2624 btrfs_node_key_to_cpu(cur, &first_key, path->slots[*level]); in walk_down_log_tree()
2627 parent = path->nodes[*level]; in walk_down_log_tree()
2642 path->slots[*level]++; in walk_down_log_tree()
2682 if (path->nodes[*level-1]) in walk_down_log_tree()
2683 free_extent_buffer(path->nodes[*level-1]); in walk_down_log_tree()
2684 path->nodes[*level-1] = next; in walk_down_log_tree()
2686 path->slots[*level] = 0; in walk_down_log_tree()
2692 path->slots[*level] = btrfs_header_nritems(path->nodes[*level]); in walk_down_log_tree()
2700 struct btrfs_path *path, int *level, in walk_up_log_tree() argument
2709 for (i = *level; i < BTRFS_MAX_LEVEL - 1 && path->nodes[i]; i++) { in walk_up_log_tree()
2710 slot = path->slots[i]; in walk_up_log_tree()
2711 if (slot + 1 < btrfs_header_nritems(path->nodes[i])) { in walk_up_log_tree()
2712 path->slots[i]++; in walk_up_log_tree()
2718 if (path->nodes[*level] == root->node) in walk_up_log_tree()
2719 parent = path->nodes[*level]; in walk_up_log_tree()
2721 parent = path->nodes[*level + 1]; in walk_up_log_tree()
2724 ret = wc->process_func(root, path->nodes[*level], wc, in walk_up_log_tree()
2725 btrfs_header_generation(path->nodes[*level]), in walk_up_log_tree()
2733 next = path->nodes[*level]; in walk_up_log_tree()
2749 path->nodes[*level]->start, in walk_up_log_tree()
2750 path->nodes[*level]->len); in walk_up_log_tree()
2754 free_extent_buffer(path->nodes[*level]); in walk_up_log_tree()
2755 path->nodes[*level] = NULL; in walk_up_log_tree()
2774 struct btrfs_path *path; in walk_log_tree() local
2777 path = btrfs_alloc_path(); in walk_log_tree()
2778 if (!path) in walk_log_tree()
2783 path->nodes[level] = log->node; in walk_log_tree()
2785 path->slots[level] = 0; in walk_log_tree()
2788 wret = walk_down_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2796 wret = walk_up_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2806 if (path->nodes[orig_level]) { in walk_log_tree()
2807 ret = wc->process_func(log, path->nodes[orig_level], wc, in walk_log_tree()
2808 btrfs_header_generation(path->nodes[orig_level]), in walk_log_tree()
2815 next = path->nodes[orig_level]; in walk_log_tree()
2838 btrfs_free_path(path); in walk_log_tree()
3270 struct btrfs_path *path; in btrfs_del_dir_entries_in_log() local
3286 path = btrfs_alloc_path(); in btrfs_del_dir_entries_in_log()
3287 if (!path) { in btrfs_del_dir_entries_in_log()
3292 di = btrfs_lookup_dir_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3299 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3306 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3307 di = btrfs_lookup_dir_index_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3314 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3331 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3333 ret = btrfs_search_slot(trans, log, &key, path, 0, 1); in btrfs_del_dir_entries_in_log()
3342 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_del_dir_entries_in_log()
3344 i_size = btrfs_inode_size(path->nodes[0], item); in btrfs_del_dir_entries_in_log()
3349 btrfs_set_inode_size(path->nodes[0], item, i_size); in btrfs_del_dir_entries_in_log()
3350 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_del_dir_entries_in_log()
3353 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3356 btrfs_free_path(path); in btrfs_del_dir_entries_in_log()
3410 struct btrfs_path *path, in insert_dir_log_key() argument
3424 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item)); in insert_dir_log_key()
3428 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in insert_dir_log_key()
3430 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); in insert_dir_log_key()
3431 btrfs_mark_buffer_dirty(path->nodes[0]); in insert_dir_log_key()
3432 btrfs_release_path(path); in insert_dir_log_key()
3443 struct btrfs_path *path, in log_dir_items() argument
3465 ret = btrfs_search_forward(root, &min_key, path, trans->transid); in log_dir_items()
3475 btrfs_release_path(path); in log_dir_items()
3476 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3478 btrfs_release_path(path); in log_dir_items()
3481 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3490 btrfs_item_key_to_cpu(path->nodes[0], &tmp, in log_dir_items()
3491 path->slots[0]); in log_dir_items()
3499 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3502 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3506 path->nodes[0], path->slots[0], in log_dir_items()
3514 btrfs_release_path(path); in log_dir_items()
3517 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3527 src = path->nodes[0]; in log_dir_items()
3529 for (i = path->slots[0]; i < nritems; i++) { in log_dir_items()
3574 path->slots[0] = nritems; in log_dir_items()
3580 ret = btrfs_next_leaf(root, path); in log_dir_items()
3588 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3593 if (btrfs_header_generation(path->nodes[0]) != trans->transid) { in log_dir_items()
3595 path->nodes[0], path->slots[0], in log_dir_items()
3605 btrfs_release_path(path); in log_dir_items()
3614 ret = insert_dir_log_key(trans, log, path, key_type, in log_dir_items()
3636 struct btrfs_path *path, in log_directory_changes() argument
3649 ret = log_dir_items(trans, root, inode, path, dst_path, key_type, in log_directory_changes()
3673 struct btrfs_path *path, in drop_objectid_items() argument
3686 ret = btrfs_search_slot(trans, log, &key, path, -1, 1); in drop_objectid_items()
3691 if (path->slots[0] == 0) in drop_objectid_items()
3694 path->slots[0]--; in drop_objectid_items()
3695 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in drop_objectid_items()
3696 path->slots[0]); in drop_objectid_items()
3703 ret = btrfs_bin_search(path->nodes[0], &found_key, 0, in drop_objectid_items()
3706 ret = btrfs_del_items(trans, log, path, start_slot, in drop_objectid_items()
3707 path->slots[0] - start_slot + 1); in drop_objectid_items()
3714 btrfs_release_path(path); in drop_objectid_items()
3716 btrfs_release_path(path); in drop_objectid_items()
3779 struct btrfs_root *log, struct btrfs_path *path, in log_inode_item() argument
3785 ret = btrfs_insert_empty_item(trans, log, path, in log_inode_item()
3789 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], in log_inode_item()
3791 fill_inode_item(trans, path->nodes[0], inode_item, &inode->vfs_inode, in log_inode_item()
3793 btrfs_release_path(path); in log_inode_item()
4172 struct btrfs_path *path, in log_one_extent() argument
4191 ret = __btrfs_drop_extents(trans, log, &inode->vfs_inode, path, em->start, in log_one_extent()
4202 ret = btrfs_insert_empty_item(trans, log, path, &key, in log_one_extent()
4207 leaf = path->nodes[0]; in log_one_extent()
4208 fi = btrfs_item_ptr(leaf, path->slots[0], in log_one_extent()
4250 btrfs_release_path(path); in log_one_extent()
4265 struct btrfs_path *path) in btrfs_log_prealloc_extents() argument
4283 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_prealloc_extents()
4288 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4289 int slot = path->slots[0]; in btrfs_log_prealloc_extents()
4293 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4300 ret = btrfs_next_leaf(root, path); in btrfs_log_prealloc_extents()
4316 path->slots[0]++; in btrfs_log_prealloc_extents()
4338 path->slots[0]++; in btrfs_log_prealloc_extents()
4348 ret = copy_items(trans, inode, dst_path, path, &last_extent, in btrfs_log_prealloc_extents()
4354 btrfs_release_path(path); in btrfs_log_prealloc_extents()
4362 struct btrfs_path *path, in btrfs_log_changed_extents() argument
4436 ret = log_one_extent(trans, inode, root, em, path, ctx); in btrfs_log_changed_extents()
4445 btrfs_release_path(path); in btrfs_log_changed_extents()
4447 ret = btrfs_log_prealloc_extents(trans, inode, path); in btrfs_log_changed_extents()
4453 struct btrfs_path *path, u64 *size_ret) in logged_inode_size() argument
4462 ret = btrfs_search_slot(NULL, log, &key, path, 0, 0); in logged_inode_size()
4470 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in logged_inode_size()
4472 *size_ret = btrfs_inode_size(path->nodes[0], item); in logged_inode_size()
4475 btrfs_release_path(path); in logged_inode_size()
4491 struct btrfs_path *path, in btrfs_log_all_xattrs() argument
4504 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_xattrs()
4509 int slot = path->slots[0]; in btrfs_log_all_xattrs()
4510 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_xattrs()
4517 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4526 ret = btrfs_next_leaf(root, path); in btrfs_log_all_xattrs()
4541 path->slots[0]++; in btrfs_log_all_xattrs()
4547 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4586 struct btrfs_path *path) in btrfs_log_trailing_hole() argument
4605 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_trailing_hole()
4610 ASSERT(path->slots[0] > 0); in btrfs_log_trailing_hole()
4611 path->slots[0]--; in btrfs_log_trailing_hole()
4612 leaf = path->nodes[0]; in btrfs_log_trailing_hole()
4613 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_log_trailing_hole()
4630 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_log_trailing_hole()
4650 btrfs_release_path(path); in btrfs_log_trailing_hole()
4814 struct btrfs_path *path; in btrfs_log_inode() local
4832 path = btrfs_alloc_path(); in btrfs_log_inode()
4833 if (!path) in btrfs_log_inode()
4837 btrfs_free_path(path); in btrfs_log_inode()
4871 btrfs_free_path(path); in btrfs_log_inode()
4892 ret = drop_objectid_items(trans, log, path, ino, max_key_type); in btrfs_log_inode()
4908 err = logged_inode_size(log, inode, path, &logged_isize); in btrfs_log_inode()
4916 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
4936 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
4953 path, trans->transid); in btrfs_log_inode()
4975 ret = btrfs_check_ref_name_override(path->nodes[0], in btrfs_log_inode()
4976 path->slots[0], &min_key, inode, in btrfs_log_inode()
4990 ins_start_slot = path->slots[0]; in btrfs_log_inode()
4992 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_inode()
5001 btrfs_release_path(path); in btrfs_log_inode()
5045 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_inode()
5054 btrfs_release_path(path); in btrfs_log_inode()
5060 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { in btrfs_log_inode()
5064 ins_start_slot = path->slots[0]; in btrfs_log_inode()
5069 ret = copy_items(trans, inode, dst_path, path, &last_extent, in btrfs_log_inode()
5078 btrfs_release_path(path); in btrfs_log_inode()
5082 ins_start_slot = path->slots[0]; in btrfs_log_inode()
5085 nritems = btrfs_header_nritems(path->nodes[0]); in btrfs_log_inode()
5086 path->slots[0]++; in btrfs_log_inode()
5087 if (path->slots[0] < nritems) { in btrfs_log_inode()
5088 btrfs_item_key_to_cpu(path->nodes[0], &min_key, in btrfs_log_inode()
5089 path->slots[0]); in btrfs_log_inode()
5093 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_inode()
5103 btrfs_release_path(path); in btrfs_log_inode()
5115 ret = copy_items(trans, inode, dst_path, path, &last_extent, in btrfs_log_inode()
5126 btrfs_release_path(path); in btrfs_log_inode()
5128 err = btrfs_log_all_xattrs(trans, root, inode, path, dst_path); in btrfs_log_inode()
5133 btrfs_release_path(path); in btrfs_log_inode()
5135 err = btrfs_log_trailing_hole(trans, root, inode, path); in btrfs_log_inode()
5140 btrfs_release_path(path); in btrfs_log_inode()
5145 err = btrfs_log_all_xattrs(trans, root, inode, path, in btrfs_log_inode()
5147 btrfs_release_path(path); in btrfs_log_inode()
5192 ret = log_directory_changes(trans, root, inode, path, dst_path, in btrfs_log_inode()
5207 btrfs_free_path(path); in btrfs_log_inode()
5372 struct btrfs_path *path; in log_new_dir_dentries() local
5377 path = btrfs_alloc_path(); in log_new_dir_dentries()
5378 if (!path) in log_new_dir_dentries()
5383 btrfs_free_path(path); in log_new_dir_dentries()
5404 btrfs_release_path(path); in log_new_dir_dentries()
5405 ret = btrfs_search_forward(log, &min_key, path, trans->transid); in log_new_dir_dentries()
5414 leaf = path->nodes[0]; in log_new_dir_dentries()
5416 for (i = path->slots[0]; i < nritems; i++) { in log_new_dir_dentries()
5438 btrfs_release_path(path); in log_new_dir_dentries()
5474 ret = btrfs_next_leaf(log, path); in log_new_dir_dentries()
5492 btrfs_free_path(path); in log_new_dir_dentries()
5502 struct btrfs_path *path; in btrfs_log_all_parents() local
5507 path = btrfs_alloc_path(); in btrfs_log_all_parents()
5508 if (!path) in btrfs_log_all_parents()
5510 path->skip_locking = 1; in btrfs_log_all_parents()
5511 path->search_commit_root = 1; in btrfs_log_all_parents()
5516 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_parents()
5521 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_parents()
5522 int slot = path->slots[0]; in btrfs_log_all_parents()
5528 ret = btrfs_next_leaf(root, path); in btrfs_log_all_parents()
5585 path->slots[0]++; in btrfs_log_all_parents()
5589 btrfs_free_path(path); in btrfs_log_all_parents()
5787 struct btrfs_path *path; in btrfs_recover_log_trees() local
5799 path = btrfs_alloc_path(); in btrfs_recover_log_trees()
5800 if (!path) in btrfs_recover_log_trees()
5827 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
5835 if (path->slots[0] == 0) in btrfs_recover_log_trees()
5837 path->slots[0]--; in btrfs_recover_log_trees()
5839 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in btrfs_recover_log_trees()
5840 path->slots[0]); in btrfs_recover_log_trees()
5841 btrfs_release_path(path); in btrfs_recover_log_trees()
5874 path); in btrfs_recover_log_trees()
5880 btrfs_release_path(path); in btrfs_recover_log_trees()
5906 btrfs_release_path(path); in btrfs_recover_log_trees()
5921 btrfs_free_path(path); in btrfs_recover_log_trees()
5937 btrfs_free_path(path); in btrfs_recover_log_trees()