diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-03-02 10:39:59 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-21 07:48:44 -0400 |
commit | 4e999af9b25d30461ae54debce92803f1b064383 (patch) | |
tree | 348be8b2536d53745db0dc4d21381cf687c59cc6 /drivers/s390/char/tape_block.c | |
parent | 46d74326e660b2878005d222fb3efbc4eaa1ea4a (diff) |
[PATCH] switch tape_block
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/s390/char/tape_block.c')
-rw-r--r-- | drivers/s390/char/tape_block.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index f1a741c9a6f0..023803dbb0c7 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -43,18 +43,18 @@ | |||
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 *); |
52 | 52 | ||
53 | static struct block_device_operations tapeblock_fops = { | 53 | 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); |