Lines Matching defs:path

161 				struct btrfs_path *path, int extent_inserted,
193 path->leave_spinning = 1;
194 ret = btrfs_insert_empty_item(trans, root, path, &key,
199 leaf = path->nodes[0];
200 ei = btrfs_item_ptr(leaf, path->slots[0],
238 btrfs_release_path(path);
285 struct btrfs_path *path;
302 path = btrfs_alloc_path();
303 if (!path)
308 btrfs_free_path(path);
320 ret = __btrfs_drop_extents(trans, root, inode, path, start, aligned_end,
330 ret = insert_inline_extent(trans, path, extent_inserted,
352 btrfs_free_path(path);
1040 * extents follows a NOCOW path because relocation preallocates the
1405 * that if the COW path fails for any reason, it decrements (through
1455 struct btrfs_path *path;
1465 path = btrfs_alloc_path();
1466 if (!path) {
1490 ret = btrfs_lookup_file_extent(NULL, root, path, ino,
1500 if (ret > 0 && path->slots[0] > 0 && check_prev) {
1501 leaf = path->nodes[0];
1503 path->slots[0] - 1);
1506 path->slots[0]--;
1511 leaf = path->nodes[0];
1512 if (path->slots[0] >= btrfs_header_nritems(leaf)) {
1513 ret = btrfs_next_leaf(root, path);
1521 leaf = path->nodes[0];
1524 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
1535 path->slots[0]++;
1558 fi = btrfs_item_ptr(leaf, path->slots[0],
1576 path->slots[0]++;
1657 path->slots[0]++;
1675 path->slots[0]++;
1679 btrfs_release_path(path);
1763 btrfs_release_path(path);
1788 btrfs_free_path(path);
2516 struct btrfs_path *path;
2526 path = btrfs_alloc_path();
2527 if (!path)
2539 ret = __btrfs_drop_extents(trans, root, inode, path, file_pos,
2550 path->leave_spinning = 1;
2551 ret = btrfs_insert_empty_item(trans, root, path, &ins,
2556 leaf = path->nodes[0];
2559 btrfs_item_ptr_offset(leaf, path->slots[0]),
2563 btrfs_release_path(path);
2578 btrfs_free_path(path);
3040 struct btrfs_path *path;
3051 path = btrfs_alloc_path();
3052 if (!path) {
3056 path->reada = READA_BACK;
3063 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
3069 * is weird, but possible, so only screw with path if we didn't
3074 if (path->slots[0] == 0)
3076 path->slots[0]--;
3080 leaf = path->nodes[0];
3081 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
3089 /* release the path since we're done with it */
3090 btrfs_release_path(path);
3188 /* release the path since we're done with it */
3189 btrfs_release_path(path);
3205 btrfs_free_path(path);
3285 struct btrfs_path *path = in_path;
3301 if (!path) {
3302 path = btrfs_alloc_path();
3303 if (!path)
3309 ret = btrfs_lookup_inode(NULL, root, path, &location, 0);
3311 if (path != in_path)
3312 btrfs_free_path(path);
3316 leaf = path->nodes[0];
3321 inode_item = btrfs_item_ptr(leaf, path->slots[0],
3409 path->slots[0]++;
3411 path->slots[0] >= btrfs_header_nritems(leaf))
3414 btrfs_item_key_to_cpu(leaf, &location, path->slots[0]);
3418 ptr = btrfs_item_ptr_offset(leaf, path->slots[0]);
3436 maybe_acls = acls_after_inode_item(leaf, path->slots[0],
3439 path->slots[0] = first_xattr_slot;
3440 ret = btrfs_load_inode_props(inode, path);
3447 if (path != in_path)
3448 btrfs_free_path(path);
3533 struct btrfs_path *path;
3537 path = btrfs_alloc_path();
3538 if (!path)
3541 path->leave_spinning = 1;
3542 ret = btrfs_lookup_inode(trans, root, path, &BTRFS_I(inode)->location,
3550 leaf = path->nodes[0];
3551 inode_item = btrfs_item_ptr(leaf, path->slots[0],
3559 btrfs_free_path(path);
3617 struct btrfs_path *path;
3624 path = btrfs_alloc_path();
3625 if (!path) {
3630 path->leave_spinning = 1;
3631 di = btrfs_lookup_dir_item(trans, root, path, dir_ino,
3637 ret = btrfs_delete_one_dir_name(trans, root, path, di);
3640 btrfs_release_path(path);
3701 btrfs_free_path(path);
3788 struct btrfs_path *path;
3808 path = btrfs_alloc_path();
3809 if (!path)
3812 di = btrfs_lookup_dir_item(trans, root, path, dir_ino,
3819 leaf = path->nodes[0];
3822 ret = btrfs_delete_one_dir_name(trans, root, path, di);
3827 btrfs_release_path(path);
3839 di = btrfs_search_dir_index_item(root, path, dir_ino,
3850 leaf = path->nodes[0];
3851 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
3853 btrfs_release_path(path);
3877 btrfs_free_path(path);
3888 struct btrfs_path *path;
3894 path = btrfs_alloc_path();
3895 if (!path)
3900 di = btrfs_lookup_dir_item(NULL, fs_info->tree_root, path,
3903 btrfs_dir_item_key_to_cpu(path->nodes[0], di, &key);
3911 btrfs_release_path(path);
3918 ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, path, 0, 0);
3924 if (path->slots[0] > 0) {
3925 path->slots[0]--;
3926 btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]);
3932 btrfs_free_path(path);
4217 struct btrfs_path *path;
4252 path = btrfs_alloc_path();
4253 if (!path)
4255 path->reada = READA_BACK;
4296 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
4305 if (path->slots[0] == 0)
4307 path->slots[0]--;
4314 leaf = path->nodes[0];
4315 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
4326 fi = btrfs_item_ptr(leaf, path->slots[0],
4341 BTRFS_I(inode), leaf, fi, path->slots[0],
4412 btrfs_truncate_item(path, size, 1);
4454 pending_del_slot = path->slots[0];
4457 path->slots[0] + 1 == pending_del_slot) {
4460 pending_del_slot = path->slots[0];
4494 if (path->slots[0] == 0 ||
4495 path->slots[0] != pending_del_slot ||
4498 ret = btrfs_del_items(trans, root, path,
4507 btrfs_release_path(path);
4529 path->slots[0]--;
4536 err = btrfs_del_items(trans, root, path, pending_del_slot,
4552 btrfs_free_path(path);
5232 struct btrfs_path *path;
5236 path = btrfs_alloc_path();
5237 if (!path)
5240 di = btrfs_lookup_dir_item(NULL, root, path, btrfs_ino(BTRFS_I(dir)),
5247 btrfs_dir_item_key_to_cpu(path->nodes[0], di, location);
5257 *type = btrfs_dir_type(path->nodes[0], di);
5259 btrfs_free_path(path);
5274 struct btrfs_path *path;
5282 path = btrfs_alloc_path();
5283 if (!path) {
5293 ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, path, 0, 0);
5300 leaf = path->nodes[0];
5301 ref = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_root_ref);
5312 btrfs_release_path(path);
5326 btrfs_free_path(path);
5433 struct btrfs_root *root, struct btrfs_path *path)
5444 ret = btrfs_read_locked_inode(inode, path);
5665 struct btrfs_path *path;
5682 path = btrfs_alloc_path();
5683 if (!path)
5687 path->reada = READA_FORWARD;
5698 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5705 leaf = path->nodes[0];
5706 slot = path->slots[0];
5708 ret = btrfs_next_leaf(root, path);
5730 btrfs_release_path(path);
5754 path->slots[0]++;
5756 btrfs_release_path(path);
5792 btrfs_free_path(path);
5866 struct btrfs_path *path;
5874 path = btrfs_alloc_path();
5875 if (!path)
5878 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
5892 if (path->slots[0] == 0) {
5897 path->slots[0]--;
5899 leaf = path->nodes[0];
5900 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
5910 btrfs_free_path(path);
5991 struct btrfs_path *path;
6000 path = btrfs_alloc_path();
6001 if (!path)
6008 btrfs_free_path(path);
6030 btrfs_free_path(path);
6087 path->leave_spinning = 1;
6088 ret = btrfs_insert_empty_items(trans, root, path, key, sizes, nitems);
6100 inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0],
6102 memzero_extent_buffer(path->nodes[0], (unsigned long)inode_item,
6104 fill_inode_item(trans, path->nodes[0], inode_item, inode);
6107 ref = btrfs_item_ptr(path->nodes[0], path->slots[0] + 1,
6109 btrfs_set_inode_ref_name_len(path->nodes[0], ref, name_len);
6110 btrfs_set_inode_ref_index(path->nodes[0], ref, *index);
6112 write_extent_buffer(path->nodes[0], name, ptr, name_len);
6115 btrfs_mark_buffer_dirty(path->nodes[0]);
6116 btrfs_free_path(path);
6148 btrfs_free_path(path);
6525 static noinline int uncompress_inline(struct btrfs_path *path,
6531 struct extent_buffer *leaf = path->nodes[0];
6542 btrfs_item_nr(path->slots[0]));
6599 struct btrfs_path *path = NULL;
6630 path = btrfs_alloc_path();
6631 if (!path) {
6637 path->reada = READA_FORWARD;
6643 path->leave_spinning = 1;
6645 path->recurse = btrfs_is_free_space_inode(inode);
6647 ret = btrfs_lookup_file_extent(NULL, root, path, objectid, start, 0);
6651 if (path->slots[0] == 0)
6653 path->slots[0]--;
6657 leaf = path->nodes[0];
6658 item = btrfs_item_ptr(leaf, path->slots[0],
6660 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
6675 extent_end = btrfs_file_extent_end(path);
6690 path->slots[0],
6695 path->slots[0]++;
6696 if (path->slots[0] >= btrfs_header_nritems(leaf)) {
6697 ret = btrfs_next_leaf(root, path);
6703 leaf = path->nodes[0];
6705 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
6722 btrfs_extent_item_to_extent_map(inode, path, item, !page, em);
6747 btrfs_set_path_blocking(path);
6751 ret = uncompress_inline(path, page, pg_offset,
6779 btrfs_release_path(path);
6792 btrfs_free_path(path);
7020 struct btrfs_path *path;
7035 path = btrfs_alloc_path();
7036 if (!path)
7039 ret = btrfs_lookup_file_extent(NULL, root, path,
7044 slot = path->slots[0];
7054 leaf = path->nodes[0];
7125 btrfs_release_path(path);
7157 btrfs_free_path(path);
7467 * buffered path.
8862 static int btrfs_getattr(const struct path *path, struct kstat *stat,
8866 struct inode *inode = d_inode(path->dentry);
9604 struct btrfs_path *path;
9658 path = btrfs_alloc_path();
9659 if (!path) {
9667 err = btrfs_insert_empty_item(trans, root, path, &key,
9670 btrfs_free_path(path);
9673 leaf = path->nodes[0];
9674 ei = btrfs_item_ptr(leaf, path->slots[0],
9687 btrfs_free_path(path);
9725 struct btrfs_path *path;
9762 path = btrfs_alloc_path();
9763 if (!path)
9766 ret = btrfs_replace_file_extents(inode, path, file_offset,
9769 btrfs_free_path(path);