aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd_ioctl.c')
-rw-r--r--drivers/s390/block/dasd_ioctl.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index b82d816d9ef7..4ce3f72ee1c1 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -9,6 +9,9 @@
9 * 9 *
10 * i/o controls for the dasd driver. 10 * i/o controls for the dasd driver.
11 */ 11 */
12
13#define KMSG_COMPONENT "dasd"
14
12#include <linux/interrupt.h> 15#include <linux/interrupt.h>
13#include <linux/major.h> 16#include <linux/major.h>
14#include <linux/fs.h> 17#include <linux/fs.h>
@@ -94,7 +97,8 @@ static int dasd_ioctl_quiesce(struct dasd_block *block)
94 if (!capable (CAP_SYS_ADMIN)) 97 if (!capable (CAP_SYS_ADMIN))
95 return -EACCES; 98 return -EACCES;
96 99
97 DEV_MESSAGE(KERN_DEBUG, base, "%s", "Quiesce IO on device"); 100 dev_info(&base->cdev->dev, "The DASD has been put in the quiesce "
101 "state\n");
98 spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); 102 spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags);
99 base->stopped |= DASD_STOPPED_QUIESCE; 103 base->stopped |= DASD_STOPPED_QUIESCE;
100 spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); 104 spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags);
@@ -103,7 +107,7 @@ static int dasd_ioctl_quiesce(struct dasd_block *block)
103 107
104 108
105/* 109/*
106 * Quiesce device. 110 * Resume device.
107 */ 111 */
108static int dasd_ioctl_resume(struct dasd_block *block) 112static int dasd_ioctl_resume(struct dasd_block *block)
109{ 113{
@@ -114,7 +118,8 @@ static int dasd_ioctl_resume(struct dasd_block *block)
114 if (!capable (CAP_SYS_ADMIN)) 118 if (!capable (CAP_SYS_ADMIN))
115 return -EACCES; 119 return -EACCES;
116 120
117 DEV_MESSAGE(KERN_DEBUG, base, "%s", "resume IO on device"); 121 dev_info(&base->cdev->dev, "I/O operations have been resumed "
122 "on the DASD\n");
118 spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); 123 spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags);
119 base->stopped &= ~DASD_STOPPED_QUIESCE; 124 base->stopped &= ~DASD_STOPPED_QUIESCE;
120 spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); 125 spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags);
@@ -140,13 +145,13 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata)
140 return -EPERM; 145 return -EPERM;
141 146
142 if (base->state != DASD_STATE_BASIC) { 147 if (base->state != DASD_STATE_BASIC) {
143 DEV_MESSAGE(KERN_WARNING, base, "%s", 148 dev_warn(&base->cdev->dev,
144 "dasd_format: device is not disabled! "); 149 "The DASD cannot be formatted while it is enabled\n");
145 return -EBUSY; 150 return -EBUSY;
146 } 151 }
147 152
148 DBF_DEV_EVENT(DBF_NOTICE, base, 153 DBF_DEV_EVENT(DBF_NOTICE, base,
149 "formatting units %d to %d (%d B blocks) flags %d", 154 "formatting units %u to %u (%u B blocks) flags %u",
150 fdata->start_unit, 155 fdata->start_unit,
151 fdata->stop_unit, fdata->blksize, fdata->intensity); 156 fdata->stop_unit, fdata->blksize, fdata->intensity);
152 157
@@ -169,10 +174,9 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata)
169 dasd_sfree_request(cqr, cqr->memdev); 174 dasd_sfree_request(cqr, cqr->memdev);
170 if (rc) { 175 if (rc) {
171 if (rc != -ERESTARTSYS) 176 if (rc != -ERESTARTSYS)
172 DEV_MESSAGE(KERN_ERR, base, 177 dev_err(&base->cdev->dev,
173 " Formatting of unit %d failed " 178 "Formatting unit %d failed with "
174 "with rc = %d", 179 "rc=%d\n", fdata->start_unit, rc);
175 fdata->start_unit, rc);
176 return rc; 180 return rc;
177 } 181 }
178 fdata->start_unit++; 182 fdata->start_unit++;
@@ -199,8 +203,9 @@ dasd_ioctl_format(struct block_device *bdev, void __user *argp)
199 if (copy_from_user(&fdata, argp, sizeof(struct format_data_t))) 203 if (copy_from_user(&fdata, argp, sizeof(struct format_data_t)))
200 return -EFAULT; 204 return -EFAULT;
201 if (bdev != bdev->bd_contains) { 205 if (bdev != bdev->bd_contains) {
202 DEV_MESSAGE(KERN_WARNING, block->base, "%s", 206 dev_warn(&block->base->cdev->dev,
203 "Cannot low-level format a partition"); 207 "The specified DASD is a partition and cannot be "
208 "formatted\n");
204 return -EINVAL; 209 return -EINVAL;
205 } 210 }
206 return dasd_format(block, &fdata); 211 return dasd_format(block, &fdata);
@@ -365,9 +370,9 @@ static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd,
365 return ret; 370 return ret;
366} 371}
367 372
368int 373static int
369dasd_ioctl(struct block_device *bdev, fmode_t mode, 374dasd_do_ioctl(struct block_device *bdev, fmode_t mode,
370 unsigned int cmd, unsigned long arg) 375 unsigned int cmd, unsigned long arg)
371{ 376{
372 struct dasd_block *block = bdev->bd_disk->private_data; 377 struct dasd_block *block = bdev->bd_disk->private_data;
373 void __user *argp = (void __user *)arg; 378 void __user *argp = (void __user *)arg;
@@ -420,3 +425,14 @@ dasd_ioctl(struct block_device *bdev, fmode_t mode,
420 return -EINVAL; 425 return -EINVAL;
421 } 426 }
422} 427}
428
429int dasd_ioctl(struct block_device *bdev, fmode_t mode,
430 unsigned int cmd, unsigned long arg)
431{
432 int rc;
433
434 lock_kernel();
435 rc = dasd_do_ioctl(bdev, mode, cmd, arg);
436 unlock_kernel();
437 return rc;
438}