From 637c50bd04f96106cea7fce4cb318fe1f1380af8 Mon Sep 17 00:00:00 2001 From: t_jeang Date: Tue, 6 Jan 2009 12:06:01 +0000 Subject: [PATCH] imported patch ratelimit-blktap-wprintk --- drivers/xen/blktap/blktap.c | 6 ++++++ drivers/xen/blktap/common.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/xen/blktap/blktap.c b/drivers/xen/blktap/blktap.c index 581f551e..f27c02f7 100644 --- a/drivers/xen/blktap/blktap.c +++ b/drivers/xen/blktap/blktap.c @@ -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); diff --git a/drivers/xen/blktap/common.h b/drivers/xen/blktap/common.h index 6168d512..134e50cd 100644 --- a/drivers/xen/blktap/common.h +++ b/drivers/xen/blktap/common.h @@ -45,7 +45,11 @@ #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; -- 2.39.5