Lines Matching refs:path
246 static noinline int device_list_add(const char *path, in device_list_add() argument
285 device->name = kstrdup(path, GFP_NOFS); in device_list_add()
538 int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, in btrfs_scan_one_device() argument
550 bdev = open_bdev_exclusive(path, flags, holder); in btrfs_scan_one_device()
577 (unsigned long long)devid, (unsigned long long)transid, path); in btrfs_scan_one_device()
578 ret = device_list_add(path, disk_super, devid, fs_devices_ret); in btrfs_scan_one_device()
600 struct btrfs_path *path; in find_free_dev_extent() local
610 path = btrfs_alloc_path(); in find_free_dev_extent()
611 if (!path) in find_free_dev_extent()
613 path->reada = 2; in find_free_dev_extent()
629 ret = btrfs_search_slot(trans, root, &key, path, 0, 0); in find_free_dev_extent()
632 ret = btrfs_previous_item(root, path, 0, key.type); in find_free_dev_extent()
635 l = path->nodes[0]; in find_free_dev_extent()
636 btrfs_item_key_to_cpu(l, &key, path->slots[0]); in find_free_dev_extent()
638 l = path->nodes[0]; in find_free_dev_extent()
639 slot = path->slots[0]; in find_free_dev_extent()
641 ret = btrfs_next_leaf(root, path); in find_free_dev_extent()
690 path->slots[0]++; in find_free_dev_extent()
707 btrfs_free_path(path); in find_free_dev_extent()
716 struct btrfs_path *path; in btrfs_free_dev_extent() local
723 path = btrfs_alloc_path(); in btrfs_free_dev_extent()
724 if (!path) in btrfs_free_dev_extent()
731 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_free_dev_extent()
733 ret = btrfs_previous_item(root, path, key.objectid, in btrfs_free_dev_extent()
736 leaf = path->nodes[0]; in btrfs_free_dev_extent()
737 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_free_dev_extent()
738 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
744 leaf = path->nodes[0]; in btrfs_free_dev_extent()
745 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
752 ret = btrfs_del_item(trans, root, path); in btrfs_free_dev_extent()
755 btrfs_free_path(path); in btrfs_free_dev_extent()
765 struct btrfs_path *path; in btrfs_alloc_dev_extent() local
772 path = btrfs_alloc_path(); in btrfs_alloc_dev_extent()
773 if (!path) in btrfs_alloc_dev_extent()
779 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_alloc_dev_extent()
783 leaf = path->nodes[0]; in btrfs_alloc_dev_extent()
784 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_alloc_dev_extent()
796 btrfs_free_path(path); in btrfs_alloc_dev_extent()
803 struct btrfs_path *path; in find_next_chunk() local
809 path = btrfs_alloc_path(); in find_next_chunk()
810 BUG_ON(!path); in find_next_chunk()
816 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_next_chunk()
822 ret = btrfs_previous_item(root, path, 0, BTRFS_CHUNK_ITEM_KEY); in find_next_chunk()
826 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in find_next_chunk()
827 path->slots[0]); in find_next_chunk()
831 chunk = btrfs_item_ptr(path->nodes[0], path->slots[0], in find_next_chunk()
834 btrfs_chunk_length(path->nodes[0], chunk); in find_next_chunk()
839 btrfs_free_path(path); in find_next_chunk()
848 struct btrfs_path *path; in find_next_devid() local
852 path = btrfs_alloc_path(); in find_next_devid()
853 if (!path) in find_next_devid()
860 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_next_devid()
866 ret = btrfs_previous_item(root, path, BTRFS_DEV_ITEMS_OBJECTID, in find_next_devid()
871 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in find_next_devid()
872 path->slots[0]); in find_next_devid()
877 btrfs_free_path(path); in find_next_devid()
890 struct btrfs_path *path; in btrfs_add_device() local
898 path = btrfs_alloc_path(); in btrfs_add_device()
899 if (!path) in btrfs_add_device()
906 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_add_device()
911 leaf = path->nodes[0]; in btrfs_add_device()
912 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_add_device()
935 btrfs_free_path(path); in btrfs_add_device()
943 struct btrfs_path *path; in btrfs_rm_dev_item() local
949 path = btrfs_alloc_path(); in btrfs_rm_dev_item()
950 if (!path) in btrfs_rm_dev_item()
959 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_rm_dev_item()
968 ret = btrfs_del_item(trans, root, path); in btrfs_rm_dev_item()
972 btrfs_free_path(path); in btrfs_rm_dev_item()
1201 struct btrfs_path *path; in btrfs_finish_sprout() local
1211 path = btrfs_alloc_path(); in btrfs_finish_sprout()
1212 if (!path) in btrfs_finish_sprout()
1221 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in btrfs_finish_sprout()
1225 leaf = path->nodes[0]; in btrfs_finish_sprout()
1227 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_finish_sprout()
1228 ret = btrfs_next_leaf(root, path); in btrfs_finish_sprout()
1233 leaf = path->nodes[0]; in btrfs_finish_sprout()
1234 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
1235 btrfs_release_path(root, path); in btrfs_finish_sprout()
1239 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
1244 dev_item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_finish_sprout()
1262 path->slots[0]++; in btrfs_finish_sprout()
1267 btrfs_free_path(path); in btrfs_finish_sprout()
1409 struct btrfs_path *path; in btrfs_update_device() local
1417 path = btrfs_alloc_path(); in btrfs_update_device()
1418 if (!path) in btrfs_update_device()
1425 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in btrfs_update_device()
1434 leaf = path->nodes[0]; in btrfs_update_device()
1435 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_update_device()
1447 btrfs_free_path(path); in btrfs_update_device()
1489 struct btrfs_path *path; in btrfs_free_chunk() local
1493 path = btrfs_alloc_path(); in btrfs_free_chunk()
1494 if (!path) in btrfs_free_chunk()
1501 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_free_chunk()
1504 ret = btrfs_del_item(trans, root, path); in btrfs_free_chunk()
1507 btrfs_free_path(path); in btrfs_free_chunk()
1639 struct btrfs_path *path; in btrfs_relocate_sys_chunks() local
1648 path = btrfs_alloc_path(); in btrfs_relocate_sys_chunks()
1649 if (!path) in btrfs_relocate_sys_chunks()
1657 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0); in btrfs_relocate_sys_chunks()
1662 ret = btrfs_previous_item(chunk_root, path, key.objectid, in btrfs_relocate_sys_chunks()
1669 leaf = path->nodes[0]; in btrfs_relocate_sys_chunks()
1670 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_relocate_sys_chunks()
1672 chunk = btrfs_item_ptr(leaf, path->slots[0], in btrfs_relocate_sys_chunks()
1675 btrfs_release_path(chunk_root, path); in btrfs_relocate_sys_chunks()
1690 btrfs_free_path(path); in btrfs_relocate_sys_chunks()
1710 struct btrfs_path *path; in btrfs_balance() local
1745 path = btrfs_alloc_path(); in btrfs_balance()
1746 BUG_ON(!path); in btrfs_balance()
1753 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0); in btrfs_balance()
1764 ret = btrfs_previous_item(chunk_root, path, 0, in btrfs_balance()
1769 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in btrfs_balance()
1770 path->slots[0]); in btrfs_balance()
1774 chunk = btrfs_item_ptr(path->nodes[0], in btrfs_balance()
1775 path->slots[0], in btrfs_balance()
1782 btrfs_release_path(chunk_root, path); in btrfs_balance()
1791 btrfs_free_path(path); in btrfs_balance()
1806 struct btrfs_path *path; in btrfs_shrink_device() local
1822 path = btrfs_alloc_path(); in btrfs_shrink_device()
1823 if (!path) in btrfs_shrink_device()
1832 path->reada = 2; in btrfs_shrink_device()
1855 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_shrink_device()
1859 ret = btrfs_previous_item(root, path, 0, key.type); in btrfs_shrink_device()
1867 l = path->nodes[0]; in btrfs_shrink_device()
1868 slot = path->slots[0]; in btrfs_shrink_device()
1869 btrfs_item_key_to_cpu(l, &key, path->slots[0]); in btrfs_shrink_device()
1883 btrfs_release_path(root, path); in btrfs_shrink_device()
1892 btrfs_free_path(path); in btrfs_shrink_device()
3151 struct btrfs_path *path; in btrfs_read_chunk_tree() local
3160 path = btrfs_alloc_path(); in btrfs_read_chunk_tree()
3161 if (!path) in btrfs_read_chunk_tree()
3172 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_read_chunk_tree()
3174 leaf = path->nodes[0]; in btrfs_read_chunk_tree()
3175 slot = path->slots[0]; in btrfs_read_chunk_tree()
3177 ret = btrfs_next_leaf(root, path); in btrfs_read_chunk_tree()
3203 path->slots[0]++; in btrfs_read_chunk_tree()
3207 btrfs_release_path(root, path); in btrfs_read_chunk_tree()
3212 btrfs_free_path(path); in btrfs_read_chunk_tree()