Lines Matching defs:path

677 			 struct btrfs_path *path, u64 start, u64 end,
716 ret = btrfs_lookup_file_extent(trans, root, path, ino,
720 if (ret > 0 && path->slots[0] > 0 && search_start == start) {
721 leaf = path->nodes[0];
722 btrfs_item_key_to_cpu(leaf, &key, path->slots[0] - 1);
725 path->slots[0]--;
730 leaf = path->nodes[0];
731 if (path->slots[0] >= btrfs_header_nritems(leaf)) {
733 ret = btrfs_next_leaf(root, path);
741 leaf = path->nodes[0];
745 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
752 path->slots[0]++;
758 fi = btrfs_item_ptr(leaf, path->slots[0],
792 path->slots[0]++;
800 btrfs_release_path(path);
817 ret = btrfs_duplicate_item(trans, root, path,
820 btrfs_release_path(path);
826 leaf = path->nodes[0];
827 fi = btrfs_item_ptr(leaf, path->slots[0] - 1,
832 fi = btrfs_item_ptr(leaf, path->slots[0],
872 btrfs_set_item_key_safe(fs_info, path, &new_key);
904 path->slots[0]++;
915 del_slot = path->slots[0];
918 BUG_ON(del_slot + del_nr != path->slots[0]);
945 if (path->slots[0] + 1 < btrfs_header_nritems(leaf)) {
946 path->slots[0]++;
950 ret = btrfs_del_items(trans, root, path, del_slot,
960 btrfs_release_path(path);
969 * Set path->slots[0] to first slot, so that after the delete
972 * path->slots[0] for our insertion (if replace_extent != 0).
974 path->slots[0] = del_slot;
975 ret = btrfs_del_items(trans, root, path, del_slot, del_nr);
980 leaf = path->nodes[0];
983 * which case it unlocked our path, so check path->locks[0] matches a
987 (path->locks[0] == BTRFS_WRITE_LOCK_BLOCKING ||
988 path->locks[0] == BTRFS_WRITE_LOCK) &&
995 if (!del_nr && path->slots[0] < btrfs_header_nritems(leaf)) {
998 btrfs_item_key_to_cpu(leaf, &slot_key, path->slots[0]);
1000 path->slots[0]++;
1002 setup_items_for_insert(root, path, &key, &extent_item_size, 1);
1007 btrfs_release_path(path);
1017 struct btrfs_path *path;
1020 path = btrfs_alloc_path();
1021 if (!path)
1023 ret = __btrfs_drop_extents(trans, root, BTRFS_I(inode), path, start,
1025 btrfs_free_path(path);
1075 struct btrfs_path *path;
1093 path = btrfs_alloc_path();
1094 if (!path)
1103 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1106 if (ret > 0 && path->slots[0] > 0)
1107 path->slots[0]--;
1109 leaf = path->nodes[0];
1110 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
1117 fi = btrfs_item_ptr(leaf, path->slots[0],
1139 if (extent_mergeable(leaf, path->slots[0] - 1,
1143 btrfs_set_item_key_safe(fs_info, path, &new_key);
1144 fi = btrfs_item_ptr(leaf, path->slots[0],
1152 fi = btrfs_item_ptr(leaf, path->slots[0] - 1,
1166 if (extent_mergeable(leaf, path->slots[0] + 1,
1169 fi = btrfs_item_ptr(leaf, path->slots[0],
1175 path->slots[0]++;
1177 btrfs_set_item_key_safe(fs_info, path, &new_key);
1179 fi = btrfs_item_ptr(leaf, path->slots[0],
1197 ret = btrfs_duplicate_item(trans, root, path, &new_key);
1199 btrfs_release_path(path);
1207 leaf = path->nodes[0];
1208 fi = btrfs_item_ptr(leaf, path->slots[0] - 1,
1214 fi = btrfs_item_ptr(leaf, path->slots[0],
1241 path->slots[0]--;
1252 if (extent_mergeable(leaf, path->slots[0] + 1,
1256 btrfs_release_path(path);
1260 del_slot = path->slots[0] + 1;
1270 if (extent_mergeable(leaf, path->slots[0] - 1,
1274 btrfs_release_path(path);
1278 del_slot = path->slots[0];
1287 fi = btrfs_item_ptr(leaf, path->slots[0],
1303 ret = btrfs_del_items(trans, root, path, del_slot, del_nr);
1310 btrfs_free_path(path);
2228 * example checking cross references in the nocow path). If we use join
2345 struct btrfs_path *path, u64 offset, u64 end)
2363 ret = btrfs_search_slot(trans, root, &key, path, 0, 1);
2374 leaf = path->nodes[0];
2375 if (hole_mergeable(inode, leaf, path->slots[0] - 1, offset, end)) {
2378 path->slots[0]--;
2379 fi = btrfs_item_ptr(leaf, path->slots[0],
2390 if (hole_mergeable(inode, leaf, path->slots[0], offset, end)) {
2394 btrfs_set_item_key_safe(fs_info, path, &key);
2395 fi = btrfs_item_ptr(leaf, path->slots[0],
2405 btrfs_release_path(path);
2413 btrfs_release_path(path);
2519 struct btrfs_path *path,
2542 ret = btrfs_insert_empty_item(trans, root, path, &key,
2546 leaf = path->nodes[0];
2547 slot = path->slots[0];
2558 btrfs_release_path(path);
2606 int btrfs_replace_file_extents(struct inode *inode, struct btrfs_path *path,
2659 ret = __btrfs_drop_extents(trans, root, BTRFS_I(inode), path,
2682 ret = fill_holes(trans, BTRFS_I(inode), path,
2717 ret = btrfs_insert_replace_extent(trans, inode, path,
2783 * map representing the existing hole), otherwise the fast fsync path
2795 ret = fill_holes(trans, BTRFS_I(inode), path,
2813 ret = btrfs_insert_replace_extent(trans, inode, path, extent_info,
2842 struct btrfs_path *path;
2955 path = btrfs_alloc_path();
2956 if (!path) {
2961 ret = btrfs_replace_file_extents(inode, path, lockstart, lockend, NULL,
2963 btrfs_free_path(path);