]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
1da177e4 LT |
2 | * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com> |
3 | * Horst Hummel <Horst.Hummel@de.ibm.com> | |
4 | * Carsten Otte <Cotte@de.ibm.com> | |
5 | * Martin Schwidefsky <schwidefsky@de.ibm.com> | |
6 | * Bugreports.to..: <Linux390@de.ibm.com> | |
a53c8fab | 7 | * Copyright IBM Corp. 1999, 2001 |
1da177e4 LT |
8 | * |
9 | * i/o controls for the dasd driver. | |
10 | */ | |
fc19f381 SH |
11 | |
12 | #define KMSG_COMPONENT "dasd" | |
13 | ||
1da177e4 | 14 | #include <linux/interrupt.h> |
048cd4e5 | 15 | #include <linux/compat.h> |
1da177e4 LT |
16 | #include <linux/major.h> |
17 | #include <linux/fs.h> | |
18 | #include <linux/blkpg.h> | |
5a0e3ad6 | 19 | #include <linux/slab.h> |
88034865 | 20 | #include <asm/compat.h> |
1da177e4 | 21 | #include <asm/ccwdev.h> |
287a0933 | 22 | #include <asm/schid.h> |
8b2eb664 | 23 | #include <asm/cmb.h> |
1da177e4 LT |
24 | #include <asm/uaccess.h> |
25 | ||
26 | /* This is ugly... */ | |
27 | #define PRINTK_HEADER "dasd_ioctl:" | |
28 | ||
29 | #include "dasd_int.h" | |
30 | ||
1da177e4 | 31 | |
1da177e4 | 32 | static int |
13c6204f | 33 | dasd_ioctl_api_version(void __user *argp) |
1da177e4 LT |
34 | { |
35 | int ver = DASD_API_VERSION; | |
b5029622 | 36 | return put_user(ver, (int __user *)argp); |
1da177e4 LT |
37 | } |
38 | ||
39 | /* | |
40 | * Enable device. | |
41 | * used by dasdfmt after BIODASDDISABLE to retrigger blocksize detection | |
42 | */ | |
43 | static int | |
13c6204f | 44 | dasd_ioctl_enable(struct block_device *bdev) |
1da177e4 | 45 | { |
65f8da47 | 46 | struct dasd_device *base; |
1da177e4 LT |
47 | |
48 | if (!capable(CAP_SYS_ADMIN)) | |
49 | return -EACCES; | |
13c6204f | 50 | |
65f8da47 SW |
51 | base = dasd_device_from_gendisk(bdev->bd_disk); |
52 | if (!base) | |
53 | return -ENODEV; | |
54 | ||
55 | dasd_enable_device(base); | |
1da177e4 | 56 | /* Formatting the dasd device can change the capacity. */ |
c039e313 | 57 | mutex_lock(&bdev->bd_mutex); |
65f8da47 SW |
58 | i_size_write(bdev->bd_inode, |
59 | (loff_t)get_capacity(base->block->gdp) << 9); | |
c039e313 | 60 | mutex_unlock(&bdev->bd_mutex); |
65f8da47 | 61 | dasd_put_device(base); |
1da177e4 LT |
62 | return 0; |
63 | } | |
64 | ||
65 | /* | |
66 | * Disable device. | |
67 | * Used by dasdfmt. Disable I/O operations but allow ioctls. | |
68 | */ | |
69 | static int | |
13c6204f | 70 | dasd_ioctl_disable(struct block_device *bdev) |
1da177e4 | 71 | { |
65f8da47 | 72 | struct dasd_device *base; |
1da177e4 LT |
73 | |
74 | if (!capable(CAP_SYS_ADMIN)) | |
75 | return -EACCES; | |
13c6204f | 76 | |
65f8da47 SW |
77 | base = dasd_device_from_gendisk(bdev->bd_disk); |
78 | if (!base) | |
79 | return -ENODEV; | |
1da177e4 LT |
80 | /* |
81 | * Man this is sick. We don't do a real disable but only downgrade | |
82 | * the device to DASD_STATE_BASIC. The reason is that dasdfmt uses | |
83 | * BIODASDDISABLE to disable accesses to the device via the block | |
84 | * device layer but it still wants to do i/o on the device by | |
85 | * using the BIODASDFMT ioctl. Therefore the correct state for the | |
86 | * device is DASD_STATE_BASIC that allows to do basic i/o. | |
87 | */ | |
65f8da47 | 88 | dasd_set_target_state(base, DASD_STATE_BASIC); |
1da177e4 LT |
89 | /* |
90 | * Set i_size to zero, since read, write, etc. check against this | |
91 | * value. | |
92 | */ | |
c039e313 | 93 | mutex_lock(&bdev->bd_mutex); |
1da177e4 | 94 | i_size_write(bdev->bd_inode, 0); |
c039e313 | 95 | mutex_unlock(&bdev->bd_mutex); |
65f8da47 | 96 | dasd_put_device(base); |
1da177e4 LT |
97 | return 0; |
98 | } | |
99 | ||
100 | /* | |
101 | * Quiesce device. | |
102 | */ | |
8e09f215 | 103 | static int dasd_ioctl_quiesce(struct dasd_block *block) |
1da177e4 | 104 | { |
1da177e4 | 105 | unsigned long flags; |
8e09f215 | 106 | struct dasd_device *base; |
138c014d | 107 | |
8e09f215 | 108 | base = block->base; |
1da177e4 LT |
109 | if (!capable (CAP_SYS_ADMIN)) |
110 | return -EACCES; | |
138c014d | 111 | |
ca99dab0 SH |
112 | pr_info("%s: The DASD has been put in the quiesce " |
113 | "state\n", dev_name(&base->cdev->dev)); | |
8e09f215 | 114 | spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); |
eb6e199b | 115 | dasd_device_set_stop_bits(base, DASD_STOPPED_QUIESCE); |
8e09f215 | 116 | spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); |
1da177e4 LT |
117 | return 0; |
118 | } | |
119 | ||
120 | ||
121 | /* | |
fc19f381 | 122 | * Resume device. |
1da177e4 | 123 | */ |
8e09f215 | 124 | static int dasd_ioctl_resume(struct dasd_block *block) |
1da177e4 | 125 | { |
1da177e4 | 126 | unsigned long flags; |
8e09f215 | 127 | struct dasd_device *base; |
138c014d | 128 | |
8e09f215 | 129 | base = block->base; |
138c014d | 130 | if (!capable (CAP_SYS_ADMIN)) |
1da177e4 LT |
131 | return -EACCES; |
132 | ||
ca99dab0 SH |
133 | pr_info("%s: I/O operations have been resumed " |
134 | "on the DASD\n", dev_name(&base->cdev->dev)); | |
8e09f215 | 135 | spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); |
eb6e199b | 136 | dasd_device_remove_stop_bits(base, DASD_STOPPED_QUIESCE); |
8e09f215 | 137 | spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); |
1da177e4 | 138 | |
8e09f215 | 139 | dasd_schedule_block_bh(block); |
1da177e4 LT |
140 | return 0; |
141 | } | |
142 | ||
143 | /* | |
144 | * performs formatting of _device_ according to _fdata_ | |
145 | * Note: The discipline's format_function is assumed to deliver formatting | |
d42e1712 SH |
146 | * commands to format multiple units of the device. In terms of the ECKD |
147 | * devices this means CCWs are generated to format multiple tracks. | |
1da177e4 | 148 | */ |
d42e1712 SH |
149 | static int |
150 | dasd_format(struct dasd_block *block, struct format_data_t *fdata) | |
1da177e4 | 151 | { |
8e09f215 | 152 | struct dasd_device *base; |
1da177e4 LT |
153 | int rc; |
154 | ||
8e09f215 SW |
155 | base = block->base; |
156 | if (base->discipline->format_device == NULL) | |
1da177e4 LT |
157 | return -EPERM; |
158 | ||
8e09f215 | 159 | if (base->state != DASD_STATE_BASIC) { |
d42e1712 SH |
160 | pr_warn("%s: The DASD cannot be formatted while it is enabled\n", |
161 | dev_name(&base->cdev->dev)); | |
1da177e4 LT |
162 | return -EBUSY; |
163 | } | |
164 | ||
8e09f215 | 165 | DBF_DEV_EVENT(DBF_NOTICE, base, |
b44b0ab3 | 166 | "formatting units %u to %u (%u B blocks) flags %u", |
1da177e4 LT |
167 | fdata->start_unit, |
168 | fdata->stop_unit, fdata->blksize, fdata->intensity); | |
169 | ||
170 | /* Since dasdfmt keeps the device open after it was disabled, | |
171 | * there still exists an inode for this device. | |
172 | * We must update i_blkbits, otherwise we might get errors when | |
173 | * enabling the device later. | |
174 | */ | |
175 | if (fdata->start_unit == 0) { | |
8e09f215 | 176 | struct block_device *bdev = bdget_disk(block->gdp, 0); |
1da177e4 LT |
177 | bdev->bd_inode->i_blkbits = blksize_bits(fdata->blksize); |
178 | bdput(bdev); | |
179 | } | |
180 | ||
d42e1712 SH |
181 | rc = base->discipline->format_device(base, fdata); |
182 | if (rc) | |
183 | return rc; | |
184 | ||
1da177e4 LT |
185 | return 0; |
186 | } | |
187 | ||
188 | /* | |
189 | * Format device. | |
190 | */ | |
191 | static int | |
13c6204f | 192 | dasd_ioctl_format(struct block_device *bdev, void __user *argp) |
1da177e4 | 193 | { |
65f8da47 | 194 | struct dasd_device *base; |
1da177e4 | 195 | struct format_data_t fdata; |
65f8da47 | 196 | int rc; |
1da177e4 LT |
197 | |
198 | if (!capable(CAP_SYS_ADMIN)) | |
199 | return -EACCES; | |
13c6204f | 200 | if (!argp) |
1da177e4 | 201 | return -EINVAL; |
65f8da47 SW |
202 | base = dasd_device_from_gendisk(bdev->bd_disk); |
203 | if (!base) | |
204 | return -ENODEV; | |
205 | if (base->features & DASD_FEATURE_READONLY || | |
206 | test_bit(DASD_FLAG_DEVICE_RO, &base->flags)) { | |
207 | dasd_put_device(base); | |
1da177e4 | 208 | return -EROFS; |
65f8da47 SW |
209 | } |
210 | if (copy_from_user(&fdata, argp, sizeof(struct format_data_t))) { | |
211 | dasd_put_device(base); | |
1da177e4 | 212 | return -EFAULT; |
65f8da47 | 213 | } |
1da177e4 | 214 | if (bdev != bdev->bd_contains) { |
ca99dab0 SH |
215 | pr_warning("%s: The specified DASD is a partition and cannot " |
216 | "be formatted\n", | |
65f8da47 SW |
217 | dev_name(&base->cdev->dev)); |
218 | dasd_put_device(base); | |
1da177e4 LT |
219 | return -EINVAL; |
220 | } | |
65f8da47 SW |
221 | rc = dasd_format(base->block, &fdata); |
222 | dasd_put_device(base); | |
223 | return rc; | |
1da177e4 LT |
224 | } |
225 | ||
226 | #ifdef CONFIG_DASD_PROFILE | |
227 | /* | |
228 | * Reset device profile information | |
229 | */ | |
8e09f215 | 230 | static int dasd_ioctl_reset_profile(struct dasd_block *block) |
1da177e4 | 231 | { |
4fa52aa7 | 232 | dasd_profile_reset(&block->profile); |
1da177e4 LT |
233 | return 0; |
234 | } | |
235 | ||
236 | /* | |
237 | * Return device profile information | |
238 | */ | |
8e09f215 | 239 | static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp) |
1da177e4 | 240 | { |
4fa52aa7 | 241 | struct dasd_profile_info_t *data; |
ba465d83 | 242 | int rc = 0; |
4fa52aa7 SW |
243 | |
244 | data = kmalloc(sizeof(*data), GFP_KERNEL); | |
245 | if (!data) | |
246 | return -ENOMEM; | |
247 | ||
248 | spin_lock_bh(&block->profile.lock); | |
249 | if (block->profile.data) { | |
250 | data->dasd_io_reqs = block->profile.data->dasd_io_reqs; | |
251 | data->dasd_io_sects = block->profile.data->dasd_io_sects; | |
252 | memcpy(data->dasd_io_secs, block->profile.data->dasd_io_secs, | |
253 | sizeof(data->dasd_io_secs)); | |
254 | memcpy(data->dasd_io_times, block->profile.data->dasd_io_times, | |
255 | sizeof(data->dasd_io_times)); | |
256 | memcpy(data->dasd_io_timps, block->profile.data->dasd_io_timps, | |
257 | sizeof(data->dasd_io_timps)); | |
258 | memcpy(data->dasd_io_time1, block->profile.data->dasd_io_time1, | |
259 | sizeof(data->dasd_io_time1)); | |
260 | memcpy(data->dasd_io_time2, block->profile.data->dasd_io_time2, | |
261 | sizeof(data->dasd_io_time2)); | |
262 | memcpy(data->dasd_io_time2ps, | |
263 | block->profile.data->dasd_io_time2ps, | |
264 | sizeof(data->dasd_io_time2ps)); | |
265 | memcpy(data->dasd_io_time3, block->profile.data->dasd_io_time3, | |
266 | sizeof(data->dasd_io_time3)); | |
267 | memcpy(data->dasd_io_nr_req, | |
268 | block->profile.data->dasd_io_nr_req, | |
269 | sizeof(data->dasd_io_nr_req)); | |
270 | spin_unlock_bh(&block->profile.lock); | |
271 | } else { | |
272 | spin_unlock_bh(&block->profile.lock); | |
ba465d83 JL |
273 | rc = -EIO; |
274 | goto out; | |
4fa52aa7 SW |
275 | } |
276 | if (copy_to_user(argp, data, sizeof(*data))) | |
ba465d83 JL |
277 | rc = -EFAULT; |
278 | out: | |
279 | kfree(data); | |
280 | return rc; | |
1da177e4 LT |
281 | } |
282 | #else | |
8e09f215 | 283 | static int dasd_ioctl_reset_profile(struct dasd_block *block) |
1da177e4 | 284 | { |
2267a0c8 | 285 | return -ENOTTY; |
1da177e4 LT |
286 | } |
287 | ||
8e09f215 | 288 | static int dasd_ioctl_read_profile(struct dasd_block *block, void __user *argp) |
1da177e4 | 289 | { |
2267a0c8 | 290 | return -ENOTTY; |
1da177e4 LT |
291 | } |
292 | #endif | |
293 | ||
294 | /* | |
295 | * Return dasd information. Used for BIODASDINFO and BIODASDINFO2. | |
296 | */ | |
8e09f215 SW |
297 | static int dasd_ioctl_information(struct dasd_block *block, |
298 | unsigned int cmd, void __user *argp) | |
1da177e4 | 299 | { |
1da177e4 | 300 | struct dasd_information2_t *dasd_info; |
287a0933 SO |
301 | struct subchannel_id sch_id; |
302 | struct ccw_dev_id dev_id; | |
8e09f215 | 303 | struct dasd_device *base; |
1da177e4 | 304 | struct ccw_device *cdev; |
287a0933 SO |
305 | unsigned long flags; |
306 | int rc; | |
1da177e4 | 307 | |
8e09f215 | 308 | base = block->base; |
294001a8 | 309 | if (!base->discipline || !base->discipline->fill_info) |
1da177e4 LT |
310 | return -EINVAL; |
311 | ||
554a826e | 312 | dasd_info = kzalloc(sizeof(struct dasd_information2_t), GFP_KERNEL); |
1da177e4 LT |
313 | if (dasd_info == NULL) |
314 | return -ENOMEM; | |
315 | ||
8e09f215 | 316 | rc = base->discipline->fill_info(base, dasd_info); |
1da177e4 LT |
317 | if (rc) { |
318 | kfree(dasd_info); | |
319 | return rc; | |
320 | } | |
321 | ||
8e09f215 | 322 | cdev = base->cdev; |
9a92fe48 | 323 | ccw_device_get_id(cdev, &dev_id); |
287a0933 | 324 | ccw_device_get_schid(cdev, &sch_id); |
1da177e4 | 325 | |
9a92fe48 | 326 | dasd_info->devno = dev_id.devno; |
287a0933 | 327 | dasd_info->schid = sch_id.sch_no; |
1da177e4 LT |
328 | dasd_info->cu_type = cdev->id.cu_type; |
329 | dasd_info->cu_model = cdev->id.cu_model; | |
330 | dasd_info->dev_type = cdev->id.dev_type; | |
331 | dasd_info->dev_model = cdev->id.dev_model; | |
8e09f215 | 332 | dasd_info->status = base->state; |
57467195 HH |
333 | /* |
334 | * The open_count is increased for every opener, that includes | |
335 | * the blkdev_get in dasd_scan_partitions. | |
336 | * This must be hidden from user-space. | |
337 | */ | |
8e09f215 SW |
338 | dasd_info->open_count = atomic_read(&block->open_count); |
339 | if (!block->bdev) | |
57467195 | 340 | dasd_info->open_count++; |
138c014d | 341 | |
1da177e4 LT |
342 | /* |
343 | * check if device is really formatted | |
344 | * LDL / CDL was returned by 'fill_info' | |
345 | */ | |
8e09f215 SW |
346 | if ((base->state < DASD_STATE_READY) || |
347 | (dasd_check_blocksize(block->bp_block))) | |
1da177e4 | 348 | dasd_info->format = DASD_FORMAT_NONE; |
f24acd45 | 349 | |
c6eb7b77 | 350 | dasd_info->features |= |
8e09f215 | 351 | ((base->features & DASD_FEATURE_READONLY) != 0); |
1da177e4 | 352 | |
294001a8 | 353 | memcpy(dasd_info->type, base->discipline->name, 4); |
554a826e | 354 | |
8e09f215 | 355 | if (block->request_queue->request_fn) { |
1da177e4 LT |
356 | struct list_head *l; |
357 | #ifdef DASD_EXTENDED_PROFILING | |
358 | { | |
359 | struct list_head *l; | |
8e09f215 SW |
360 | spin_lock_irqsave(&block->lock, flags); |
361 | list_for_each(l, &block->request_queue->queue_head) | |
1da177e4 | 362 | dasd_info->req_queue_len++; |
8e09f215 | 363 | spin_unlock_irqrestore(&block->lock, flags); |
1da177e4 LT |
364 | } |
365 | #endif /* DASD_EXTENDED_PROFILING */ | |
8e09f215 SW |
366 | spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); |
367 | list_for_each(l, &base->ccw_queue) | |
1da177e4 | 368 | dasd_info->chanq_len++; |
8e09f215 | 369 | spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), |
1da177e4 LT |
370 | flags); |
371 | } | |
372 | ||
373 | rc = 0; | |
13c6204f CH |
374 | if (copy_to_user(argp, dasd_info, |
375 | ((cmd == (unsigned int) BIODASDINFO2) ? | |
8e09f215 SW |
376 | sizeof(struct dasd_information2_t) : |
377 | sizeof(struct dasd_information_t)))) | |
1da177e4 LT |
378 | rc = -EFAULT; |
379 | kfree(dasd_info); | |
380 | return rc; | |
381 | } | |
382 | ||
383 | /* | |
384 | * Set read only | |
385 | */ | |
386 | static int | |
13c6204f | 387 | dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) |
1da177e4 | 388 | { |
65f8da47 SW |
389 | struct dasd_device *base; |
390 | int intval, rc; | |
1da177e4 LT |
391 | |
392 | if (!capable(CAP_SYS_ADMIN)) | |
393 | return -EACCES; | |
394 | if (bdev != bdev->bd_contains) | |
395 | // ro setting is not allowed for partitions | |
396 | return -EINVAL; | |
d2c993d8 | 397 | if (get_user(intval, (int __user *)argp)) |
1da177e4 | 398 | return -EFAULT; |
65f8da47 SW |
399 | base = dasd_device_from_gendisk(bdev->bd_disk); |
400 | if (!base) | |
401 | return -ENODEV; | |
402 | if (!intval && test_bit(DASD_FLAG_DEVICE_RO, &base->flags)) { | |
403 | dasd_put_device(base); | |
33b62a30 | 404 | return -EROFS; |
65f8da47 | 405 | } |
1da177e4 | 406 | set_disk_ro(bdev->bd_disk, intval); |
65f8da47 SW |
407 | rc = dasd_set_feature(base->cdev, DASD_FEATURE_READONLY, intval); |
408 | dasd_put_device(base); | |
409 | return rc; | |
1da177e4 LT |
410 | } |
411 | ||
8e09f215 | 412 | static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, |
88034865 | 413 | struct cmbdata __user *argp) |
8b2eb664 | 414 | { |
8b2eb664 CH |
415 | size_t size = _IOC_SIZE(cmd); |
416 | struct cmbdata data; | |
417 | int ret; | |
418 | ||
8e09f215 | 419 | ret = cmf_readall(block->base->cdev, &data); |
8b2eb664 CH |
420 | if (!ret && copy_to_user(argp, &data, min(size, sizeof(*argp)))) |
421 | return -EFAULT; | |
422 | return ret; | |
423 | } | |
424 | ||
cfdb00a7 AB |
425 | int dasd_ioctl(struct block_device *bdev, fmode_t mode, |
426 | unsigned int cmd, unsigned long arg) | |
1da177e4 | 427 | { |
65f8da47 SW |
428 | struct dasd_block *block; |
429 | struct dasd_device *base; | |
88034865 | 430 | void __user *argp; |
65f8da47 | 431 | int rc; |
88034865 HC |
432 | |
433 | if (is_compat_task()) | |
434 | argp = compat_ptr(arg); | |
435 | else | |
436 | argp = (void __user *)arg; | |
1da177e4 | 437 | |
13c6204f CH |
438 | if ((_IOC_DIR(cmd) != _IOC_NONE) && !arg) { |
439 | PRINT_DEBUG("empty data ptr"); | |
440 | return -EINVAL; | |
441 | } | |
1da177e4 | 442 | |
65f8da47 SW |
443 | base = dasd_device_from_gendisk(bdev->bd_disk); |
444 | if (!base) | |
445 | return -ENODEV; | |
446 | block = base->block; | |
447 | rc = 0; | |
13c6204f CH |
448 | switch (cmd) { |
449 | case BIODASDDISABLE: | |
65f8da47 SW |
450 | rc = dasd_ioctl_disable(bdev); |
451 | break; | |
13c6204f | 452 | case BIODASDENABLE: |
65f8da47 SW |
453 | rc = dasd_ioctl_enable(bdev); |
454 | break; | |
13c6204f | 455 | case BIODASDQUIESCE: |
65f8da47 SW |
456 | rc = dasd_ioctl_quiesce(block); |
457 | break; | |
13c6204f | 458 | case BIODASDRESUME: |
65f8da47 SW |
459 | rc = dasd_ioctl_resume(block); |
460 | break; | |
13c6204f | 461 | case BIODASDFMT: |
65f8da47 SW |
462 | rc = dasd_ioctl_format(bdev, argp); |
463 | break; | |
13c6204f | 464 | case BIODASDINFO: |
65f8da47 SW |
465 | rc = dasd_ioctl_information(block, cmd, argp); |
466 | break; | |
13c6204f | 467 | case BIODASDINFO2: |
65f8da47 SW |
468 | rc = dasd_ioctl_information(block, cmd, argp); |
469 | break; | |
13c6204f | 470 | case BIODASDPRRD: |
65f8da47 SW |
471 | rc = dasd_ioctl_read_profile(block, argp); |
472 | break; | |
13c6204f | 473 | case BIODASDPRRST: |
65f8da47 SW |
474 | rc = dasd_ioctl_reset_profile(block); |
475 | break; | |
13c6204f | 476 | case BLKROSET: |
65f8da47 SW |
477 | rc = dasd_ioctl_set_ro(bdev, argp); |
478 | break; | |
13c6204f | 479 | case DASDAPIVER: |
65f8da47 SW |
480 | rc = dasd_ioctl_api_version(argp); |
481 | break; | |
8b2eb664 | 482 | case BIODASDCMFENABLE: |
65f8da47 SW |
483 | rc = enable_cmf(base->cdev); |
484 | break; | |
8b2eb664 | 485 | case BIODASDCMFDISABLE: |
65f8da47 SW |
486 | rc = disable_cmf(base->cdev); |
487 | break; | |
8b2eb664 | 488 | case BIODASDREADALLCMB: |
65f8da47 SW |
489 | rc = dasd_ioctl_readall_cmb(block, cmd, argp); |
490 | break; | |
13c6204f | 491 | default: |
1107ccfb | 492 | /* if the discipline has an ioctl method try it. */ |
6b79d14e HC |
493 | rc = -ENOTTY; |
494 | if (base->discipline->ioctl) | |
65f8da47 | 495 | rc = base->discipline->ioctl(block, cmd, argp); |
13c6204f | 496 | } |
65f8da47 SW |
497 | dasd_put_device(base); |
498 | return rc; | |
1da177e4 | 499 | } |