diff options
author | Christoph Hellwig <hch@lst.de> | 2006-03-24 03:15:21 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 07:33:17 -0800 |
commit | 8b2eb664ce9dcba8b54ececf5e057470c47e57f7 (patch) | |
tree | dab47df832f199b0a1e9e20226b152feb522640a /drivers/s390/block/dasd_ioctl.c | |
parent | 1107ccfbdef280fedc677af3bdbc405611ba554a (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.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index bb6caf46bbd..c8319bef273 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -16,6 +16,7 @@ #include <linux/blkpg.h> #include <asm/ccwdev.h> +#include <asm/cmb.h> #include <asm/uaccess.h> /* This is ugly... */ @@ -406,6 +407,21 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) return dasd_set_feature(device->cdev, DASD_FEATURE_READONLY, intval); } +static int +dasd_ioctl_readall_cmb(struct dasd_device *device, unsigned int cmd, + unsigned long arg) +{ + struct cmbdata __user *argp = (void __user *) arg; + size_t size = _IOC_SIZE(cmd); + struct cmbdata data; + int ret; + + ret = cmf_readall(device->cdev, &data); + if (!ret && copy_to_user(argp, &data, min(size, sizeof(*argp)))) + return -EFAULT; + return ret; +} + int dasd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) @@ -447,6 +463,12 @@ dasd_ioctl(struct inode *inode, struct file *file, return dasd_ioctl_set_ro(bdev, argp); case DASDAPIVER: return dasd_ioctl_api_version(argp); + case BIODASDCMFENABLE: + return enable_cmf(device->cdev); + case BIODASDCMFDISABLE: + return disable_cmf(device->cdev); + case BIODASDREADALLCMB: + return dasd_ioctl_readall_cmb(device, cmd, arg); default: /* if the discipline has an ioctl method try it. */ if (device->discipline->ioctl) { |