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()
917 struct btrfs_path *path, in drop_one_dir_item() argument
928 leaf = path->nodes[0]; in drop_one_dir_item()
937 btrfs_release_path(path); in drop_one_dir_item()
945 ret = link_to_fixup_dir(trans, root, path, location.objectid); in drop_one_dir_item()
965 struct btrfs_path *path, in inode_in_dir() argument
973 di = btrfs_lookup_dir_index_item(NULL, root, path, dirid, in inode_in_dir()
979 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
986 btrfs_release_path(path); in inode_in_dir()
987 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); in inode_in_dir()
992 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); in inode_in_dir()
997 btrfs_release_path(path); in inode_in_dir()
1016 struct btrfs_path *path; in backref_in_log() local
1019 path = btrfs_alloc_path(); in backref_in_log()
1020 if (!path) in backref_in_log()
1023 ret = btrfs_search_slot(NULL, log, key, path, 0, 0); in backref_in_log()
1032 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in backref_in_log()
1033 path->slots[0], in backref_in_log()
1037 ret = !!btrfs_find_name_in_backref(path->nodes[0], in backref_in_log()
1038 path->slots[0], in backref_in_log()
1041 btrfs_free_path(path); in backref_in_log()
1047 struct btrfs_path *path, in __add_inode_ref() argument
1068 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in __add_inode_ref()
1074 leaf = path->nodes[0]; in __add_inode_ref()
1086 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1087 ptr_end = ptr + btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1108 btrfs_release_path(path); in __add_inode_ref()
1129 btrfs_release_path(path); in __add_inode_ref()
1132 extref = btrfs_lookup_inode_extref(NULL, root, path, name, namelen, in __add_inode_ref()
1143 leaf = path->nodes[0]; in __add_inode_ref()
1145 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in __add_inode_ref()
1146 base = btrfs_item_ptr_offset(leaf, path->slots[0]); in __add_inode_ref()
1179 btrfs_release_path(path); in __add_inode_ref()
1200 btrfs_release_path(path); in __add_inode_ref()
1203 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1208 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1212 btrfs_release_path(path); in __add_inode_ref()
1215 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), in __add_inode_ref()
1220 ret = drop_one_dir_item(trans, root, path, dir, di); in __add_inode_ref()
1224 btrfs_release_path(path); in __add_inode_ref()
1282 struct btrfs_path *path, in unlink_old_inode_refs() argument
1294 btrfs_release_path(path); in unlink_old_inode_refs()
1295 ret = btrfs_search_slot(NULL, root, key, path, 0, 0); in unlink_old_inode_refs()
1303 eb = path->nodes[0]; in unlink_old_inode_refs()
1304 ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]); in unlink_old_inode_refs()
1305 ref_end = ref_ptr + btrfs_item_size_nr(eb, path->slots[0]); in unlink_old_inode_refs()
1333 btrfs_release_path(path); in unlink_old_inode_refs()
1358 btrfs_release_path(path); in unlink_old_inode_refs()
1367 struct btrfs_path *path; in btrfs_inode_ref_exists() local
1371 path = btrfs_alloc_path(); in btrfs_inode_ref_exists()
1372 if (!path) in btrfs_inode_ref_exists()
1382 ret = btrfs_search_slot(NULL, BTRFS_I(inode)->root, &key, path, 0, 0); in btrfs_inode_ref_exists()
1390 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0], in btrfs_inode_ref_exists()
1391 path->slots[0], parent_id, name, namelen); in btrfs_inode_ref_exists()
1393 ret = !!btrfs_find_name_in_backref(path->nodes[0], path->slots[0], in btrfs_inode_ref_exists()
1397 btrfs_free_path(path); in btrfs_inode_ref_exists()
1407 struct btrfs_path *path; in add_link() local
1411 path = btrfs_alloc_path(); in add_link()
1412 if (!path) in add_link()
1415 dir_item = btrfs_lookup_dir_item(NULL, root, path, in add_link()
1419 btrfs_release_path(path); in add_link()
1431 btrfs_dir_item_key_to_cpu(path->nodes[0], dir_item, &key); in add_link()
1432 btrfs_release_path(path); in add_link()
1453 btrfs_free_path(path); in add_link()
1467 struct btrfs_path *path, in add_inode_ref() argument
1540 ret = inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), in add_inode_ref()
1555 ret = __add_inode_ref(trans, root, path, log, in add_inode_ref()
1624 ret = unlink_old_inode_refs(trans, root, path, BTRFS_I(inode), eb, slot, in add_inode_ref()
1630 ret = overwrite_item(trans, root, path, eb, slot, key); in add_inode_ref()
1632 btrfs_release_path(path); in add_inode_ref()
1640 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_extrefs() argument
1654 ret = btrfs_find_one_extref(root, inode_objectid, offset, path, in count_inode_extrefs()
1659 leaf = path->nodes[0]; in count_inode_extrefs()
1660 item_size = btrfs_item_size_nr(leaf, path->slots[0]); in count_inode_extrefs()
1661 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]); in count_inode_extrefs()
1674 btrfs_release_path(path); in count_inode_extrefs()
1676 btrfs_release_path(path); in count_inode_extrefs()
1684 struct btrfs_inode *inode, struct btrfs_path *path) in count_inode_refs() argument
1699 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in count_inode_refs()
1703 if (path->slots[0] == 0) in count_inode_refs()
1705 path->slots[0]--; in count_inode_refs()
1708 btrfs_item_key_to_cpu(path->nodes[0], &key, in count_inode_refs()
1709 path->slots[0]); in count_inode_refs()
1713 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]); in count_inode_refs()
1714 ptr_end = ptr + btrfs_item_size_nr(path->nodes[0], in count_inode_refs()
1715 path->slots[0]); in count_inode_refs()
1720 name_len = btrfs_inode_ref_name_len(path->nodes[0], in count_inode_refs()
1728 if (path->slots[0] > 0) { in count_inode_refs()
1729 path->slots[0]--; in count_inode_refs()
1733 btrfs_release_path(path); in count_inode_refs()
1735 btrfs_release_path(path); in count_inode_refs()
1754 struct btrfs_path *path; in fixup_inode_link_count() local
1759 path = btrfs_alloc_path(); in fixup_inode_link_count()
1760 if (!path) in fixup_inode_link_count()
1763 ret = count_inode_refs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1769 ret = count_inode_extrefs(root, BTRFS_I(inode), path); in fixup_inode_link_count()
1787 ret = replay_dir_deletes(trans, root, NULL, path, in fixup_inode_link_count()
1798 btrfs_free_path(path); in fixup_inode_link_count()
1804 struct btrfs_path *path) in fixup_inode_link_counts() argument
1814 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in fixup_inode_link_counts()
1820 if (path->slots[0] == 0) in fixup_inode_link_counts()
1822 path->slots[0]--; in fixup_inode_link_counts()
1825 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in fixup_inode_link_counts()
1830 ret = btrfs_del_item(trans, root, path); in fixup_inode_link_counts()
1834 btrfs_release_path(path); in fixup_inode_link_counts()
1853 btrfs_release_path(path); in fixup_inode_link_counts()
1865 struct btrfs_path *path, in link_to_fixup_dir() argument
1880 ret = btrfs_insert_empty_item(trans, root, path, &key, 0); in link_to_fixup_dir()
1882 btrfs_release_path(path); in link_to_fixup_dir()
1950 struct btrfs_path *path, in replay_one_name() argument
1983 ret = btrfs_lookup_inode(trans, root, path, &log_key, 0); in replay_one_name()
1984 btrfs_release_path(path); in replay_one_name()
1991 dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, in replay_one_name()
1994 dst_di = btrfs_lookup_dir_index_item(trans, root, path, in replay_one_name()
2016 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key); in replay_one_name()
2021 btrfs_dir_type(path->nodes[0], dst_di) == log_type) { in replay_one_name()
2033 ret = drop_one_dir_item(trans, root, path, BTRFS_I(dir), dst_di); in replay_one_name()
2040 btrfs_release_path(path); in replay_one_name()
2082 btrfs_release_path(path); in replay_one_name()
2102 struct btrfs_path *path, in replay_one_dir_item() argument
2119 ret = replay_one_name(trans, root, path, eb, di, key); in replay_one_dir_item()
2187 struct btrfs_path *path, in find_dir_range() argument
2204 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_dir_range()
2208 if (path->slots[0] == 0) in find_dir_range()
2210 path->slots[0]--; 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()
2232 nritems = btrfs_header_nritems(path->nodes[0]); in find_dir_range()
2233 path->slots[0]++; in find_dir_range()
2234 if (path->slots[0] >= nritems) { in find_dir_range()
2235 ret = btrfs_next_leaf(root, path); in find_dir_range()
2240 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); in find_dir_range()
2246 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_dir_range()
2248 found_end = btrfs_dir_log_end(path->nodes[0], item); in find_dir_range()
2253 btrfs_release_path(path); in find_dir_range()
2265 struct btrfs_path *path, in check_item_in_log() argument
2287 eb = path->nodes[0]; in check_item_in_log()
2288 slot = path->slots[0]; in check_item_in_log()
2317 btrfs_release_path(path); in check_item_in_log()
2325 ret = link_to_fixup_dir(trans, root, path, location.objectid); in check_item_in_log()
2338 btrfs_release_path(path); in check_item_in_log()
2348 struct btrfs_path *path, in replay_xattr_deletes() argument
2365 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in replay_xattr_deletes()
2369 nritems = btrfs_header_nritems(path->nodes[0]); in replay_xattr_deletes()
2370 for (i = path->slots[0]; i < nritems; i++) { in replay_xattr_deletes()
2377 btrfs_item_key_to_cpu(path->nodes[0], &key, i); in replay_xattr_deletes()
2383 di = btrfs_item_ptr(path->nodes[0], i, struct btrfs_dir_item); in replay_xattr_deletes()
2384 total_size = btrfs_item_size_nr(path->nodes[0], i); in replay_xattr_deletes()
2387 u16 name_len = btrfs_dir_name_len(path->nodes[0], di); in replay_xattr_deletes()
2388 u16 data_len = btrfs_dir_data_len(path->nodes[0], di); in replay_xattr_deletes()
2397 read_extent_buffer(path->nodes[0], name, in replay_xattr_deletes()
2405 btrfs_release_path(path); in replay_xattr_deletes()
2406 di = btrfs_lookup_xattr(trans, root, path, ino, in replay_xattr_deletes()
2415 path, di); in replay_xattr_deletes()
2418 btrfs_release_path(path); in replay_xattr_deletes()
2431 ret = btrfs_next_leaf(root, path); in replay_xattr_deletes()
2438 btrfs_release_path(path); in replay_xattr_deletes()
2456 struct btrfs_path *path, in replay_dir_deletes() argument
2489 ret = find_dir_range(log, path, dirid, in replay_dir_deletes()
2500 ret = btrfs_search_slot(NULL, root, &dir_key, path, in replay_dir_deletes()
2505 nritems = btrfs_header_nritems(path->nodes[0]); in replay_dir_deletes()
2506 if (path->slots[0] >= nritems) { in replay_dir_deletes()
2507 ret = btrfs_next_leaf(root, path); in replay_dir_deletes()
2513 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in replay_dir_deletes()
2514 path->slots[0]); in replay_dir_deletes()
2524 ret = check_item_in_log(trans, root, log, path, in replay_dir_deletes()
2533 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()
2661 path, key.objectid); in replay_one_buffer()
2671 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2682 ret = overwrite_item(wc->trans, root, path, in replay_one_buffer()
2688 ret = add_inode_ref(wc->trans, root, log, path, in replay_one_buffer()
2694 ret = replay_one_extent(wc->trans, root, path, in replay_one_buffer()
2699 ret = replay_one_dir_item(wc->trans, root, path, in replay_one_buffer()
2705 btrfs_free_path(path); in replay_one_buffer()
2734 struct btrfs_path *path, int *level, in walk_down_log_tree() argument
2748 cur = path->nodes[*level]; in walk_down_log_tree()
2752 if (path->slots[*level] >= in walk_down_log_tree()
2756 bytenr = btrfs_node_blockptr(cur, path->slots[*level]); in walk_down_log_tree()
2757 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]); in walk_down_log_tree()
2758 btrfs_node_key_to_cpu(cur, &first_key, path->slots[*level]); in walk_down_log_tree()
2775 path->slots[*level]++; in walk_down_log_tree()
2812 if (path->nodes[*level-1]) in walk_down_log_tree()
2813 free_extent_buffer(path->nodes[*level-1]); in walk_down_log_tree()
2814 path->nodes[*level-1] = next; in walk_down_log_tree()
2816 path->slots[*level] = 0; in walk_down_log_tree()
2819 path->slots[*level] = btrfs_header_nritems(path->nodes[*level]); in walk_down_log_tree()
2827 struct btrfs_path *path, int *level, in walk_up_log_tree() argument
2835 for (i = *level; i < BTRFS_MAX_LEVEL - 1 && path->nodes[i]; i++) { in walk_up_log_tree()
2836 slot = path->slots[i]; in walk_up_log_tree()
2837 if (slot + 1 < btrfs_header_nritems(path->nodes[i])) { in walk_up_log_tree()
2838 path->slots[i]++; in walk_up_log_tree()
2843 ret = wc->process_func(root, path->nodes[*level], wc, in walk_up_log_tree()
2844 btrfs_header_generation(path->nodes[*level]), in walk_up_log_tree()
2852 next = path->nodes[*level]; in walk_up_log_tree()
2860 path->nodes[*level]->start, in walk_up_log_tree()
2861 path->nodes[*level]->len); in walk_up_log_tree()
2871 path->nodes[*level]->start); in walk_up_log_tree()
2874 free_extent_buffer(path->nodes[*level]); in walk_up_log_tree()
2875 path->nodes[*level] = NULL; in walk_up_log_tree()
2894 struct btrfs_path *path; in walk_log_tree() local
2897 path = btrfs_alloc_path(); in walk_log_tree()
2898 if (!path) in walk_log_tree()
2903 path->nodes[level] = log->node; in walk_log_tree()
2905 path->slots[level] = 0; in walk_log_tree()
2908 wret = walk_down_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2916 wret = walk_up_log_tree(trans, log, path, &level, wc); in walk_log_tree()
2926 if (path->nodes[orig_level]) { in walk_log_tree()
2927 ret = wc->process_func(log, path->nodes[orig_level], wc, in walk_log_tree()
2928 btrfs_header_generation(path->nodes[orig_level]), in walk_log_tree()
2935 next = path->nodes[orig_level]; in walk_log_tree()
2956 btrfs_free_path(path); in walk_log_tree()
3507 struct btrfs_path *path; in btrfs_del_dir_entries_in_log() local
3522 path = btrfs_alloc_path(); in btrfs_del_dir_entries_in_log()
3523 if (!path) { in btrfs_del_dir_entries_in_log()
3528 di = btrfs_lookup_dir_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3535 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3541 btrfs_release_path(path); in btrfs_del_dir_entries_in_log()
3542 di = btrfs_lookup_dir_index_item(trans, log, path, dir_ino, in btrfs_del_dir_entries_in_log()
3549 ret = btrfs_delete_one_dir_name(trans, log, path, di); in btrfs_del_dir_entries_in_log()
3562 btrfs_free_path(path); in btrfs_del_dir_entries_in_log()
3616 struct btrfs_path *path, in insert_dir_log_key() argument
3630 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item)); in insert_dir_log_key()
3634 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in insert_dir_log_key()
3636 btrfs_set_dir_log_end(path->nodes[0], item, last_offset); in insert_dir_log_key()
3637 btrfs_mark_buffer_dirty(path->nodes[0]); in insert_dir_log_key()
3638 btrfs_release_path(path); in insert_dir_log_key()
3649 struct btrfs_path *path, in log_dir_items() argument
3671 ret = btrfs_search_forward(root, &min_key, path, trans->transid); in log_dir_items()
3681 btrfs_release_path(path); in log_dir_items()
3682 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3684 btrfs_release_path(path); in log_dir_items()
3687 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3696 btrfs_item_key_to_cpu(path->nodes[0], &tmp, in log_dir_items()
3697 path->slots[0]); in log_dir_items()
3705 ret = btrfs_previous_item(root, path, ino, key_type); in log_dir_items()
3708 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3712 path->nodes[0], path->slots[0], in log_dir_items()
3720 btrfs_release_path(path); in log_dir_items()
3731 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0); in log_dir_items()
3741 src = path->nodes[0]; in log_dir_items()
3743 for (i = path->slots[0]; i < nritems; i++) { in log_dir_items()
3752 btrfs_release_path(path); in log_dir_items()
3795 path->slots[0] = nritems; in log_dir_items()
3801 ret = btrfs_next_leaf(root, path); in log_dir_items()
3809 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]); in log_dir_items()
3814 if (btrfs_header_generation(path->nodes[0]) != trans->transid) { in log_dir_items()
3816 path->nodes[0], path->slots[0], in log_dir_items()
3826 btrfs_release_path(path); in log_dir_items()
3835 ret = insert_dir_log_key(trans, log, path, key_type, in log_dir_items()
3857 struct btrfs_path *path, in log_directory_changes() argument
3870 ret = log_dir_items(trans, root, inode, path, dst_path, key_type, in log_directory_changes()
3894 struct btrfs_path *path, in drop_objectid_items() argument
3907 ret = btrfs_search_slot(trans, log, &key, path, -1, 1); in drop_objectid_items()
3912 if (path->slots[0] == 0) in drop_objectid_items()
3915 path->slots[0]--; in drop_objectid_items()
3916 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in drop_objectid_items()
3917 path->slots[0]); in drop_objectid_items()
3924 ret = btrfs_bin_search(path->nodes[0], &found_key, &start_slot); in drop_objectid_items()
3928 ret = btrfs_del_items(trans, log, path, start_slot, in drop_objectid_items()
3929 path->slots[0] - start_slot + 1); in drop_objectid_items()
3936 btrfs_release_path(path); in drop_objectid_items()
3938 btrfs_release_path(path); in drop_objectid_items()
4008 struct btrfs_root *log, struct btrfs_path *path, in log_inode_item() argument
4025 ret = btrfs_search_slot(trans, log, &inode->location, path, 0, 1); in log_inode_item()
4039 ret = btrfs_insert_empty_item(trans, log, path, &inode->location, in log_inode_item()
4045 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], in log_inode_item()
4047 fill_inode_item(trans, path->nodes[0], inode_item, &inode->vfs_inode, in log_inode_item()
4049 btrfs_release_path(path); in log_inode_item()
4350 struct btrfs_path *path, in log_one_extent() argument
4367 drop_args.path = path; in log_one_extent()
4381 ret = btrfs_insert_empty_item(trans, log, path, &key, in log_one_extent()
4386 leaf = path->nodes[0]; in log_one_extent()
4388 fi = btrfs_item_ptr(leaf, path->slots[0], in log_one_extent()
4422 btrfs_release_path(path); in log_one_extent()
4437 struct btrfs_path *path) in btrfs_log_prealloc_extents() argument
4458 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_prealloc_extents()
4470 ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY); in btrfs_log_prealloc_extents()
4477 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4478 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4497 leaf = path->nodes[0]; in btrfs_log_prealloc_extents()
4498 slot = path->slots[0]; in btrfs_log_prealloc_extents()
4502 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4508 ret = btrfs_next_leaf(root, path); in btrfs_log_prealloc_extents()
4524 path->slots[0]++; in btrfs_log_prealloc_extents()
4546 path->slots[0]++; in btrfs_log_prealloc_extents()
4556 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_prealloc_extents()
4559 btrfs_release_path(path); in btrfs_log_prealloc_extents()
4567 struct btrfs_path *path, in btrfs_log_changed_extents() argument
4630 ret = log_one_extent(trans, inode, root, em, path, ctx); in btrfs_log_changed_extents()
4638 btrfs_release_path(path); in btrfs_log_changed_extents()
4640 ret = btrfs_log_prealloc_extents(trans, inode, path); in btrfs_log_changed_extents()
4670 struct btrfs_path *path, u64 *size_ret) in logged_inode_size() argument
4679 ret = btrfs_search_slot(NULL, log, &key, path, 0, 0); in logged_inode_size()
4687 item = btrfs_item_ptr(path->nodes[0], path->slots[0], in logged_inode_size()
4689 *size_ret = btrfs_inode_size(path->nodes[0], item); in logged_inode_size()
4705 btrfs_release_path(path); in logged_inode_size()
4721 struct btrfs_path *path, in btrfs_log_all_xattrs() argument
4738 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_xattrs()
4743 int slot = path->slots[0]; in btrfs_log_all_xattrs()
4744 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_xattrs()
4749 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4755 ret = btrfs_next_leaf(root, path); in btrfs_log_all_xattrs()
4770 path->slots[0]++; in btrfs_log_all_xattrs()
4775 ret = copy_items(trans, inode, dst_path, path, in btrfs_log_all_xattrs()
4799 struct btrfs_path *path) in btrfs_log_holes() argument
4815 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4820 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_holes()
4822 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) { in btrfs_log_holes()
4823 ret = btrfs_next_leaf(root, path); in btrfs_log_holes()
4830 leaf = path->nodes[0]; in btrfs_log_holes()
4833 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_log_holes()
4846 btrfs_release_path(path); in btrfs_log_holes()
4861 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_holes()
4866 leaf = path->nodes[0]; in btrfs_log_holes()
4869 prev_extent_end = btrfs_file_extent_end(path); in btrfs_log_holes()
4870 path->slots[0]++; in btrfs_log_holes()
4877 btrfs_release_path(path); in btrfs_log_holes()
5033 struct btrfs_path *path, in log_conflicting_inodes() argument
5062 btrfs_release_path(path); in log_conflicting_inodes()
5147 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in log_conflicting_inodes()
5154 struct extent_buffer *leaf = path->nodes[0]; in log_conflicting_inodes()
5155 int slot = path->slots[0]; in log_conflicting_inodes()
5160 ret = btrfs_next_leaf(root, path); in log_conflicting_inodes()
5194 path->slots[0]++; in log_conflicting_inodes()
5206 struct btrfs_path *path, in copy_inode_items_to_log() argument
5221 ret = btrfs_search_forward(root, min_key, path, trans->transid); in copy_inode_items_to_log()
5253 ret = btrfs_check_ref_name_override(path->nodes[0], in copy_inode_items_to_log()
5254 path->slots[0], min_key, inode, in copy_inode_items_to_log()
5264 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5266 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5273 ret = log_conflicting_inodes(trans, root, path, in copy_inode_items_to_log()
5277 btrfs_release_path(path); in copy_inode_items_to_log()
5284 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5293 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { in copy_inode_items_to_log()
5297 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5302 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5307 ins_start_slot = path->slots[0]; in copy_inode_items_to_log()
5309 path->slots[0]++; in copy_inode_items_to_log()
5310 if (path->slots[0] < btrfs_header_nritems(path->nodes[0])) { in copy_inode_items_to_log()
5311 btrfs_item_key_to_cpu(path->nodes[0], min_key, in copy_inode_items_to_log()
5312 path->slots[0]); in copy_inode_items_to_log()
5316 ret = copy_items(trans, inode, dst_path, path, in copy_inode_items_to_log()
5323 btrfs_release_path(path); in copy_inode_items_to_log()
5335 ret = copy_items(trans, inode, dst_path, path, ins_start_slot, in copy_inode_items_to_log()
5346 btrfs_release_path(path); in copy_inode_items_to_log()
5372 struct btrfs_path *path; in btrfs_log_inode() local
5388 path = btrfs_alloc_path(); in btrfs_log_inode()
5389 if (!path) in btrfs_log_inode()
5393 btrfs_free_path(path); in btrfs_log_inode()
5431 btrfs_free_path(path); in btrfs_log_inode()
5484 ret = drop_objectid_items(trans, log, path, ino, max_key_type); in btrfs_log_inode()
5500 err = logged_inode_size(log, inode, path, &logged_isize); in btrfs_log_inode()
5508 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5528 ret = drop_objectid_items(trans, log, path, ino, in btrfs_log_inode()
5544 path, dst_path, logged_isize, in btrfs_log_inode()
5550 btrfs_release_path(path); in btrfs_log_inode()
5552 err = btrfs_log_all_xattrs(trans, root, inode, path, dst_path); in btrfs_log_inode()
5557 btrfs_release_path(path); in btrfs_log_inode()
5559 err = btrfs_log_holes(trans, root, inode, path); in btrfs_log_inode()
5564 btrfs_release_path(path); in btrfs_log_inode()
5579 err = btrfs_log_all_xattrs(trans, root, inode, path, in btrfs_log_inode()
5583 btrfs_release_path(path); in btrfs_log_inode()
5603 ret = log_directory_changes(trans, root, inode, path, dst_path, in btrfs_log_inode()
5656 btrfs_free_path(path); in btrfs_log_inode()
5750 struct btrfs_path *path; in log_new_dir_dentries() local
5755 path = btrfs_alloc_path(); in log_new_dir_dentries()
5756 if (!path) in log_new_dir_dentries()
5761 btrfs_free_path(path); in log_new_dir_dentries()
5782 btrfs_release_path(path); in log_new_dir_dentries()
5783 ret = btrfs_search_forward(log, &min_key, path, trans->transid); in log_new_dir_dentries()
5792 leaf = path->nodes[0]; in log_new_dir_dentries()
5794 for (i = path->slots[0]; i < nritems; i++) { in log_new_dir_dentries()
5816 btrfs_release_path(path); in log_new_dir_dentries()
5849 ret = btrfs_next_leaf(log, path); in log_new_dir_dentries()
5867 btrfs_free_path(path); in log_new_dir_dentries()
5877 struct btrfs_path *path; in btrfs_log_all_parents() local
5882 path = btrfs_alloc_path(); in btrfs_log_all_parents()
5883 if (!path) in btrfs_log_all_parents()
5885 path->skip_locking = 1; in btrfs_log_all_parents()
5886 path->search_commit_root = 1; in btrfs_log_all_parents()
5891 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_log_all_parents()
5896 struct extent_buffer *leaf = path->nodes[0]; in btrfs_log_all_parents()
5897 int slot = path->slots[0]; in btrfs_log_all_parents()
5903 ret = btrfs_next_leaf(root, path); in btrfs_log_all_parents()
5986 path->slots[0]++; in btrfs_log_all_parents()
5990 btrfs_free_path(path); in btrfs_log_all_parents()
5996 struct btrfs_path *path, in log_new_ancestors() argument
6001 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); in log_new_ancestors()
6005 struct extent_buffer *leaf = path->nodes[0]; in log_new_ancestors()
6006 int slot = path->slots[0]; in log_new_ancestors()
6012 btrfs_release_path(path); in log_new_ancestors()
6035 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_new_ancestors()
6039 leaf = path->nodes[0]; in log_new_ancestors()
6040 slot = path->slots[0]; in log_new_ancestors()
6042 ret = btrfs_next_leaf(root, path); in log_new_ancestors()
6047 leaf = path->nodes[0]; in log_new_ancestors()
6048 slot = path->slots[0]; in log_new_ancestors()
6104 struct btrfs_path *path; in log_all_new_ancestors() local
6115 path = btrfs_alloc_path(); in log_all_new_ancestors()
6116 if (!path) in log_all_new_ancestors()
6123 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in log_all_new_ancestors()
6127 path->slots[0]++; in log_all_new_ancestors()
6130 struct extent_buffer *leaf = path->nodes[0]; in log_all_new_ancestors()
6131 int slot = path->slots[0]; in log_all_new_ancestors()
6135 ret = btrfs_next_leaf(root, path); in log_all_new_ancestors()
6168 ret = log_new_ancestors(trans, root, path, ctx); in log_all_new_ancestors()
6171 btrfs_release_path(path); in log_all_new_ancestors()
6176 btrfs_free_path(path); in log_all_new_ancestors()
6338 struct btrfs_path *path; in btrfs_recover_log_trees() local
6349 path = btrfs_alloc_path(); in btrfs_recover_log_trees()
6350 if (!path) in btrfs_recover_log_trees()
6377 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
6385 if (path->slots[0] == 0) in btrfs_recover_log_trees()
6387 path->slots[0]--; in btrfs_recover_log_trees()
6389 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in btrfs_recover_log_trees()
6390 path->slots[0]); in btrfs_recover_log_trees()
6391 btrfs_release_path(path); in btrfs_recover_log_trees()
6443 path); in btrfs_recover_log_trees()
6449 btrfs_release_path(path); in btrfs_recover_log_trees()
6473 btrfs_release_path(path); in btrfs_recover_log_trees()
6488 btrfs_free_path(path); in btrfs_recover_log_trees()
6504 btrfs_free_path(path); in btrfs_recover_log_trees()