diff options
author | Tejun Heo <tj@kernel.org> | 2011-03-09 13:54:28 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-03-09 13:54:28 -0500 |
commit | ffe80cea354519d846767b8165598c2903706c2a (patch) | |
tree | 2168adbcba027c96a1e0dfc3b4d7cb105ef2c03d /drivers/s390 | |
parent | f47350fdecb7ce9fe715e2df4431c4b51c4ef46b (diff) |
s390/tape_block: Convert to bdops->check_events()
Convert from ->media_changed() to ->check_events().
s390/tape_block buffers media changed state and clears it on
revalidation. It will behave correctly with kernel event polling.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/char/tape_block.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 55d2d0f4eabc..ad8431636012 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -48,14 +48,14 @@ | |||
48 | static DEFINE_MUTEX(tape_block_mutex); | 48 | static DEFINE_MUTEX(tape_block_mutex); |
49 | static int tapeblock_open(struct block_device *, fmode_t); | 49 | static int tapeblock_open(struct block_device *, fmode_t); |
50 | static int tapeblock_release(struct gendisk *, fmode_t); | 50 | static int tapeblock_release(struct gendisk *, fmode_t); |
51 | static int tapeblock_medium_changed(struct gendisk *); | 51 | static unsigned int tapeblock_check_events(struct gendisk *, unsigned int); |
52 | static int tapeblock_revalidate_disk(struct gendisk *); | 52 | static int tapeblock_revalidate_disk(struct gendisk *); |
53 | 53 | ||
54 | static const struct block_device_operations tapeblock_fops = { | 54 | static const struct block_device_operations tapeblock_fops = { |
55 | .owner = THIS_MODULE, | 55 | .owner = THIS_MODULE, |
56 | .open = tapeblock_open, | 56 | .open = tapeblock_open, |
57 | .release = tapeblock_release, | 57 | .release = tapeblock_release, |
58 | .media_changed = tapeblock_medium_changed, | 58 | .check_events = tapeblock_check_events, |
59 | .revalidate_disk = tapeblock_revalidate_disk, | 59 | .revalidate_disk = tapeblock_revalidate_disk, |
60 | }; | 60 | }; |
61 | 61 | ||
@@ -237,6 +237,7 @@ tapeblock_setup_device(struct tape_device * device) | |||
237 | disk->major = tapeblock_major; | 237 | disk->major = tapeblock_major; |
238 | disk->first_minor = device->first_minor; | 238 | disk->first_minor = device->first_minor; |
239 | disk->fops = &tapeblock_fops; | 239 | disk->fops = &tapeblock_fops; |
240 | disk->events = DISK_EVENT_MEDIA_CHANGE; | ||
240 | disk->private_data = tape_get_device(device); | 241 | disk->private_data = tape_get_device(device); |
241 | disk->queue = blkdat->request_queue; | 242 | disk->queue = blkdat->request_queue; |
242 | set_capacity(disk, 0); | 243 | set_capacity(disk, 0); |
@@ -340,8 +341,8 @@ tapeblock_revalidate_disk(struct gendisk *disk) | |||
340 | return 0; | 341 | return 0; |
341 | } | 342 | } |
342 | 343 | ||
343 | static int | 344 | static unsigned int |
344 | tapeblock_medium_changed(struct gendisk *disk) | 345 | tapeblock_check_events(struct gendisk *disk, unsigned int clearing) |
345 | { | 346 | { |
346 | struct tape_device *device; | 347 | struct tape_device *device; |
347 | 348 | ||
@@ -349,7 +350,7 @@ tapeblock_medium_changed(struct gendisk *disk) | |||
349 | DBF_LH(6, "tapeblock_medium_changed(%p) = %d\n", | 350 | DBF_LH(6, "tapeblock_medium_changed(%p) = %d\n", |
350 | device, device->blk_data.medium_changed); | 351 | device, device->blk_data.medium_changed); |
351 | 352 | ||
352 | return device->blk_data.medium_changed; | 353 | return device->blk_data.medium_changed ? DISK_EVENT_MEDIA_CHANGE : 0; |
353 | } | 354 | } |
354 | 355 | ||
355 | /* | 356 | /* |