Skip to contentSkip to conversation

dasd: merge dasd_cmd into dasd_mod

PATCH In review Christoph Hellwig 1 participant 1 message Feb 12, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/5 dasd: merge dasd_cmd into dasd_mod

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.

 Kconfig      |   10 ----
 Makefile     |    1 
 dasd_cmb.c   |  128 -----------------------------------------------------------
 dasd_ioctl.c |   22 ++++++++++
 4 files changed, 22 insertions(+), 139 deletions(-)
drivers/s390/block/Kconfig +0 -10
Index: linux-2.6.16-rc2-mm1/drivers/s390/block/Kconfig
===================================================================
@@ -63,14 +63,4 @@
           DASD extended error reporting. This is only needed if you want to
           use applications written for the EER facility.
 
-config DASD_CMB
-	tristate "Compatibility interface for DASD channel measurement blocks"
-	depends on DASD
-	help
-	  This driver provides an additional interface to the channel
-          measurement facility, which is normally accessed though sysfs, with
-          a set of ioctl functions specific to the dasd driver.
-	  This is only needed if you want to use applications written for
-	  linux-2.4 dasd channel measurement facility interface.
-
 endif
drivers/s390/block/Makefile +0 -1
Index: linux-2.6.16-rc2-mm1/drivers/s390/block/Makefile
===================================================================
@@ -13,7 +13,6 @@
 obj-$(CONFIG_DASD_DIAG) += dasd_diag_mod.o
 obj-$(CONFIG_DASD_ECKD) += dasd_eckd_mod.o
 obj-$(CONFIG_DASD_FBA)  += dasd_fba_mod.o
-obj-$(CONFIG_DASD_CMB)  += dasd_cmb.o
 obj-$(CONFIG_DASD_EER)  += dasd_eer.o
 obj-$(CONFIG_BLK_DEV_XPRAM) += xpram.o
 obj-$(CONFIG_DCSSBLK) += dcssblk.o
drivers/s390/block/dasd_cmb.c deleted +0 -128

128 lines not on this page · raw message

drivers/s390/block/dasd_ioctl.c +22 -0
Index: linux-2.6.16-rc2-mm1/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 @@
 	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 @@
 		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) {