]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/block/xen-blkback/blkback.c
xen/blkback: Change printk/DPRINTK to pr_.. type variant.
[karo-tx-linux.git] / drivers / block / xen-blkback / blkback.c
index 6808cc7d9c736833f4b3bb60b7977236c0bc22ce..5c9568e39eab398bd70db19463a8b94975833c19 100644 (file)
@@ -196,20 +196,20 @@ static void vbd_resize(struct blkif_st *blkif)
        struct xenbus_device *dev = xen_blkbk_xenbus(blkif->be);
        unsigned long long new_size = vbd_sz(vbd);
 
-       printk(KERN_INFO "VBD Resize: Domid: %d, Device: (%d, %d)\n",
+       pr_info("xen-blkback: VBD Resize: Domid: %d, Device: (%d, %d)\n",
                blkif->domid, MAJOR(vbd->pdevice), MINOR(vbd->pdevice));
-       printk(KERN_INFO "VBD Resize: new size %llu\n", new_size);
+       pr_info("xen-blkback: VBD Resize: new size %llu\n", new_size);
        vbd->size = new_size;
 again:
        err = xenbus_transaction_start(&xbt);
        if (err) {
-               printk(KERN_WARNING "Error starting transaction");
+               pr_warn("xen-blkback: Error starting transaction");
                return;
        }
        err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu",
                            (unsigned long long)vbd_sz(vbd));
        if (err) {
-               printk(KERN_WARNING "Error writing new size");
+               pr_warn("xen-blkback: Error writing new size");
                goto abort;
        }
        /*
@@ -219,7 +219,7 @@ again:
         */
        err = xenbus_printf(xbt, dev->nodename, "state", "%d", dev->state);
        if (err) {
-               printk(KERN_WARNING "Error writing the state");
+               pr_warn("xen-blkback: Error writing the state");
                goto abort;
        }
 
@@ -227,7 +227,7 @@ again:
        if (err == -EAGAIN)
                goto again;
        if (err)
-               printk(KERN_WARNING "Error ending transaction");
+               pr_warn("xen-blkback: Error ending transaction");
 abort:
        xenbus_transaction_end(xbt, 1);
 }
