Lines Matching refs:path
453 static noinline int device_list_add(const char *path, in device_list_add() argument
488 name = rcu_string_strdup(path, GFP_NOFS); in device_list_add()
502 } else if (!device->name || strcmp(device->name->str, path)) { in device_list_add()
540 name = rcu_string_strdup(path, GFP_NOFS); in device_list_add()
880 int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, in btrfs_scan_one_device() argument
904 bdev = blkdev_get_by_path(path, flags, holder); in btrfs_scan_one_device()
944 ret = device_list_add(path, disk_super, devid, fs_devices_ret); in btrfs_scan_one_device()
954 printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path); in btrfs_scan_one_device()
978 struct btrfs_path *path; in btrfs_account_dev_extents_size() local
989 path = btrfs_alloc_path(); in btrfs_account_dev_extents_size()
990 if (!path) in btrfs_account_dev_extents_size()
992 path->reada = 2; in btrfs_account_dev_extents_size()
998 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_account_dev_extents_size()
1002 ret = btrfs_previous_item(root, path, key.objectid, key.type); in btrfs_account_dev_extents_size()
1008 l = path->nodes[0]; in btrfs_account_dev_extents_size()
1009 slot = path->slots[0]; in btrfs_account_dev_extents_size()
1011 ret = btrfs_next_leaf(root, path); in btrfs_account_dev_extents_size()
1047 path->slots[0]++; in btrfs_account_dev_extents_size()
1051 btrfs_free_path(path); in btrfs_account_dev_extents_size()
1118 struct btrfs_path *path; in find_free_dev_extent() local
1136 path = btrfs_alloc_path(); in find_free_dev_extent()
1137 if (!path) in find_free_dev_extent()
1149 path->reada = 2; in find_free_dev_extent()
1150 path->search_commit_root = 1; in find_free_dev_extent()
1151 path->skip_locking = 1; in find_free_dev_extent()
1157 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_free_dev_extent()
1161 ret = btrfs_previous_item(root, path, key.objectid, key.type); in find_free_dev_extent()
1167 l = path->nodes[0]; in find_free_dev_extent()
1168 slot = path->slots[0]; in find_free_dev_extent()
1170 ret = btrfs_next_leaf(root, path); in find_free_dev_extent()
1233 path->slots[0]++; in find_free_dev_extent()
1247 btrfs_release_path(path); in find_free_dev_extent()
1264 btrfs_free_path(path); in find_free_dev_extent()
1276 struct btrfs_path *path; in btrfs_free_dev_extent() local
1283 path = btrfs_alloc_path(); in btrfs_free_dev_extent()
1284 if (!path) in btrfs_free_dev_extent()
1291 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_free_dev_extent()
1293 ret = btrfs_previous_item(root, path, key.objectid, in btrfs_free_dev_extent()
1297 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1298 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_free_dev_extent()
1299 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1304 btrfs_release_path(path); in btrfs_free_dev_extent()
1307 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1308 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1317 ret = btrfs_del_item(trans, root, path); in btrfs_free_dev_extent()
1325 btrfs_free_path(path); in btrfs_free_dev_extent()
1335 struct btrfs_path *path; in btrfs_alloc_dev_extent() local
1343 path = btrfs_alloc_path(); in btrfs_alloc_dev_extent()
1344 if (!path) in btrfs_alloc_dev_extent()
1350 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_alloc_dev_extent()
1355 leaf = path->nodes[0]; in btrfs_alloc_dev_extent()
1356 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_alloc_dev_extent()
1368 btrfs_free_path(path); in btrfs_alloc_dev_extent()
1397 struct btrfs_path *path; in find_next_devid() local
1399 path = btrfs_alloc_path(); in find_next_devid()
1400 if (!path) in find_next_devid()
1407 ret = btrfs_search_slot(NULL, fs_info->chunk_root, &key, path, 0, 0); in find_next_devid()
1413 ret = btrfs_previous_item(fs_info->chunk_root, path, in find_next_devid()
1419 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in find_next_devid()
1420 path->slots[0]); in find_next_devid()
1425 btrfs_free_path(path); in find_next_devid()
1438 struct btrfs_path *path; in btrfs_add_device() local
1446 path = btrfs_alloc_path(); in btrfs_add_device()
1447 if (!path) in btrfs_add_device()
1454 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_add_device()
1459 leaf = path->nodes[0]; in btrfs_add_device()
1460 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_add_device()
1485 btrfs_free_path(path); in btrfs_add_device()
1509 struct btrfs_path *path; in btrfs_rm_dev_item() local
1515 path = btrfs_alloc_path(); in btrfs_rm_dev_item()
1516 if (!path) in btrfs_rm_dev_item()
1521 btrfs_free_path(path); in btrfs_rm_dev_item()
1528 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_rm_dev_item()
1537 ret = btrfs_del_item(trans, root, path); in btrfs_rm_dev_item()
1541 btrfs_free_path(path); in btrfs_rm_dev_item()
2027 struct btrfs_path *path; in btrfs_finish_sprout() local
2037 path = btrfs_alloc_path(); in btrfs_finish_sprout()
2038 if (!path) in btrfs_finish_sprout()
2047 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in btrfs_finish_sprout()
2051 leaf = path->nodes[0]; in btrfs_finish_sprout()
2053 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_finish_sprout()
2054 ret = btrfs_next_leaf(root, path); in btrfs_finish_sprout()
2059 leaf = path->nodes[0]; in btrfs_finish_sprout()
2060 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
2061 btrfs_release_path(path); in btrfs_finish_sprout()
2065 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
2070 dev_item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_finish_sprout()
2087 path->slots[0]++; in btrfs_finish_sprout()
2092 btrfs_free_path(path); in btrfs_finish_sprout()
2415 struct btrfs_path *path; in btrfs_update_device() local
2423 path = btrfs_alloc_path(); in btrfs_update_device()
2424 if (!path) in btrfs_update_device()
2431 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in btrfs_update_device()
2440 leaf = path->nodes[0]; in btrfs_update_device()
2441 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_update_device()
2455 btrfs_free_path(path); in btrfs_update_device()
2502 struct btrfs_path *path; in btrfs_free_chunk() local
2506 path = btrfs_alloc_path(); in btrfs_free_chunk()
2507 if (!path) in btrfs_free_chunk()
2514 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_free_chunk()
2524 ret = btrfs_del_item(trans, root, path); in btrfs_free_chunk()
2529 btrfs_free_path(path); in btrfs_free_chunk()
2710 struct btrfs_path *path; in btrfs_relocate_sys_chunks() local
2720 path = btrfs_alloc_path(); in btrfs_relocate_sys_chunks()
2721 if (!path) in btrfs_relocate_sys_chunks()
2730 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0); in btrfs_relocate_sys_chunks()
2735 ret = btrfs_previous_item(chunk_root, path, key.objectid, in btrfs_relocate_sys_chunks()
2742 leaf = path->nodes[0]; in btrfs_relocate_sys_chunks()
2743 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_relocate_sys_chunks()
2745 chunk = btrfs_item_ptr(leaf, path->slots[0], in btrfs_relocate_sys_chunks()
2748 btrfs_release_path(path); in btrfs_relocate_sys_chunks()
2773 btrfs_free_path(path); in btrfs_relocate_sys_chunks()
2783 struct btrfs_path *path; in insert_balance_item() local
2788 path = btrfs_alloc_path(); in insert_balance_item()
2789 if (!path) in insert_balance_item()
2794 btrfs_free_path(path); in insert_balance_item()
2802 ret = btrfs_insert_empty_item(trans, root, path, &key, in insert_balance_item()
2807 leaf = path->nodes[0]; in insert_balance_item()
2808 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); in insert_balance_item()
2823 btrfs_free_path(path); in insert_balance_item()
2833 struct btrfs_path *path; in del_balance_item() local
2837 path = btrfs_alloc_path(); in del_balance_item()
2838 if (!path) in del_balance_item()
2843 btrfs_free_path(path); in del_balance_item()
2851 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in del_balance_item()
2859 ret = btrfs_del_item(trans, root, path); in del_balance_item()
2861 btrfs_free_path(path); in del_balance_item()
3148 struct btrfs_path *path; in __btrfs_balance() local
3188 path = btrfs_alloc_path(); in __btrfs_balance()
3189 if (!path) { in __btrfs_balance()
3215 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0); in __btrfs_balance()
3226 ret = btrfs_previous_item(chunk_root, path, 0, in __btrfs_balance()
3233 leaf = path->nodes[0]; in __btrfs_balance()
3234 slot = path->slots[0]; in __btrfs_balance()
3250 btrfs_release_path(path); in __btrfs_balance()
3280 btrfs_release_path(path); in __btrfs_balance()
3285 btrfs_free_path(path); in __btrfs_balance()
3572 struct btrfs_path *path; in btrfs_recover_balance() local
3577 path = btrfs_alloc_path(); in btrfs_recover_balance()
3578 if (!path) in btrfs_recover_balance()
3585 ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, path, 0, 0); in btrfs_recover_balance()
3599 leaf = path->nodes[0]; in btrfs_recover_balance()
3600 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); in btrfs_recover_balance()
3623 btrfs_free_path(path); in btrfs_recover_balance()
3701 struct btrfs_path *path = NULL; in btrfs_uuid_scan_kthread() local
3709 path = btrfs_alloc_path(); in btrfs_uuid_scan_kthread()
3710 if (!path) { in btrfs_uuid_scan_kthread()
3724 ret = btrfs_search_forward(root, &key, path, 0); in btrfs_uuid_scan_kthread()
3737 eb = path->nodes[0]; in btrfs_uuid_scan_kthread()
3738 slot = path->slots[0]; in btrfs_uuid_scan_kthread()
3754 btrfs_release_path(path); in btrfs_uuid_scan_kthread()
3801 btrfs_release_path(path); in btrfs_uuid_scan_kthread()
3818 btrfs_free_path(path); in btrfs_uuid_scan_kthread()
3961 struct btrfs_path *path; in btrfs_shrink_device() local
3979 path = btrfs_alloc_path(); in btrfs_shrink_device()
3980 if (!path) in btrfs_shrink_device()
3983 path->reada = 2; in btrfs_shrink_device()
4002 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_shrink_device()
4006 ret = btrfs_previous_item(root, path, 0, key.type); in btrfs_shrink_device()
4011 btrfs_release_path(path); in btrfs_shrink_device()
4015 l = path->nodes[0]; in btrfs_shrink_device()
4016 slot = path->slots[0]; in btrfs_shrink_device()
4017 btrfs_item_key_to_cpu(l, &key, path->slots[0]); in btrfs_shrink_device()
4020 btrfs_release_path(path); in btrfs_shrink_device()
4028 btrfs_release_path(path); in btrfs_shrink_device()
4034 btrfs_release_path(path); in btrfs_shrink_device()
4082 btrfs_free_path(path); in btrfs_shrink_device()
6361 struct btrfs_path *path; in btrfs_read_chunk_tree() local
6370 path = btrfs_alloc_path(); in btrfs_read_chunk_tree()
6371 if (!path) in btrfs_read_chunk_tree()
6386 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_read_chunk_tree()
6390 leaf = path->nodes[0]; in btrfs_read_chunk_tree()
6391 slot = path->slots[0]; in btrfs_read_chunk_tree()
6393 ret = btrfs_next_leaf(root, path); in btrfs_read_chunk_tree()
6415 path->slots[0]++; in btrfs_read_chunk_tree()
6422 btrfs_free_path(path); in btrfs_read_chunk_tree()
6459 struct btrfs_path *path = NULL; in btrfs_init_dev_stats() local
6462 path = btrfs_alloc_path(); in btrfs_init_dev_stats()
6463 if (!path) { in btrfs_init_dev_stats()
6476 ret = btrfs_search_slot(NULL, dev_root, &key, path, 0, 0); in btrfs_init_dev_stats()
6480 btrfs_release_path(path); in btrfs_init_dev_stats()
6483 slot = path->slots[0]; in btrfs_init_dev_stats()
6484 eb = path->nodes[0]; in btrfs_init_dev_stats()
6501 btrfs_release_path(path); in btrfs_init_dev_stats()
6506 btrfs_free_path(path); in btrfs_init_dev_stats()
6514 struct btrfs_path *path; in update_dev_stat_item() local
6525 path = btrfs_alloc_path(); in update_dev_stat_item()
6526 BUG_ON(!path); in update_dev_stat_item()
6527 ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); in update_dev_stat_item()
6536 btrfs_item_size_nr(path->nodes[0], path->slots[0]) < sizeof(*ptr)) { in update_dev_stat_item()
6538 ret = btrfs_del_item(trans, dev_root, path); in update_dev_stat_item()
6550 btrfs_release_path(path); in update_dev_stat_item()
6551 ret = btrfs_insert_empty_item(trans, dev_root, path, in update_dev_stat_item()
6561 eb = path->nodes[0]; in update_dev_stat_item()
6562 ptr = btrfs_item_ptr(eb, path->slots[0], struct btrfs_dev_stats_item); in update_dev_stat_item()
6569 btrfs_free_path(path); in update_dev_stat_item()