aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_ioctl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-03-24 06:15:21 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:17 -0500
commit8b2eb664ce9dcba8b54ececf5e057470c47e57f7 (patch)
treedab47df832f199b0a1e9e20226b152feb522640a /drivers/s390/block/dasd_ioctl.c
parent1107ccfbdef280fedc677af3bdbc405611ba554a (diff)
[PATCH] s390: merge cmb into dasdc
dasd_cmd just implements three ioctls which are wrappers around functionality in the core kernel or other modules. When merging those into dasd_mod they just add 22 lines of code which is far less than the amount of code removed in the last two patches, and which doesn't spill into another 4k pages when build modular, while removing a 128lines module. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/block/dasd_ioctl.c')
-rw-r--r--drivers/s390/block/dasd_ioctl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index bb6caf46bbd9..c8319bef2730 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -16,6 +16,7 @@
16#include <linux/blkpg.h> 16#include <linux/blkpg.h>
17 17
18#include <asm/ccwdev.h> 18#include <asm/ccwdev.h>
19#include <asm/cmb.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
20 21
21/* This is ugly... */ 22/* This is ugly... */
@@ -406,6 +407,21 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp)
406 return dasd_set_feature(device->cdev, DASD_FEATURE_READONLY, intval); 407 return dasd_set_feature(device->cdev, DASD_FEATURE_READONLY, intval);
407} 408}
408 409
410static int
411dasd_ioctl_readall_cmb(struct dasd_device *device, unsigned int cmd,
412 unsigned long arg)
413{
414 struct cmbdata __user *argp = (void __user *) arg;
415 size_t size = _IOC_SIZE(cmd);
416 struct cmbdata data;
417 int ret;
418
419 ret = cmf_readall(device->cdev, &data);
420 if (!ret && copy_to_user(argp, &data, min(size, sizeof(*argp))))
421 return -EFAULT;
422 return ret;
423}
424
409int 425int
410dasd_ioctl(struct inode *inode, struct file *file, 426dasd_ioctl(struct inode *inode, struct file *file,
411 unsigned int cmd, unsigned long arg) 427 unsigned int cmd, unsigned long arg)
@@ -447,6 +463,12 @@ dasd_ioctl(struct inode *inode, struct file *file,
447 return dasd_ioctl_set_ro(bdev, argp); 463 return dasd_ioctl_set_ro(bdev, argp);
448 case DASDAPIVER: 464 case DASDAPIVER:
449 return dasd_ioctl_api_version(argp); 465 return dasd_ioctl_api_version(argp);
466 case BIODASDCMFENABLE:
467 return enable_cmf(device->cdev);
468 case BIODASDCMFDISABLE:
469 return disable_cmf(device->cdev);
470 case BIODASDREADALLCMB:
471 return dasd_ioctl_readall_cmb(device, cmd, arg);
450 default: 472 default:
451 /* if the discipline has an ioctl method try it. */ 473 /* if the discipline has an ioctl method try it. */
452 if (device->discipline->ioctl) { 474 if (device->discipline->ioctl) {