diff options
author | Joe Perches <joe@perches.com> | 2011-11-28 13:40:46 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2012-01-05 11:51:44 -0500 |
commit | 5d3851530d6d68564e4e0ce04d0547d4d106fc72 (patch) | |
tree | d47065fcc1f93f00070afe597a98ab185fd13859 /net/9p/trans_rdma.c | |
parent | a0ea787b027b79cf2e01c6758e5246db06520158 (diff) |
9p: Reduce object size with CONFIG_NET_9P_DEBUG
Reduce object size by deduplicating formats.
Use vsprintf extension %pV.
Rename P9_DPRINTK uses to p9_debug, align arguments.
Add function for _p9_debug and macro to add __func__.
Add missing "\n"s to p9_debug uses.
Remove embedded function names as p9_debug adds it.
Remove P9_EPRINTK macro and convert use to pr_<level>.
Add and use pr_fmt and pr_<level>.
$ size fs/9p/built-in.o*
text data bss dec hex filename
62133 984 16000 79117 1350d fs/9p/built-in.o.new
67342 984 16928 85254 14d06 fs/9p/built-in.o.old
$ size net/9p/built-in.o*
text data bss dec hex filename
88792 4148 22024 114964 1c114 net/9p/built-in.o.new
94072 4148 23232 121452 1da6c net/9p/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/trans_rdma.c')
-rw-r--r-- | net/9p/trans_rdma.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 159c50f1c6bf..2c69ddd691a1 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/in.h> | 31 | #include <linux/in.h> |
30 | #include <linux/module.h> | 32 | #include <linux/module.h> |
31 | #include <linux/net.h> | 33 | #include <linux/net.h> |
@@ -178,8 +180,8 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts) | |||
178 | 180 | ||
179 | tmp_options = kstrdup(params, GFP_KERNEL); | 181 | tmp_options = kstrdup(params, GFP_KERNEL); |
180 | if (!tmp_options) { | 182 | if (!tmp_options) { |
181 | P9_DPRINTK(P9_DEBUG_ERROR, | 183 | p9_debug(P9_DEBUG_ERROR, |
182 | "failed to allocate copy of option string\n"); | 184 | "failed to allocate copy of option string\n"); |
183 | return -ENOMEM; | 185 | return -ENOMEM; |
184 | } | 186 | } |
185 | options = tmp_options; | 187 | options = tmp_options; |
@@ -192,8 +194,8 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts) | |||
192 | token = match_token(p, tokens, args); | 194 | token = match_token(p, tokens, args); |
193 | r = match_int(&args[0], &option); | 195 | r = match_int(&args[0], &option); |
194 | if (r < 0) { | 196 | if (r < 0) { |
195 | P9_DPRINTK(P9_DEBUG_ERROR, | 197 | p9_debug(P9_DEBUG_ERROR, |
196 | "integer field, but no integer?\n"); | 198 | "integer field, but no integer?\n"); |
197 | continue; | 199 | continue; |
198 | } | 200 | } |
199 | switch (token) { | 201 | switch (token) { |
@@ -301,8 +303,7 @@ handle_recv(struct p9_client *client, struct p9_trans_rdma *rdma, | |||
301 | return; | 303 | return; |
302 | 304 | ||
303 | err_out: | 305 | err_out: |
304 | P9_DPRINTK(P9_DEBUG_ERROR, "req %p err %d status %d\n", | 306 | p9_debug(P9_DEBUG_ERROR, "req %p err %d status %d\n", req, err, status); |
305 | req, err, status); | ||
306 | rdma->state = P9_RDMA_FLUSHING; | 307 | rdma->state = P9_RDMA_FLUSHING; |
307 | client->status = Disconnected; | 308 | client->status = Disconnected; |
308 | } | 309 | } |
@@ -318,8 +319,8 @@ handle_send(struct p9_client *client, struct p9_trans_rdma *rdma, | |||
318 | 319 | ||
319 | static void qp_event_handler(struct ib_event *event, void *context) | 320 | static void qp_event_handler(struct ib_event *event, void *context) |
320 | { | 321 | { |
321 | P9_DPRINTK(P9_DEBUG_ERROR, "QP event %d context %p\n", event->event, | 322 | p9_debug(P9_DEBUG_ERROR, "QP event %d context %p\n", |
322 | context); | 323 | event->event, context); |
323 | } | 324 | } |
324 | 325 | ||
325 | static void cq_comp_handler(struct ib_cq *cq, void *cq_context) | 326 | static void cq_comp_handler(struct ib_cq *cq, void *cq_context) |
@@ -345,8 +346,7 @@ static void cq_comp_handler(struct ib_cq *cq, void *cq_context) | |||
345 | break; | 346 | break; |
346 | 347 | ||
347 | default: | 348 | default: |
348 | printk(KERN_ERR "9prdma: unexpected completion type, " | 349 | pr_err("unexpected completion type, c->wc_op=%d, wc.opcode=%d, status=%d\n", |
349 | "c->wc_op=%d, wc.opcode=%d, status=%d\n", | ||
350 | c->wc_op, wc.opcode, wc.status); | 350 | c->wc_op, wc.opcode, wc.status); |
351 | break; | 351 | break; |
352 | } | 352 | } |
@@ -356,7 +356,7 @@ static void cq_comp_handler(struct ib_cq *cq, void *cq_context) | |||
356 | 356 | ||
357 | static void cq_event_handler(struct ib_event *e, void *v) | 357 | static void cq_event_handler(struct ib_event *e, void *v) |
358 | { | 358 | { |
359 | P9_DPRINTK(P9_DEBUG_ERROR, "CQ event %d context %p\n", e->event, v); | 359 | p9_debug(P9_DEBUG_ERROR, "CQ event %d context %p\n", e->event, v); |
360 | } | 360 | } |
361 | 361 | ||
362 | static void rdma_destroy_trans(struct p9_trans_rdma *rdma) | 362 | static void rdma_destroy_trans(struct p9_trans_rdma *rdma) |
@@ -407,7 +407,7 @@ post_recv(struct p9_client *client, struct p9_rdma_context *c) | |||
407 | return ib_post_recv(rdma->qp, &wr, &bad_wr); | 407 | return ib_post_recv(rdma->qp, &wr, &bad_wr); |
408 | 408 | ||
409 | error: | 409 | error: |
410 | P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n"); | 410 | p9_debug(P9_DEBUG_ERROR, "EIO\n"); |
411 | return -EIO; | 411 | return -EIO; |
412 | } | 412 | } |
413 | 413 | ||
@@ -500,7 +500,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) | |||
500 | kfree(c); | 500 | kfree(c); |
501 | kfree(rpl_context->rc); | 501 | kfree(rpl_context->rc); |
502 | kfree(rpl_context); | 502 | kfree(rpl_context); |
503 | P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n"); | 503 | p9_debug(P9_DEBUG_ERROR, "EIO\n"); |
504 | return -EIO; | 504 | return -EIO; |
505 | err_free1: | 505 | err_free1: |
506 | kfree(rpl_context->rc); | 506 | kfree(rpl_context->rc); |