Lines Matching refs:path

102 			     struct btrfs_path *path, u64 objectid);
106 struct btrfs_path *path,
387 struct btrfs_path *path, in overwrite_item() argument
407 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in overwrite_item()
414 u32 dst_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
415 path->slots[0]); in overwrite_item()
420 btrfs_release_path(path); in overwrite_item()
426 btrfs_release_path(path); in overwrite_item()
434 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in overwrite_item()
435 read_extent_buffer(path->nodes[0], dst_copy, dst_ptr, in overwrite_item()
448 btrfs_release_path(path); in overwrite_item()
461 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in overwrite_item()
463 nbytes = btrfs_inode_nbytes(path->nodes[0], item); in overwrite_item()
498 btrfs_release_path(path); in overwrite_item()
500 path->skip_release_on_error = 1; in overwrite_item()
501 ret = btrfs_insert_empty_item(trans, root, path, in overwrite_item()
503 path->skip_release_on_error = 0; in overwrite_item()
508 found_size = btrfs_item_size_nr(path->nodes[0], in overwrite_item()
509 path->slots[0]); in overwrite_item()
511 btrfs_truncate_item(path, item_size, 1); in overwrite_item()
513 btrfs_extend_item(path, item_size - found_size); in overwrite_item()
517 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], in overwrite_item()
518 path->slots[0]); in overwrite_item()
537 struct extent_buffer *dst_eb = path->nodes[0]; in overwrite_item()
556 S_ISDIR(btrfs_inode_mode(path->nodes[0], dst_item))) { in overwrite_item()
558 saved_i_size = btrfs_inode_size(path->nodes[0], in overwrite_item()
563 copy_extent_buffer(path->nodes[0], eb, dst_ptr, in overwrite_item()
569 btrfs_set_inode_size(path->nodes[0], dst_item, saved_i_size); in overwrite_item()
576 if (btrfs_inode_generation(path->nodes[0], dst_item) == 0) { in overwrite_item()
577 btrfs_set_inode_generation(path->nodes[0], dst_item, in overwrite_item()
582 btrfs_mark_buffer_dirty(path->nodes[0]); in overwrite_item()
583 btrfs_release_path(path); in overwrite_item()
616 struct btrfs_path *path, in replay_one_extent() argument
666 ret = btrfs_lookup_file_extent(trans, root, path, in replay_one_extent()
677 leaf = path->nodes[0]; in replay_one_extent()
678 existing = btrfs_item_ptr(leaf, path->slots[0], in replay_one_extent()
691 btrfs_release_path(path); in replay_one_extent()
695 btrfs_release_path(path); in replay_one_extent()
715 ret = btrfs_insert_empty_item(trans, root, path, key, in replay_one_extent()
719 dest_offset = btrfs_item_ptr_offset(path->nodes[0], in replay_one_extent()
720 path->slots[0]); in replay_one_extent()
721 copy_extent_buffer(path->nodes[0], eb, dest_offset, in replay_one_extent()
779 btrfs_release_path(path); in replay_one_extent()
864 btrfs_release_path(path); in replay_one_extent()
868 ret = overwrite_item(trans, root, path, eb, slot, key); in replay_one_extent()
897 struct btrfs_path *path, in drop_one_dir_item() argument
908 leaf = path->nodes[0]; in drop_one_dir_item()
917 btrfs_release_path(path); in drop_one_dir_item()
925 ret = link_to_fixup_dir(trans, root, path, location.objectid); in drop_one_dir_item()
949 struct btrfs_path *path, in inode_in_dir() argument
957 di = btrfs_lookup_dir_index_item(NULL, root, path, dirid, in inode_in_dir()
963 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
970 btrfs_release_path(path); in inode_in_dir()
971 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); in inode_in_dir()
976 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
981 btrfs_release_path(path); in inode_in_dir()
1000 struct btrfs_path *path; in backref_in_log() local
1003 path = btrfs_alloc_path(); in backref_in_log()
1004 if (!path) in backref_in_log()
1007 ret = btrfs_search_slot(NULL, log, key, path, 0, 0); in backref_in_log()
1016 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in backref_in_log()
1017 path->slots[0], in backref_in_log()
1021 ret = !!btrfs_find_name_in_backref(path->nodes[0], in backref_in_log()
1022 path->slots[0], in backref_in_log()
1025 btrfs_free_path(path); in backref_in_log()
1031 struct btrfs_path *path, in __add_inode_ref() argument
1052 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in __add_inode_ref()
1058 leaf = path->nodes[0]; in __add_inode_ref()
1070 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1071 ptr_end = ptr + btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1092 btrfs_release_path(path); in __add_inode_ref()
1116 btrfs_release_path(path); in __add_inode_ref()
1119 extref = btrfs_lookup_inode_extref(NULL, root, path, name, namelen, in __add_inode_ref()
1128 leaf = path->nodes[0]; in __add_inode_ref()
1130 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1131 base = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1163 btrfs_release_path(path); in __add_inode_ref()
1187 btrfs_release_path(path); in __add_inode_ref()
1190 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1195 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1199 btrfs_release_path(path); in __add_inode_ref()
1202 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1207 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1211 btrfs_release_path(path); in __add_inode_ref()
1269 struct btrfs_path *path, in unlink_old_inode_refs() argument
1281 btrfs_release_path(path); in unlink_old_inode_refs()
1282 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in unlink_old_inode_refs()
1290 eb = path->nodes[0]; in unlink_old_inode_refs()
1291 ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]); in unlink_old_inode_refs()
1292 ref_end = ref_ptr + btrfs_item_size_nr(eb, path->slots[0]); in unlink_old_inode_refs()
1320 btrfs_release_path(path); in unlink_old_inode_refs()
1345 btrfs_release_path(path); in unlink_old_inode_refs()
1354 struct btrfs_path *path; in btrfs_inode_ref_exists() local
1358 path = btrfs_alloc_path(); in btrfs_inode_ref_exists()
1359 if (!path) in btrfs_inode_ref_exists()
1369 ret = btrfs_search_slot(NULL, BTRFS_I(inode)->root, &key, path, 0, 0); in btrfs_inode_ref_exists()
1377 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in btrfs_inode_ref_exists()
1378 path->slots[0], parent_id, name, namelen); in btrfs_inode_ref_exists()
1380 ret = !!btrfs_find_name_in_backref(path->nodes[0], path->slots[0], in btrfs_inode_ref_exists()
1384 btrfs_free_path(path); in btrfs_inode_ref_exists()
1394 struct btrfs_path *path; in add_link() local
1398 path = btrfs_alloc_path(); in add_link()
1399 if (!path) in add_link()
1402 dir_item = btrfs_lookup_dir_item(NULL, root, path, in add_link()
1406 btrfs_release_path(path); in add_link()
1418 btrfs_dir_item_key_to_cpu(path->nodes[0], dir_item, &key); in add_link()
1419 btrfs_release_path(path); in add_link()
1444 btrfs_free_path(path); in add_link()
1458 struct btrfs_path *path, in add_inode_ref() argument
1531 ret = inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), in add_inode_ref()
1546 ret = __add_inode_ref(trans, root, path, log, in add_inode_ref()
1615 ret = unlink_old_inode_refs(trans, root, path, BTRFS_I(inode), eb, slot, in add_inode_ref()
1621 ret = overwrite_item(trans, root, path, eb, slot, key); in add_inode_ref()
1623 btrfs_release_path(path); in add_inode_ref()
1631 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_extrefs() argument
1645 ret = btrfs_find_one_extref(root, inode_objectid, offset, path, in count_inode_extrefs()
1650 leaf = path->nodes[0]; in count_inode_extrefs()
1651 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in count_inode_extrefs()
1652 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in count_inode_extrefs()
1665 btrfs_release_path(path); in count_inode_extrefs()
1667 btrfs_release_path(path); in count_inode_extrefs()
1675 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_refs() argument
1690 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in count_inode_refs()
1694 if (path->slots[0] == 0) in count_inode_refs()
1696 path->slots[0]--; in count_inode_refs()
1699 btrfs_item_key_to_cpu(path->nodes[0], &key, in count_inode_refs()
1700 path->slots[0]); in count_inode_refs()
1704 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in count_inode_refs()
1705 ptr_end = ptr + btrfs_item_size_nr(path->nodes[0], in count_inode_refs()
1706 path->slots[0]); in count_inode_refs()
1711 name_len = btrfs_inode_ref_name_len(path->nodes[0], in count_inode_refs()
1719 if (path->slots[0] > 0) { in count_inode_refs()
1720 path->slots[0]--; in count_inode_refs()
1724 btrfs_release_path(path); in count_inode_refs()
1726 btrfs_release_path(path); in count_inode_refs()
1745 struct btrfs_path *path; in fixup_inode_link_count() local
1750 path = btrfs_alloc_path(); in fixup_inode_link_count()
1751 if (!path) in fixup_inode_link_count()
1754 ret = count_inode_refs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1760 ret = count_inode_extrefs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1778 ret = replay_dir_deletes(trans, root, NULL, path, in fixup_inode_link_count()
1789 btrfs_free_path(path); in fixup_inode_link_count()
1795 struct btrfs_path *path) in fixup_inode_link_counts() argument
1805 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in fixup_inode_link_counts()
1811 if (path->slots[0] == 0) in fixup_inode_link_counts()
1813 path->slots[0]--; in fixup_inode_link_counts()
1816 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in fixup_inode_link_counts()
1821 ret = btrfs_del_item(trans, root, path); in fixup_inode_link_counts()
1825 btrfs_release_path(path); in fixup_inode_link_counts()
1844 btrfs_release_path(path); in fixup_inode_link_counts()
1856 struct btrfs_path *path, in link_to_fixup_dir() argument
1871 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in link_to_fixup_dir()
1873 btrfs_release_path(path); in link_to_fixup_dir()
1941 struct btrfs_path *path, in replay_one_name() argument
1974 ret = btrfs_lookup_inode(trans, root, path, &log_key, 0); in replay_one_name()
1975 btrfs_release_path(path); in replay_one_name()
1982 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, in replay_one_name()
1985 dst_di = btrfs_lookup_dir_index_item(trans, root, path, in replay_one_name()
2007 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key); in replay_one_name()
2012 btrfs_dir_type(path->nodes[0], dst_di) == log_type) { in replay_one_name()
2024 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), dst_di); in replay_one_name()
2031 btrfs_release_path(path); in replay_one_name()
2073 btrfs_release_path(path); in replay_one_name()
2093 struct btrfs_path *path, in replay_one_dir_item() argument
2110 ret = replay_one_name(trans, root, path, eb, di, key); in replay_one_dir_item()
2178 struct btrfs_path *path, in find_dir_range() argument
2195 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_dir_range()
2199 if (path->slots[0] == 0) in find_dir_range()
2201 path->slots[0]--; in find_dir_range()
2204 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2210 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2212 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2223 nritems = btrfs_header_nritems(path->nodes[0]); in find_dir_range()
2224 path->slots[0]++; in find_dir_range()
2225 if (path->slots[0] >= nritems) { in find_dir_range()
2226 ret = btrfs_next_leaf(root, path); in find_dir_range()
2231 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2237 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2239 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2244 btrfs_release_path(path); in find_dir_range()
2256 struct btrfs_path *path, in check_item_in_log() argument
2275 eb = path->nodes[0]; in check_item_in_log()
2276 slot = path->slots[0]; in check_item_in_log()
2304 btrfs_release_path(path); in check_item_in_log()
2313 path, location.objectid); in check_item_in_log()
2333 ret = btrfs_search_slot(NULL, root, dir_key, path, in check_item_in_log()
2351 btrfs_release_path(path); in check_item_in_log()
2359 struct btrfs_path *path, in replay_xattr_deletes() argument
2376 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in replay_xattr_deletes()
2380 nritems = btrfs_header_nritems(path->nodes[0]); in replay_xattr_deletes()
2381 for (i = path->slots[0]; i < nritems; i++) { in replay_xattr_deletes()
2388 btrfs_item_key_to_cpu(path->nodes[0], &key, i); in replay_xattr_deletes()
2394 di = btrfs_item_ptr(path->nodes[0], i, struct btrfs_dir_item); in replay_xattr_deletes()
2395 total_size = btrfs_item_size_nr(path->nodes[0], i); in replay_xattr_deletes()
2398 u16 name_len = btrfs_dir_name_len(path->nodes[0], di); in replay_xattr_deletes()
2399 u16 data_len = btrfs_dir_data_len(path->nodes[0], di); in replay_xattr_deletes()
2408 read_extent_buffer(path->nodes[0], name, in replay_xattr_deletes()
2416 btrfs_release_path(path); in replay_xattr_deletes()
2417 di = btrfs_lookup_xattr(trans, root, path, ino, in replay_xattr_deletes()
2426 path, di); in replay_xattr_deletes()
2429 btrfs_release_path(path); in replay_xattr_deletes()
2442 ret = btrfs_next_leaf(root, path); in replay_xattr_deletes()
2449 btrfs_release_path(path); in replay_xattr_deletes()
2467 struct btrfs_path *path, in replay_dir_deletes() argument
2501 ret = find_dir_range(log, path, dirid, key_type, in replay_dir_deletes()
2510 ret = btrfs_search_slot(NULL, root, &dir_key, path, in replay_dir_deletes()
2515 nritems = btrfs_header_nritems(path->nodes[0]); in replay_dir_deletes()
2516 if (path->slots[0] >= nritems) { in replay_dir_deletes()
2517 ret = btrfs_next_leaf(root, path); in replay_dir_deletes()
2523 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in replay_dir_deletes()
2524 path->slots[0]); in replay_dir_deletes()
2532 ret = check_item_in_log(trans, root, log, path, in replay_dir_deletes()
2541 btrfs_release_path(path); in replay_dir_deletes()
2552 btrfs_release_path(path); in replay_dir_deletes()
2556 btrfs_release_path(path); in replay_dir_deletes()
2577 struct btrfs_path *path; in replay_one_buffer() local
2592 path = btrfs_alloc_path(); in replay_one_buffer()
2593 if (!path) in replay_one_buffer()
2623 path, key.objectid); in replay_one_buffer()
2629 root, log, path, key.objectid, 0); in replay_one_buffer()
2633 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2677 path, key.objectid); in replay_one_buffer()
2687 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2698 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2704 ret = add_inode_ref(wc->trans, root, log, path, in replay_one_buffer()
2710 ret = replay_one_extent(wc->trans, root, path, in replay_one_buffer()
2715 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2721 btrfs_free_path(path); in replay_one_buffer()
2750 struct btrfs_path *path, int *level, in walk_down_log_tree() argument
2764 cur = path->nodes[*level]; in walk_down_log_tree()
2768 if (path->slots[*level] >= in walk_down_log_tree()
2772 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_log_tree()
2773 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_log_tree()
2774 btrfs_node_key_to_cpu(cur, &first_key, path->slots[*level]); in walk_down_log_tree()
2791 path->slots[*level]++; in walk_down_log_tree()
2828 if (path->nodes[*level-1]) in walk_down_log_tree()
2829 free_extent_buffer(path->nodes[*level-1]); in walk_down_log_tree()
2830 path->nodes[*level-1] = next; in walk_down_log_tree()
2832 path->slots[*level] = 0; in walk_down_log_tree()
2835 path->slots[*level] = btrfs_header_nritems(path->nodes[*level]); in walk_down_log_tree()
2843 struct btrfs_path *path, int *level, in walk_up_log_tree() argument
2851 for (i = *level; i < BTRFS_MAX_LEVEL - 1 && path->nodes[i]; i++) { in walk_up_log_tree()
2852 slot = path->slots[i]; in walk_up_log_tree()
2853 if (slot + 1 < btrfs_header_nritems(path->nodes[i])) { in walk_up_log_tree()
2854 path->slots[i]++; in walk_up_log_tree()
2859 ret = wc->process_func(root, path->nodes[*level], wc, in walk_up_log_tree()
2860 btrfs_header_generation(path->nodes[*level]), in walk_up_log_tree()
2868 next = path->nodes[*level]; in walk_up_log_tree()
2876 path->nodes[*level]->start, in walk_up_log_tree()
2877 path->nodes[*level]->len); in walk_up_log_tree()
2885 path->nodes[*level]->start); in walk_up_log_tree()
2888 free_extent_buffer(path->nodes[*level]); in walk_up_log_tree()
2889 path->nodes[*level] = NULL; in walk_up_log_tree()
2908 struct btrfs_path *path; in walk_log_tree() local
2911 path = btrfs_alloc_path(); in walk_log_tree()
2912 if (!path) in walk_log_tree()
2917 path->nodes[level] = log->node; in walk_log_tree()
2919 path->slots[level] = 0; in walk_log_tree()
2922 wret = walk_down_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2930 wret = walk_up_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2940 if (path->nodes[orig_level]) { in walk_log_tree()
2941 ret = wc->process_func(log, path->nodes[orig_level], wc, in walk_log_tree()
2942 btrfs_header_generation(path->nodes[orig_level]), in walk_log_tree()
2949 next = path->nodes[orig_level]; in walk_log_tree()
2969 btrfs_free_path(path); in walk_log_tree()
3500 struct btrfs_path *path; in btrfs_del_dir_entries_in_log() local
3515 path = btrfs_alloc_path(); in btrfs_del_dir_entries_in_log()
3516 if (!path) { in btrfs_del_dir_entries_in_log()
3521 di = btrfs_lookup_dir_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3528 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3534 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3535 di = btrfs_lookup_dir_index_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3542 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3555 btrfs_free_path(path); in btrfs_del_dir_entries_in_log()
3609 struct btrfs_path *path, in insert_dir_log_key() argument
3623 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item)); in insert_dir_log_key()
3627 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in insert_dir_log_key()
3629 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); in insert_dir_log_key()
3630 btrfs_mark_buffer_dirty(path->nodes[0]); in insert_dir_log_key()
3631 btrfs_release_path(path); in insert_dir_log_key()
3642 struct btrfs_path *path, in log_dir_items() argument
3664 ret = btrfs_search_forward(root, &min_key, path, trans->transid); in log_dir_items()
3674 btrfs_release_path(path); in log_dir_items()
3675 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3677 btrfs_release_path(path); in log_dir_items()
3680 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3689 btrfs_item_key_to_cpu(path->nodes[0], &tmp, in log_dir_items()
3690 path->slots[0]); in log_dir_items()
3698 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3701 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3705 path->nodes[0], path->slots[0], in log_dir_items()
3713 btrfs_release_path(path); in log_dir_items()
3724 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3734 src = path->nodes[0]; in log_dir_items()
3736 for (i = path->slots[0]; i < nritems; i++) { in log_dir_items()
3745 btrfs_release_path(path); in log_dir_items()
3788 path->slots[0] = nritems; in log_dir_items()
3794 ret = btrfs_next_leaf(root, path); in log_dir_items()
3802 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3807 if (btrfs_header_generation(path->nodes[0]) != trans->transid) { in log_dir_items()
3809 path->nodes[0], path->slots[0], in log_dir_items()
3819 btrfs_release_path(path); in log_dir_items()
3828 ret = insert_dir_log_key(trans, log, path, key_type, in log_dir_items()
3850 struct btrfs_path *path, in log_directory_changes() argument
3863 ret = log_dir_items(trans, root, inode, path, dst_path, key_type, in log_directory_changes()
3887 struct btrfs_path *path, in drop_objectid_items() argument
3900 ret = btrfs_search_slot(trans, log, &key, path, -1, 1); in drop_objectid_items()
3905 if (path->slots[0] == 0) in drop_objectid_items()
3908 path->slots[0]--; in drop_objectid_items()
3909 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in drop_objectid_items()
3910 path->slots[0]); in drop_objectid_items()
3917 ret = btrfs_bin_search(path->nodes[0], &found_key, &start_slot); in drop_objectid_items()
3921 ret = btrfs_del_items(trans, log, path, start_slot, in drop_objectid_items()
3922 path->slots[0] - start_slot + 1); in drop_objectid_items()
3929 btrfs_release_path(path); in drop_objectid_items()
3931 btrfs_release_path(path); in drop_objectid_items()
4001 struct btrfs_root *log, struct btrfs_path *path, in log_inode_item() argument
4018 ret = btrfs_search_slot(trans, log, &inode->location, path, 0, 1); in log_inode_item()
4032 ret = btrfs_insert_empty_item(trans, log, path, &inode->location, in log_inode_item()
4038 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], in log_inode_item()
4040 fill_inode_item(trans, path->nodes[0], inode_item, &inode->vfs_inode, in log_inode_item()
4042 btrfs_release_path(path); in log_inode_item()
4343 struct btrfs_path *path, in log_one_extent() argument
4360 drop_args.path = path; in log_one_extent()
4374 ret = btrfs_insert_empty_item(trans, log, path, &key, in log_one_extent()
4379 leaf = path->nodes[0]; in log_one_extent()
4381 fi = btrfs_item_ptr(leaf, path->slots[0], in log_one_extent()
4415 btrfs_release_path(path); in log_one_extent()
4430 struct btrfs_path *path) in btrfs_log_prealloc_extents() argument
4451 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_prealloc_extents()
4463 ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY); in btrfs_log_prealloc_extents()
4470 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4471 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4490 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4491 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4495 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4501 ret = btrfs_next_leaf(root, path); in btrfs_log_prealloc_extents()
4517 path->slots[0]++; in btrfs_log_prealloc_extents()
4539 path->slots[0]++; in btrfs_log_prealloc_extents()
4549 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4552 btrfs_release_path(path); in btrfs_log_prealloc_extents()
4560 struct btrfs_path *path, in btrfs_log_changed_extents() argument
4623 ret = log_one_extent(trans, inode, root, em, path, ctx); in btrfs_log_changed_extents()
4631 btrfs_release_path(path); in btrfs_log_changed_extents()
4633 ret = btrfs_log_prealloc_extents(trans, inode, path); in btrfs_log_changed_extents()
4663 struct btrfs_path *path, u64 *size_ret) in logged_inode_size() argument
4672 ret = btrfs_search_slot(NULL, log, &key, path, 0, 0); in logged_inode_size()
4680 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in logged_inode_size()
4682 *size_ret = btrfs_inode_size(path->nodes[0], item); in logged_inode_size()
4698 btrfs_release_path(path); in logged_inode_size()
4714 struct btrfs_path *path, in btrfs_log_all_xattrs() argument
4731 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_xattrs()
4736 int slot = path->slots[0]; in btrfs_log_all_xattrs()
4737 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_xattrs()
4742 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4748 ret = btrfs_next_leaf(root, path); in btrfs_log_all_xattrs()
4763 path->slots[0]++; in btrfs_log_all_xattrs()
4768 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4792 struct btrfs_path *path) in btrfs_log_holes() argument
4808 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4813 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_holes()
4815 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { in btrfs_log_holes()
4816 ret = btrfs_next_leaf(root, path); in btrfs_log_holes()
4823 leaf = path->nodes[0]; in btrfs_log_holes()
4826 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_log_holes()
4839 btrfs_release_path(path); in btrfs_log_holes()
4854 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4859 leaf = path->nodes[0]; in btrfs_log_holes()
4862 prev_extent_end = btrfs_file_extent_end(path); in btrfs_log_holes()
4863 path->slots[0]++; in btrfs_log_holes()
4870 btrfs_release_path(path); in btrfs_log_holes()
5026 struct btrfs_path *path, in log_conflicting_inodes() argument
5055 btrfs_release_path(path); in log_conflicting_inodes()
5140 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in log_conflicting_inodes()
5147 struct extent_buffer *leaf = path->nodes[0]; in log_conflicting_inodes()
5148 int slot = path->slots[0]; in log_conflicting_inodes()
5153 ret = btrfs_next_leaf(root, path); in log_conflicting_inodes()
5187 path->slots[0]++; in log_conflicting_inodes()
5199 struct btrfs_path *path, in copy_inode_items_to_log() argument
5213 ret = btrfs_search_forward(root, min_key, path, trans->transid); in copy_inode_items_to_log()
5237 ret = btrfs_check_ref_name_override(path->nodes[0], in copy_inode_items_to_log()
5238 path->slots[0], min_key, inode, in copy_inode_items_to_log()
5248 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5250 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5257 ret = log_conflicting_inodes(trans, root, path, in copy_inode_items_to_log()
5261 btrfs_release_path(path); in copy_inode_items_to_log()
5270 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5279 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { in copy_inode_items_to_log()
5283 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5288 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5293 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5295 path->slots[0]++; in copy_inode_items_to_log()
5296 if (path->slots[0] < btrfs_header_nritems(path->nodes[0])) { in copy_inode_items_to_log()
5297 btrfs_item_key_to_cpu(path->nodes[0], min_key, in copy_inode_items_to_log()
5298 path->slots[0]); in copy_inode_items_to_log()
5302 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5309 btrfs_release_path(path); in copy_inode_items_to_log()
5321 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5346 struct btrfs_path *path; in btrfs_log_inode() local
5362 path = btrfs_alloc_path(); in btrfs_log_inode()
5363 if (!path) in btrfs_log_inode()
5367 btrfs_free_path(path); in btrfs_log_inode()
5405 btrfs_free_path(path); in btrfs_log_inode()
5446 ret = drop_objectid_items(trans, log, path, ino, max_key_type); in btrfs_log_inode()
5462 err = logged_inode_size(log, inode, path, &logged_isize); in btrfs_log_inode()
5470 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5490 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5506 path, dst_path, logged_isize, in btrfs_log_inode()
5512 btrfs_release_path(path); in btrfs_log_inode()
5514 err = btrfs_log_all_xattrs(trans, root, inode, path, dst_path); in btrfs_log_inode()
5519 btrfs_release_path(path); in btrfs_log_inode()
5521 err = btrfs_log_holes(trans, root, inode, path); in btrfs_log_inode()
5526 btrfs_release_path(path); in btrfs_log_inode()
5541 err = btrfs_log_all_xattrs(trans, root, inode, path, in btrfs_log_inode()
5545 btrfs_release_path(path); in btrfs_log_inode()
5565 ret = log_directory_changes(trans, root, inode, path, dst_path, in btrfs_log_inode()
5618 btrfs_free_path(path); in btrfs_log_inode()
5712 struct btrfs_path *path; in log_new_dir_dentries() local
5717 path = btrfs_alloc_path(); in log_new_dir_dentries()
5718 if (!path) in log_new_dir_dentries()
5723 btrfs_free_path(path); in log_new_dir_dentries()
5744 btrfs_release_path(path); in log_new_dir_dentries()
5745 ret = btrfs_search_forward(log, &min_key, path, trans->transid); in log_new_dir_dentries()
5754 leaf = path->nodes[0]; in log_new_dir_dentries()
5756 for (i = path->slots[0]; i < nritems; i++) { in log_new_dir_dentries()
5778 btrfs_release_path(path); in log_new_dir_dentries()
5811 ret = btrfs_next_leaf(log, path); in log_new_dir_dentries()
5829 btrfs_free_path(path); in log_new_dir_dentries()
5839 struct btrfs_path *path; in btrfs_log_all_parents() local
5844 path = btrfs_alloc_path(); in btrfs_log_all_parents()
5845 if (!path) in btrfs_log_all_parents()
5847 path->skip_locking = 1; in btrfs_log_all_parents()
5848 path->search_commit_root = 1; in btrfs_log_all_parents()
5853 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_parents()
5858 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_parents()
5859 int slot = path->slots[0]; in btrfs_log_all_parents()
5865 ret = btrfs_next_leaf(root, path); in btrfs_log_all_parents()
5948 path->slots[0]++; in btrfs_log_all_parents()
5952 btrfs_free_path(path); in btrfs_log_all_parents()
5958 struct btrfs_path *path, in log_new_ancestors() argument
5963 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); in log_new_ancestors()
5967 struct extent_buffer *leaf = path->nodes[0]; in log_new_ancestors()
5968 int slot = path->slots[0]; in log_new_ancestors()
5974 btrfs_release_path(path); in log_new_ancestors()
5997 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_new_ancestors()
6001 leaf = path->nodes[0]; in log_new_ancestors()
6002 slot = path->slots[0]; in log_new_ancestors()
6004 ret = btrfs_next_leaf(root, path); in log_new_ancestors()
6009 leaf = path->nodes[0]; in log_new_ancestors()
6010 slot = path->slots[0]; in log_new_ancestors()
6066 struct btrfs_path *path; in log_all_new_ancestors() local
6077 path = btrfs_alloc_path(); in log_all_new_ancestors()
6078 if (!path) in log_all_new_ancestors()
6085 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_all_new_ancestors()
6089 path->slots[0]++; in log_all_new_ancestors()
6092 struct extent_buffer *leaf = path->nodes[0]; in log_all_new_ancestors()
6093 int slot = path->slots[0]; in log_all_new_ancestors()
6097 ret = btrfs_next_leaf(root, path); in log_all_new_ancestors()
6130 ret = log_new_ancestors(trans, root, path, ctx); in log_all_new_ancestors()
6133 btrfs_release_path(path); in log_all_new_ancestors()
6138 btrfs_free_path(path); in log_all_new_ancestors()
6300 struct btrfs_path *path; in btrfs_recover_log_trees() local
6311 path = btrfs_alloc_path(); in btrfs_recover_log_trees()
6312 if (!path) in btrfs_recover_log_trees()
6339 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
6347 if (path->slots[0] == 0) in btrfs_recover_log_trees()
6349 path->slots[0]--; in btrfs_recover_log_trees()
6351 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in btrfs_recover_log_trees()
6352 path->slots[0]); in btrfs_recover_log_trees()
6353 btrfs_release_path(path); in btrfs_recover_log_trees()
6405 path); in btrfs_recover_log_trees()
6411 btrfs_release_path(path); in btrfs_recover_log_trees()
6435 btrfs_release_path(path); in btrfs_recover_log_trees()
6450 btrfs_free_path(path); in btrfs_recover_log_trees()
6466 btrfs_free_path(path); in btrfs_recover_log_trees()