aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/tape_block.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2009-12-07 06:52:03 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2009-12-07 06:51:36 -0500
commit8fd138c366a8a302d9da8a428c6e927c8bff7d35 (patch)
tree23b406a120390a6631fab5ca2f35d91395971c3c /drivers/s390/char/tape_block.c
parent1b52fff059d660d4bf83d97c389dd80f1e6aad9a (diff)
[S390] tape: cleanup reference counting
Rename tape_get_device to tape_find_device and tape_get_device_reference to tape_get_device. The old names didn't make too much sense. Follow the get_device()/put_device() semantic and convert tape_put_device to a void function. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/tape_block.c')
-rw-r--r--drivers/s390/char/tape_block.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
index 0c0705b91c28..c97c6aac8ed5 100644
--- a/drivers/s390/char/tape_block.c
+++ b/drivers/s390/char/tape_block.c
@@ -239,7 +239,7 @@ tapeblock_setup_device(struct tape_device * device)
239 disk->major = tapeblock_major; 239 disk->major = tapeblock_major;
240 disk->first_minor = device->first_minor; 240 disk->first_minor = device->first_minor;
241 disk->fops = &tapeblock_fops; 241 disk->fops = &tapeblock_fops;
242 disk->private_data = tape_get_device_reference(device); 242 disk->private_data = tape_get_device(device);
243 disk->queue = blkdat->request_queue; 243 disk->queue = blkdat->request_queue;
244 set_capacity(disk, 0); 244 set_capacity(disk, 0);
245 sprintf(disk->disk_name, "btibm%d", 245 sprintf(disk->disk_name, "btibm%d",
@@ -247,11 +247,11 @@ tapeblock_setup_device(struct tape_device * device)
247 247
248 blkdat->disk = disk; 248 blkdat->disk = disk;
249 blkdat->medium_changed = 1; 249 blkdat->medium_changed = 1;
250 blkdat->request_queue->queuedata = tape_get_device_reference(device); 250 blkdat->request_queue->queuedata = tape_get_device(device);
251 251
252 add_disk(disk); 252 add_disk(disk);
253 253
254 tape_get_device_reference(device); 254 tape_get_device(device);
255 INIT_WORK(&blkdat->requeue_task, tapeblock_requeue); 255 INIT_WORK(&blkdat->requeue_task, tapeblock_requeue);
256 256
257 return 0; 257 return 0;
@@ -274,13 +274,14 @@ tapeblock_cleanup_device(struct tape_device *device)
274 } 274 }
275 275
276 del_gendisk(device->blk_data.disk); 276 del_gendisk(device->blk_data.disk);
277 device->blk_data.disk->private_data = 277 device->blk_data.disk->private_data = NULL;
278 tape_put_device(device->blk_data.disk->private_data); 278 tape_put_device(device);
279 put_disk(device->blk_data.disk); 279 put_disk(device->blk_data.disk);
280 280
281 device->blk_data.disk = NULL; 281 device->blk_data.disk = NULL;
282cleanup_queue: 282cleanup_queue:
283 device->blk_data.request_queue->queuedata = tape_put_device(device); 283 device->blk_data.request_queue->queuedata = NULL;
284 tape_put_device(device);
284 285
285 blk_cleanup_queue(device->blk_data.request_queue); 286 blk_cleanup_queue(device->blk_data.request_queue);
286 device->blk_data.request_queue = NULL; 287 device->blk_data.request_queue = NULL;
@@ -363,7 +364,7 @@ tapeblock_open(struct block_device *bdev, fmode_t mode)
363 struct tape_device * device; 364 struct tape_device * device;
364 int rc; 365 int rc;
365 366
366 device = tape_get_device_reference(disk->private_data); 367 device = tape_get_device(disk->private_data);
367 368
368 if (device->required_tapemarks) { 369 if (device->required_tapemarks) {
369 DBF_EVENT(2, "TBLOCK: missing tapemarks\n"); 370 DBF_EVENT(2, "TBLOCK: missing tapemarks\n");