]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/s390/char/tape_block.c
[S390] tape message cleanup
[karo-tx-linux.git] / drivers / s390 / char / tape_block.c
index 023803dbb0c7bd691189b10976e28874cc69403c..f32e89e7c4f2e9f3f1aa54856996c446921e8a9a 100644 (file)
@@ -10,6 +10,8 @@
  *              Stefan Bader <shbader@de.ibm.com>
  */
 
+#define KMSG_COMPONENT "tape"
+
 #include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
@@ -23,8 +25,6 @@
 
 #include "tape.h"
 
-#define PRINTK_HEADER "TAPE_BLOCK: "
-
 #define TAPEBLOCK_MAX_SEC      100
 #define TAPEBLOCK_MIN_REQUEUE  3
 
@@ -76,7 +76,7 @@ tapeblock_trigger_requeue(struct tape_device *device)
 static void
 tapeblock_end_request(struct request *req, int error)
 {
-       if (__blk_end_request(req, error, blk_rq_bytes(req)))
+       if (blk_end_request(req, error, blk_rq_bytes(req)))
                BUG();
 }
 
@@ -166,7 +166,7 @@ tapeblock_requeue(struct work_struct *work) {
                nr_queued++;
        spin_unlock(get_ccwdev_lock(device->cdev));
 
-       spin_lock(&device->blk_data.request_queue_lock);
+       spin_lock_irq(&device->blk_data.request_queue_lock);
        while (
                !blk_queue_plugged(queue) &&
                elv_next_request(queue)   &&
@@ -176,7 +176,9 @@ tapeblock_requeue(struct work_struct *work) {
                if (rq_data_dir(req) == WRITE) {
                        DBF_EVENT(1, "TBLOCK: Rejecting write request\n");
                        blkdev_dequeue_request(req);
+                       spin_unlock_irq(&device->blk_data.request_queue_lock);
                        tapeblock_end_request(req, -EIO);
+                       spin_lock_irq(&device->blk_data.request_queue_lock);
                        continue;
                }
                blkdev_dequeue_request(req);
@@ -277,8 +279,6 @@ tapeblock_cleanup_device(struct tape_device *device)
        tape_put_device(device);
 
        if (!device->blk_data.disk) {
-               PRINT_ERR("(%s): No gendisk to clean up!\n",
-                       dev_name(&device->cdev->dev));
                goto cleanup_queue;
        }
 
@@ -312,7 +312,8 @@ tapeblock_revalidate_disk(struct gendisk *disk)
        if (!device->blk_data.medium_changed)
                return 0;
 
-       PRINT_INFO("Detecting media size...\n");
+       dev_info(&device->cdev->dev, "Determining the size of the recorded "
+               "area...\n");
        rc = tape_mtop(device, MTFSFM, 1);
        if (rc)
                return rc;
@@ -339,7 +340,8 @@ tapeblock_revalidate_disk(struct gendisk *disk)
        device->bof = rc;
        nr_of_blks -= rc;
 
-       PRINT_INFO("Found %i blocks on media\n", nr_of_blks);
+       dev_info(&device->cdev->dev, "The size of the recorded area is %i "
+               "blocks\n", nr_of_blks);
        set_capacity(device->blk_data.disk,
                nr_of_blks*(TAPEBLOCK_HSEC_SIZE/512));
 
@@ -374,8 +376,8 @@ tapeblock_open(struct block_device *bdev, fmode_t mode)
 
        if (device->required_tapemarks) {
                DBF_EVENT(2, "TBLOCK: missing tapemarks\n");
-               PRINT_ERR("TBLOCK: Refusing to open tape with missing"
-                       " end of file marks.\n");
+               dev_warn(&device->cdev->dev, "Opening the tape failed because"
+                       " of missing end-of-file marks\n");
                rc = -EPERM;
                goto put_device;
        }
@@ -450,7 +452,6 @@ tapeblock_ioctl(
                        rc = -EINVAL;
                        break;
                default:
-                       PRINT_WARN("invalid ioctl 0x%x\n", command);
                        rc = -EINVAL;
        }
 
@@ -472,7 +473,6 @@ tapeblock_init(void)
 
        if (tapeblock_major == 0)
                tapeblock_major = rc;
-       PRINT_INFO("tape gets major %d for block device\n", tapeblock_major);
        return 0;
 }