/* Disable device. Used by dasdfmt. Disable I/O operations but allow ioctls.  */
static int dasd_ioctl_disable(struct block_device *bdev)
/* Disable device. Used by dasdfmt. Disable I/O operations but allow ioctls.  */
static int dasd_ioctl_disable(struct block_device *bdev)
{
	struct dasd_block *block = bdev->bd_disk->private_data;
	if (!capable(CAP_SYS_ADMIN))
		return -EACCES;
	dasd_set_target_state(block->base, DASD_STATE_BASIC);
	mutex_lock(&bdev->bd_mutex);
	i_size_write(bdev->bd_inode, 0);
	mutex_unlock(&bdev->bd_mutex);
	return 0;
}