/* used by btrfsctl to scan devices when no FS is mounted  */
static long btrfs_control_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* used by btrfsctl to scan devices when no FS is mounted  */
static long btrfs_control_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	struct btrfs_ioctl_vol_args *vol;
	struct btrfs_fs_devices *fs_devices;
	int ret = -ENOTTY;
	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
	vol = memdup_user((void __user *)arg, sizeof(*vol));
	if (IS_ERR(vol))
		return PTR_ERR(vol);
	switch (cmd) {
	case BTRFS_IOC_SCAN_DEV:
		ret = btrfs_scan_one_device(vol->name, FMODE_READ,
					    &btrfs_fs_type, &fs_devices);
		break;
	}
	kfree(vol);
	return ret;
}