diff options
Diffstat (limited to 'drivers/block/xen-blkback')
-rw-r--r-- | drivers/block/xen-blkback/blkback.c | 36 | ||||
-rw-r--r-- | drivers/block/xen-blkback/common.h | 3 | ||||
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 6 |
3 files changed, 23 insertions, 22 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 5c9568e39eab..09fe528dd088 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
@@ -196,20 +196,20 @@ static void vbd_resize(struct blkif_st *blkif) | |||
196 | struct xenbus_device *dev = xen_blkbk_xenbus(blkif->be); | 196 | struct xenbus_device *dev = xen_blkbk_xenbus(blkif->be); |
197 | unsigned long long new_size = vbd_sz(vbd); | 197 | unsigned long long new_size = vbd_sz(vbd); |
198 | 198 | ||
199 | pr_info("xen-blkback: VBD Resize: Domid: %d, Device: (%d, %d)\n", | 199 | pr_info(DRV_PFX "VBD Resize: Domid: %d, Device: (%d, %d)\n", |
200 | blkif->domid, MAJOR(vbd->pdevice), MINOR(vbd->pdevice)); | 200 | blkif->domid, MAJOR(vbd->pdevice), MINOR(vbd->pdevice)); |
201 | pr_info("xen-blkback: VBD Resize: new size %llu\n", new_size); | 201 | pr_info(DRV_PFX "VBD Resize: new size %llu\n", new_size); |
202 | vbd->size = new_size; | 202 | vbd->size = new_size; |
203 | again: | 203 | again: |
204 | err = xenbus_transaction_start(&xbt); | 204 | err = xenbus_transaction_start(&xbt); |
205 | if (err) { | 205 | if (err) { |
206 | pr_warn("xen-blkback: Error starting transaction"); | 206 | pr_warn(DRV_PFX "Error starting transaction"); |
207 | return; | 207 | return; |
208 | } | 208 | } |
209 | err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu", | 209 | err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu", |
210 | (unsigned long long)vbd_sz(vbd)); | 210 | (unsigned long long)vbd_sz(vbd)); |
211 | if (err) { | 211 | if (err) { |
212 | pr_warn("xen-blkback: Error writing new size"); | 212 | pr_warn(DRV_PFX "Error writing new size"); |
213 | goto abort; | 213 | goto abort; |
214 | } | 214 | } |
215 | /* | 215 | /* |
@@ -219,7 +219,7 @@ again: | |||
219 | */ | 219 | */ |
220 | err = xenbus_printf(xbt, dev->nodename, "state", "%d", dev->state); | 220 | err = xenbus_printf(xbt, dev->nodename, "state", "%d", dev->state); |
221 | if (err) { | 221 | if (err) { |
222 | pr_warn("xen-blkback: Error writing the state"); | 222 | pr_warn(DRV_PFX "Error writing the state"); |
223 | goto abort; | 223 | goto abort; |
224 | } | 224 | } |
225 | 225 | ||
@@ -227,7 +227,7 @@ again: | |||
227 | if (err == -EAGAIN) | 227 | if (err == -EAGAIN) |
228 | goto again; | 228 | goto again; |
229 | if (err) | 229 | if (err) |
230 | pr_warn("xen-blkback: Error ending transaction"); | 230 | pr_warn(DRV_PFX "Error ending transaction"); |
231 | abort: | 231 | abort: |
232 | xenbus_transaction_end(xbt, 1); | 232 | xenbus_transaction_end(xbt, 1); |
233 | } | 233 | } |
@@ -270,7 +270,7 @@ int xen_blkif_schedule(void *arg) | |||
270 | xen_blkif_get(blkif); | 270 | xen_blkif_get(blkif); |
271 | 271 | ||
272 | if (debug_lvl) | 272 | if (debug_lvl) |
273 | pr_debug("xen-blkback: %s: started\n", current->comm); | 273 | pr_debug(DRV_PFX "%s: started\n", current->comm); |
274 | 274 | ||
275 | while (!kthread_should_stop()) { | 275 | while (!kthread_should_stop()) { |
276 | if (try_to_freeze()) | 276 | if (try_to_freeze()) |
@@ -299,7 +299,7 @@ int xen_blkif_schedule(void *arg) | |||
299 | if (log_stats) | 299 | if (log_stats) |
300 | print_stats(blkif); | 300 | print_stats(blkif); |
301 | if (debug_lvl) | 301 | if (debug_lvl) |
302 | pr_debug("xen-blkback: %s: exiting\n", current->comm); | 302 | pr_debug(DRV_PFX "%s: exiting\n", current->comm); |
303 | 303 | ||
304 | blkif->xenblkd = NULL; | 304 | blkif->xenblkd = NULL; |
305 | xen_blkif_put(blkif); | 305 | xen_blkif_put(blkif); |
@@ -343,7 +343,7 @@ static void xen_blkbk_unmap(struct pending_req *req) | |||
343 | ret = m2p_remove_override( | 343 | ret = m2p_remove_override( |
344 | virt_to_page(unmap[i].host_addr), false); | 344 | virt_to_page(unmap[i].host_addr), false); |
345 | if (ret) { | 345 | if (ret) { |
346 | pr_alert("xen-blkback: Failed to remove M2P override for %lx\n", | 346 | pr_alert(DRV_PFX "Failed to remove M2P override for %lx\n", |
347 | (unsigned long)unmap[i].host_addr); | 347 | (unsigned long)unmap[i].host_addr); |
348 | continue; | 348 | continue; |
349 | } | 349 | } |
@@ -385,7 +385,7 @@ static int xen_blkbk_map(struct blkif_request *req, | |||
385 | */ | 385 | */ |
386 | for (i = 0; i < nseg; i++) { | 386 | for (i = 0; i < nseg; i++) { |
387 | if (unlikely(map[i].status != 0)) { | 387 | if (unlikely(map[i].status != 0)) { |
388 | pr_debug("xen-blkback: invalid buffer -- could not remap it\n"); | 388 | pr_debug(DRV_PFX "invalid buffer -- could not remap it\n"); |
389 | map[i].handle = BLKBACK_INVALID_HANDLE; | 389 | map[i].handle = BLKBACK_INVALID_HANDLE; |
390 | ret |= 1; | 390 | ret |= 1; |
391 | } | 391 | } |
@@ -398,7 +398,7 @@ static int xen_blkbk_map(struct blkif_request *req, | |||
398 | ret = m2p_add_override(PFN_DOWN(map[i].dev_bus_addr), | 398 | ret = m2p_add_override(PFN_DOWN(map[i].dev_bus_addr), |
399 | blkbk->pending_page(pending_req, i), false); | 399 | blkbk->pending_page(pending_req, i), false); |
400 | if (ret) { | 400 | if (ret) { |
401 | pr_alert("xen-blkback: Failed to install M2P override for %lx (ret: %d)\n", | 401 | pr_alert(DRV_PFX "Failed to install M2P override for %lx (ret: %d)\n", |
402 | (unsigned long)map[i].dev_bus_addr, ret); | 402 | (unsigned long)map[i].dev_bus_addr, ret); |
403 | /* We could switch over to GNTTABOP_copy */ | 403 | /* We could switch over to GNTTABOP_copy */ |
404 | continue; | 404 | continue; |
@@ -419,11 +419,11 @@ static void __end_block_io_op(struct pending_req *pending_req, int error) | |||
419 | /* An error fails the entire request. */ | 419 | /* An error fails the entire request. */ |
420 | if ((pending_req->operation == BLKIF_OP_FLUSH_DISKCACHE) && | 420 | if ((pending_req->operation == BLKIF_OP_FLUSH_DISKCACHE) && |
421 | (error == -EOPNOTSUPP)) { | 421 | (error == -EOPNOTSUPP)) { |
422 | pr_debug("xen-blkback: flush diskcache op failed, not supported\n"); | 422 | pr_debug(DRV_PFX "flush diskcache op failed, not supported\n"); |
423 | xen_blkbk_flush_diskcache(XBT_NIL, pending_req->blkif->be, 0); | 423 | xen_blkbk_flush_diskcache(XBT_NIL, pending_req->blkif->be, 0); |
424 | pending_req->status = BLKIF_RSP_EOPNOTSUPP; | 424 | pending_req->status = BLKIF_RSP_EOPNOTSUPP; |
425 | } else if (error) { | 425 | } else if (error) { |
426 | pr_debug("xen-blkback: Buffer not up-to-date at end of operation," | 426 | pr_debug(DRV_PFX "Buffer not up-to-date at end of operation," |
427 | " error=%d\n", error); | 427 | " error=%d\n", error); |
428 | pending_req->status = BLKIF_RSP_ERROR; | 428 | pending_req->status = BLKIF_RSP_ERROR; |
429 | } | 429 | } |
@@ -561,7 +561,7 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, | |||
561 | nseg = req->nr_segments; | 561 | nseg = req->nr_segments; |
562 | if (unlikely(nseg == 0 && operation != WRITE_FLUSH) || | 562 | if (unlikely(nseg == 0 && operation != WRITE_FLUSH) || |
563 | unlikely(nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) { | 563 | unlikely(nseg > BLKIF_MAX_SEGMENTS_PER_REQUEST)) { |
564 | pr_debug("xen-blkback: Bad number of segments in request (%d)\n", | 564 | pr_debug(DRV_PFX "Bad number of segments in request (%d)\n", |
565 | nseg); | 565 | nseg); |
566 | /* Haven't submitted any bio's yet. */ | 566 | /* Haven't submitted any bio's yet. */ |
567 | goto fail_response; | 567 | goto fail_response; |
@@ -588,7 +588,7 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, | |||
588 | } | 588 | } |
589 | 589 | ||
590 | if (vbd_translate(&preq, blkif, operation) != 0) { | 590 | if (vbd_translate(&preq, blkif, operation) != 0) { |
591 | pr_debug("xen-blkback: access denied: %s of [%llu,%llu] on dev=%04x\n", | 591 | pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n", |
592 | operation == READ ? "read" : "write", | 592 | operation == READ ? "read" : "write", |
593 | preq.sector_number, | 593 | preq.sector_number, |
594 | preq.sector_number + preq.nr_sects, preq.dev); | 594 | preq.sector_number + preq.nr_sects, preq.dev); |
@@ -602,7 +602,7 @@ static int dispatch_rw_block_io(struct blkif_st *blkif, | |||
602 | for (i = 0; i < nseg; i++) { | 602 | for (i = 0; i < nseg; i++) { |
603 | if (((int)preq.sector_number|(int)seg[i].nsec) & | 603 | if (((int)preq.sector_number|(int)seg[i].nsec) & |
604 | ((bdev_logical_block_size(preq.bdev) >> 9) - 1)) { | 604 | ((bdev_logical_block_size(preq.bdev) >> 9) - 1)) { |
605 | pr_debug("xen-blkback: Misaligned I/O request from domain %d", | 605 | pr_debug(DRV_PFX "Misaligned I/O request from domain %d", |
606 | blkif->domid); | 606 | blkif->domid); |
607 | goto fail_response; | 607 | goto fail_response; |
608 | } | 608 | } |
@@ -759,7 +759,7 @@ static int __init xen_blkif_init(void) | |||
759 | 759 | ||
760 | blkbk = kzalloc(sizeof(struct xen_blkbk), GFP_KERNEL); | 760 | blkbk = kzalloc(sizeof(struct xen_blkbk), GFP_KERNEL); |
761 | if (!blkbk) { | 761 | if (!blkbk) { |
762 | pr_alert("xen-blkback: %s: out of memory!\n", __func__); | 762 | pr_alert(DRV_PFX "%s: out of memory!\n", __func__); |
763 | return -ENOMEM; | 763 | return -ENOMEM; |
764 | } | 764 | } |
765 | 765 | ||
@@ -807,7 +807,7 @@ static int __init xen_blkif_init(void) | |||
807 | return 0; | 807 | return 0; |
808 | 808 | ||
809 | out_of_memory: | 809 | out_of_memory: |
810 | pr_alert("xen-blkback: %s: out of memory\n", __func__); | 810 | pr_alert(DRV_PFX "%s: out of memory\n", __func__); |
811 | failed_init: | 811 | failed_init: |
812 | kfree(blkbk->pending_reqs); | 812 | kfree(blkbk->pending_reqs); |
813 | kfree(blkbk->pending_grant_handles); | 813 | kfree(blkbk->pending_grant_handles); |
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 46e5d0630440..da96e3eaa641 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h | |||
@@ -42,8 +42,9 @@ | |||
42 | #include <xen/grant_table.h> | 42 | #include <xen/grant_table.h> |
43 | #include <xen/xenbus.h> | 43 | #include <xen/xenbus.h> |
44 | 44 | ||
45 | #define DRV_PFX "xen-blkback:" | ||
45 | #define DPRINTK(fmt, args...) \ | 46 | #define DPRINTK(fmt, args...) \ |
46 | pr_debug("xen-blkback: (%s:%d) " fmt ".\n", \ | 47 | pr_debug(DRV_PFX "(%s:%d) " fmt ".\n", \ |
47 | __func__, __LINE__, ##args) | 48 | __func__, __LINE__, ##args) |
48 | 49 | ||
49 | struct vbd { | 50 | struct vbd { |
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index fa01dbbee0ad..1c3fa6507e6d 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c | |||
@@ -504,7 +504,7 @@ static void backend_changed(struct xenbus_watch *watch, | |||
504 | 504 | ||
505 | if ((be->major || be->minor) && | 505 | if ((be->major || be->minor) && |
506 | ((be->major != major) || (be->minor != minor))) { | 506 | ((be->major != major) || (be->minor != minor))) { |
507 | pr_warn("xen-blkback: changing physical device (from %x:%x to %x:%x) not supported.\n", | 507 | pr_warn(DRV_PFX "changing physical device (from %x:%x to %x:%x) not supported.\n", |
508 | be->major, be->minor, major, minor); | 508 | be->major, be->minor, major, minor); |
509 | return; | 509 | return; |
510 | } | 510 | } |
@@ -571,7 +571,7 @@ static void frontend_changed(struct xenbus_device *dev, | |||
571 | switch (frontend_state) { | 571 | switch (frontend_state) { |
572 | case XenbusStateInitialising: | 572 | case XenbusStateInitialising: |
573 | if (dev->state == XenbusStateClosed) { | 573 | if (dev->state == XenbusStateClosed) { |
574 | pr_info("xen-blkback: %s: prepare for reconnect\n", | 574 | pr_info(DRV_PFX "%s: prepare for reconnect\n", |
575 | dev->nodename); | 575 | dev->nodename); |
576 | xenbus_switch_state(dev, XenbusStateInitWait); | 576 | xenbus_switch_state(dev, XenbusStateInitWait); |
577 | } | 577 | } |
@@ -726,7 +726,7 @@ static int connect_ring(struct backend_info *be) | |||
726 | xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol); | 726 | xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol); |
727 | return -1; | 727 | return -1; |
728 | } | 728 | } |
729 | pr_info("xen-blkback: ring-ref %ld, event-channel %d, protocol %d (%s)\n", | 729 | pr_info(DRV_PFX "ring-ref %ld, event-channel %d, protocol %d (%s)\n", |
730 | ring_ref, evtchn, be->blkif->blk_protocol, protocol); | 730 | ring_ref, evtchn, be->blkif->blk_protocol, protocol); |
731 | 731 | ||
732 | /* Map the shared frame, irq etc. */ | 732 | /* Map the shared frame, irq etc. */ |