]> xenbits.xensource.com Git - xenclient/kernel.git/commitdiff
imported patch ratelimit-blktap-wprintk close-and-flush-disconnected-emulated-devices
authort_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:01 +0000 (12:06 +0000)
committert_jeang <devnull@localhost>
Tue, 6 Jan 2009 12:06:01 +0000 (12:06 +0000)
drivers/xen/blktap/blktap.c
drivers/xen/blktap/common.h

index 581f551eb3967c35bdabacaf304da5ffb824c9cc..f27c02f7a3f14afaee3dc16a4f707ddc1a36f210 100644 (file)
@@ -1125,6 +1125,12 @@ static int do_block_io_op(tap_blkif_t *info)
                        msleep(1);
                        WPRINTK("unknown operation [%d]\n",
                                req.operation);
+                       WPRINTK("req_prod: 0x%08x, req_cons: 0x%08x, "
+                               "rsp_prod: 0x%08x, rsp_prod_pvt: 0x%08x\n",
+                               blk_rings->common.sring->req_prod,
+                               blk_rings->common.req_cons,
+                               blk_rings->common.sring->rsp_prod,
+                               blk_rings->common.rsp_prod_pvt);
                        make_response(blkif, req.id, req.operation,
                                      BLKIF_RSP_ERROR);
                        free_req(pending_req);
index 6168d5122f96d1af0a9d96c89d11eb12626bff85..134e50cdf429e239bb65fc5fca5113ba98ec1c44 100644 (file)
 #define DPRINTK(_f, _a...) pr_debug("(file=%s, line=%d) " _f, \
                                     __FILE__ , __LINE__ , ## _a )
 
-#define WPRINTK(fmt, args...) printk(KERN_WARNING "blk_tap: " fmt, ##args)
+#define WPRINTK(fmt, args...)                                         \
+do {                                                                  \
+       if (printk_ratelimit())                                       \
+               printk(KERN_WARNING "blk_tap: " fmt, ##args);         \
+} while (0)
 
 struct backend_info;