diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd.c | 11 | ||||
-rw-r--r-- | drivers/s390/block/dasd_genhd.c | 4 | ||||
-rw-r--r-- | drivers/s390/block/dasd_int.h | 3 | ||||
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 15 | ||||
-rw-r--r-- | drivers/s390/block/dcssblk.c | 17 | ||||
-rw-r--r-- | drivers/s390/char/tape_block.c | 25 |
6 files changed, 27 insertions, 48 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 0a225ccda026..4b76fca64a6f 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -2011,10 +2011,9 @@ static void dasd_flush_request_queue(struct dasd_block *block) | |||
2011 | spin_unlock_irq(&block->request_queue_lock); | 2011 | spin_unlock_irq(&block->request_queue_lock); |
2012 | } | 2012 | } |
2013 | 2013 | ||
2014 | static int dasd_open(struct inode *inp, struct file *filp) | 2014 | static int dasd_open(struct block_device *bdev, fmode_t mode) |
2015 | { | 2015 | { |
2016 | struct gendisk *disk = inp->i_bdev->bd_disk; | 2016 | struct dasd_block *block = bdev->bd_disk->private_data; |
2017 | struct dasd_block *block = disk->private_data; | ||
2018 | struct dasd_device *base = block->base; | 2017 | struct dasd_device *base = block->base; |
2019 | int rc; | 2018 | int rc; |
2020 | 2019 | ||
@@ -2052,9 +2051,8 @@ unlock: | |||
2052 | return rc; | 2051 | return rc; |
2053 | } | 2052 | } |
2054 | 2053 | ||
2055 | static int dasd_release(struct inode *inp, struct file *filp) | 2054 | static int dasd_release(struct gendisk *disk, fmode_t mode) |
2056 | { | 2055 | { |
2057 | struct gendisk *disk = inp->i_bdev->bd_disk; | ||
2058 | struct dasd_block *block = disk->private_data; | 2056 | struct dasd_block *block = disk->private_data; |
2059 | 2057 | ||
2060 | atomic_dec(&block->open_count); | 2058 | atomic_dec(&block->open_count); |
@@ -2089,8 +2087,7 @@ dasd_device_operations = { | |||
2089 | .owner = THIS_MODULE, | 2087 | .owner = THIS_MODULE, |
2090 | .open = dasd_open, | 2088 | .open = dasd_open, |
2091 | .release = dasd_release, | 2089 | .release = dasd_release, |
2092 | .ioctl = dasd_ioctl, | 2090 | .locked_ioctl = dasd_ioctl, |
2093 | .compat_ioctl = dasd_compat_ioctl, | ||
2094 | .getgeo = dasd_getgeo, | 2091 | .getgeo = dasd_getgeo, |
2095 | }; | 2092 | }; |
2096 | 2093 | ||
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index aee6565aaf98..e99d566b69cc 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c | |||
@@ -99,7 +99,7 @@ int dasd_scan_partitions(struct dasd_block *block) | |||
99 | struct block_device *bdev; | 99 | struct block_device *bdev; |
100 | 100 | ||
101 | bdev = bdget_disk(block->gdp, 0); | 101 | bdev = bdget_disk(block->gdp, 0); |
102 | if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0) | 102 | if (!bdev || blkdev_get(bdev, FMODE_READ) < 0) |
103 | return -ENODEV; | 103 | return -ENODEV; |
104 | /* | 104 | /* |
105 | * See fs/partition/check.c:register_disk,rescan_partitions | 105 | * See fs/partition/check.c:register_disk,rescan_partitions |
@@ -152,7 +152,7 @@ void dasd_destroy_partitions(struct dasd_block *block) | |||
152 | 152 | ||
153 | invalidate_partition(block->gdp, 0); | 153 | invalidate_partition(block->gdp, 0); |
154 | /* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */ | 154 | /* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */ |
155 | blkdev_put(bdev); | 155 | blkdev_put(bdev, FMODE_READ); |
156 | set_capacity(block->gdp, 0); | 156 | set_capacity(block->gdp, 0); |
157 | } | 157 | } |
158 | 158 | ||
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index 489d5fe488fb..05a14536c369 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h | |||
@@ -610,8 +610,7 @@ int dasd_scan_partitions(struct dasd_block *); | |||
610 | void dasd_destroy_partitions(struct dasd_block *); | 610 | void dasd_destroy_partitions(struct dasd_block *); |
611 | 611 | ||
612 | /* externals in dasd_ioctl.c */ | 612 | /* externals in dasd_ioctl.c */ |
613 | int dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 613 | int dasd_ioctl(struct block_device *, fmode_t, unsigned int, unsigned long); |
614 | long dasd_compat_ioctl(struct file *, unsigned int, unsigned long); | ||
615 | 614 | ||
616 | /* externals in dasd_proc.c */ | 615 | /* externals in dasd_proc.c */ |
617 | int dasd_proc_init(void); | 616 | int dasd_proc_init(void); |
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 91a64630cb0f..b82d816d9ef7 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
@@ -366,10 +366,9 @@ static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, | |||
366 | } | 366 | } |
367 | 367 | ||
368 | int | 368 | int |
369 | dasd_ioctl(struct inode *inode, struct file *file, | 369 | dasd_ioctl(struct block_device *bdev, fmode_t mode, |
370 | unsigned int cmd, unsigned long arg) | 370 | unsigned int cmd, unsigned long arg) |
371 | { | 371 | { |
372 | struct block_device *bdev = inode->i_bdev; | ||
373 | struct dasd_block *block = bdev->bd_disk->private_data; | 372 | struct dasd_block *block = bdev->bd_disk->private_data; |
374 | void __user *argp = (void __user *)arg; | 373 | void __user *argp = (void __user *)arg; |
375 | 374 | ||
@@ -421,15 +420,3 @@ dasd_ioctl(struct inode *inode, struct file *file, | |||
421 | return -EINVAL; | 420 | return -EINVAL; |
422 | } | 421 | } |
423 | } | 422 | } |
424 | |||
425 | long | ||
426 | dasd_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
427 | { | ||
428 | int rval; | ||
429 | |||
430 | lock_kernel(); | ||
431 | rval = dasd_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg); | ||
432 | unlock_kernel(); | ||
433 | |||
434 | return (rval == -EINVAL) ? -ENOIOCTLCMD : rval; | ||
435 | } | ||
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index a7ff167d5b81..63f26a135fe5 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c | |||
@@ -31,8 +31,8 @@ | |||
31 | #define PRINT_WARN(x...) printk(KERN_WARNING DCSSBLK_NAME " warning: " x) | 31 | #define PRINT_WARN(x...) printk(KERN_WARNING DCSSBLK_NAME " warning: " x) |
32 | #define PRINT_ERR(x...) printk(KERN_ERR DCSSBLK_NAME " error: " x) | 32 | #define PRINT_ERR(x...) printk(KERN_ERR DCSSBLK_NAME " error: " x) |
33 | 33 | ||
34 | static int dcssblk_open(struct inode *inode, struct file *filp); | 34 | static int dcssblk_open(struct block_device *bdev, fmode_t mode); |
35 | static int dcssblk_release(struct inode *inode, struct file *filp); | 35 | static int dcssblk_release(struct gendisk *disk, fmode_t mode); |
36 | static int dcssblk_make_request(struct request_queue *q, struct bio *bio); | 36 | static int dcssblk_make_request(struct request_queue *q, struct bio *bio); |
37 | static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, | 37 | static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, |
38 | void **kaddr, unsigned long *pfn); | 38 | void **kaddr, unsigned long *pfn); |
@@ -776,32 +776,31 @@ out_buf: | |||
776 | } | 776 | } |
777 | 777 | ||
778 | static int | 778 | static int |
779 | dcssblk_open(struct inode *inode, struct file *filp) | 779 | dcssblk_open(struct block_device *bdev, fmode_t mode) |
780 | { | 780 | { |
781 | struct dcssblk_dev_info *dev_info; | 781 | struct dcssblk_dev_info *dev_info; |
782 | int rc; | 782 | int rc; |
783 | 783 | ||
784 | dev_info = inode->i_bdev->bd_disk->private_data; | 784 | dev_info = bdev->bd_disk->private_data; |
785 | if (NULL == dev_info) { | 785 | if (NULL == dev_info) { |
786 | rc = -ENODEV; | 786 | rc = -ENODEV; |
787 | goto out; | 787 | goto out; |
788 | } | 788 | } |
789 | atomic_inc(&dev_info->use_count); | 789 | atomic_inc(&dev_info->use_count); |
790 | inode->i_bdev->bd_block_size = 4096; | 790 | bdev->bd_block_size = 4096; |
791 | rc = 0; | 791 | rc = 0; |
792 | out: | 792 | out: |
793 | return rc; | 793 | return rc; |
794 | } | 794 | } |
795 | 795 | ||
796 | static int | 796 | static int |
797 | dcssblk_release(struct inode *inode, struct file *filp) | 797 | dcssblk_release(struct gendisk *disk, fmode_t mode) |
798 | { | 798 | { |
799 | struct dcssblk_dev_info *dev_info; | 799 | struct dcssblk_dev_info *dev_info = disk->private_data; |
800 | struct segment_info *entry; | 800 | struct segment_info *entry; |
801 | int rc; | 801 | int rc; |
802 | 802 | ||
803 | dev_info = inode->i_bdev->bd_disk->private_data; | 803 | if (!dev_info) { |
804 | if (NULL == dev_info) { | ||
805 | rc = -ENODEV; | 804 | rc = -ENODEV; |
806 | goto out; | 805 | goto out; |
807 | } | 806 | } |
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index a25b8bf54f41..023803dbb0c7 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -43,9 +43,9 @@ | |||
43 | /* | 43 | /* |
44 | * file operation structure for tape block frontend | 44 | * file operation structure for tape block frontend |
45 | */ | 45 | */ |
46 | static int tapeblock_open(struct inode *, struct file *); | 46 | static int tapeblock_open(struct block_device *, fmode_t); |
47 | static int tapeblock_release(struct inode *, struct file *); | 47 | static int tapeblock_release(struct gendisk *, fmode_t); |
48 | static int tapeblock_ioctl(struct inode *, struct file *, unsigned int, | 48 | static int tapeblock_ioctl(struct block_device *, fmode_t, unsigned int, |
49 | unsigned long); | 49 | unsigned long); |
50 | static int tapeblock_medium_changed(struct gendisk *); | 50 | static int tapeblock_medium_changed(struct gendisk *); |
51 | static int tapeblock_revalidate_disk(struct gendisk *); | 51 | static int tapeblock_revalidate_disk(struct gendisk *); |
@@ -54,7 +54,7 @@ static struct block_device_operations tapeblock_fops = { | |||
54 | .owner = THIS_MODULE, | 54 | .owner = THIS_MODULE, |
55 | .open = tapeblock_open, | 55 | .open = tapeblock_open, |
56 | .release = tapeblock_release, | 56 | .release = tapeblock_release, |
57 | .ioctl = tapeblock_ioctl, | 57 | .locked_ioctl = tapeblock_ioctl, |
58 | .media_changed = tapeblock_medium_changed, | 58 | .media_changed = tapeblock_medium_changed, |
59 | .revalidate_disk = tapeblock_revalidate_disk, | 59 | .revalidate_disk = tapeblock_revalidate_disk, |
60 | }; | 60 | }; |
@@ -364,13 +364,12 @@ tapeblock_medium_changed(struct gendisk *disk) | |||
364 | * Block frontend tape device open function. | 364 | * Block frontend tape device open function. |
365 | */ | 365 | */ |
366 | static int | 366 | static int |
367 | tapeblock_open(struct inode *inode, struct file *filp) | 367 | tapeblock_open(struct block_device *bdev, fmode_t mode) |
368 | { | 368 | { |
369 | struct gendisk * disk; | 369 | struct gendisk * disk = bdev->bd_disk; |
370 | struct tape_device * device; | 370 | struct tape_device * device; |
371 | int rc; | 371 | int rc; |
372 | 372 | ||
373 | disk = inode->i_bdev->bd_disk; | ||
374 | device = tape_get_device_reference(disk->private_data); | 373 | device = tape_get_device_reference(disk->private_data); |
375 | 374 | ||
376 | if (device->required_tapemarks) { | 375 | if (device->required_tapemarks) { |
@@ -410,9 +409,8 @@ release: | |||
410 | * we just get the pointer here and release the reference. | 409 | * we just get the pointer here and release the reference. |
411 | */ | 410 | */ |
412 | static int | 411 | static int |
413 | tapeblock_release(struct inode *inode, struct file *filp) | 412 | tapeblock_release(struct gendisk *disk, fmode_t mode) |
414 | { | 413 | { |
415 | struct gendisk *disk = inode->i_bdev->bd_disk; | ||
416 | struct tape_device *device = disk->private_data; | 414 | struct tape_device *device = disk->private_data; |
417 | 415 | ||
418 | tape_state_set(device, TS_IN_USE); | 416 | tape_state_set(device, TS_IN_USE); |
@@ -427,22 +425,21 @@ tapeblock_release(struct inode *inode, struct file *filp) | |||
427 | */ | 425 | */ |
428 | static int | 426 | static int |
429 | tapeblock_ioctl( | 427 | tapeblock_ioctl( |
430 | struct inode * inode, | 428 | struct block_device * bdev, |
431 | struct file * file, | 429 | fmode_t mode, |
432 | unsigned int command, | 430 | unsigned int command, |
433 | unsigned long arg | 431 | unsigned long arg |
434 | ) { | 432 | ) { |
435 | int rc; | 433 | int rc; |
436 | int minor; | 434 | int minor; |
437 | struct gendisk *disk; | 435 | struct gendisk *disk = bdev->bd_disk; |
438 | struct tape_device *device; | 436 | struct tape_device *device; |
439 | 437 | ||
440 | rc = 0; | 438 | rc = 0; |
441 | disk = inode->i_bdev->bd_disk; | ||
442 | BUG_ON(!disk); | 439 | BUG_ON(!disk); |
443 | device = disk->private_data; | 440 | device = disk->private_data; |
444 | BUG_ON(!device); | 441 | BUG_ON(!device); |
445 | minor = iminor(inode); | 442 | minor = MINOR(bdev->bd_dev); |
446 | 443 | ||
447 | DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command); | 444 | DBF_LH(6, "tapeblock_ioctl(0x%0x)\n", command); |
448 | DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor); | 445 | DBF_LH(6, "device = %d:%d\n", tapeblock_major, minor); |