Lines Matching refs:path
358 struct btrfs_path *path = NULL;
374 path = btrfs_alloc_path();
375 if (!path) {
392 ret = btrfs_search_slot_for_read(quota_root, &key, path, 1, 1);
399 slot = path->slots[0];
400 l = path->nodes[0];
475 ret = btrfs_next_item(quota_root, path);
481 btrfs_release_path(path);
489 ret = btrfs_search_slot_for_read(quota_root, &key, path, 1, 0);
493 slot = path->slots[0];
494 l = path->nodes[0];
517 ret = btrfs_next_item(quota_root, path);
524 btrfs_free_path(path);
613 struct btrfs_path *path;
616 path = btrfs_alloc_path();
617 if (!path)
624 ret = btrfs_insert_empty_item(trans, quota_root, path, &key, 0);
626 btrfs_mark_buffer_dirty(trans, path->nodes[0]);
628 btrfs_free_path(path);
637 struct btrfs_path *path;
640 path = btrfs_alloc_path();
641 if (!path)
648 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1);
657 ret = btrfs_del_item(trans, quota_root, path);
659 btrfs_free_path(path);
667 struct btrfs_path *path;
676 path = btrfs_alloc_path();
677 if (!path)
690 ret = btrfs_insert_empty_item(trans, quota_root, path, &key,
695 leaf = path->nodes[0];
696 qgroup_info = btrfs_item_ptr(leaf, path->slots[0],
706 btrfs_release_path(path);
709 ret = btrfs_insert_empty_item(trans, quota_root, path, &key,
714 leaf = path->nodes[0];
715 qgroup_limit = btrfs_item_ptr(leaf, path->slots[0],
727 btrfs_free_path(path);
735 struct btrfs_path *path;
738 path = btrfs_alloc_path();
739 if (!path)
745 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1);
754 ret = btrfs_del_item(trans, quota_root, path);
758 btrfs_release_path(path);
761 ret = btrfs_search_slot(trans, quota_root, &key, path, -1, 1);
770 ret = btrfs_del_item(trans, quota_root, path);
773 btrfs_free_path(path);
781 struct btrfs_path *path;
792 path = btrfs_alloc_path();
793 if (!path)
796 ret = btrfs_search_slot(trans, quota_root, &key, path, 0, 1);
803 l = path->nodes[0];
804 slot = path->slots[0];
815 btrfs_free_path(path);
824 struct btrfs_path *path;
838 path = btrfs_alloc_path();
839 if (!path)
842 ret = btrfs_search_slot(trans, quota_root, &key, path, 0, 1);
849 l = path->nodes[0];
850 slot = path->slots[0];
861 btrfs_free_path(path);
869 struct btrfs_path *path;
880 path = btrfs_alloc_path();
881 if (!path)
884 ret = btrfs_search_slot(trans, quota_root, &key, path, 0, 1);
891 l = path->nodes[0];
892 slot = path->slots[0];
903 btrfs_free_path(path);
913 struct btrfs_path *path;
919 path = btrfs_alloc_path();
920 if (!path)
928 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
931 leaf = path->nodes[0];
940 path->slots[0] = 0;
941 ret = btrfs_del_items(trans, root, path, 0, nr);
945 btrfs_release_path(path);
949 btrfs_free_path(path);
957 struct btrfs_path *path = NULL;
1044 path = btrfs_alloc_path();
1045 if (!path) {
1055 ret = btrfs_insert_empty_item(trans, quota_root, path, &key,
1062 leaf = path->nodes[0];
1063 ptr = btrfs_item_ptr(leaf, path->slots[0],
1079 btrfs_release_path(path);
1080 ret = btrfs_search_slot_for_read(tree_root, &key, path, 1, 0);
1089 slot = path->slots[0];
1090 leaf = path->nodes[0];
1096 btrfs_release_path(path);
1117 path, 1, 0);
1131 ret = btrfs_next_item(tree_root, path);
1141 btrfs_release_path(path);
1210 btrfs_free_path(path);
1445 * Quick path for updating qgroup with only excl refs.
1972 * At the end of this function, we should have a path which has all
1980 static int adjust_slots_upwards(struct btrfs_path *path, int root_level)
1990 eb = path->nodes[level];
1992 path->slots[level]++;
1993 slot = path->slots[level];
2001 btrfs_tree_unlock_rw(eb, path->locks[level]);
2002 path->locks[level] = 0;
2005 path->nodes[level] = NULL;
2006 path->slots[level] = 0;
2020 eb = path->nodes[root_level];
2021 if (path->slots[root_level] >= btrfs_header_nritems(eb))
2364 struct btrfs_path *path = NULL;
2406 path = btrfs_alloc_path();
2407 if (!path)
2419 atomic_inc(&root_eb->refs); /* For path */
2420 path->nodes[root_level] = root_eb;
2421 path->slots[root_level] = 0;
2422 path->locks[root_level] = 0; /* so release_path doesn't try to unlock */
2426 if (path->nodes[level] == NULL) {
2434 eb = path->nodes[level + 1];
2435 parent_slot = path->slots[level + 1];
2444 path->nodes[level] = eb;
2445 path->slots[level] = 0;
2448 path->locks[level] = BTRFS_READ_LOCK;
2458 path->nodes[level]);
2463 ret = adjust_slots_upwards(path, root_level);
2476 btrfs_free_path(path);
2879 * Called by the transaction commit path and the qgroup assign ioctl.
3282 static bool is_last_leaf(struct btrfs_path *path)
3286 for (i = 1; i < BTRFS_MAX_LEVEL && path->nodes[i]; i++) {
3287 if (path->slots[i] != btrfs_header_nritems(path->nodes[i]) - 1)
3298 struct btrfs_path *path)
3314 path, 1, 0);
3332 btrfs_release_path(path);
3336 done = is_last_leaf(path);
3338 btrfs_item_key_to_cpu(path->nodes[0], &found,
3339 btrfs_header_nritems(path->nodes[0]) - 1);
3342 scratch_leaf = btrfs_clone_extent_buffer(path->nodes[0]);
3348 slot = path->slots[0];
3349 btrfs_release_path(path);
3399 struct btrfs_path *path;
3406 path = btrfs_alloc_path();
3407 if (!path)
3413 path->search_commit_root = 1;
3414 path->skip_locking = 1;
3424 err = qgroup_rescan_leaf(trans, path);
3434 btrfs_free_path(path);
3867 /* Free ranges specified by @reserved, normally in error path */