Lines Matching refs:path
102 struct btrfs_path *path, u64 objectid);
106 struct btrfs_path *path,
346 struct btrfs_path *path, in overwrite_item() argument
366 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in overwrite_item()
373 u32 dst_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
374 path->slots[0]); in overwrite_item()
379 btrfs_release_path(path); in overwrite_item()
385 btrfs_release_path(path); in overwrite_item()
393 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in overwrite_item()
394 read_extent_buffer(path->nodes[0], dst_copy, dst_ptr, in overwrite_item()
407 btrfs_release_path(path); in overwrite_item()
420 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in overwrite_item()
422 nbytes = btrfs_inode_nbytes(path->nodes[0], item); in overwrite_item()
457 btrfs_release_path(path); in overwrite_item()
459 path->skip_release_on_error = 1; in overwrite_item()
460 ret = btrfs_insert_empty_item(trans, root, path, in overwrite_item()
462 path->skip_release_on_error = 0; in overwrite_item()
467 found_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
468 path->slots[0]); in overwrite_item()
470 btrfs_truncate_item(path, item_size, 1); in overwrite_item()
472 btrfs_extend_item(path, item_size - found_size); in overwrite_item()
476 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], in overwrite_item()
477 path->slots[0]); in overwrite_item()
496 struct extent_buffer *dst_eb = path->nodes[0]; in overwrite_item()
515 S_ISDIR(btrfs_inode_mode(path->nodes[0], dst_item))) { in overwrite_item()
517 saved_i_size = btrfs_inode_size(path->nodes[0], in overwrite_item()
522 copy_extent_buffer(path->nodes[0], eb, dst_ptr, in overwrite_item()
528 btrfs_set_inode_size(path->nodes[0], dst_item, saved_i_size); in overwrite_item()
535 if (btrfs_inode_generation(path->nodes[0], dst_item) == 0) { in overwrite_item()
536 btrfs_set_inode_generation(path->nodes[0], dst_item, in overwrite_item()
541 btrfs_mark_buffer_dirty(path->nodes[0]); in overwrite_item()
542 btrfs_release_path(path); in overwrite_item()
575 struct btrfs_path *path, in replay_one_extent() argument
624 ret = btrfs_lookup_file_extent(trans, root, path, in replay_one_extent()
635 leaf = path->nodes[0]; in replay_one_extent()
636 existing = btrfs_item_ptr(leaf, path->slots[0], in replay_one_extent()
649 btrfs_release_path(path); in replay_one_extent()
653 btrfs_release_path(path); in replay_one_extent()
670 ret = btrfs_insert_empty_item(trans, root, path, key, in replay_one_extent()
674 dest_offset = btrfs_item_ptr_offset(path->nodes[0], in replay_one_extent()
675 path->slots[0]); in replay_one_extent()
676 copy_extent_buffer(path->nodes[0], eb, dest_offset, in replay_one_extent()
732 btrfs_release_path(path); in replay_one_extent()
817 btrfs_release_path(path); in replay_one_extent()
821 ret = overwrite_item(trans, root, path, eb, slot, key); in replay_one_extent()
850 struct btrfs_path *path, in drop_one_dir_item() argument
861 leaf = path->nodes[0]; in drop_one_dir_item()
870 btrfs_release_path(path); in drop_one_dir_item()
878 ret = link_to_fixup_dir(trans, root, path, location.objectid); in drop_one_dir_item()
900 struct btrfs_path *path, in inode_in_dir() argument
908 di = btrfs_lookup_dir_index_item(NULL, root, path, dirid, in inode_in_dir()
911 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
916 btrfs_release_path(path); in inode_in_dir()
918 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); in inode_in_dir()
920 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
927 btrfs_release_path(path); in inode_in_dir()
946 struct btrfs_path *path; in backref_in_log() local
949 path = btrfs_alloc_path(); in backref_in_log()
950 if (!path) in backref_in_log()
953 ret = btrfs_search_slot(NULL, log, key, path, 0, 0); in backref_in_log()
962 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in backref_in_log()
963 path->slots[0], in backref_in_log()
967 ret = !!btrfs_find_name_in_backref(path->nodes[0], in backref_in_log()
968 path->slots[0], in backref_in_log()
971 btrfs_free_path(path); in backref_in_log()
977 struct btrfs_path *path, in __add_inode_ref() argument
998 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in __add_inode_ref()
1004 leaf = path->nodes[0]; in __add_inode_ref()
1016 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1017 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()
1109 btrfs_release_path(path); in __add_inode_ref()
1133 btrfs_release_path(path); in __add_inode_ref()
1136 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1139 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1143 btrfs_release_path(path); in __add_inode_ref()
1146 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1149 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1153 btrfs_release_path(path); in __add_inode_ref()
1211 struct btrfs_path *path, in unlink_old_inode_refs() argument
1223 btrfs_release_path(path); in unlink_old_inode_refs()
1224 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in unlink_old_inode_refs()
1232 eb = path->nodes[0]; in unlink_old_inode_refs()
1233 ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]); in unlink_old_inode_refs()
1234 ref_end = ref_ptr + btrfs_item_size_nr(eb, path->slots[0]); in unlink_old_inode_refs()
1262 btrfs_release_path(path); in unlink_old_inode_refs()
1287 btrfs_release_path(path); in unlink_old_inode_refs()
1296 struct btrfs_path *path; in btrfs_inode_ref_exists() local
1300 path = btrfs_alloc_path(); in btrfs_inode_ref_exists()
1301 if (!path) in btrfs_inode_ref_exists()
1311 ret = btrfs_search_slot(NULL, BTRFS_I(inode)->root, &key, path, 0, 0); in btrfs_inode_ref_exists()
1319 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in btrfs_inode_ref_exists()
1320 path->slots[0], parent_id, name, namelen); in btrfs_inode_ref_exists()
1322 ret = !!btrfs_find_name_in_backref(path->nodes[0], path->slots[0], in btrfs_inode_ref_exists()
1326 btrfs_free_path(path); in btrfs_inode_ref_exists()
1336 struct btrfs_path *path; in add_link() local
1340 path = btrfs_alloc_path(); in add_link()
1341 if (!path) in add_link()
1344 dir_item = btrfs_lookup_dir_item(NULL, root, path, in add_link()
1348 btrfs_release_path(path); in add_link()
1360 btrfs_dir_item_key_to_cpu(path->nodes[0], dir_item, &key); in add_link()
1361 btrfs_release_path(path); in add_link()
1386 btrfs_free_path(path); in add_link()
1400 struct btrfs_path *path, in add_inode_ref() argument
1474 if (!inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), in add_inode_ref()
1486 ret = __add_inode_ref(trans, root, path, log, in add_inode_ref()
1552 ret = unlink_old_inode_refs(trans, root, path, BTRFS_I(inode), eb, slot, in add_inode_ref()
1558 ret = overwrite_item(trans, root, path, eb, slot, key); in add_inode_ref()
1560 btrfs_release_path(path); in add_inode_ref()
1580 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_extrefs() argument
1594 ret = btrfs_find_one_extref(root, inode_objectid, offset, path, in count_inode_extrefs()
1599 leaf = path->nodes[0]; in count_inode_extrefs()
1600 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in count_inode_extrefs()
1601 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in count_inode_extrefs()
1614 btrfs_release_path(path); in count_inode_extrefs()
1616 btrfs_release_path(path); in count_inode_extrefs()
1624 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_refs() argument
1639 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in count_inode_refs()
1643 if (path->slots[0] == 0) in count_inode_refs()
1645 path->slots[0]--; in count_inode_refs()
1648 btrfs_item_key_to_cpu(path->nodes[0], &key, in count_inode_refs()
1649 path->slots[0]); in count_inode_refs()
1653 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in count_inode_refs()
1654 ptr_end = ptr + btrfs_item_size_nr(path->nodes[0], in count_inode_refs()
1655 path->slots[0]); in count_inode_refs()
1660 name_len = btrfs_inode_ref_name_len(path->nodes[0], in count_inode_refs()
1668 if (path->slots[0] > 0) { in count_inode_refs()
1669 path->slots[0]--; in count_inode_refs()
1673 btrfs_release_path(path); in count_inode_refs()
1675 btrfs_release_path(path); in count_inode_refs()
1694 struct btrfs_path *path; in fixup_inode_link_count() local
1699 path = btrfs_alloc_path(); in fixup_inode_link_count()
1700 if (!path) in fixup_inode_link_count()
1703 ret = count_inode_refs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1709 ret = count_inode_extrefs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1725 ret = replay_dir_deletes(trans, root, NULL, path, in fixup_inode_link_count()
1734 btrfs_free_path(path); in fixup_inode_link_count()
1740 struct btrfs_path *path) in fixup_inode_link_counts() argument
1750 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in fixup_inode_link_counts()
1755 if (path->slots[0] == 0) in fixup_inode_link_counts()
1757 path->slots[0]--; in fixup_inode_link_counts()
1760 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in fixup_inode_link_counts()
1765 ret = btrfs_del_item(trans, root, path); in fixup_inode_link_counts()
1769 btrfs_release_path(path); in fixup_inode_link_counts()
1788 btrfs_release_path(path); in fixup_inode_link_counts()
1800 struct btrfs_path *path, in link_to_fixup_dir() argument
1815 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in link_to_fixup_dir()
1817 btrfs_release_path(path); in link_to_fixup_dir()
1887 struct btrfs_path *path, in replay_one_name() argument
1920 exists = btrfs_lookup_inode(trans, root, path, &log_key, 0); in replay_one_name()
1925 btrfs_release_path(path); in replay_one_name()
1928 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, in replay_one_name()
1931 dst_di = btrfs_lookup_dir_index_item(trans, root, path, in replay_one_name()
1949 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key); in replay_one_name()
1954 btrfs_dir_type(path->nodes[0], dst_di) == log_type) { in replay_one_name()
1966 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), dst_di); in replay_one_name()
1973 btrfs_release_path(path); in replay_one_name()
2015 btrfs_release_path(path); in replay_one_name()
2035 struct btrfs_path *path, in replay_one_dir_item() argument
2052 ret = replay_one_name(trans, root, path, eb, di, key); in replay_one_dir_item()
2120 struct btrfs_path *path, in find_dir_range() argument
2137 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_dir_range()
2141 if (path->slots[0] == 0) in find_dir_range()
2143 path->slots[0]--; in find_dir_range()
2146 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2152 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2154 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2165 nritems = btrfs_header_nritems(path->nodes[0]); in find_dir_range()
2166 path->slots[0]++; in find_dir_range()
2167 if (path->slots[0] >= nritems) { in find_dir_range()
2168 ret = btrfs_next_leaf(root, path); in find_dir_range()
2173 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2179 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2181 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2186 btrfs_release_path(path); in find_dir_range()
2198 struct btrfs_path *path, in check_item_in_log() argument
2217 eb = path->nodes[0]; in check_item_in_log()
2218 slot = path->slots[0]; in check_item_in_log()
2246 btrfs_release_path(path); in check_item_in_log()
2255 path, location.objectid); in check_item_in_log()
2275 ret = btrfs_search_slot(NULL, root, dir_key, path, in check_item_in_log()
2293 btrfs_release_path(path); in check_item_in_log()
2301 struct btrfs_path *path, in replay_xattr_deletes() argument
2318 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in replay_xattr_deletes()
2322 nritems = btrfs_header_nritems(path->nodes[0]); in replay_xattr_deletes()
2323 for (i = path->slots[0]; i < nritems; i++) { in replay_xattr_deletes()
2330 btrfs_item_key_to_cpu(path->nodes[0], &key, i); in replay_xattr_deletes()
2336 di = btrfs_item_ptr(path->nodes[0], i, struct btrfs_dir_item); in replay_xattr_deletes()
2337 total_size = btrfs_item_size_nr(path->nodes[0], i); in replay_xattr_deletes()
2340 u16 name_len = btrfs_dir_name_len(path->nodes[0], di); in replay_xattr_deletes()
2341 u16 data_len = btrfs_dir_data_len(path->nodes[0], di); in replay_xattr_deletes()
2350 read_extent_buffer(path->nodes[0], name, in replay_xattr_deletes()
2358 btrfs_release_path(path); in replay_xattr_deletes()
2359 di = btrfs_lookup_xattr(trans, root, path, ino, in replay_xattr_deletes()
2368 path, di); in replay_xattr_deletes()
2371 btrfs_release_path(path); in replay_xattr_deletes()
2384 ret = btrfs_next_leaf(root, path); in replay_xattr_deletes()
2391 btrfs_release_path(path); in replay_xattr_deletes()
2409 struct btrfs_path *path, in replay_dir_deletes() argument
2443 ret = find_dir_range(log, path, dirid, key_type, in replay_dir_deletes()
2452 ret = btrfs_search_slot(NULL, root, &dir_key, path, in replay_dir_deletes()
2457 nritems = btrfs_header_nritems(path->nodes[0]); in replay_dir_deletes()
2458 if (path->slots[0] >= nritems) { in replay_dir_deletes()
2459 ret = btrfs_next_leaf(root, path); in replay_dir_deletes()
2465 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in replay_dir_deletes()
2466 path->slots[0]); in replay_dir_deletes()
2474 ret = check_item_in_log(trans, root, log, path, in replay_dir_deletes()
2483 btrfs_release_path(path); in replay_dir_deletes()
2494 btrfs_release_path(path); in replay_dir_deletes()
2498 btrfs_release_path(path); in replay_dir_deletes()
2519 struct btrfs_path *path; in replay_one_buffer() local
2534 path = btrfs_alloc_path(); in replay_one_buffer()
2535 if (!path) in replay_one_buffer()
2565 path, key.objectid); in replay_one_buffer()
2571 root, log, path, key.objectid, 0); in replay_one_buffer()
2575 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2612 path, key.objectid); in replay_one_buffer()
2622 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2633 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2639 ret = add_inode_ref(wc->trans, root, log, path, in replay_one_buffer()
2645 ret = replay_one_extent(wc->trans, root, path, in replay_one_buffer()
2650 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2656 btrfs_free_path(path); in replay_one_buffer()
2685 struct btrfs_path *path, int *level, in walk_down_log_tree() argument
2699 cur = path->nodes[*level]; in walk_down_log_tree()
2703 if (path->slots[*level] >= in walk_down_log_tree()
2707 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_log_tree()
2708 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_log_tree()
2709 btrfs_node_key_to_cpu(cur, &first_key, path->slots[*level]); in walk_down_log_tree()
2724 path->slots[*level]++; in walk_down_log_tree()
2760 if (path->nodes[*level-1]) in walk_down_log_tree()
2761 free_extent_buffer(path->nodes[*level-1]); in walk_down_log_tree()
2762 path->nodes[*level-1] = next; in walk_down_log_tree()
2764 path->slots[*level] = 0; in walk_down_log_tree()
2767 path->slots[*level] = btrfs_header_nritems(path->nodes[*level]); in walk_down_log_tree()
2775 struct btrfs_path *path, int *level, in walk_up_log_tree() argument
2783 for (i = *level; i < BTRFS_MAX_LEVEL - 1 && path->nodes[i]; i++) { in walk_up_log_tree()
2784 slot = path->slots[i]; in walk_up_log_tree()
2785 if (slot + 1 < btrfs_header_nritems(path->nodes[i])) { in walk_up_log_tree()
2786 path->slots[i]++; in walk_up_log_tree()
2791 ret = wc->process_func(root, path->nodes[*level], wc, in walk_up_log_tree()
2792 btrfs_header_generation(path->nodes[*level]), in walk_up_log_tree()
2800 next = path->nodes[*level]; in walk_up_log_tree()
2809 path->nodes[*level]->start, in walk_up_log_tree()
2810 path->nodes[*level]->len); in walk_up_log_tree()
2818 path->nodes[*level]->start); in walk_up_log_tree()
2821 free_extent_buffer(path->nodes[*level]); in walk_up_log_tree()
2822 path->nodes[*level] = NULL; in walk_up_log_tree()
2841 struct btrfs_path *path; in walk_log_tree() local
2844 path = btrfs_alloc_path(); in walk_log_tree()
2845 if (!path) in walk_log_tree()
2850 path->nodes[level] = log->node; in walk_log_tree()
2852 path->slots[level] = 0; in walk_log_tree()
2855 wret = walk_down_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2863 wret = walk_up_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2873 if (path->nodes[orig_level]) { in walk_log_tree()
2874 ret = wc->process_func(log, path->nodes[orig_level], wc, in walk_log_tree()
2875 btrfs_header_generation(path->nodes[orig_level]), in walk_log_tree()
2882 next = path->nodes[orig_level]; in walk_log_tree()
2903 btrfs_free_path(path); in walk_log_tree()
3359 struct btrfs_path *path; in btrfs_del_dir_entries_in_log() local
3375 path = btrfs_alloc_path(); in btrfs_del_dir_entries_in_log()
3376 if (!path) { in btrfs_del_dir_entries_in_log()
3381 di = btrfs_lookup_dir_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3388 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3395 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3396 di = btrfs_lookup_dir_index_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3403 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3420 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3422 ret = btrfs_search_slot(trans, log, &key, path, 0, 1); in btrfs_del_dir_entries_in_log()
3431 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_del_dir_entries_in_log()
3433 i_size = btrfs_inode_size(path->nodes[0], item); in btrfs_del_dir_entries_in_log()
3438 btrfs_set_inode_size(path->nodes[0], item, i_size); in btrfs_del_dir_entries_in_log()
3439 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_del_dir_entries_in_log()
3442 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3445 btrfs_free_path(path); in btrfs_del_dir_entries_in_log()
3500 struct btrfs_path *path, in insert_dir_log_key() argument
3514 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item)); in insert_dir_log_key()
3518 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in insert_dir_log_key()
3520 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); in insert_dir_log_key()
3521 btrfs_mark_buffer_dirty(path->nodes[0]); in insert_dir_log_key()
3522 btrfs_release_path(path); in insert_dir_log_key()
3533 struct btrfs_path *path, in log_dir_items() argument
3555 ret = btrfs_search_forward(root, &min_key, path, trans->transid); in log_dir_items()
3565 btrfs_release_path(path); in log_dir_items()
3566 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3568 btrfs_release_path(path); in log_dir_items()
3571 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3580 btrfs_item_key_to_cpu(path->nodes[0], &tmp, in log_dir_items()
3581 path->slots[0]); in log_dir_items()
3589 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3592 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3596 path->nodes[0], path->slots[0], in log_dir_items()
3604 btrfs_release_path(path); in log_dir_items()
3615 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3625 src = path->nodes[0]; in log_dir_items()
3627 for (i = path->slots[0]; i < nritems; i++) { in log_dir_items()
3636 btrfs_release_path(path); in log_dir_items()
3679 path->slots[0] = nritems; in log_dir_items()
3685 ret = btrfs_next_leaf(root, path); in log_dir_items()
3693 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3698 if (btrfs_header_generation(path->nodes[0]) != trans->transid) { in log_dir_items()
3700 path->nodes[0], path->slots[0], in log_dir_items()
3710 btrfs_release_path(path); in log_dir_items()
3719 ret = insert_dir_log_key(trans, log, path, key_type, in log_dir_items()
3741 struct btrfs_path *path, in log_directory_changes() argument
3754 ret = log_dir_items(trans, root, inode, path, dst_path, key_type, in log_directory_changes()
3778 struct btrfs_path *path, in drop_objectid_items() argument
3791 ret = btrfs_search_slot(trans, log, &key, path, -1, 1); in drop_objectid_items()
3796 if (path->slots[0] == 0) in drop_objectid_items()
3799 path->slots[0]--; in drop_objectid_items()
3800 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in drop_objectid_items()
3801 path->slots[0]); in drop_objectid_items()
3808 ret = btrfs_bin_search(path->nodes[0], &found_key, &start_slot); in drop_objectid_items()
3812 ret = btrfs_del_items(trans, log, path, start_slot, in drop_objectid_items()
3813 path->slots[0] - start_slot + 1); in drop_objectid_items()
3820 btrfs_release_path(path); in drop_objectid_items()
3822 btrfs_release_path(path); in drop_objectid_items()
3882 struct btrfs_root *log, struct btrfs_path *path, in log_inode_item() argument
3888 ret = btrfs_insert_empty_item(trans, log, path, in log_inode_item()
3892 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], in log_inode_item()
3894 fill_inode_item(trans, path->nodes[0], inode_item, &inode->vfs_inode, in log_inode_item()
3896 btrfs_release_path(path); in log_inode_item()
4196 struct btrfs_path *path, in log_one_extent() argument
4213 ret = __btrfs_drop_extents(trans, log, inode, path, em->start, in log_one_extent()
4224 ret = btrfs_insert_empty_item(trans, log, path, &key, in log_one_extent()
4229 leaf = path->nodes[0]; in log_one_extent()
4231 fi = btrfs_item_ptr(leaf, path->slots[0], in log_one_extent()
4265 btrfs_release_path(path); in log_one_extent()
4280 struct btrfs_path *path) in btrfs_log_prealloc_extents() argument
4301 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_prealloc_extents()
4313 ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY); in btrfs_log_prealloc_extents()
4320 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4321 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4340 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4341 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4345 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4351 ret = btrfs_next_leaf(root, path); in btrfs_log_prealloc_extents()
4367 path->slots[0]++; in btrfs_log_prealloc_extents()
4389 path->slots[0]++; in btrfs_log_prealloc_extents()
4399 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4402 btrfs_release_path(path); in btrfs_log_prealloc_extents()
4410 struct btrfs_path *path, in btrfs_log_changed_extents() argument
4475 ret = log_one_extent(trans, inode, root, em, path, ctx); in btrfs_log_changed_extents()
4483 btrfs_release_path(path); in btrfs_log_changed_extents()
4485 ret = btrfs_log_prealloc_extents(trans, inode, path); in btrfs_log_changed_extents()
4515 struct btrfs_path *path, u64 *size_ret) in logged_inode_size() argument
4524 ret = btrfs_search_slot(NULL, log, &key, path, 0, 0); in logged_inode_size()
4532 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in logged_inode_size()
4534 *size_ret = btrfs_inode_size(path->nodes[0], item); in logged_inode_size()
4550 btrfs_release_path(path); in logged_inode_size()
4566 struct btrfs_path *path, in btrfs_log_all_xattrs() argument
4579 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_xattrs()
4584 int slot = path->slots[0]; in btrfs_log_all_xattrs()
4585 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_xattrs()
4590 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4596 ret = btrfs_next_leaf(root, path); in btrfs_log_all_xattrs()
4611 path->slots[0]++; in btrfs_log_all_xattrs()
4615 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4636 struct btrfs_path *path) in btrfs_log_holes() argument
4652 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4657 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_holes()
4659 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { in btrfs_log_holes()
4660 ret = btrfs_next_leaf(root, path); in btrfs_log_holes()
4667 leaf = path->nodes[0]; in btrfs_log_holes()
4670 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_log_holes()
4683 btrfs_release_path(path); in btrfs_log_holes()
4698 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4703 leaf = path->nodes[0]; in btrfs_log_holes()
4706 prev_extent_end = btrfs_file_extent_end(path); in btrfs_log_holes()
4707 path->slots[0]++; in btrfs_log_holes()
4714 btrfs_release_path(path); in btrfs_log_holes()
4870 struct btrfs_path *path, in log_conflicting_inodes() argument
4899 btrfs_release_path(path); in log_conflicting_inodes()
4984 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in log_conflicting_inodes()
4991 struct extent_buffer *leaf = path->nodes[0]; in log_conflicting_inodes()
4992 int slot = path->slots[0]; in log_conflicting_inodes()
4997 ret = btrfs_next_leaf(root, path); in log_conflicting_inodes()
5031 path->slots[0]++; in log_conflicting_inodes()
5043 struct btrfs_path *path, in copy_inode_items_to_log() argument
5057 ret = btrfs_search_forward(root, min_key, path, trans->transid); in copy_inode_items_to_log()
5081 ret = btrfs_check_ref_name_override(path->nodes[0], in copy_inode_items_to_log()
5082 path->slots[0], min_key, inode, in copy_inode_items_to_log()
5092 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5094 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5101 ret = log_conflicting_inodes(trans, root, path, in copy_inode_items_to_log()
5105 btrfs_release_path(path); in copy_inode_items_to_log()
5114 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5123 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { in copy_inode_items_to_log()
5127 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5132 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5137 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5139 path->slots[0]++; in copy_inode_items_to_log()
5140 if (path->slots[0] < btrfs_header_nritems(path->nodes[0])) { in copy_inode_items_to_log()
5141 btrfs_item_key_to_cpu(path->nodes[0], min_key, in copy_inode_items_to_log()
5142 path->slots[0]); in copy_inode_items_to_log()
5146 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5153 btrfs_release_path(path); in copy_inode_items_to_log()
5165 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5190 struct btrfs_path *path; in btrfs_log_inode() local
5205 path = btrfs_alloc_path(); in btrfs_log_inode()
5206 if (!path) in btrfs_log_inode()
5210 btrfs_free_path(path); in btrfs_log_inode()
5248 btrfs_free_path(path); in btrfs_log_inode()
5273 ret = drop_objectid_items(trans, log, path, ino, max_key_type); in btrfs_log_inode()
5289 err = logged_inode_size(log, inode, path, &logged_isize); in btrfs_log_inode()
5297 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5317 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5332 path, dst_path, logged_isize, in btrfs_log_inode()
5338 btrfs_release_path(path); in btrfs_log_inode()
5340 err = btrfs_log_all_xattrs(trans, root, inode, path, dst_path); in btrfs_log_inode()
5345 btrfs_release_path(path); in btrfs_log_inode()
5347 err = btrfs_log_holes(trans, root, inode, path); in btrfs_log_inode()
5352 btrfs_release_path(path); in btrfs_log_inode()
5357 err = btrfs_log_all_xattrs(trans, root, inode, path, in btrfs_log_inode()
5359 btrfs_release_path(path); in btrfs_log_inode()
5381 ret = log_directory_changes(trans, root, inode, path, dst_path, in btrfs_log_inode()
5421 btrfs_free_path(path); in btrfs_log_inode()
5575 struct btrfs_path *path; in log_new_dir_dentries() local
5580 path = btrfs_alloc_path(); in log_new_dir_dentries()
5581 if (!path) in log_new_dir_dentries()
5586 btrfs_free_path(path); in log_new_dir_dentries()
5607 btrfs_release_path(path); in log_new_dir_dentries()
5608 ret = btrfs_search_forward(log, &min_key, path, trans->transid); in log_new_dir_dentries()
5617 leaf = path->nodes[0]; in log_new_dir_dentries()
5619 for (i = path->slots[0]; i < nritems; i++) { in log_new_dir_dentries()
5641 btrfs_release_path(path); in log_new_dir_dentries()
5677 ret = btrfs_next_leaf(log, path); in log_new_dir_dentries()
5695 btrfs_free_path(path); in log_new_dir_dentries()
5705 struct btrfs_path *path; in btrfs_log_all_parents() local
5710 path = btrfs_alloc_path(); in btrfs_log_all_parents()
5711 if (!path) in btrfs_log_all_parents()
5713 path->skip_locking = 1; in btrfs_log_all_parents()
5714 path->search_commit_root = 1; in btrfs_log_all_parents()
5719 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_parents()
5724 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_parents()
5725 int slot = path->slots[0]; in btrfs_log_all_parents()
5731 ret = btrfs_next_leaf(root, path); in btrfs_log_all_parents()
5812 path->slots[0]++; in btrfs_log_all_parents()
5816 btrfs_free_path(path); in btrfs_log_all_parents()
5822 struct btrfs_path *path, in log_new_ancestors() argument
5827 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); in log_new_ancestors()
5832 struct extent_buffer *leaf = path->nodes[0]; in log_new_ancestors()
5833 int slot = path->slots[0]; in log_new_ancestors()
5839 btrfs_release_path(path); in log_new_ancestors()
5861 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_new_ancestors()
5865 leaf = path->nodes[0]; in log_new_ancestors()
5866 slot = path->slots[0]; in log_new_ancestors()
5868 ret = btrfs_next_leaf(root, path); in log_new_ancestors()
5873 leaf = path->nodes[0]; in log_new_ancestors()
5874 slot = path->slots[0]; in log_new_ancestors()
5930 struct btrfs_path *path; in log_all_new_ancestors() local
5941 path = btrfs_alloc_path(); in log_all_new_ancestors()
5942 if (!path) in log_all_new_ancestors()
5949 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_all_new_ancestors()
5953 path->slots[0]++; in log_all_new_ancestors()
5956 struct extent_buffer *leaf = path->nodes[0]; in log_all_new_ancestors()
5957 int slot = path->slots[0]; in log_all_new_ancestors()
5961 ret = btrfs_next_leaf(root, path); in log_all_new_ancestors()
5994 ret = log_new_ancestors(trans, root, path, ctx); in log_all_new_ancestors()
5997 btrfs_release_path(path); in log_all_new_ancestors()
6002 btrfs_free_path(path); in log_all_new_ancestors()
6182 struct btrfs_path *path; in btrfs_recover_log_trees() local
6193 path = btrfs_alloc_path(); in btrfs_recover_log_trees()
6194 if (!path) in btrfs_recover_log_trees()
6221 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
6229 if (path->slots[0] == 0) in btrfs_recover_log_trees()
6231 path->slots[0]--; in btrfs_recover_log_trees()
6233 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in btrfs_recover_log_trees()
6234 path->slots[0]); in btrfs_recover_log_trees()
6235 btrfs_release_path(path); in btrfs_recover_log_trees()
6282 path); in btrfs_recover_log_trees()
6288 btrfs_release_path(path); in btrfs_recover_log_trees()
6313 btrfs_release_path(path); in btrfs_recover_log_trees()
6328 btrfs_free_path(path); in btrfs_recover_log_trees()
6343 btrfs_free_path(path); in btrfs_recover_log_trees()