Lines Matching refs:path
590 static noinline int device_list_add(const char *path, in device_list_add() argument
625 name = rcu_string_strdup(path, GFP_NOFS); in device_list_add()
639 } else if (!device->name || strcmp(device->name->str, path)) { in device_list_add()
677 name = rcu_string_strdup(path, GFP_NOFS); in device_list_add()
994 int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, in btrfs_scan_one_device() argument
1018 bdev = blkdev_get_by_path(path, flags, holder); in btrfs_scan_one_device()
1058 ret = device_list_add(path, disk_super, devid, fs_devices_ret); in btrfs_scan_one_device()
1068 printk(KERN_CONT "devid %llu transid %llu %s\n", devid, transid, path); in btrfs_scan_one_device()
1092 struct btrfs_path *path; in btrfs_account_dev_extents_size() local
1103 path = btrfs_alloc_path(); in btrfs_account_dev_extents_size()
1104 if (!path) in btrfs_account_dev_extents_size()
1106 path->reada = 2; in btrfs_account_dev_extents_size()
1112 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_account_dev_extents_size()
1116 ret = btrfs_previous_item(root, path, key.objectid, key.type); in btrfs_account_dev_extents_size()
1122 l = path->nodes[0]; in btrfs_account_dev_extents_size()
1123 slot = path->slots[0]; in btrfs_account_dev_extents_size()
1125 ret = btrfs_next_leaf(root, path); in btrfs_account_dev_extents_size()
1161 path->slots[0]++; in btrfs_account_dev_extents_size()
1165 btrfs_free_path(path); in btrfs_account_dev_extents_size()
1252 struct btrfs_path *path; in find_free_dev_extent_start() local
1271 path = btrfs_alloc_path(); in find_free_dev_extent_start()
1272 if (!path) in find_free_dev_extent_start()
1284 path->reada = 2; in find_free_dev_extent_start()
1285 path->search_commit_root = 1; in find_free_dev_extent_start()
1286 path->skip_locking = 1; in find_free_dev_extent_start()
1292 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in find_free_dev_extent_start()
1296 ret = btrfs_previous_item(root, path, key.objectid, key.type); in find_free_dev_extent_start()
1302 l = path->nodes[0]; in find_free_dev_extent_start()
1303 slot = path->slots[0]; in find_free_dev_extent_start()
1305 ret = btrfs_next_leaf(root, path); in find_free_dev_extent_start()
1368 path->slots[0]++; in find_free_dev_extent_start()
1382 btrfs_release_path(path); in find_free_dev_extent_start()
1399 btrfs_free_path(path); in find_free_dev_extent_start()
1420 struct btrfs_path *path; in btrfs_free_dev_extent() local
1427 path = btrfs_alloc_path(); in btrfs_free_dev_extent()
1428 if (!path) in btrfs_free_dev_extent()
1435 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_free_dev_extent()
1437 ret = btrfs_previous_item(root, path, key.objectid, in btrfs_free_dev_extent()
1441 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1442 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_free_dev_extent()
1443 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1448 btrfs_release_path(path); in btrfs_free_dev_extent()
1451 leaf = path->nodes[0]; in btrfs_free_dev_extent()
1452 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_free_dev_extent()
1461 ret = btrfs_del_item(trans, root, path); in btrfs_free_dev_extent()
1469 btrfs_free_path(path); in btrfs_free_dev_extent()
1479 struct btrfs_path *path; in btrfs_alloc_dev_extent() local
1487 path = btrfs_alloc_path(); in btrfs_alloc_dev_extent()
1488 if (!path) in btrfs_alloc_dev_extent()
1494 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_alloc_dev_extent()
1499 leaf = path->nodes[0]; in btrfs_alloc_dev_extent()
1500 extent = btrfs_item_ptr(leaf, path->slots[0], in btrfs_alloc_dev_extent()
1512 btrfs_free_path(path); in btrfs_alloc_dev_extent()
1541 struct btrfs_path *path; in find_next_devid() local
1543 path = btrfs_alloc_path(); in find_next_devid()
1544 if (!path) in find_next_devid()
1551 ret = btrfs_search_slot(NULL, fs_info->chunk_root, &key, path, 0, 0); in find_next_devid()
1557 ret = btrfs_previous_item(fs_info->chunk_root, path, in find_next_devid()
1563 btrfs_item_key_to_cpu(path->nodes[0], &found_key, in find_next_devid()
1564 path->slots[0]); in find_next_devid()
1569 btrfs_free_path(path); in find_next_devid()
1582 struct btrfs_path *path; in btrfs_add_device() local
1590 path = btrfs_alloc_path(); in btrfs_add_device()
1591 if (!path) in btrfs_add_device()
1598 ret = btrfs_insert_empty_item(trans, root, path, &key, in btrfs_add_device()
1603 leaf = path->nodes[0]; in btrfs_add_device()
1604 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_add_device()
1629 btrfs_free_path(path); in btrfs_add_device()
1653 struct btrfs_path *path; in btrfs_rm_dev_item() local
1659 path = btrfs_alloc_path(); in btrfs_rm_dev_item()
1660 if (!path) in btrfs_rm_dev_item()
1665 btrfs_free_path(path); in btrfs_rm_dev_item()
1672 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_rm_dev_item()
1681 ret = btrfs_del_item(trans, root, path); in btrfs_rm_dev_item()
1685 btrfs_free_path(path); in btrfs_rm_dev_item()
2172 struct btrfs_path *path; in btrfs_finish_sprout() local
2182 path = btrfs_alloc_path(); in btrfs_finish_sprout()
2183 if (!path) in btrfs_finish_sprout()
2192 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in btrfs_finish_sprout()
2196 leaf = path->nodes[0]; in btrfs_finish_sprout()
2198 if (path->slots[0] >= btrfs_header_nritems(leaf)) { in btrfs_finish_sprout()
2199 ret = btrfs_next_leaf(root, path); in btrfs_finish_sprout()
2204 leaf = path->nodes[0]; in btrfs_finish_sprout()
2205 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
2206 btrfs_release_path(path); in btrfs_finish_sprout()
2210 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); in btrfs_finish_sprout()
2215 dev_item = btrfs_item_ptr(leaf, path->slots[0], in btrfs_finish_sprout()
2232 path->slots[0]++; in btrfs_finish_sprout()
2237 btrfs_free_path(path); in btrfs_finish_sprout()
2562 struct btrfs_path *path; in btrfs_update_device() local
2570 path = btrfs_alloc_path(); in btrfs_update_device()
2571 if (!path) in btrfs_update_device()
2578 ret = btrfs_search_slot(trans, root, &key, path, 0, 1); in btrfs_update_device()
2587 leaf = path->nodes[0]; in btrfs_update_device()
2588 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item); in btrfs_update_device()
2602 btrfs_free_path(path); in btrfs_update_device()
2649 struct btrfs_path *path; in btrfs_free_chunk() local
2653 path = btrfs_alloc_path(); in btrfs_free_chunk()
2654 if (!path) in btrfs_free_chunk()
2661 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in btrfs_free_chunk()
2671 ret = btrfs_del_item(trans, root, path); in btrfs_free_chunk()
2676 btrfs_free_path(path); in btrfs_free_chunk()
2875 struct btrfs_path *path; in btrfs_relocate_sys_chunks() local
2885 path = btrfs_alloc_path(); in btrfs_relocate_sys_chunks()
2886 if (!path) in btrfs_relocate_sys_chunks()
2896 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0); in btrfs_relocate_sys_chunks()
2903 ret = btrfs_previous_item(chunk_root, path, key.objectid, in btrfs_relocate_sys_chunks()
2912 leaf = path->nodes[0]; in btrfs_relocate_sys_chunks()
2913 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); in btrfs_relocate_sys_chunks()
2915 chunk = btrfs_item_ptr(leaf, path->slots[0], in btrfs_relocate_sys_chunks()
2918 btrfs_release_path(path); in btrfs_relocate_sys_chunks()
2943 btrfs_free_path(path); in btrfs_relocate_sys_chunks()
2953 struct btrfs_path *path; in insert_balance_item() local
2958 path = btrfs_alloc_path(); in insert_balance_item()
2959 if (!path) in insert_balance_item()
2964 btrfs_free_path(path); in insert_balance_item()
2972 ret = btrfs_insert_empty_item(trans, root, path, &key, in insert_balance_item()
2977 leaf = path->nodes[0]; in insert_balance_item()
2978 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); in insert_balance_item()
2993 btrfs_free_path(path); in insert_balance_item()
3003 struct btrfs_path *path; in del_balance_item() local
3007 path = btrfs_alloc_path(); in del_balance_item()
3008 if (!path) in del_balance_item()
3013 btrfs_free_path(path); in del_balance_item()
3021 ret = btrfs_search_slot(trans, root, &key, path, -1, 1); in del_balance_item()
3029 ret = btrfs_del_item(trans, root, path); in del_balance_item()
3031 btrfs_free_path(path); in del_balance_item()
3387 struct btrfs_path *path; in __btrfs_balance() local
3432 path = btrfs_alloc_path(); in __btrfs_balance()
3433 if (!path) { in __btrfs_balance()
3464 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0); in __btrfs_balance()
3477 ret = btrfs_previous_item(chunk_root, path, 0, in __btrfs_balance()
3485 leaf = path->nodes[0]; in __btrfs_balance()
3486 slot = path->slots[0]; in __btrfs_balance()
3506 btrfs_release_path(path); in __btrfs_balance()
3579 btrfs_release_path(path); in __btrfs_balance()
3584 btrfs_free_path(path); in __btrfs_balance()
3861 struct btrfs_path *path; in btrfs_recover_balance() local
3866 path = btrfs_alloc_path(); in btrfs_recover_balance()
3867 if (!path) in btrfs_recover_balance()
3874 ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, path, 0, 0); in btrfs_recover_balance()
3888 leaf = path->nodes[0]; in btrfs_recover_balance()
3889 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); in btrfs_recover_balance()
3912 btrfs_free_path(path); in btrfs_recover_balance()
3990 struct btrfs_path *path = NULL; in btrfs_uuid_scan_kthread() local
3998 path = btrfs_alloc_path(); in btrfs_uuid_scan_kthread()
3999 if (!path) { in btrfs_uuid_scan_kthread()
4013 ret = btrfs_search_forward(root, &key, path, 0); in btrfs_uuid_scan_kthread()
4026 eb = path->nodes[0]; in btrfs_uuid_scan_kthread()
4027 slot = path->slots[0]; in btrfs_uuid_scan_kthread()
4043 btrfs_release_path(path); in btrfs_uuid_scan_kthread()
4090 btrfs_release_path(path); in btrfs_uuid_scan_kthread()
4107 btrfs_free_path(path); in btrfs_uuid_scan_kthread()
4250 struct btrfs_path *path; in btrfs_shrink_device() local
4268 path = btrfs_alloc_path(); in btrfs_shrink_device()
4269 if (!path) in btrfs_shrink_device()
4272 path->reada = 2; in btrfs_shrink_device()
4292 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_shrink_device()
4298 ret = btrfs_previous_item(root, path, 0, key.type); in btrfs_shrink_device()
4305 btrfs_release_path(path); in btrfs_shrink_device()
4309 l = path->nodes[0]; in btrfs_shrink_device()
4310 slot = path->slots[0]; in btrfs_shrink_device()
4311 btrfs_item_key_to_cpu(l, &key, path->slots[0]); in btrfs_shrink_device()
4315 btrfs_release_path(path); in btrfs_shrink_device()
4324 btrfs_release_path(path); in btrfs_shrink_device()
4329 btrfs_release_path(path); in btrfs_shrink_device()
4399 btrfs_free_path(path); in btrfs_shrink_device()
6551 struct btrfs_path *path; in btrfs_read_chunk_tree() local
6560 path = btrfs_alloc_path(); in btrfs_read_chunk_tree()
6561 if (!path) in btrfs_read_chunk_tree()
6576 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_read_chunk_tree()
6580 leaf = path->nodes[0]; in btrfs_read_chunk_tree()
6581 slot = path->slots[0]; in btrfs_read_chunk_tree()
6583 ret = btrfs_next_leaf(root, path); in btrfs_read_chunk_tree()
6605 path->slots[0]++; in btrfs_read_chunk_tree()
6612 btrfs_free_path(path); in btrfs_read_chunk_tree()
6649 struct btrfs_path *path = NULL; in btrfs_init_dev_stats() local
6652 path = btrfs_alloc_path(); in btrfs_init_dev_stats()
6653 if (!path) { in btrfs_init_dev_stats()
6666 ret = btrfs_search_slot(NULL, dev_root, &key, path, 0, 0); in btrfs_init_dev_stats()
6670 btrfs_release_path(path); in btrfs_init_dev_stats()
6673 slot = path->slots[0]; in btrfs_init_dev_stats()
6674 eb = path->nodes[0]; in btrfs_init_dev_stats()
6691 btrfs_release_path(path); in btrfs_init_dev_stats()
6696 btrfs_free_path(path); in btrfs_init_dev_stats()
6704 struct btrfs_path *path; in update_dev_stat_item() local
6715 path = btrfs_alloc_path(); in update_dev_stat_item()
6716 BUG_ON(!path); in update_dev_stat_item()
6717 ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); in update_dev_stat_item()
6726 btrfs_item_size_nr(path->nodes[0], path->slots[0]) < sizeof(*ptr)) { in update_dev_stat_item()
6728 ret = btrfs_del_item(trans, dev_root, path); in update_dev_stat_item()
6740 btrfs_release_path(path); in update_dev_stat_item()
6741 ret = btrfs_insert_empty_item(trans, dev_root, path, in update_dev_stat_item()
6751 eb = path->nodes[0]; in update_dev_stat_item()
6752 ptr = btrfs_item_ptr(eb, path->slots[0], struct btrfs_dev_stats_item); in update_dev_stat_item()
6759 btrfs_free_path(path); in update_dev_stat_item()