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()
734 btrfs_release_path(path); in replay_one_extent()
819 btrfs_release_path(path); in replay_one_extent()
823 ret = overwrite_item(trans, root, path, eb, slot, key); in replay_one_extent()
852 struct btrfs_path *path, in drop_one_dir_item() argument
863 leaf = path->nodes[0]; in drop_one_dir_item()
872 btrfs_release_path(path); in drop_one_dir_item()
880 ret = link_to_fixup_dir(trans, root, path, location.objectid); in drop_one_dir_item()
904 struct btrfs_path *path, in inode_in_dir() argument
912 di = btrfs_lookup_dir_index_item(NULL, root, path, dirid, in inode_in_dir()
918 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
925 btrfs_release_path(path); in inode_in_dir()
926 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); in inode_in_dir()
931 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
936 btrfs_release_path(path); in inode_in_dir()
955 struct btrfs_path *path; in backref_in_log() local
958 path = btrfs_alloc_path(); in backref_in_log()
959 if (!path) in backref_in_log()
962 ret = btrfs_search_slot(NULL, log, key, path, 0, 0); in backref_in_log()
971 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in backref_in_log()
972 path->slots[0], in backref_in_log()
976 ret = !!btrfs_find_name_in_backref(path->nodes[0], in backref_in_log()
977 path->slots[0], in backref_in_log()
980 btrfs_free_path(path); in backref_in_log()
986 struct btrfs_path *path, in __add_inode_ref() argument
1007 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in __add_inode_ref()
1013 leaf = path->nodes[0]; in __add_inode_ref()
1025 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1026 ptr_end = ptr + btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1047 btrfs_release_path(path); in __add_inode_ref()
1071 btrfs_release_path(path); in __add_inode_ref()
1074 extref = btrfs_lookup_inode_extref(NULL, root, path, name, namelen, in __add_inode_ref()
1085 leaf = path->nodes[0]; in __add_inode_ref()
1087 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1088 base = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1121 btrfs_release_path(path); in __add_inode_ref()
1145 btrfs_release_path(path); in __add_inode_ref()
1148 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1153 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1157 btrfs_release_path(path); in __add_inode_ref()
1160 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1165 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1169 btrfs_release_path(path); in __add_inode_ref()
1227 struct btrfs_path *path, in unlink_old_inode_refs() argument
1239 btrfs_release_path(path); in unlink_old_inode_refs()
1240 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in unlink_old_inode_refs()
1248 eb = path->nodes[0]; in unlink_old_inode_refs()
1249 ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]); in unlink_old_inode_refs()
1250 ref_end = ref_ptr + btrfs_item_size_nr(eb, path->slots[0]); in unlink_old_inode_refs()
1278 btrfs_release_path(path); in unlink_old_inode_refs()
1312 btrfs_release_path(path); in unlink_old_inode_refs()
1321 struct btrfs_path *path; in btrfs_inode_ref_exists() local
1325 path = btrfs_alloc_path(); in btrfs_inode_ref_exists()
1326 if (!path) in btrfs_inode_ref_exists()
1336 ret = btrfs_search_slot(NULL, BTRFS_I(inode)->root, &key, path, 0, 0); in btrfs_inode_ref_exists()
1344 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in btrfs_inode_ref_exists()
1345 path->slots[0], parent_id, name, namelen); in btrfs_inode_ref_exists()
1347 ret = !!btrfs_find_name_in_backref(path->nodes[0], path->slots[0], in btrfs_inode_ref_exists()
1351 btrfs_free_path(path); in btrfs_inode_ref_exists()
1361 struct btrfs_path *path; in add_link() local
1365 path = btrfs_alloc_path(); in add_link()
1366 if (!path) in add_link()
1369 dir_item = btrfs_lookup_dir_item(NULL, root, path, in add_link()
1373 btrfs_release_path(path); in add_link()
1385 btrfs_dir_item_key_to_cpu(path->nodes[0], dir_item, &key); in add_link()
1386 btrfs_release_path(path); in add_link()
1411 btrfs_free_path(path); in add_link()
1425 struct btrfs_path *path, in add_inode_ref() argument
1498 ret = inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), in add_inode_ref()
1513 ret = __add_inode_ref(trans, root, path, log, in add_inode_ref()
1589 ret = unlink_old_inode_refs(trans, root, path, BTRFS_I(inode), eb, slot, in add_inode_ref()
1595 ret = overwrite_item(trans, root, path, eb, slot, key); in add_inode_ref()
1597 btrfs_release_path(path); in add_inode_ref()
1617 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_extrefs() argument
1631 ret = btrfs_find_one_extref(root, inode_objectid, offset, path, in count_inode_extrefs()
1636 leaf = path->nodes[0]; in count_inode_extrefs()
1637 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in count_inode_extrefs()
1638 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in count_inode_extrefs()
1651 btrfs_release_path(path); in count_inode_extrefs()
1653 btrfs_release_path(path); in count_inode_extrefs()
1661 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_refs() argument
1676 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in count_inode_refs()
1680 if (path->slots[0] == 0) in count_inode_refs()
1682 path->slots[0]--; in count_inode_refs()
1685 btrfs_item_key_to_cpu(path->nodes[0], &key, in count_inode_refs()
1686 path->slots[0]); in count_inode_refs()
1690 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in count_inode_refs()
1691 ptr_end = ptr + btrfs_item_size_nr(path->nodes[0], in count_inode_refs()
1692 path->slots[0]); in count_inode_refs()
1697 name_len = btrfs_inode_ref_name_len(path->nodes[0], in count_inode_refs()
1705 if (path->slots[0] > 0) { in count_inode_refs()
1706 path->slots[0]--; in count_inode_refs()
1710 btrfs_release_path(path); in count_inode_refs()
1712 btrfs_release_path(path); in count_inode_refs()
1731 struct btrfs_path *path; in fixup_inode_link_count() local
1736 path = btrfs_alloc_path(); in fixup_inode_link_count()
1737 if (!path) in fixup_inode_link_count()
1740 ret = count_inode_refs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1746 ret = count_inode_extrefs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1762 ret = replay_dir_deletes(trans, root, NULL, path, in fixup_inode_link_count()
1771 btrfs_free_path(path); in fixup_inode_link_count()
1777 struct btrfs_path *path) in fixup_inode_link_counts() argument
1787 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in fixup_inode_link_counts()
1793 if (path->slots[0] == 0) in fixup_inode_link_counts()
1795 path->slots[0]--; in fixup_inode_link_counts()
1798 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in fixup_inode_link_counts()
1803 ret = btrfs_del_item(trans, root, path); in fixup_inode_link_counts()
1807 btrfs_release_path(path); in fixup_inode_link_counts()
1826 btrfs_release_path(path); in fixup_inode_link_counts()
1838 struct btrfs_path *path, in link_to_fixup_dir() argument
1853 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in link_to_fixup_dir()
1855 btrfs_release_path(path); in link_to_fixup_dir()
1923 struct btrfs_path *path, in replay_one_name() argument
1956 ret = btrfs_lookup_inode(trans, root, path, &log_key, 0); in replay_one_name()
1957 btrfs_release_path(path); in replay_one_name()
1964 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, in replay_one_name()
1967 dst_di = btrfs_lookup_dir_index_item(trans, root, path, in replay_one_name()
1989 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key); in replay_one_name()
1994 btrfs_dir_type(path->nodes[0], dst_di) == log_type) { in replay_one_name()
2006 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), dst_di); in replay_one_name()
2013 btrfs_release_path(path); in replay_one_name()
2055 btrfs_release_path(path); in replay_one_name()
2075 struct btrfs_path *path, in replay_one_dir_item() argument
2092 ret = replay_one_name(trans, root, path, eb, di, key); in replay_one_dir_item()
2160 struct btrfs_path *path, in find_dir_range() argument
2177 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_dir_range()
2181 if (path->slots[0] == 0) in find_dir_range()
2183 path->slots[0]--; in find_dir_range()
2186 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2192 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2194 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2205 nritems = btrfs_header_nritems(path->nodes[0]); in find_dir_range()
2206 path->slots[0]++; in find_dir_range()
2207 if (path->slots[0] >= nritems) { in find_dir_range()
2208 ret = btrfs_next_leaf(root, path); in find_dir_range()
2213 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2219 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2221 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2226 btrfs_release_path(path); in find_dir_range()
2238 struct btrfs_path *path, in check_item_in_log() argument
2257 eb = path->nodes[0]; in check_item_in_log()
2258 slot = path->slots[0]; in check_item_in_log()
2286 btrfs_release_path(path); in check_item_in_log()
2295 path, location.objectid); in check_item_in_log()
2315 ret = btrfs_search_slot(NULL, root, dir_key, path, in check_item_in_log()
2333 btrfs_release_path(path); in check_item_in_log()
2341 struct btrfs_path *path, in replay_xattr_deletes() argument
2358 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in replay_xattr_deletes()
2362 nritems = btrfs_header_nritems(path->nodes[0]); in replay_xattr_deletes()
2363 for (i = path->slots[0]; i < nritems; i++) { in replay_xattr_deletes()
2370 btrfs_item_key_to_cpu(path->nodes[0], &key, i); in replay_xattr_deletes()
2376 di = btrfs_item_ptr(path->nodes[0], i, struct btrfs_dir_item); in replay_xattr_deletes()
2377 total_size = btrfs_item_size_nr(path->nodes[0], i); in replay_xattr_deletes()
2380 u16 name_len = btrfs_dir_name_len(path->nodes[0], di); in replay_xattr_deletes()
2381 u16 data_len = btrfs_dir_data_len(path->nodes[0], di); in replay_xattr_deletes()
2390 read_extent_buffer(path->nodes[0], name, in replay_xattr_deletes()
2398 btrfs_release_path(path); in replay_xattr_deletes()
2399 di = btrfs_lookup_xattr(trans, root, path, ino, in replay_xattr_deletes()
2408 path, di); in replay_xattr_deletes()
2411 btrfs_release_path(path); in replay_xattr_deletes()
2424 ret = btrfs_next_leaf(root, path); in replay_xattr_deletes()
2431 btrfs_release_path(path); in replay_xattr_deletes()
2449 struct btrfs_path *path, in replay_dir_deletes() argument
2483 ret = find_dir_range(log, path, dirid, key_type, in replay_dir_deletes()
2494 ret = btrfs_search_slot(NULL, root, &dir_key, path, in replay_dir_deletes()
2499 nritems = btrfs_header_nritems(path->nodes[0]); in replay_dir_deletes()
2500 if (path->slots[0] >= nritems) { in replay_dir_deletes()
2501 ret = btrfs_next_leaf(root, path); in replay_dir_deletes()
2507 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in replay_dir_deletes()
2508 path->slots[0]); in replay_dir_deletes()
2516 ret = check_item_in_log(trans, root, log, path, in replay_dir_deletes()
2525 btrfs_release_path(path); in replay_dir_deletes()
2536 btrfs_release_path(path); in replay_dir_deletes()
2540 btrfs_release_path(path); in replay_dir_deletes()
2561 struct btrfs_path *path; in replay_one_buffer() local
2576 path = btrfs_alloc_path(); in replay_one_buffer()
2577 if (!path) in replay_one_buffer()
2607 path, key.objectid); in replay_one_buffer()
2613 root, log, path, key.objectid, 0); in replay_one_buffer()
2617 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2654 path, key.objectid); in replay_one_buffer()
2664 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2675 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2681 ret = add_inode_ref(wc->trans, root, log, path, in replay_one_buffer()
2687 ret = replay_one_extent(wc->trans, root, path, in replay_one_buffer()
2692 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2698 btrfs_free_path(path); in replay_one_buffer()
2727 struct btrfs_path *path, int *level, in walk_down_log_tree() argument
2741 cur = path->nodes[*level]; in walk_down_log_tree()
2745 if (path->slots[*level] >= in walk_down_log_tree()
2749 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_log_tree()
2750 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_log_tree()
2751 btrfs_node_key_to_cpu(cur, &first_key, path->slots[*level]); in walk_down_log_tree()
2766 path->slots[*level]++; in walk_down_log_tree()
2802 if (path->nodes[*level-1]) in walk_down_log_tree()
2803 free_extent_buffer(path->nodes[*level-1]); in walk_down_log_tree()
2804 path->nodes[*level-1] = next; in walk_down_log_tree()
2806 path->slots[*level] = 0; in walk_down_log_tree()
2809 path->slots[*level] = btrfs_header_nritems(path->nodes[*level]); in walk_down_log_tree()
2817 struct btrfs_path *path, int *level, in walk_up_log_tree() argument
2825 for (i = *level; i < BTRFS_MAX_LEVEL - 1 && path->nodes[i]; i++) { in walk_up_log_tree()
2826 slot = path->slots[i]; in walk_up_log_tree()
2827 if (slot + 1 < btrfs_header_nritems(path->nodes[i])) { in walk_up_log_tree()
2828 path->slots[i]++; in walk_up_log_tree()
2833 ret = wc->process_func(root, path->nodes[*level], wc, in walk_up_log_tree()
2834 btrfs_header_generation(path->nodes[*level]), in walk_up_log_tree()
2842 next = path->nodes[*level]; in walk_up_log_tree()
2851 path->nodes[*level]->start, in walk_up_log_tree()
2852 path->nodes[*level]->len); in walk_up_log_tree()
2860 path->nodes[*level]->start); in walk_up_log_tree()
2863 free_extent_buffer(path->nodes[*level]); in walk_up_log_tree()
2864 path->nodes[*level] = NULL; in walk_up_log_tree()
2883 struct btrfs_path *path; in walk_log_tree() local
2886 path = btrfs_alloc_path(); in walk_log_tree()
2887 if (!path) in walk_log_tree()
2892 path->nodes[level] = log->node; in walk_log_tree()
2894 path->slots[level] = 0; in walk_log_tree()
2897 wret = walk_down_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2905 wret = walk_up_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2915 if (path->nodes[orig_level]) { in walk_log_tree()
2916 ret = wc->process_func(log, path->nodes[orig_level], wc, in walk_log_tree()
2917 btrfs_header_generation(path->nodes[orig_level]), in walk_log_tree()
2924 next = path->nodes[orig_level]; in walk_log_tree()
2945 btrfs_free_path(path); in walk_log_tree()
3401 struct btrfs_path *path; in btrfs_del_dir_entries_in_log() local
3417 path = btrfs_alloc_path(); in btrfs_del_dir_entries_in_log()
3418 if (!path) { in btrfs_del_dir_entries_in_log()
3423 di = btrfs_lookup_dir_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3430 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3437 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3438 di = btrfs_lookup_dir_index_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3445 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3462 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3464 ret = btrfs_search_slot(trans, log, &key, path, 0, 1); in btrfs_del_dir_entries_in_log()
3473 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in btrfs_del_dir_entries_in_log()
3475 i_size = btrfs_inode_size(path->nodes[0], item); in btrfs_del_dir_entries_in_log()
3480 btrfs_set_inode_size(path->nodes[0], item, i_size); in btrfs_del_dir_entries_in_log()
3481 btrfs_mark_buffer_dirty(path->nodes[0]); in btrfs_del_dir_entries_in_log()
3484 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3487 btrfs_free_path(path); in btrfs_del_dir_entries_in_log()
3541 struct btrfs_path *path, in insert_dir_log_key() argument
3555 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item)); in insert_dir_log_key()
3559 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in insert_dir_log_key()
3561 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); in insert_dir_log_key()
3562 btrfs_mark_buffer_dirty(path->nodes[0]); in insert_dir_log_key()
3563 btrfs_release_path(path); in insert_dir_log_key()
3574 struct btrfs_path *path, in log_dir_items() argument
3596 ret = btrfs_search_forward(root, &min_key, path, trans->transid); in log_dir_items()
3606 btrfs_release_path(path); in log_dir_items()
3607 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3609 btrfs_release_path(path); in log_dir_items()
3612 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3621 btrfs_item_key_to_cpu(path->nodes[0], &tmp, in log_dir_items()
3622 path->slots[0]); in log_dir_items()
3630 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3633 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3637 path->nodes[0], path->slots[0], in log_dir_items()
3645 btrfs_release_path(path); in log_dir_items()
3656 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3666 src = path->nodes[0]; in log_dir_items()
3668 for (i = path->slots[0]; i < nritems; i++) { in log_dir_items()
3677 btrfs_release_path(path); in log_dir_items()
3720 path->slots[0] = nritems; in log_dir_items()
3726 ret = btrfs_next_leaf(root, path); in log_dir_items()
3734 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3739 if (btrfs_header_generation(path->nodes[0]) != trans->transid) { in log_dir_items()
3741 path->nodes[0], path->slots[0], in log_dir_items()
3751 btrfs_release_path(path); in log_dir_items()
3760 ret = insert_dir_log_key(trans, log, path, key_type, in log_dir_items()
3782 struct btrfs_path *path, in log_directory_changes() argument
3795 ret = log_dir_items(trans, root, inode, path, dst_path, key_type, in log_directory_changes()
3819 struct btrfs_path *path, in drop_objectid_items() argument
3832 ret = btrfs_search_slot(trans, log, &key, path, -1, 1); in drop_objectid_items()
3837 if (path->slots[0] == 0) in drop_objectid_items()
3840 path->slots[0]--; in drop_objectid_items()
3841 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in drop_objectid_items()
3842 path->slots[0]); in drop_objectid_items()
3849 ret = btrfs_bin_search(path->nodes[0], &found_key, &start_slot); in drop_objectid_items()
3853 ret = btrfs_del_items(trans, log, path, start_slot, in drop_objectid_items()
3854 path->slots[0] - start_slot + 1); in drop_objectid_items()
3861 btrfs_release_path(path); in drop_objectid_items()
3863 btrfs_release_path(path); in drop_objectid_items()
3923 struct btrfs_root *log, struct btrfs_path *path, in log_inode_item() argument
3929 ret = btrfs_insert_empty_item(trans, log, path, in log_inode_item()
3933 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], in log_inode_item()
3935 fill_inode_item(trans, path->nodes[0], inode_item, &inode->vfs_inode, in log_inode_item()
3937 btrfs_release_path(path); in log_inode_item()
4237 struct btrfs_path *path, in log_one_extent() argument
4254 ret = __btrfs_drop_extents(trans, log, inode, path, em->start, in log_one_extent()
4265 ret = btrfs_insert_empty_item(trans, log, path, &key, in log_one_extent()
4270 leaf = path->nodes[0]; in log_one_extent()
4272 fi = btrfs_item_ptr(leaf, path->slots[0], in log_one_extent()
4306 btrfs_release_path(path); in log_one_extent()
4321 struct btrfs_path *path) in btrfs_log_prealloc_extents() argument
4342 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_prealloc_extents()
4354 ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY); in btrfs_log_prealloc_extents()
4361 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4362 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4381 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4382 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4386 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4392 ret = btrfs_next_leaf(root, path); in btrfs_log_prealloc_extents()
4408 path->slots[0]++; in btrfs_log_prealloc_extents()
4430 path->slots[0]++; in btrfs_log_prealloc_extents()
4440 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4443 btrfs_release_path(path); in btrfs_log_prealloc_extents()
4451 struct btrfs_path *path, in btrfs_log_changed_extents() argument
4516 ret = log_one_extent(trans, inode, root, em, path, ctx); in btrfs_log_changed_extents()
4524 btrfs_release_path(path); in btrfs_log_changed_extents()
4526 ret = btrfs_log_prealloc_extents(trans, inode, path); in btrfs_log_changed_extents()
4556 struct btrfs_path *path, u64 *size_ret) in logged_inode_size() argument
4565 ret = btrfs_search_slot(NULL, log, &key, path, 0, 0); in logged_inode_size()
4573 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in logged_inode_size()
4575 *size_ret = btrfs_inode_size(path->nodes[0], item); in logged_inode_size()
4591 btrfs_release_path(path); in logged_inode_size()
4607 struct btrfs_path *path, in btrfs_log_all_xattrs() argument
4624 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_xattrs()
4629 int slot = path->slots[0]; in btrfs_log_all_xattrs()
4630 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_xattrs()
4635 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4641 ret = btrfs_next_leaf(root, path); in btrfs_log_all_xattrs()
4656 path->slots[0]++; in btrfs_log_all_xattrs()
4661 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4685 struct btrfs_path *path) in btrfs_log_holes() argument
4701 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4706 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_holes()
4708 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { in btrfs_log_holes()
4709 ret = btrfs_next_leaf(root, path); in btrfs_log_holes()
4716 leaf = path->nodes[0]; in btrfs_log_holes()
4719 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_log_holes()
4732 btrfs_release_path(path); in btrfs_log_holes()
4747 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4752 leaf = path->nodes[0]; in btrfs_log_holes()
4755 prev_extent_end = btrfs_file_extent_end(path); in btrfs_log_holes()
4756 path->slots[0]++; in btrfs_log_holes()
4763 btrfs_release_path(path); in btrfs_log_holes()
4919 struct btrfs_path *path, in log_conflicting_inodes() argument
4948 btrfs_release_path(path); in log_conflicting_inodes()
5033 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in log_conflicting_inodes()
5040 struct extent_buffer *leaf = path->nodes[0]; in log_conflicting_inodes()
5041 int slot = path->slots[0]; in log_conflicting_inodes()
5046 ret = btrfs_next_leaf(root, path); in log_conflicting_inodes()
5080 path->slots[0]++; in log_conflicting_inodes()
5092 struct btrfs_path *path, in copy_inode_items_to_log() argument
5107 ret = btrfs_search_forward(root, min_key, path, trans->transid); in copy_inode_items_to_log()
5139 ret = btrfs_check_ref_name_override(path->nodes[0], in copy_inode_items_to_log()
5140 path->slots[0], min_key, inode, in copy_inode_items_to_log()
5150 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5152 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5159 ret = log_conflicting_inodes(trans, root, path, in copy_inode_items_to_log()
5163 btrfs_release_path(path); in copy_inode_items_to_log()
5170 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5179 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { in copy_inode_items_to_log()
5183 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5188 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5193 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5195 path->slots[0]++; in copy_inode_items_to_log()
5196 if (path->slots[0] < btrfs_header_nritems(path->nodes[0])) { in copy_inode_items_to_log()
5197 btrfs_item_key_to_cpu(path->nodes[0], min_key, in copy_inode_items_to_log()
5198 path->slots[0]); in copy_inode_items_to_log()
5202 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5209 btrfs_release_path(path); in copy_inode_items_to_log()
5221 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5232 btrfs_release_path(path); in copy_inode_items_to_log()
5258 struct btrfs_path *path; in btrfs_log_inode() local
5273 path = btrfs_alloc_path(); in btrfs_log_inode()
5274 if (!path) in btrfs_log_inode()
5278 btrfs_free_path(path); in btrfs_log_inode()
5316 btrfs_free_path(path); in btrfs_log_inode()
5353 ret = drop_objectid_items(trans, log, path, ino, max_key_type); in btrfs_log_inode()
5369 err = logged_inode_size(log, inode, path, &logged_isize); in btrfs_log_inode()
5377 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5397 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5412 path, dst_path, logged_isize, in btrfs_log_inode()
5418 btrfs_release_path(path); in btrfs_log_inode()
5420 err = btrfs_log_all_xattrs(trans, root, inode, path, dst_path); in btrfs_log_inode()
5425 btrfs_release_path(path); in btrfs_log_inode()
5427 err = btrfs_log_holes(trans, root, inode, path); in btrfs_log_inode()
5432 btrfs_release_path(path); in btrfs_log_inode()
5437 err = btrfs_log_all_xattrs(trans, root, inode, path, in btrfs_log_inode()
5439 btrfs_release_path(path); in btrfs_log_inode()
5461 ret = log_directory_changes(trans, root, inode, path, dst_path, in btrfs_log_inode()
5501 btrfs_free_path(path); in btrfs_log_inode()
5655 struct btrfs_path *path; in log_new_dir_dentries() local
5660 path = btrfs_alloc_path(); in log_new_dir_dentries()
5661 if (!path) in log_new_dir_dentries()
5666 btrfs_free_path(path); in log_new_dir_dentries()
5687 btrfs_release_path(path); in log_new_dir_dentries()
5688 ret = btrfs_search_forward(log, &min_key, path, trans->transid); in log_new_dir_dentries()
5697 leaf = path->nodes[0]; in log_new_dir_dentries()
5699 for (i = path->slots[0]; i < nritems; i++) { in log_new_dir_dentries()
5721 btrfs_release_path(path); in log_new_dir_dentries()
5757 ret = btrfs_next_leaf(log, path); in log_new_dir_dentries()
5775 btrfs_free_path(path); in log_new_dir_dentries()
5785 struct btrfs_path *path; in btrfs_log_all_parents() local
5790 path = btrfs_alloc_path(); in btrfs_log_all_parents()
5791 if (!path) in btrfs_log_all_parents()
5793 path->skip_locking = 1; in btrfs_log_all_parents()
5794 path->search_commit_root = 1; in btrfs_log_all_parents()
5799 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_parents()
5804 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_parents()
5805 int slot = path->slots[0]; in btrfs_log_all_parents()
5811 ret = btrfs_next_leaf(root, path); in btrfs_log_all_parents()
5892 path->slots[0]++; in btrfs_log_all_parents()
5896 btrfs_free_path(path); in btrfs_log_all_parents()
5902 struct btrfs_path *path, in log_new_ancestors() argument
5907 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); in log_new_ancestors()
5912 struct extent_buffer *leaf = path->nodes[0]; in log_new_ancestors()
5913 int slot = path->slots[0]; in log_new_ancestors()
5919 btrfs_release_path(path); in log_new_ancestors()
5941 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_new_ancestors()
5945 leaf = path->nodes[0]; in log_new_ancestors()
5946 slot = path->slots[0]; in log_new_ancestors()
5948 ret = btrfs_next_leaf(root, path); in log_new_ancestors()
5953 leaf = path->nodes[0]; in log_new_ancestors()
5954 slot = path->slots[0]; in log_new_ancestors()
6010 struct btrfs_path *path; in log_all_new_ancestors() local
6021 path = btrfs_alloc_path(); in log_all_new_ancestors()
6022 if (!path) in log_all_new_ancestors()
6029 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_all_new_ancestors()
6033 path->slots[0]++; in log_all_new_ancestors()
6036 struct extent_buffer *leaf = path->nodes[0]; in log_all_new_ancestors()
6037 int slot = path->slots[0]; in log_all_new_ancestors()
6041 ret = btrfs_next_leaf(root, path); in log_all_new_ancestors()
6074 ret = log_new_ancestors(trans, root, path, ctx); in log_all_new_ancestors()
6077 btrfs_release_path(path); in log_all_new_ancestors()
6082 btrfs_free_path(path); in log_all_new_ancestors()
6263 struct btrfs_path *path; in btrfs_recover_log_trees() local
6274 path = btrfs_alloc_path(); in btrfs_recover_log_trees()
6275 if (!path) in btrfs_recover_log_trees()
6302 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
6310 if (path->slots[0] == 0) in btrfs_recover_log_trees()
6312 path->slots[0]--; in btrfs_recover_log_trees()
6314 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in btrfs_recover_log_trees()
6315 path->slots[0]); in btrfs_recover_log_trees()
6316 btrfs_release_path(path); in btrfs_recover_log_trees()
6363 path); in btrfs_recover_log_trees()
6369 btrfs_release_path(path); in btrfs_recover_log_trees()
6394 btrfs_release_path(path); in btrfs_recover_log_trees()
6409 btrfs_free_path(path); in btrfs_recover_log_trees()
6425 btrfs_free_path(path); in btrfs_recover_log_trees()