diff options
author | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 15:36:37 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 15:36:37 +0100 |
commit | 2fc2991175bf77395e6b15fe6b2304d3bf72da40 (patch) | |
tree | b0ff38c09240e7c00e1577d447ebe89143d752dc /drivers/s390/block/dasd_ioctl.c | |
parent | [MTD] mtdchar: Return EINVAL for bad seeks instead of fixing up to valid byte (diff) | |
parent | [PATCH] nvidiafb: Geforce 7800 series support added (diff) | |
download | linux-2fc2991175bf77395e6b15fe6b2304d3bf72da40.tar.xz linux-2fc2991175bf77395e6b15fe6b2304d3bf72da40.zip |
Merge branch 'master' of /home/tglx/work/mtd/git/linux-2.6.git/
Diffstat (limited to 'drivers/s390/block/dasd_ioctl.c')
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 980c555aa538..789595b3fa09 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -7,7 +7,7 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * - * $Revision: 1.45 $ + * $Revision: 1.47 $ * * i/o controls for the dasd driver. */ @@ -296,7 +296,6 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args) { struct dasd_device *device; struct format_data_t fdata; - int feature_ro; if (!capable(CAP_SYS_ADMIN)) return -EACCES; @@ -308,10 +307,7 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args) if (device == NULL) return -ENODEV; - feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY); - if (feature_ro < 0) - return feature_ro; - if (feature_ro) + if (device->features & DASD_FEATURE_READONLY) return -EROFS; if (copy_from_user(&fdata, (void __user *) args, sizeof (struct format_data_t))) @@ -384,7 +380,7 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args) struct dasd_device *device; struct dasd_information2_t *dasd_info; unsigned long flags; - int rc, feature_ro; + int rc; struct ccw_device *cdev; device = bdev->bd_disk->private_data; @@ -394,10 +390,6 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args) if (!device->discipline->fill_info) return -EINVAL; - feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY); - if (feature_ro < 0) - return feature_ro; - dasd_info = kmalloc(sizeof(struct dasd_information2_t), GFP_KERNEL); if (dasd_info == NULL) return -ENOMEM; @@ -427,7 +419,8 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args) (dasd_check_blocksize(device->bp_block))) dasd_info->format = DASD_FORMAT_NONE; - dasd_info->features |= feature_ro; + dasd_info->features |= + ((device->features & DASD_FEATURE_READONLY) != 0); if (device->discipline) memcpy(dasd_info->type, device->discipline->name, 4); |