Lines Matching refs:path

777 static noinline struct btrfs_device *device_list_add(const char *path,
793 error = lookup_bdev(path, &path_devt);
795 btrfs_err(NULL, "failed to lookup block device for path %s: %d",
796 path, error);
856 path, fs_devices->fsid, current->comm,
864 disk_super->dev_item.uuid, path);
883 disk_super->label, devid, found_transid, path,
888 disk_super->fsid, devid, found_transid, path,
891 } else if (!device->name || strcmp(device->name->str, path)) {
897 * from 'path' that means either
906 * Further in case of 1 and 2a above, the disk at 'path'
929 path, found_transid, device->generation);
934 * We are going to replace the device path for a given devid,
947 path, devid, found_transid,
953 "devid %llu device path %s changed to %s scanned by %s (%d)",
955 path, current->comm,
959 name = rcu_string_strdup(path, GFP_NOFS);
1050 /* This is the initialized path, it is safe to release the devices. */
1357 * Look for a btrfs signature on a device. This may be called out of the mount path
1361 struct btrfs_device *btrfs_scan_one_device(const char *path, blk_mode_t flags)
1389 bdev = blkdev_get_by_path(path, flags, NULL, NULL);
1406 device = device_list_add(path, disk_super, &new_device_added);
1593 struct btrfs_path *path;
1610 path = btrfs_alloc_path();
1611 if (!path) {
1622 path->reada = READA_FORWARD;
1623 path->search_commit_root = 1;
1624 path->skip_locking = 1;
1630 ret = btrfs_search_backwards(root, &key, path);
1635 l = path->nodes[0];
1636 slot = path->slots[0];
1638 ret = btrfs_next_leaf(root, path);
1691 path->slots[0]++;
1704 btrfs_release_path(path);
1722 btrfs_free_path(path);
1736 struct btrfs_path *path;
1742 path = btrfs_alloc_path();
1743 if (!path)
1750 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1752 ret = btrfs_previous_item(root, path, key.objectid,
1756 leaf = path->nodes[0];
1757 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
1758 extent = btrfs_item_ptr(leaf, path->slots[0],
1763 btrfs_release_path(path);
1766 leaf = path->nodes[0];
1767 extent = btrfs_item_ptr(leaf, path->slots[0],
1775 ret = btrfs_del_item(trans, root, path);
1779 btrfs_free_path(path);
1808 struct btrfs_path *path;
1810 path = btrfs_alloc_path();
1811 if (!path)
1818 ret = btrfs_search_slot(NULL, fs_info->chunk_root, &key, path, 0, 0);
1829 ret = btrfs_previous_item(fs_info->chunk_root, path,
1835 btrfs_item_key_to_cpu(path->nodes[0], &found_key,
1836 path->slots[0]);
1841 btrfs_free_path(path);
1853 struct btrfs_path *path;
1859 path = btrfs_alloc_path();
1860 if (!path)
1868 ret = btrfs_insert_empty_item(trans, trans->fs_info->chunk_root, path,
1874 leaf = path->nodes[0];
1875 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item);
1901 btrfs_free_path(path);
1906 * Function to update ctime/mtime for a given device path.
1913 struct path path;
1916 ret = kern_path(device_path, LOOKUP_FOLLOW, &path);
1920 inode_update_time(d_inode(path.dentry), S_MTIME | S_CTIME | S_VERSION);
1921 path_put(&path);
1929 struct btrfs_path *path;
1932 path = btrfs_alloc_path();
1933 if (!path)
1941 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
1949 ret = btrfs_del_item(trans, root, path);
1951 btrfs_free_path(path);
2084 /* Update ctime/mtime for device path for libblkid */
2344 * Populate args from device at path.
2348 * @path: the path to the device
2350 * This will read the super block of the device at @path and populate @args with
2354 * and does some basic sanity checks. The caller must make sure that @path is
2363 const char *path)
2369 if (!path || !path[0])
2371 if (!strcmp(path, "missing")) {
2383 ret = btrfs_get_bdev_and_sb(path, BLK_OPEN_READ, NULL, 0,
2542 struct btrfs_path *path;
2551 path = btrfs_alloc_path();
2552 if (!path)
2561 ret = btrfs_search_slot(trans, root, &key, path, 0, 1);
2566 leaf = path->nodes[0];
2568 if (path->slots[0] >= btrfs_header_nritems(leaf)) {
2569 ret = btrfs_next_leaf(root, path);
2574 leaf = path->nodes[0];
2575 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
2576 btrfs_release_path(path);
2580 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
2585 dev_item = btrfs_item_ptr(leaf, path->slots[0],
2603 path->slots[0]++;
2608 btrfs_free_path(path);
2863 struct btrfs_path *path;
2869 path = btrfs_alloc_path();
2870 if (!path)
2877 ret = btrfs_search_slot(trans, root, &key, path, 0, 1);
2886 leaf = path->nodes[0];
2887 dev_item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_dev_item);
2901 btrfs_free_path(path);
2953 struct btrfs_path *path;
2956 path = btrfs_alloc_path();
2957 if (!path)
2964 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
2974 ret = btrfs_del_item(trans, root, path);
2979 btrfs_free_path(path);
3269 * we release the path used to search the chunk/dev tree and before
3329 struct btrfs_path *path;
3339 path = btrfs_alloc_path();
3340 if (!path)
3350 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0);
3357 ret = btrfs_previous_item(chunk_root, path, key.objectid,
3366 leaf = path->nodes[0];
3367 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
3369 chunk = btrfs_item_ptr(leaf, path->slots[0],
3372 btrfs_release_path(path);
3396 btrfs_free_path(path);
3449 struct btrfs_path *path;
3454 path = btrfs_alloc_path();
3455 if (!path)
3460 btrfs_free_path(path);
3468 ret = btrfs_insert_empty_item(trans, root, path, &key,
3473 leaf = path->nodes[0];
3474 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item);
3489 btrfs_free_path(path);
3500 struct btrfs_path *path;
3504 path = btrfs_alloc_path();
3505 if (!path)
3510 btrfs_free_path(path);
3518 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
3526 ret = btrfs_del_item(trans, root, path);
3528 btrfs_free_path(path);
3868 struct btrfs_path *path = NULL;
3885 path = btrfs_alloc_path();
3886 if (!path) {
3917 ret = btrfs_search_slot(NULL, chunk_root, &key, path, 0, 0);
3930 ret = btrfs_previous_item(chunk_root, path, 0,
3938 leaf = path->nodes[0];
3939 slot = path->slots[0];
3958 btrfs_release_path(path);
4034 btrfs_release_path(path);
4039 btrfs_free_path(path);
4495 struct btrfs_path *path;
4500 path = btrfs_alloc_path();
4501 if (!path)
4508 ret = btrfs_search_slot(NULL, fs_info->tree_root, &key, path, 0, 0);
4522 leaf = path->nodes[0];
4523 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item);
4549 btrfs_release_path(path);
4558 btrfs_free_path(path);
4645 struct btrfs_path *path = NULL;
4654 path = btrfs_alloc_path();
4655 if (!path) {
4669 ret = btrfs_search_forward(root, &key, path,
4683 eb = path->nodes[0];
4684 slot = path->slots[0];
4700 btrfs_release_path(path);
4715 btrfs_release_path(path);
4740 btrfs_release_path(path);
4764 btrfs_free_path(path);
4828 struct btrfs_path *path;
4850 path = btrfs_alloc_path();
4851 if (!path)
4854 path->reada = READA_BACK;
4858 btrfs_free_path(path);
4892 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
4898 ret = btrfs_previous_item(root, path, 0, key.type);
4904 btrfs_release_path(path);
4908 l = path->nodes[0];
4909 slot = path->slots[0];
4910 btrfs_item_key_to_cpu(l, &key, path->slots[0]);
4914 btrfs_release_path(path);
4923 btrfs_release_path(path);
4928 btrfs_release_path(path);
4998 btrfs_free_path(path);
6600 * @path: a pointer to device path if available, NULL otherwise.
6608 const char *path)
6646 if (path) {
6649 name = rcu_string_strdup(path, GFP_KERNEL);
7233 struct btrfs_path *path;
7243 path = btrfs_alloc_path();
7244 if (!path)
7255 * we execute this code path, but open_fs_devices failed to clear
7272 path->skip_locking = 1;
7283 btrfs_for_each_slot(root, &key, &found_key, path, iter_ret) {
7284 struct extent_buffer *node = path->nodes[1];
7286 leaf = path->nodes[0];
7287 slot = path->slots[0];
7351 btrfs_free_path(path);
7406 struct btrfs_path *path)
7420 ret = btrfs_search_slot(NULL, device->fs_info->dev_root, &key, path, 0, 0);
7425 btrfs_release_path(path);
7428 slot = path->slots[0];
7429 eb = path->nodes[0];
7444 btrfs_release_path(path);
7453 struct btrfs_path *path = NULL;
7456 path = btrfs_alloc_path();
7457 if (!path)
7462 ret = btrfs_device_init_dev_stats(device, path);
7468 ret = btrfs_device_init_dev_stats(device, path);
7476 btrfs_free_path(path);
7485 struct btrfs_path *path;
7496 path = btrfs_alloc_path();
7497 if (!path)
7499 ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1);
7508 btrfs_item_size(path->nodes[0], path->slots[0]) < sizeof(*ptr)) {
7510 ret = btrfs_del_item(trans, dev_root, path);
7522 btrfs_release_path(path);
7523 ret = btrfs_insert_empty_item(trans, dev_root, path,
7533 eb = path->nodes[0];
7534 ptr = btrfs_item_ptr(eb, path->slots[0], struct btrfs_dev_stats_item);
7541 btrfs_free_path(path);
7841 struct btrfs_path *path;
7865 path = btrfs_alloc_path();
7866 if (!path)
7869 path->reada = READA_FORWARD;
7870 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
7874 if (path->slots[0] >= btrfs_header_nritems(path->nodes[0])) {
7875 ret = btrfs_next_leaf(root, path);
7885 struct extent_buffer *leaf = path->nodes[0];
7887 int slot = path->slots[0];
7919 ret = btrfs_next_item(root, path);
7931 btrfs_free_path(path);
8060 * Not update any other mirrors nor go through RMW path.