@@ -253,9 +253,9 @@ irqreturn_t xen_blkif_be_int(int irq, void *dev_id)
 
 static void print_stats(struct blkif_st *blkif)
 {
-       printk(KERN_DEBUG "%s: oo %3d  |  rd %4d  |  wr %4d  |  f %4d\n",
-              current->comm, blkif->st_oo_req,
-              blkif->st_rd_req, blkif->st_wr_req, blkif->st_f_req);
+       pr_debug("xen-blkback (%s): oo %3d  |  rd %4d  |  wr %4d  |  f %4d\n",
+                current->comm, blkif->st_oo_req,
+                blkif->st_rd_req, blkif->st_wr_req, blkif->st_f_req);
        blkif->st_print = jiffies + msecs_to_jiffies(10 * 1000);
        blkif->st_rd_req = 0;
        blkif->st_wr_req = 0;
@@ -270,7 +270,7 @@ int xen_blkif_schedule(void *arg)
        xen_blkif_get(blkif);
 
        if (debug_lvl)
-               printk(KERN_DEBUG "%s: started\n", current->comm);
+               pr_debug("xen-blkback: %s: started\n", current->comm);
 
        while (!kthread_should_stop()) {
                if (try_to_freeze())
@@ -299,7 +299,7 @@ int xen_blkif_schedule(void *arg)
        if (log_stats)
                print_stats(blkif);
        if (debug_lvl)
-               printk(KERN_DEBUG "%s: exiting\n", current->comm);
+               pr_debug("xen-blkback: %s: exiting\n", current->comm);
 
        blkif->xenblkd = NULL;
        xen_blkif_put(blkif);
@@ -343,8 +343,8 @@ static void xen_blkbk_unmap(struct pending_req *req)
                ret = m2p_remove_override(
                        virt_to_page(unmap[i].host_addr), false);
                if (ret) {
-                       printk(KERN_ALERT "Failed to remove M2P override for %lx\n",
-                              (unsigned long)unmap[i].host_addr);
+                       pr_alert("xen-blkback: Failed to remove M2P override for %lx\n",
+                                (unsigned long)unmap[i].host_addr);
                        continue;
                }
        }
@@ -385,7 +385,7 @@ static int xen_blkbk_map(struct blkif_request *req,
         */
        for (i = 0; i < nseg; i++) {
                if (unlikely(map[i].status != 0)) {
-                       DPRINTK("invalid buffer -- could not remap it\n");
+                       pr_debug("xen-blkback: invalid buffer -- could not remap it\n");
                        map[i].handle = BLKBACK_INVALID_HANDLE;
                        ret |= 1;
                }
@@ -398,9 +398,8 @@ static int xen_blkbk_map(struct blkif_request *req,
                ret = m2p_add_override(PFN_DOWN(map[i].dev_bus_addr),
                        blkbk->pending_page(pending_req, i), false);
                if (ret) {
-                       printk(KERN_ALERT "Failed to install M2P override for"\
-                               " %lx (ret: %d)\n", (unsigned long)
-                               map[i].dev_bus_addr, ret);
+                       pr_alert("xen-blkback: Failed to install M2P override for %lx (ret: %d)\n",
+                                (unsigned long)map[i].dev_bus_addr, ret);
                        /* We could switch over to GNTTABOP_copy */
                        continue;
                }
@@ -420,12 +419,12 @@ static void __end_block_io_op(struct pending_req *pending_req, int error)
        /* An error fails the entire request. */
        if ((pending_req->operation == BLKIF_OP_FLUSH_DISKCACHE) &&
            (error == -EOPNOTSUPP)) {
-               DPRINTK("blkback: flush diskcache op failed, not supported\n");
+               pr_debug("xen-blkback: flush diskcache op failed, not supported\n");
                xen_blkbk_flush_diskcache(XBT_NIL, pending_req->blkif->be, 0);
                pending_req->status = BLKIF_RSP_EOPNOTSUPP;
        } else if (error) {
-               DPRINTK("Buffer not up-to-date at end of operation, "
-                       "error=%d\n", error);
+               pr_debug("xen-blkback: Buffer not up-to-date at end of operation,"
+                        " error=%d\n", error);
                pending_req->status = BLKIF_RSP_ERROR;
        }
 
@@ -562,7 +561,8 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
        nseg = req->nr_segments;
        if (unlikely(nseg == 0 && operation != WRITE_FLUSH) ||
            unlikely(nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) {
-               DPRINTK("Bad number of segments in request (%d)\n", nseg);
+               pr_debug("xen-blkback: Bad number of segments in request (%d)\n",
+                        nseg);
                /* Haven't submitted any bio's yet. */
                goto fail_response;
        }
@@ -588,10 +588,10 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
        }
 
        if (vbd_translate(&preq, blkif, operation) != 0) {
-               DPRINTK("access denied: %s of [%llu,%llu] on dev=%04x\n",
-                       operation == READ ? "read" : "write",
-                       preq.sector_number,
-                       preq.sector_number + preq.nr_sects, preq.dev);
+               pr_debug("xen-blkback: access denied: %s of [%llu,%llu] on dev=%04x\n",
+                        operation == READ ? "read" : "write",
+                        preq.sector_number,
+                        preq.sector_number + preq.nr_sects, preq.dev);
                goto fail_response;
        }
 
@@ -602,8 +602,8 @@ static int dispatch_rw_block_io(struct blkif_st *blkif,
        for (i = 0; i < nseg; i++) {
                if (((int)preq.sector_number|(int)seg[i].nsec) &
                    ((bdev_logical_block_size(preq.bdev) >> 9) - 1)) {
-                       DPRINTK("Misaligned I/O request from domain %d",
-                               blkif->domid);
+                       pr_debug("xen-blkback: Misaligned I/O request from domain %d",
+                                blkif->domid);
                        goto fail_response;
                }
        }
@@ -759,7 +759,7 @@ static int __init xen_blkif_init(void)
 
        blkbk = kzalloc(sizeof(struct xen_blkbk), GFP_KERNEL);
        if (!blkbk) {
-               printk(KERN_ALERT "%s: out of memory!\n", __func__);
+               pr_alert("xen-blkback: %s: out of memory!\n", __func__);
                return -ENOMEM;
        }
 
@@ -807,7 +807,7 @@ static int __init xen_blkif_init(void)
        return 0;
 
  out_of_memory:
-       printk(KERN_ERR "%s: out of memory\n", __func__);
+       pr_alert("xen-blkback: %s: out of memory\n", __func__);
  failed_init:
        kfree(blkbk->pending_reqs);
        kfree(blkbk->pending_grant_handles);