aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block')
-rw-r--r--drivers/s390/block/dcssblk.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 413460cc3dd8..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
34static int dcssblk_open(struct inode *inode, struct file *filp); 34static int dcssblk_open(struct block_device *bdev, fmode_t mode);
35static int dcssblk_release(struct inode *inode, struct file *filp); 35static int dcssblk_release(struct gendisk *disk, fmode_t mode);
36static int dcssblk_make_request(struct request_queue *q, struct bio *bio); 36static int dcssblk_make_request(struct request_queue *q, struct bio *bio);
37static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, 37static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum,
38 void **kaddr, unsigned long *pfn); 38 void **kaddr, unsigned long *pfn);
@@ -42,8 +42,8 @@ static char dcssblk_segments[DCSSBLK_PARM_LEN] = "\0";
42static int dcssblk_major; 42static int dcssblk_major;
43static struct block_device_operations dcssblk_devops = { 43static struct block_device_operations dcssblk_devops = {
44 .owner = THIS_MODULE, 44 .owner = THIS_MODULE,
45 .__open = dcssblk_open, 45 .open = dcssblk_open,
46 .__release = dcssblk_release, 46 .release = dcssblk_release,
47 .direct_access = dcssblk_direct_access, 47 .direct_access = dcssblk_direct_access,
48}; 48};
49 49
@@ -776,32 +776,31 @@ out_buf:
776} 776}
777 777
778static int 778static int
779dcssblk_open(struct inode *inode, struct file *filp) 779dcssblk_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;
792out: 792out:
793 return rc; 793 return rc;
794} 794}
795 795
796static int 796static int
797dcssblk_release(struct inode *inode, struct file *filp) 797dcssblk_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 }