Lines Matching refs:path

112 			     struct btrfs_path *path, u64 objectid);
116 struct btrfs_path *path,
366 * root is the tree we are copying into, and path is a scratch
367 * path for use in this function (it should be released on entry and
378 struct btrfs_path *path,
393 * we'll have to clone the leaf in the path, release the path and use
403 ret = btrfs_search_slot(NULL, root, key, path, 0, 0);
410 u32 dst_size = btrfs_item_size(path->nodes[0],
411 path->slots[0]);
416 btrfs_release_path(path);
422 btrfs_release_path(path);
430 dst_ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]);
431 read_extent_buffer(path->nodes[0], dst_copy, dst_ptr,
444 btrfs_release_path(path);
457 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
459 nbytes = btrfs_inode_nbytes(path->nodes[0], item);
494 btrfs_release_path(path);
496 path->skip_release_on_error = 1;
497 ret = btrfs_insert_empty_item(trans, root, path,
499 path->skip_release_on_error = 0;
504 found_size = btrfs_item_size(path->nodes[0],
505 path->slots[0]);
507 btrfs_truncate_item(trans, path, item_size, 1);
509 btrfs_extend_item(trans, path, item_size - found_size);
513 dst_ptr = btrfs_item_ptr_offset(path->nodes[0],
514 path->slots[0]);
533 struct extent_buffer *dst_eb = path->nodes[0];
551 S_ISDIR(btrfs_inode_mode(path->nodes[0], dst_item))) {
553 saved_i_size = btrfs_inode_size(path->nodes[0],
558 copy_extent_buffer(path->nodes[0], eb, dst_ptr,
564 btrfs_set_inode_size(path->nodes[0], dst_item, saved_i_size);
571 if (btrfs_inode_generation(path->nodes[0], dst_item) == 0) {
572 btrfs_set_inode_generation(path->nodes[0], dst_item,
577 btrfs_mark_buffer_dirty(trans, path->nodes[0]);
578 btrfs_release_path(path);
613 * subvolume 'root'. path is released on entry and should be released
626 struct btrfs_path *path,
676 ret = btrfs_lookup_file_extent(trans, root, path,
687 leaf = path->nodes[0];
688 existing = btrfs_item_ptr(leaf, path->slots[0],
701 btrfs_release_path(path);
705 btrfs_release_path(path);
725 ret = btrfs_insert_empty_item(trans, root, path, key,
729 dest_offset = btrfs_item_ptr_offset(path->nodes[0],
730 path->slots[0]);
731 copy_extent_buffer(path->nodes[0], eb, dest_offset,
788 btrfs_release_path(path);
877 btrfs_release_path(path);
881 ret = overwrite_item(trans, root, path, eb, slot, key);
927 struct btrfs_path *path,
938 leaf = path->nodes[0];
945 btrfs_release_path(path);
953 ret = link_to_fixup_dir(trans, root, path, location.objectid);
972 struct btrfs_path *path,
980 di = btrfs_lookup_dir_index_item(NULL, root, path, dirid,
986 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location);
993 btrfs_release_path(path);
994 di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, 0);
999 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location);
1004 btrfs_release_path(path);
1023 struct btrfs_path *path;
1026 path = btrfs_alloc_path();
1027 if (!path)
1030 ret = btrfs_search_slot(NULL, log, key, path, 0, 0);
1039 ret = !!btrfs_find_name_in_ext_backref(path->nodes[0],
1040 path->slots[0],
1043 ret = !!btrfs_find_name_in_backref(path->nodes[0],
1044 path->slots[0], name);
1046 btrfs_free_path(path);
1052 struct btrfs_path *path,
1070 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
1076 leaf = path->nodes[0];
1088 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
1089 ptr_end = ptr + btrfs_item_size(leaf, path->slots[0]);
1107 btrfs_release_path(path);
1121 btrfs_release_path(path);
1124 extref = btrfs_lookup_inode_extref(NULL, root, path, name,
1135 leaf = path->nodes[0];
1137 item_size = btrfs_item_size(leaf, path->slots[0]);
1138 base = btrfs_item_ptr_offset(leaf, path->slots[0]);
1170 btrfs_release_path(path);
1187 btrfs_release_path(path);
1190 di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir),
1195 ret = drop_one_dir_item(trans, path, dir, di);
1199 btrfs_release_path(path);
1202 di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), name, 0);
1206 ret = drop_one_dir_item(trans, path, dir, di);
1210 btrfs_release_path(path);
1265 struct btrfs_path *path,
1277 btrfs_release_path(path);
1278 ret = btrfs_search_slot(NULL, root, key, path, 0, 0);
1286 eb = path->nodes[0];
1287 ref_ptr = btrfs_item_ptr_offset(eb, path->slots[0]);
1288 ref_end = ref_ptr + btrfs_item_size(eb, path->slots[0]);
1312 btrfs_release_path(path);
1337 btrfs_release_path(path);
1344 * root is the destination we are replaying into, and path is for temp
1350 struct btrfs_path *path,
1420 ret = inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)),
1432 ret = __add_inode_ref(trans, root, path, log,
1471 ret = unlink_old_inode_refs(trans, root, path, BTRFS_I(inode), eb, slot,
1477 ret = overwrite_item(trans, root, path, eb, slot, key);
1479 btrfs_release_path(path);
1487 struct btrfs_inode *inode, struct btrfs_path *path)
1501 ret = btrfs_find_one_extref(root, inode_objectid, offset, path,
1506 leaf = path->nodes[0];
1507 item_size = btrfs_item_size(leaf, path->slots[0]);
1508 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
1521 btrfs_release_path(path);
1523 btrfs_release_path(path);
1531 struct btrfs_inode *inode, struct btrfs_path *path)
1546 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
1550 if (path->slots[0] == 0)
1552 path->slots[0]--;
1555 btrfs_item_key_to_cpu(path->nodes[0], &key,
1556 path->slots[0]);
1560 ptr = btrfs_item_ptr_offset(path->nodes[0], path->slots[0]);
1561 ptr_end = ptr + btrfs_item_size(path->nodes[0],
1562 path->slots[0]);
1567 name_len = btrfs_inode_ref_name_len(path->nodes[0],
1575 if (path->slots[0] > 0) {
1576 path->slots[0]--;
1580 btrfs_release_path(path);
1582 btrfs_release_path(path);
1601 struct btrfs_path *path;
1606 path = btrfs_alloc_path();
1607 if (!path)
1610 ret = count_inode_refs(root, BTRFS_I(inode), path);
1616 ret = count_inode_extrefs(root, BTRFS_I(inode), path);
1634 ret = replay_dir_deletes(trans, root, NULL, path,
1645 btrfs_free_path(path);
1651 struct btrfs_path *path)
1661 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1667 if (path->slots[0] == 0)
1669 path->slots[0]--;
1672 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
1677 ret = btrfs_del_item(trans, root, path);
1681 btrfs_release_path(path);
1700 btrfs_release_path(path);
1712 struct btrfs_path *path,
1727 ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
1729 btrfs_release_path(path);
1781 struct btrfs_path *path,
1789 btrfs_dir_item_key_to_cpu(path->nodes[0], dst_di, &found_key);
1794 btrfs_dir_flags(path->nodes[0], dst_di) == log_flags)
1804 return drop_one_dir_item(trans, path, dir, dst_di);
1825 struct btrfs_path *path,
1854 ret = btrfs_lookup_inode(trans, root, path, &log_key, 0);
1855 btrfs_release_path(path);
1861 dir_dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid,
1867 ret = delete_conflicting_dir_entry(trans, BTRFS_I(dir), path,
1875 btrfs_release_path(path);
1877 index_dst_di = btrfs_lookup_dir_index_item(trans, root, path,
1884 ret = delete_conflicting_dir_entry(trans, BTRFS_I(dir), path,
1892 btrfs_release_path(path);
1929 btrfs_release_path(path);
1954 struct btrfs_path *path,
1965 ret = replay_one_name(trans, root, path, eb, di, key);
2023 struct btrfs_path *path,
2040 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
2044 if (path->slots[0] == 0)
2046 path->slots[0]--;
2049 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
2055 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
2057 found_end = btrfs_dir_log_end(path->nodes[0], item);
2068 nritems = btrfs_header_nritems(path->nodes[0]);
2069 path->slots[0]++;
2070 if (path->slots[0] >= nritems) {
2071 ret = btrfs_next_leaf(root, path);
2076 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
2082 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
2084 found_end = btrfs_dir_log_end(path->nodes[0], item);
2089 btrfs_release_path(path);
2100 struct btrfs_path *path,
2122 eb = path->nodes[0];
2123 slot = path->slots[0];
2146 btrfs_release_path(path);
2154 ret = link_to_fixup_dir(trans, root, path, location.objectid);
2167 btrfs_release_path(path);
2177 struct btrfs_path *path,
2194 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
2198 nritems = btrfs_header_nritems(path->nodes[0]);
2199 for (i = path->slots[0]; i < nritems; i++) {
2206 btrfs_item_key_to_cpu(path->nodes[0], &key, i);
2212 di = btrfs_item_ptr(path->nodes[0], i, struct btrfs_dir_item);
2213 total_size = btrfs_item_size(path->nodes[0], i);
2216 u16 name_len = btrfs_dir_name_len(path->nodes[0], di);
2217 u16 data_len = btrfs_dir_data_len(path->nodes[0], di);
2226 read_extent_buffer(path->nodes[0], name,
2234 btrfs_release_path(path);
2235 di = btrfs_lookup_xattr(trans, root, path, ino,
2244 path, di);
2247 btrfs_release_path(path);
2260 ret = btrfs_next_leaf(root, path);
2267 btrfs_release_path(path);
2285 struct btrfs_path *path,
2318 ret = find_dir_range(log, path, dirid,
2329 ret = btrfs_search_slot(NULL, root, &dir_key, path,
2334 nritems = btrfs_header_nritems(path->nodes[0]);
2335 if (path->slots[0] >= nritems) {
2336 ret = btrfs_next_leaf(root, path);
2342 btrfs_item_key_to_cpu(path->nodes[0], &found_key,
2343 path->slots[0]);
2353 ret = check_item_in_log(trans, log, path,
2362 btrfs_release_path(path);
2369 btrfs_release_path(path);
2394 struct btrfs_path *path;
2409 path = btrfs_alloc_path();
2410 if (!path)
2440 path, key.objectid);
2446 root, log, path, key.objectid, 0);
2450 ret = overwrite_item(wc->trans, root, path,
2494 path, key.objectid);
2504 ret = replay_one_dir_item(wc->trans, root, path,
2515 ret = overwrite_item(wc->trans, root, path,
2521 ret = add_inode_ref(wc->trans, root, log, path,
2527 ret = replay_one_extent(wc->trans, root, path,
2539 btrfs_free_path(path);
2590 struct btrfs_path *path, int *level,
2603 cur = path->nodes[*level];
2607 if (path->slots[*level] >=
2611 bytenr = btrfs_node_blockptr(cur, path->slots[*level]);
2612 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]);
2616 btrfs_node_key_to_cpu(cur, &check.first_key, path->slots[*level]);
2632 path->slots[*level]++;
2655 if (path->nodes[*level-1])
2656 free_extent_buffer(path->nodes[*level-1]);
2657 path->nodes[*level-1] = next;
2659 path->slots[*level] = 0;
2662 path->slots[*level] = btrfs_header_nritems(path->nodes[*level]);
2670 struct btrfs_path *path, int *level,
2677 for (i = *level; i < BTRFS_MAX_LEVEL - 1 && path->nodes[i]; i++) {
2678 slot = path->slots[i];
2679 if (slot + 1 < btrfs_header_nritems(path->nodes[i])) {
2680 path->slots[i]++;
2685 ret = wc->process_func(root, path->nodes[*level], wc,
2686 btrfs_header_generation(path->nodes[*level]),
2692 ret = clean_log_buffer(trans, path->nodes[*level]);
2696 free_extent_buffer(path->nodes[*level]);
2697 path->nodes[*level] = NULL;
2715 struct btrfs_path *path;
2718 path = btrfs_alloc_path();
2719 if (!path)
2724 path->nodes[level] = log->node;
2726 path->slots[level] = 0;
2729 wret = walk_down_log_tree(trans, log, path, &level, wc);
2737 wret = walk_up_log_tree(trans, log, path, &level, wc);
2747 if (path->nodes[orig_level]) {
2748 ret = wc->process_func(log, path->nodes[orig_level], wc,
2749 btrfs_header_generation(path->nodes[orig_level]),
2754 ret = clean_log_buffer(trans, path->nodes[orig_level]);
2758 btrfs_free_path(path);
3259 struct btrfs_path *path = path_in;
3313 if (!path) {
3314 path = btrfs_alloc_path();
3315 if (!path)
3319 ret = btrfs_search_slot(NULL, inode->root->log_root, &key, path, 0, 0);
3322 btrfs_release_path(path);
3324 btrfs_free_path(path);
3373 struct btrfs_path *path,
3384 di = btrfs_lookup_dir_index_item(trans, log, path, dir_ino,
3396 return btrfs_delete_one_dir_name(trans, log, path, di);
3425 struct btrfs_path *path;
3442 path = btrfs_alloc_path();
3443 if (!path) {
3448 ret = del_logged_dentry(trans, root->log_root, path, btrfs_ino(dir),
3450 btrfs_free_path(path);
3497 struct btrfs_path *path,
3508 ret = btrfs_insert_empty_item(trans, log, path, &key, sizeof(*item));
3519 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
3522 const u64 curr_end = btrfs_dir_log_end(path->nodes[0], item);
3532 btrfs_set_dir_log_end(path->nodes[0], item, last_offset);
3533 btrfs_mark_buffer_dirty(trans, path->nodes[0]);
3534 btrfs_release_path(path);
3632 struct btrfs_path *path,
3639 const int nritems = btrfs_header_nritems(path->nodes[0]);
3651 src = btrfs_clone_extent_buffer(path->nodes[0]);
3655 i = path->slots[0];
3656 btrfs_release_path(path);
3657 path->nodes[0] = src;
3658 path->slots[0] = i;
3751 struct btrfs_path *path,
3768 ret = btrfs_search_forward(root, &min_key, path, trans->transid);
3779 btrfs_release_path(path);
3780 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
3782 btrfs_release_path(path);
3785 ret = btrfs_previous_item(root, path, ino, BTRFS_DIR_INDEX_KEY);
3795 btrfs_item_key_to_cpu(path->nodes[0], &tmp,
3796 path->slots[0]);
3807 ret = btrfs_previous_item(root, path, ino, BTRFS_DIR_INDEX_KEY);
3811 btrfs_item_key_to_cpu(path->nodes[0], &tmp, path->slots[0]);
3826 btrfs_release_path(path);
3843 ret = btrfs_search_slot(NULL, root, &min_key, path, 0, 0);
3845 ret = btrfs_next_item(root, path);
3860 ret = process_dir_items_leaf(trans, inode, path, dst_path, ctx,
3867 path->slots[0] = btrfs_header_nritems(path->nodes[0]);
3873 ret = btrfs_next_leaf(root, path);
3881 btrfs_item_key_to_cpu(path->nodes[0], &min_key, path->slots[0]);
3886 if (btrfs_header_generation(path->nodes[0]) != trans->transid) {
3900 btrfs_release_path(path);
3906 btrfs_release_path(path);
3921 ret = insert_dir_log_key(trans, log, path, ino,
3938 struct btrfs_path *path,
3959 ret = btrfs_search_slot(NULL, inode->root->log_root, &key, path, 0, 0);
3974 if (path->slots[0] == 0)
3984 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0] - 1);
3989 btrfs_release_path(path);
4008 struct btrfs_path *path,
4016 ret = update_last_dir_index_offset(inode, path, ctx);
4024 ret = log_dir_items(trans, inode, path, dst_path,
4044 struct btrfs_path *path,
4058 ret = btrfs_search_slot(trans, log, &key, path, -1, 1);
4062 if (path->slots[0] == 0)
4064 path->slots[0]--;
4067 btrfs_item_key_to_cpu(path->nodes[0], &found_key,
4068 path->slots[0]);
4075 ret = btrfs_bin_search(path->nodes[0], 0, &found_key, &start_slot);
4079 ret = btrfs_del_items(trans, log, path, start_slot,
4080 path->slots[0] - start_slot + 1);
4087 btrfs_release_path(path);
4089 btrfs_release_path(path);
4174 struct btrfs_root *log, struct btrfs_path *path,
4191 ret = btrfs_search_slot(trans, log, &inode->location, path, 0, 1);
4205 ret = btrfs_insert_empty_item(trans, log, path, &inode->location,
4211 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0],
4213 fill_inode_item(trans, path->nodes[0], inode_item, &inode->vfs_inode,
4215 btrfs_release_path(path);
4230 * transaction with new extents, then do the fast path, no need to
4625 struct btrfs_path *path,
4672 drop_args.path = path;
4687 ret = btrfs_insert_empty_item(trans, log, path, &key,
4692 leaf = path->nodes[0];
4694 btrfs_item_ptr_offset(leaf, path->slots[0]),
4698 btrfs_release_path(path);
4713 struct btrfs_path *path)
4734 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
4746 ret = btrfs_previous_item(root, path, ino, BTRFS_EXTENT_DATA_KEY);
4753 leaf = path->nodes[0];
4754 slot = path->slots[0];
4773 leaf = path->nodes[0];
4774 slot = path->slots[0];
4778 ret = copy_items(trans, inode, dst_path, path,
4784 ret = btrfs_next_leaf(root, path);
4800 path->slots[0]++;
4818 path->slots[0]++;
4828 ret = copy_items(trans, inode, dst_path, path,
4831 btrfs_release_path(path);
4838 struct btrfs_path *path,
4899 ret = log_one_extent(trans, inode, em, path, ctx);
4908 ret = btrfs_log_prealloc_extents(trans, inode, path);
4938 struct btrfs_path *path, u64 *size_ret)
4947 ret = btrfs_search_slot(NULL, log, &key, path, 0, 0);
4955 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
4957 *size_ret = btrfs_inode_size(path->nodes[0], item);
4973 btrfs_release_path(path);
4988 struct btrfs_path *path,
5006 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5011 int slot = path->slots[0];
5012 struct extent_buffer *leaf = path->nodes[0];
5017 ret = copy_items(trans, inode, dst_path, path,
5023 ret = btrfs_next_leaf(root, path);
5038 path->slots[0]++;
5043 ret = copy_items(trans, inode, dst_path, path,
5066 struct btrfs_path *path)
5083 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5088 struct extent_buffer *leaf = path->nodes[0];
5090 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) {
5091 ret = btrfs_next_leaf(root, path);
5098 leaf = path->nodes[0];
5101 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
5110 * Release the path to avoid deadlocks with other code
5114 btrfs_release_path(path);
5128 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5133 leaf = path->nodes[0];
5136 prev_extent_end = btrfs_file_extent_end(path);
5137 path->slots[0]++;
5144 btrfs_release_path(path);
5376 struct btrfs_path *path;
5391 path = btrfs_alloc_path();
5392 if (!path)
5411 btrfs_for_each_slot(root->log_root, &key, &found_key, path, iter_ret) {
5412 struct extent_buffer *leaf = path->nodes[0];
5427 di = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dir_item);
5435 btrfs_release_path(path);
5467 btrfs_release_path(path);
5504 btrfs_free_path(path);
5536 struct btrfs_path *path)
5545 path->search_commit_root = 1;
5546 path->skip_locking = 1;
5548 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5559 item = btrfs_item_ptr(path->nodes[0], path->slots[0],
5561 if (S_ISDIR(btrfs_inode_mode(path->nodes[0], item)))
5565 btrfs_release_path(path);
5566 path->search_commit_root = 0;
5567 path->skip_locking = 0;
5574 struct btrfs_path *path,
5618 ret = conflicting_inode_is_dir(root, ino, path);
5795 struct btrfs_path *path,
5809 ret = btrfs_search_forward(root, min_key, path, trans->transid);
5841 ret = btrfs_check_ref_name_override(path->nodes[0],
5842 path->slots[0], min_key, inode,
5852 ins_start_slot = path->slots[0];
5854 ret = copy_items(trans, inode, dst_path, path,
5861 btrfs_release_path(path);
5862 ret = add_conflicting_inode(trans, root, path,
5873 ret = copy_items(trans, inode, dst_path, path,
5882 if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) {
5886 ins_start_slot = path->slots[0];
5891 ret = copy_items(trans, inode, dst_path, path, ins_start_slot,
5896 ins_start_slot = path->slots[0];
5898 path->slots[0]++;
5899 if (path->slots[0] < btrfs_header_nritems(path->nodes[0])) {
5900 btrfs_item_key_to_cpu(path->nodes[0], min_key,
5901 path->slots[0]);
5905 ret = copy_items(trans, inode, dst_path, path,
5912 btrfs_release_path(path);
5931 ret = copy_items(trans, inode, dst_path, path, ins_start_slot,
5939 * Release the path because otherwise we might attempt to double
5942 btrfs_release_path(path);
5951 struct btrfs_path *path,
5958 ret = btrfs_insert_empty_items(trans, log, path, batch);
5965 data_ptr = btrfs_item_ptr(path->nodes[0], path->slots[0], char);
5966 write_extent_buffer(path->nodes[0], &curr->data,
5969 path->slots[0]++;
5972 btrfs_release_path(path);
5979 struct btrfs_path *path,
6038 ret = insert_delayed_items_batch(trans, log, path,
6061 ret = insert_delayed_items_batch(trans, log, path, &batch, first);
6074 struct btrfs_path *path,
6106 ret = insert_dir_log_key(trans, inode->root->log_root, path,
6118 struct btrfs_path *path,
6125 struct extent_buffer *leaf = path->nodes[0];
6127 int slot = path->slots[0] + 1;
6147 return btrfs_del_items(trans, inode->root->log_root, path,
6148 path->slots[0], slot - path->slots[0]);
6153 struct btrfs_path *path,
6176 ret = btrfs_search_slot(trans, log, &key, path, -1, 1);
6180 ret = batch_delete_dir_index_items(trans, inode, path, ctx,
6188 btrfs_release_path(path);
6209 ret = insert_dir_log_key(trans, log, path, key.objectid,
6225 struct btrfs_path *path,
6239 return log_delayed_deletions_incremental(trans, inode, path,
6242 return log_delayed_deletions_full(trans, inode, path, delayed_del_list,
6333 struct btrfs_path *path;
6350 path = btrfs_alloc_path();
6351 if (!path)
6355 btrfs_free_path(path);
6389 * Where all directories in the path did not exist before and are
6434 ret = inode_logged(trans, inode, path);
6459 ret = drop_inode_items(trans, log, path, inode,
6476 ret = logged_inode_size(log, inode, path, &logged_isize);
6485 ret = drop_inode_items(trans, log, path,
6503 ret = drop_inode_items(trans, log, path, inode,
6527 path, dst_path, logged_isize,
6533 btrfs_release_path(path);
6535 ret = btrfs_log_all_xattrs(trans, inode, path, dst_path);
6540 btrfs_release_path(path);
6542 ret = btrfs_log_holes(trans, inode, path);
6547 btrfs_release_path(path);
6562 ret = btrfs_log_all_xattrs(trans, inode, path, dst_path);
6565 btrfs_release_path(path);
6582 ret = log_directory_changes(trans, inode, path, dst_path, ctx);
6585 ret = log_delayed_insertion_items(trans, inode, path,
6589 ret = log_delayed_deletion_items(trans, inode, path,
6634 * go through the slower path when logging extents and their checksums.
6642 btrfs_free_path(path);
6668 struct btrfs_path *path;
6673 path = btrfs_alloc_path();
6674 if (!path)
6676 path->skip_locking = 1;
6677 path->search_commit_root = 1;
6682 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
6687 struct extent_buffer *leaf = path->nodes[0];
6688 int slot = path->slots[0];
6694 ret = btrfs_next_leaf(root, path);
6776 path->slots[0]++;
6780 btrfs_free_path(path);
6786 struct btrfs_path *path,
6791 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]);
6802 btrfs_release_path(path);
6825 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
6829 leaf = path->nodes[0];
6830 slot = path->slots[0];
6832 ret = btrfs_next_leaf(root, path);
6837 leaf = path->nodes[0];
6838 slot = path->slots[0];
6894 struct btrfs_path *path;
6899 * For a single hard link case, go through a fast path that does not
6905 path = btrfs_alloc_path();
6906 if (!path)
6913 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
6917 path->slots[0]++;
6920 struct extent_buffer *leaf = path->nodes[0];
6921 int slot = path->slots[0];
6925 ret = btrfs_next_leaf(root, path);
6952 * tree, so it releases the path as needed to avoid deadlocks.
6958 ret = log_new_ancestors(trans, root, path, ctx);
6961 btrfs_release_path(path);
6966 btrfs_free_path(path);
7128 struct btrfs_path *path;
7139 path = btrfs_alloc_path();
7140 if (!path)
7166 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0);
7173 if (path->slots[0] == 0)
7175 path->slots[0]--;
7177 btrfs_item_key_to_cpu(path->nodes[0], &found_key,
7178 path->slots[0]);
7179 btrfs_release_path(path);
7228 path);
7236 btrfs_release_path(path);
7262 btrfs_release_path(path);
7277 btrfs_free_path(path);
7293 btrfs_free_path(path);
7445 struct btrfs_path *path;
7473 path = btrfs_alloc_path();
7474 if (!path) {
7491 ret = del_logged_dentry(trans, log, path, btrfs_ino(old_dir),
7498 btrfs_release_path(path);
7499 ret = insert_dir_log_key(trans, log, path,
7505 btrfs_free_path(path);