Lines Matching defs:path
333 struct btrfs_path *path = NULL;
349 path = btrfs_alloc_path();
350 if (!path) {
367 ret = btrfs_search_slot_for_read(quota_root, &key, path, 1, 1);
374 slot = path->slots[0];
375 l = path->nodes[0];
450 ret = btrfs_next_item(quota_root, path);
456 btrfs_release_path(path);
464 ret = btrfs_search_slot_for_read(quota_root, &key, path, 1, 0);
468 slot = path->slots[0];
469 l = path->nodes[0];
492 ret = btrfs_next_item(quota_root, path);
499 btrfs_free_path(path);
588 struct btrfs_path *path;
591 path = btrfs_alloc_path();
592 if (!path)
599 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, 0);
601 btrfs_mark_buffer_dirty(path->nodes[0]);
603 btrfs_free_path(path);
612 struct btrfs_path *path;
615 path = btrfs_alloc_path();
616 if (!path)
623 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1);
632 ret = btrfs_del_item(trans, quota_root, path);
634 btrfs_free_path(path);
642 struct btrfs_path *path;
651 path = btrfs_alloc_path();
652 if (!path)
665 ret = btrfs_insert_empty_item(trans, quota_root, path, &key,
670 leaf = path->nodes[0];
671 qgroup_info = btrfs_item_ptr(leaf, path->slots[0],
681 btrfs_release_path(path);
684 ret = btrfs_insert_empty_item(trans, quota_root, path, &key,
689 leaf = path->nodes[0];
690 qgroup_limit = btrfs_item_ptr(leaf, path->slots[0],
702 btrfs_free_path(path);
710 struct btrfs_path *path;
713 path = btrfs_alloc_path();
714 if (!path)
720 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1);
729 ret = btrfs_del_item(trans, quota_root, path);
733 btrfs_release_path(path);
736 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1);
745 ret = btrfs_del_item(trans, quota_root, path);
748 btrfs_free_path(path);
756 struct btrfs_path *path;
767 path = btrfs_alloc_path();
768 if (!path)
771 ret = btrfs_search_slot(trans, quota_root, &key, path, 0, 1);
778 l = path->nodes[0];
779 slot = path->slots[0];
790 btrfs_free_path(path);
799 struct btrfs_path *path;
813 path = btrfs_alloc_path();
814 if (!path)
817 ret = btrfs_search_slot(trans, quota_root, &key, path, 0, 1);
824 l = path->nodes[0];
825 slot = path->slots[0];
836 btrfs_free_path(path);
844 struct btrfs_path *path;
855 path = btrfs_alloc_path();
856 if (!path)
859 ret = btrfs_search_slot(trans, quota_root, &key, path, 0, 1);
866 l = path->nodes[0];
867 slot = path->slots[0];
877 btrfs_free_path(path);
887 struct btrfs_path *path;
893 path = btrfs_alloc_path();
894 if (!path)
897 path->leave_spinning = 1;
904 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
907 leaf = path->nodes[0];
916 path->slots[0] = 0;
917 ret = btrfs_del_items(trans, root, path, 0, nr);
921 btrfs_release_path(path);
925 btrfs_free_path(path);
933 struct btrfs_path *path = NULL;
1014 path = btrfs_alloc_path();
1015 if (!path) {
1025 ret = btrfs_insert_empty_item(trans, quota_root, path, &key,
1032 leaf = path->nodes[0];
1033 ptr = btrfs_item_ptr(leaf, path->slots[0],
1048 btrfs_release_path(path);
1049 ret = btrfs_search_slot_for_read(tree_root, &key, path, 1, 0);
1058 slot = path->slots[0];
1059 leaf = path->nodes[0];
1065 btrfs_release_path(path);
1086 path, 1, 0);
1100 ret = btrfs_next_item(tree_root, path);
1110 btrfs_release_path(path);
1179 btrfs_free_path(path);
1394 * Quick path for updating qgroup with only excl refs.
1896 * At the end of this function, we should have a path which has all
1904 static int adjust_slots_upwards(struct btrfs_path *path, int root_level)
1914 eb = path->nodes[level];
1916 path->slots[level]++;
1917 slot = path->slots[level];
1925 btrfs_tree_unlock_rw(eb, path->locks[level]);
1926 path->locks[level] = 0;
1929 path->nodes[level] = NULL;
1930 path->slots[level] = 0;
1944 eb = path->nodes[root_level];
1945 if (path->slots[root_level] >= btrfs_header_nritems(eb))
2310 struct btrfs_path *path = NULL;
2329 path = btrfs_alloc_path();
2330 if (!path)
2342 atomic_inc(&root_eb->refs); /* For path */
2343 path->nodes[root_level] = root_eb;
2344 path->slots[root_level] = 0;
2345 path->locks[root_level] = 0; /* so release_path doesn't try to unlock */
2349 if (path->nodes[level] == NULL) {
2359 eb = path->nodes[level + 1];
2360 parent_slot = path->slots[level + 1];
2376 path->nodes[level] = eb;
2377 path->slots[level] = 0;
2381 path->locks[level] = BTRFS_READ_LOCK_BLOCKING;
2392 path->nodes[level]);
2397 ret = adjust_slots_upwards(path, root_level);
2410 btrfs_free_path(path);
2794 * Called by the transaction commit path and the qgroup assign ioctl.
3221 static bool is_last_leaf(struct btrfs_path *path)
3225 for (i = 1; i < BTRFS_MAX_LEVEL && path->nodes[i]; i++) {
3226 if (path->slots[i] != btrfs_header_nritems(path->nodes[i]) - 1)
3237 struct btrfs_path *path)
3251 path, 1, 0);
3269 btrfs_release_path(path);
3273 done = is_last_leaf(path);
3275 btrfs_item_key_to_cpu(path->nodes[0], &found,
3276 btrfs_header_nritems(path->nodes[0]) - 1);
3279 scratch_leaf = btrfs_clone_extent_buffer(path->nodes[0]);
3285 slot = path->slots[0];
3286 btrfs_release_path(path);
3331 struct btrfs_path *path;
3338 path = btrfs_alloc_path();
3339 if (!path)
3345 path->search_commit_root = 1;
3346 path->skip_locking = 1;
3356 err = qgroup_rescan_leaf(trans, path);
3366 btrfs_free_path(path);
3814 /* Free ranges specified by @reserved, normally in error path */