aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/client.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-11-28 13:40:46 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2012-01-05 11:51:44 -0500
commit5d3851530d6d68564e4e0ce04d0547d4d106fc72 (patch)
treed47065fcc1f93f00070afe597a98ab185fd13859 /net/9p/client.c
parenta0ea787b027b79cf2e01c6758e5246db06520158 (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/client.c')
-rw-r--r--net/9p/client.c242
1 files changed, 121 insertions, 121 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index 854ca7a911c..776618cd2be 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -23,6 +23,8 @@
23 * 23 *
24 */ 24 */
25 25
26#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27
26#include <linux/module.h> 28#include <linux/module.h>
27#include <linux/errno.h> 29#include <linux/errno.h>
28#include <linux/fs.h> 30#include <linux/fs.h>
@@ -81,15 +83,15 @@ static int get_protocol_version(char *s)
81 83
82 if (!strcmp(s, "9p2000")) { 84 if (!strcmp(s, "9p2000")) {
83 version = p9_proto_legacy; 85 version = p9_proto_legacy;
84 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); 86 p9_debug(P9_DEBUG_9P, "Protocol version: Legacy\n");
85 } else if (!strcmp(s, "9p2000.u")) { 87 } else if (!strcmp(s, "9p2000.u")) {
86 version = p9_proto_2000u; 88 version = p9_proto_2000u;
87 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.u\n"); 89 p9_debug(P9_DEBUG_9P, "Protocol version: 9P2000.u\n");
88 } else if (!strcmp(s, "9p2000.L")) { 90 } else if (!strcmp(s, "9p2000.L")) {
89 version = p9_proto_2000L; 91 version = p9_proto_2000L;
90 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.L\n"); 92 p9_debug(P9_DEBUG_9P, "Protocol version: 9P2000.L\n");
91 } else 93 } else
92 printk(KERN_INFO "9p: Unknown protocol version %s.\n", s); 94 pr_info("Unknown protocol version %s\n", s);
93 95
94 return version; 96 return version;
95} 97}
@@ -119,8 +121,8 @@ static int parse_opts(char *opts, struct p9_client *clnt)
119 121
120 tmp_options = kstrdup(opts, GFP_KERNEL); 122 tmp_options = kstrdup(opts, GFP_KERNEL);
121 if (!tmp_options) { 123 if (!tmp_options) {
122 P9_DPRINTK(P9_DEBUG_ERROR, 124 p9_debug(P9_DEBUG_ERROR,
123 "failed to allocate copy of option string\n"); 125 "failed to allocate copy of option string\n");
124 return -ENOMEM; 126 return -ENOMEM;
125 } 127 }
126 options = tmp_options; 128 options = tmp_options;
@@ -134,8 +136,8 @@ static int parse_opts(char *opts, struct p9_client *clnt)
134 case Opt_msize: 136 case Opt_msize:
135 r = match_int(&args[0], &option); 137 r = match_int(&args[0], &option);
136 if (r < 0) { 138 if (r < 0) {
137 P9_DPRINTK(P9_DEBUG_ERROR, 139 p9_debug(P9_DEBUG_ERROR,
138 "integer field, but no integer?\n"); 140 "integer field, but no integer?\n");
139 ret = r; 141 ret = r;
140 continue; 142 continue;
141 } 143 }
@@ -145,15 +147,14 @@ static int parse_opts(char *opts, struct p9_client *clnt)
145 s = match_strdup(&args[0]); 147 s = match_strdup(&args[0]);
146 if (!s) { 148 if (!s) {
147 ret = -ENOMEM; 149 ret = -ENOMEM;
148 P9_DPRINTK(P9_DEBUG_ERROR, 150 p9_debug(P9_DEBUG_ERROR,
149 "problem allocating copy of trans arg\n"); 151 "problem allocating copy of trans arg\n");
150 goto free_and_return; 152 goto free_and_return;
151 } 153 }
152 clnt->trans_mod = v9fs_get_trans_by_name(s); 154 clnt->trans_mod = v9fs_get_trans_by_name(s);
153 if (clnt->trans_mod == NULL) { 155 if (clnt->trans_mod == NULL) {
154 printk(KERN_INFO 156 pr_info("Could not find request transport: %s\n",
155 "9p: Could not find " 157 s);
156 "request transport: %s\n", s);
157 ret = -EINVAL; 158 ret = -EINVAL;
158 kfree(s); 159 kfree(s);
159 goto free_and_return; 160 goto free_and_return;
@@ -167,8 +168,8 @@ static int parse_opts(char *opts, struct p9_client *clnt)
167 s = match_strdup(&args[0]); 168 s = match_strdup(&args[0]);
168 if (!s) { 169 if (!s) {
169 ret = -ENOMEM; 170 ret = -ENOMEM;
170 P9_DPRINTK(P9_DEBUG_ERROR, 171 p9_debug(P9_DEBUG_ERROR,
171 "problem allocating copy of version arg\n"); 172 "problem allocating copy of version arg\n");
172 goto free_and_return; 173 goto free_and_return;
173 } 174 }
174 ret = get_protocol_version(s); 175 ret = get_protocol_version(s);
@@ -225,7 +226,7 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
225 sizeof(struct p9_req_t), GFP_ATOMIC); 226 sizeof(struct p9_req_t), GFP_ATOMIC);
226 227
227 if (!c->reqs[row]) { 228 if (!c->reqs[row]) {
228 printk(KERN_ERR "Couldn't grow tag array\n"); 229 pr_err("Couldn't grow tag array\n");
229 spin_unlock_irqrestore(&c->lock, flags); 230 spin_unlock_irqrestore(&c->lock, flags);
230 return ERR_PTR(-ENOMEM); 231 return ERR_PTR(-ENOMEM);
231 } 232 }
@@ -244,7 +245,7 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
244 if (!req->tc) { 245 if (!req->tc) {
245 req->wq = kmalloc(sizeof(wait_queue_head_t), GFP_NOFS); 246 req->wq = kmalloc(sizeof(wait_queue_head_t), GFP_NOFS);
246 if (!req->wq) { 247 if (!req->wq) {
247 printk(KERN_ERR "Couldn't grow tag array\n"); 248 pr_err("Couldn't grow tag array\n");
248 return ERR_PTR(-ENOMEM); 249 return ERR_PTR(-ENOMEM);
249 } 250 }
250 init_waitqueue_head(req->wq); 251 init_waitqueue_head(req->wq);
@@ -253,7 +254,7 @@ p9_tag_alloc(struct p9_client *c, u16 tag, unsigned int max_size)
253 req->rc = kmalloc(sizeof(struct p9_fcall) + alloc_msize, 254 req->rc = kmalloc(sizeof(struct p9_fcall) + alloc_msize,
254 GFP_NOFS); 255 GFP_NOFS);
255 if ((!req->tc) || (!req->rc)) { 256 if ((!req->tc) || (!req->rc)) {
256 printk(KERN_ERR "Couldn't grow tag array\n"); 257 pr_err("Couldn't grow tag array\n");
257 kfree(req->tc); 258 kfree(req->tc);
258 kfree(req->rc); 259 kfree(req->rc);
259 kfree(req->wq); 260 kfree(req->wq);
@@ -343,9 +344,9 @@ static void p9_tag_cleanup(struct p9_client *c)
343 for (row = 0; row < (c->max_tag/P9_ROW_MAXTAG); row++) { 344 for (row = 0; row < (c->max_tag/P9_ROW_MAXTAG); row++) {
344 for (col = 0; col < P9_ROW_MAXTAG; col++) { 345 for (col = 0; col < P9_ROW_MAXTAG; col++) {
345 if (c->reqs[row][col].status != REQ_STATUS_IDLE) { 346 if (c->reqs[row][col].status != REQ_STATUS_IDLE) {
346 P9_DPRINTK(P9_DEBUG_MUX, 347 p9_debug(P9_DEBUG_MUX,
347 "Attempting to cleanup non-free tag %d,%d\n", 348 "Attempting to cleanup non-free tag %d,%d\n",
348 row, col); 349 row, col);
349 /* TODO: delay execution of cleanup */ 350 /* TODO: delay execution of cleanup */
350 return; 351 return;
351 } 352 }
@@ -379,7 +380,7 @@ static void p9_tag_cleanup(struct p9_client *c)
379static void p9_free_req(struct p9_client *c, struct p9_req_t *r) 380static void p9_free_req(struct p9_client *c, struct p9_req_t *r)
380{ 381{
381 int tag = r->tc->tag; 382 int tag = r->tc->tag;
382 P9_DPRINTK(P9_DEBUG_MUX, "clnt %p req %p tag: %d\n", c, r, tag); 383 p9_debug(P9_DEBUG_MUX, "clnt %p req %p tag: %d\n", c, r, tag);
383 384
384 r->status = REQ_STATUS_IDLE; 385 r->status = REQ_STATUS_IDLE;
385 if (tag != P9_NOTAG && p9_idpool_check(tag, c->tagpool)) 386 if (tag != P9_NOTAG && p9_idpool_check(tag, c->tagpool))
@@ -394,9 +395,9 @@ static void p9_free_req(struct p9_client *c, struct p9_req_t *r)
394 */ 395 */
395void p9_client_cb(struct p9_client *c, struct p9_req_t *req) 396void p9_client_cb(struct p9_client *c, struct p9_req_t *req)
396{ 397{
397 P9_DPRINTK(P9_DEBUG_MUX, " tag %d\n", req->tc->tag); 398 p9_debug(P9_DEBUG_MUX, " tag %d\n", req->tc->tag);
398 wake_up(req->wq); 399 wake_up(req->wq);
399 P9_DPRINTK(P9_DEBUG_MUX, "wakeup: %d\n", req->tc->tag); 400 p9_debug(P9_DEBUG_MUX, "wakeup: %d\n", req->tc->tag);
400} 401}
401EXPORT_SYMBOL(p9_client_cb); 402EXPORT_SYMBOL(p9_client_cb);
402 403
@@ -431,8 +432,8 @@ p9_parse_header(struct p9_fcall *pdu, int32_t *size, int8_t *type, int16_t *tag,
431 pdu->id = r_type; 432 pdu->id = r_type;
432 pdu->tag = r_tag; 433 pdu->tag = r_tag;
433 434
434 P9_DPRINTK(P9_DEBUG_9P, "<<< size=%d type: %d tag: %d\n", pdu->size, 435 p9_debug(P9_DEBUG_9P, "<<< size=%d type: %d tag: %d\n",
435 pdu->id, pdu->tag); 436 pdu->size, pdu->id, pdu->tag);
436 437
437 if (type) 438 if (type)
438 *type = r_type; 439 *type = r_type;
@@ -473,7 +474,7 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
473 */ 474 */
474 trace_9p_protocol_dump(c, req->rc); 475 trace_9p_protocol_dump(c, req->rc);
475 if (err) { 476 if (err) {
476 P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse header %d\n", err); 477 p9_debug(P9_DEBUG_ERROR, "couldn't parse header %d\n", err);
477 return err; 478 return err;
478 } 479 }
479 if (type != P9_RERROR && type != P9_RLERROR) 480 if (type != P9_RERROR && type != P9_RLERROR)
@@ -492,21 +493,21 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
492 if (!err || !IS_ERR_VALUE(err)) { 493 if (!err || !IS_ERR_VALUE(err)) {
493 err = p9_errstr2errno(ename, strlen(ename)); 494 err = p9_errstr2errno(ename, strlen(ename));
494 495
495 P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", 496 p9_debug(P9_DEBUG_9P, "<<< RERROR (%d) %s\n",
496 -ecode, ename); 497 -ecode, ename);
497 } 498 }
498 kfree(ename); 499 kfree(ename);
499 } else { 500 } else {
500 err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode); 501 err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode);
501 err = -ecode; 502 err = -ecode;
502 503
503 P9_DPRINTK(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode); 504 p9_debug(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
504 } 505 }
505 506
506 return err; 507 return err;
507 508
508out_err: 509out_err:
509 P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n", err); 510 p9_debug(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);
510 511
511 return err; 512 return err;
512} 513}
@@ -538,7 +539,7 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
538 */ 539 */
539 trace_9p_protocol_dump(c, req->rc); 540 trace_9p_protocol_dump(c, req->rc);
540 if (err) { 541 if (err) {
541 P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse header %d\n", err); 542 p9_debug(P9_DEBUG_ERROR, "couldn't parse header %d\n", err);
542 return err; 543 return err;
543 } 544 }
544 545
@@ -601,22 +602,22 @@ static int p9_check_zc_errors(struct p9_client *c, struct p9_req_t *req,
601 if (!err || !IS_ERR_VALUE(err)) { 602 if (!err || !IS_ERR_VALUE(err)) {
602 err = p9_errstr2errno(ename, strlen(ename)); 603 err = p9_errstr2errno(ename, strlen(ename));
603 604
604 P9_DPRINTK(P9_DEBUG_9P, "<<< RERROR (%d) %s\n", 605 p9_debug(P9_DEBUG_9P, "<<< RERROR (%d) %s\n",
605 -ecode, ename); 606 -ecode, ename);
606 } 607 }
607 kfree(ename); 608 kfree(ename);
608 } else { 609 } else {
609 err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode); 610 err = p9pdu_readf(req->rc, c->proto_version, "d", &ecode);
610 err = -ecode; 611 err = -ecode;
611 612
612 P9_DPRINTK(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode); 613 p9_debug(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);
613 } 614 }
614 return err; 615 return err;
615 616
616out_free: 617out_free:
617 kfree(ename); 618 kfree(ename);
618out_err: 619out_err:
619 P9_DPRINTK(P9_DEBUG_ERROR, "couldn't parse error%d\n", err); 620 p9_debug(P9_DEBUG_ERROR, "couldn't parse error%d\n", err);
620 return err; 621 return err;
621} 622}
622 623
@@ -645,7 +646,7 @@ static int p9_client_flush(struct p9_client *c, struct p9_req_t *oldreq)
645 if (err) 646 if (err)
646 return err; 647 return err;
647 648
648 P9_DPRINTK(P9_DEBUG_9P, ">>> TFLUSH tag %d\n", oldtag); 649 p9_debug(P9_DEBUG_9P, ">>> TFLUSH tag %d\n", oldtag);
649 650
650 req = p9_client_rpc(c, P9_TFLUSH, "w", oldtag); 651 req = p9_client_rpc(c, P9_TFLUSH, "w", oldtag);
651 if (IS_ERR(req)) 652 if (IS_ERR(req))
@@ -670,7 +671,7 @@ static struct p9_req_t *p9_client_prepare_req(struct p9_client *c,
670 int tag, err; 671 int tag, err;
671 struct p9_req_t *req; 672 struct p9_req_t *req;
672 673
673 P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type); 674 p9_debug(P9_DEBUG_MUX, "client %p op %d\n", c, type);
674 675
675 /* we allow for any status other than disconnected */ 676 /* we allow for any status other than disconnected */
676 if (c->status == Disconnected) 677 if (c->status == Disconnected)
@@ -744,11 +745,11 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
744 req->status >= REQ_STATUS_RCVD); 745 req->status >= REQ_STATUS_RCVD);
745 746
746 if (req->status == REQ_STATUS_ERROR) { 747 if (req->status == REQ_STATUS_ERROR) {
747 P9_DPRINTK(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err); 748 p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
748 err = req->t_err; 749 err = req->t_err;
749 } 750 }
750 if ((err == -ERESTARTSYS) && (c->status == Connected)) { 751 if ((err == -ERESTARTSYS) && (c->status == Connected)) {
751 P9_DPRINTK(P9_DEBUG_MUX, "flushing\n"); 752 p9_debug(P9_DEBUG_MUX, "flushing\n");
752 sigpending = 1; 753 sigpending = 1;
753 clear_thread_flag(TIF_SIGPENDING); 754 clear_thread_flag(TIF_SIGPENDING);
754 755
@@ -827,11 +828,11 @@ static struct p9_req_t *p9_client_zc_rpc(struct p9_client *c, int8_t type,
827 goto reterr; 828 goto reterr;
828 } 829 }
829 if (req->status == REQ_STATUS_ERROR) { 830 if (req->status == REQ_STATUS_ERROR) {
830 P9_DPRINTK(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err); 831 p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err);
831 err = req->t_err; 832 err = req->t_err;
832 } 833 }
833 if ((err == -ERESTARTSYS) && (c->status == Connected)) { 834 if ((err == -ERESTARTSYS) && (c->status == Connected)) {
834 P9_DPRINTK(P9_DEBUG_MUX, "flushing\n"); 835 p9_debug(P9_DEBUG_MUX, "flushing\n");
835 sigpending = 1; 836 sigpending = 1;
836 clear_thread_flag(TIF_SIGPENDING); 837 clear_thread_flag(TIF_SIGPENDING);
837 838
@@ -865,7 +866,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
865 struct p9_fid *fid; 866 struct p9_fid *fid;
866 unsigned long flags; 867 unsigned long flags;
867 868
868 P9_DPRINTK(P9_DEBUG_FID, "clnt %p\n", clnt); 869 p9_debug(P9_DEBUG_FID, "clnt %p\n", clnt);
869 fid = kmalloc(sizeof(struct p9_fid), GFP_KERNEL); 870 fid = kmalloc(sizeof(struct p9_fid), GFP_KERNEL);
870 if (!fid) 871 if (!fid)
871 return ERR_PTR(-ENOMEM); 872 return ERR_PTR(-ENOMEM);
@@ -898,7 +899,7 @@ static void p9_fid_destroy(struct p9_fid *fid)
898 struct p9_client *clnt; 899 struct p9_client *clnt;
899 unsigned long flags; 900 unsigned long flags;
900 901
901 P9_DPRINTK(P9_DEBUG_FID, "fid %d\n", fid->fid); 902 p9_debug(P9_DEBUG_FID, "fid %d\n", fid->fid);
902 clnt = fid->clnt; 903 clnt = fid->clnt;
903 p9_idpool_put(fid->fid, clnt->fidpool); 904 p9_idpool_put(fid->fid, clnt->fidpool);
904 spin_lock_irqsave(&clnt->lock, flags); 905 spin_lock_irqsave(&clnt->lock, flags);
@@ -915,8 +916,8 @@ static int p9_client_version(struct p9_client *c)
915 char *version; 916 char *version;
916 int msize; 917 int msize;
917 918
918 P9_DPRINTK(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n", 919 p9_debug(P9_DEBUG_9P, ">>> TVERSION msize %d protocol %d\n",
919 c->msize, c->proto_version); 920 c->msize, c->proto_version);
920 921
921 switch (c->proto_version) { 922 switch (c->proto_version) {
922 case p9_proto_2000L: 923 case p9_proto_2000L:
@@ -941,12 +942,12 @@ static int p9_client_version(struct p9_client *c)
941 942
942 err = p9pdu_readf(req->rc, c->proto_version, "ds", &msize, &version); 943 err = p9pdu_readf(req->rc, c->proto_version, "ds", &msize, &version);
943 if (err) { 944 if (err) {
944 P9_DPRINTK(P9_DEBUG_9P, "version error %d\n", err); 945 p9_debug(P9_DEBUG_9P, "version error %d\n", err);
945 trace_9p_protocol_dump(c, req->rc); 946 trace_9p_protocol_dump(c, req->rc);
946 goto error; 947 goto error;
947 } 948 }
948 949
949 P9_DPRINTK(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version); 950 p9_debug(P9_DEBUG_9P, "<<< RVERSION msize %d %s\n", msize, version);
950 if (!strncmp(version, "9P2000.L", 8)) 951 if (!strncmp(version, "9P2000.L", 8))
951 c->proto_version = p9_proto_2000L; 952 c->proto_version = p9_proto_2000L;
952 else if (!strncmp(version, "9P2000.u", 8)) 953 else if (!strncmp(version, "9P2000.u", 8))
@@ -996,8 +997,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
996 997
997 if (clnt->trans_mod == NULL) { 998 if (clnt->trans_mod == NULL) {
998 err = -EPROTONOSUPPORT; 999 err = -EPROTONOSUPPORT;
999 P9_DPRINTK(P9_DEBUG_ERROR, 1000 p9_debug(P9_DEBUG_ERROR,
1000 "No transport defined or default transport\n"); 1001 "No transport defined or default transport\n");
1001 goto destroy_tagpool; 1002 goto destroy_tagpool;
1002 } 1003 }
1003 1004
@@ -1007,8 +1008,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
1007 goto put_trans; 1008 goto put_trans;
1008 } 1009 }
1009 1010
1010 P9_DPRINTK(P9_DEBUG_MUX, "clnt %p trans %p msize %d protocol %d\n", 1011 p9_debug(P9_DEBUG_MUX, "clnt %p trans %p msize %d protocol %d\n",
1011 clnt, clnt->trans_mod, clnt->msize, clnt->proto_version); 1012 clnt, clnt->trans_mod, clnt->msize, clnt->proto_version);
1012 1013
1013 err = clnt->trans_mod->create(clnt, dev_name, options); 1014 err = clnt->trans_mod->create(clnt, dev_name, options);
1014 if (err) 1015 if (err)
@@ -1041,7 +1042,7 @@ void p9_client_destroy(struct p9_client *clnt)
1041{ 1042{
1042 struct p9_fid *fid, *fidptr; 1043 struct p9_fid *fid, *fidptr;
1043 1044
1044 P9_DPRINTK(P9_DEBUG_MUX, "clnt %p\n", clnt); 1045 p9_debug(P9_DEBUG_MUX, "clnt %p\n", clnt);
1045 1046
1046 if (clnt->trans_mod) 1047 if (clnt->trans_mod)
1047 clnt->trans_mod->close(clnt); 1048 clnt->trans_mod->close(clnt);
@@ -1049,7 +1050,7 @@ void p9_client_destroy(struct p9_client *clnt)
1049 v9fs_put_trans(clnt->trans_mod); 1050 v9fs_put_trans(clnt->trans_mod);
1050 1051
1051 list_for_each_entry_safe(fid, fidptr, &clnt->fidlist, flist) { 1052 list_for_each_entry_safe(fid, fidptr, &clnt->fidlist, flist) {
1052 printk(KERN_INFO "Found fid %d not clunked\n", fid->fid); 1053 pr_info("Found fid %d not clunked\n", fid->fid);
1053 p9_fid_destroy(fid); 1054 p9_fid_destroy(fid);
1054 } 1055 }
1055 1056
@@ -1064,14 +1065,14 @@ EXPORT_SYMBOL(p9_client_destroy);
1064 1065
1065void p9_client_disconnect(struct p9_client *clnt) 1066void p9_client_disconnect(struct p9_client *clnt)
1066{ 1067{
1067 P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); 1068 p9_debug(P9_DEBUG_9P, "clnt %p\n", clnt);
1068 clnt->status = Disconnected; 1069 clnt->status = Disconnected;
1069} 1070}
1070EXPORT_SYMBOL(p9_client_disconnect); 1071EXPORT_SYMBOL(p9_client_disconnect);
1071 1072
1072void p9_client_begin_disconnect(struct p9_client *clnt) 1073void p9_client_begin_disconnect(struct p9_client *clnt)
1073{ 1074{
1074 P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); 1075 p9_debug(P9_DEBUG_9P, "clnt %p\n", clnt);
1075 clnt->status = BeginDisconnect; 1076 clnt->status = BeginDisconnect;
1076} 1077}
1077EXPORT_SYMBOL(p9_client_begin_disconnect); 1078EXPORT_SYMBOL(p9_client_begin_disconnect);
@@ -1085,8 +1086,8 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
1085 struct p9_qid qid; 1086 struct p9_qid qid;
1086 1087
1087 1088
1088 P9_DPRINTK(P9_DEBUG_9P, ">>> TATTACH afid %d uname %s aname %s\n", 1089 p9_debug(P9_DEBUG_9P, ">>> TATTACH afid %d uname %s aname %s\n",
1089 afid ? afid->fid : -1, uname, aname); 1090 afid ? afid->fid : -1, uname, aname);
1090 fid = p9_fid_create(clnt); 1091 fid = p9_fid_create(clnt);
1091 if (IS_ERR(fid)) { 1092 if (IS_ERR(fid)) {
1092 err = PTR_ERR(fid); 1093 err = PTR_ERR(fid);
@@ -1108,10 +1109,8 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
1108 goto error; 1109 goto error;
1109 } 1110 }
1110 1111
1111 P9_DPRINTK(P9_DEBUG_9P, "<<< RATTACH qid %x.%llx.%x\n", 1112 p9_debug(P9_DEBUG_9P, "<<< RATTACH qid %x.%llx.%x\n",
1112 qid.type, 1113 qid.type, (unsigned long long)qid.path, qid.version);
1113 (unsigned long long)qid.path,
1114 qid.version);
1115 1114
1116 memmove(&fid->qid, &qid, sizeof(struct p9_qid)); 1115 memmove(&fid->qid, &qid, sizeof(struct p9_qid));
1117 1116
@@ -1151,8 +1150,8 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
1151 fid = oldfid; 1150 fid = oldfid;
1152 1151
1153 1152
1154 P9_DPRINTK(P9_DEBUG_9P, ">>> TWALK fids %d,%d nwname %ud wname[0] %s\n", 1153 p9_debug(P9_DEBUG_9P, ">>> TWALK fids %d,%d nwname %ud wname[0] %s\n",
1155 oldfid->fid, fid->fid, nwname, wnames ? wnames[0] : NULL); 1154 oldfid->fid, fid->fid, nwname, wnames ? wnames[0] : NULL);
1156 1155
1157 req = p9_client_rpc(clnt, P9_TWALK, "ddT", oldfid->fid, fid->fid, 1156 req = p9_client_rpc(clnt, P9_TWALK, "ddT", oldfid->fid, fid->fid,
1158 nwname, wnames); 1157 nwname, wnames);
@@ -1169,7 +1168,7 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
1169 } 1168 }
1170 p9_free_req(clnt, req); 1169 p9_free_req(clnt, req);
1171 1170
1172 P9_DPRINTK(P9_DEBUG_9P, "<<< RWALK nwqid %d:\n", nwqids); 1171 p9_debug(P9_DEBUG_9P, "<<< RWALK nwqid %d:\n", nwqids);
1173 1172
1174 if (nwqids != nwname) { 1173 if (nwqids != nwname) {
1175 err = -ENOENT; 1174 err = -ENOENT;
@@ -1177,7 +1176,7 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
1177 } 1176 }
1178 1177
1179 for (count = 0; count < nwqids; count++) 1178 for (count = 0; count < nwqids; count++)
1180 P9_DPRINTK(P9_DEBUG_9P, "<<< [%d] %x.%llx.%x\n", 1179 p9_debug(P9_DEBUG_9P, "<<< [%d] %x.%llx.%x\n",
1181 count, wqids[count].type, 1180 count, wqids[count].type,
1182 (unsigned long long)wqids[count].path, 1181 (unsigned long long)wqids[count].path,
1183 wqids[count].version); 1182 wqids[count].version);
@@ -1212,7 +1211,7 @@ int p9_client_open(struct p9_fid *fid, int mode)
1212 int iounit; 1211 int iounit;
1213 1212
1214 clnt = fid->clnt; 1213 clnt = fid->clnt;
1215 P9_DPRINTK(P9_DEBUG_9P, ">>> %s fid %d mode %d\n", 1214 p9_debug(P9_DEBUG_9P, ">>> %s fid %d mode %d\n",
1216 p9_is_proto_dotl(clnt) ? "TLOPEN" : "TOPEN", fid->fid, mode); 1215 p9_is_proto_dotl(clnt) ? "TLOPEN" : "TOPEN", fid->fid, mode);
1217 err = 0; 1216 err = 0;
1218 1217
@@ -1234,7 +1233,7 @@ int p9_client_open(struct p9_fid *fid, int mode)
1234 goto free_and_error; 1233 goto free_and_error;
1235 } 1234 }
1236 1235
1237 P9_DPRINTK(P9_DEBUG_9P, "<<< %s qid %x.%llx.%x iounit %x\n", 1236 p9_debug(P9_DEBUG_9P, "<<< %s qid %x.%llx.%x iounit %x\n",
1238 p9_is_proto_dotl(clnt) ? "RLOPEN" : "ROPEN", qid.type, 1237 p9_is_proto_dotl(clnt) ? "RLOPEN" : "ROPEN", qid.type,
1239 (unsigned long long)qid.path, qid.version, iounit); 1238 (unsigned long long)qid.path, qid.version, iounit);
1240 1239
@@ -1256,7 +1255,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
1256 struct p9_req_t *req; 1255 struct p9_req_t *req;
1257 int iounit; 1256 int iounit;
1258 1257
1259 P9_DPRINTK(P9_DEBUG_9P, 1258 p9_debug(P9_DEBUG_9P,
1260 ">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n", 1259 ">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n",
1261 ofid->fid, name, flags, mode, gid); 1260 ofid->fid, name, flags, mode, gid);
1262 clnt = ofid->clnt; 1261 clnt = ofid->clnt;
@@ -1277,7 +1276,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
1277 goto free_and_error; 1276 goto free_and_error;
1278 } 1277 }
1279 1278
1280 P9_DPRINTK(P9_DEBUG_9P, "<<< RLCREATE qid %x.%llx.%x iounit %x\n", 1279 p9_debug(P9_DEBUG_9P, "<<< RLCREATE qid %x.%llx.%x iounit %x\n",
1281 qid->type, 1280 qid->type,
1282 (unsigned long long)qid->path, 1281 (unsigned long long)qid->path,
1283 qid->version, iounit); 1282 qid->version, iounit);
@@ -1301,7 +1300,7 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
1301 struct p9_qid qid; 1300 struct p9_qid qid;
1302 int iounit; 1301 int iounit;
1303 1302
1304 P9_DPRINTK(P9_DEBUG_9P, ">>> TCREATE fid %d name %s perm %d mode %d\n", 1303 p9_debug(P9_DEBUG_9P, ">>> TCREATE fid %d name %s perm %d mode %d\n",
1305 fid->fid, name, perm, mode); 1304 fid->fid, name, perm, mode);
1306 err = 0; 1305 err = 0;
1307 clnt = fid->clnt; 1306 clnt = fid->clnt;
@@ -1322,7 +1321,7 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
1322 goto free_and_error; 1321 goto free_and_error;
1323 } 1322 }
1324 1323
1325 P9_DPRINTK(P9_DEBUG_9P, "<<< RCREATE qid %x.%llx.%x iounit %x\n", 1324 p9_debug(P9_DEBUG_9P, "<<< RCREATE qid %x.%llx.%x iounit %x\n",
1326 qid.type, 1325 qid.type,
1327 (unsigned long long)qid.path, 1326 (unsigned long long)qid.path,
1328 qid.version, iounit); 1327 qid.version, iounit);
@@ -1344,7 +1343,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid,
1344 struct p9_client *clnt; 1343 struct p9_client *clnt;
1345 struct p9_req_t *req; 1344 struct p9_req_t *req;
1346 1345
1347 P9_DPRINTK(P9_DEBUG_9P, ">>> TSYMLINK dfid %d name %s symtgt %s\n", 1346 p9_debug(P9_DEBUG_9P, ">>> TSYMLINK dfid %d name %s symtgt %s\n",
1348 dfid->fid, name, symtgt); 1347 dfid->fid, name, symtgt);
1349 clnt = dfid->clnt; 1348 clnt = dfid->clnt;
1350 1349
@@ -1361,7 +1360,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid,
1361 goto free_and_error; 1360 goto free_and_error;
1362 } 1361 }
1363 1362
1364 P9_DPRINTK(P9_DEBUG_9P, "<<< RSYMLINK qid %x.%llx.%x\n", 1363 p9_debug(P9_DEBUG_9P, "<<< RSYMLINK qid %x.%llx.%x\n",
1365 qid->type, (unsigned long long)qid->path, qid->version); 1364 qid->type, (unsigned long long)qid->path, qid->version);
1366 1365
1367free_and_error: 1366free_and_error:
@@ -1376,7 +1375,7 @@ int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname)
1376 struct p9_client *clnt; 1375 struct p9_client *clnt;
1377 struct p9_req_t *req; 1376 struct p9_req_t *req;
1378 1377
1379 P9_DPRINTK(P9_DEBUG_9P, ">>> TLINK dfid %d oldfid %d newname %s\n", 1378 p9_debug(P9_DEBUG_9P, ">>> TLINK dfid %d oldfid %d newname %s\n",
1380 dfid->fid, oldfid->fid, newname); 1379 dfid->fid, oldfid->fid, newname);
1381 clnt = dfid->clnt; 1380 clnt = dfid->clnt;
1382 req = p9_client_rpc(clnt, P9_TLINK, "dds", dfid->fid, oldfid->fid, 1381 req = p9_client_rpc(clnt, P9_TLINK, "dds", dfid->fid, oldfid->fid,
@@ -1384,7 +1383,7 @@ int p9_client_link(struct p9_fid *dfid, struct p9_fid *oldfid, char *newname)
1384 if (IS_ERR(req)) 1383 if (IS_ERR(req))
1385 return PTR_ERR(req); 1384 return PTR_ERR(req);
1386 1385
1387 P9_DPRINTK(P9_DEBUG_9P, "<<< RLINK\n"); 1386 p9_debug(P9_DEBUG_9P, "<<< RLINK\n");
1388 p9_free_req(clnt, req); 1387 p9_free_req(clnt, req);
1389 return 0; 1388 return 0;
1390} 1389}
@@ -1396,7 +1395,7 @@ int p9_client_fsync(struct p9_fid *fid, int datasync)
1396 struct p9_client *clnt; 1395 struct p9_client *clnt;
1397 struct p9_req_t *req; 1396 struct p9_req_t *req;
1398 1397
1399 P9_DPRINTK(P9_DEBUG_9P, ">>> TFSYNC fid %d datasync:%d\n", 1398 p9_debug(P9_DEBUG_9P, ">>> TFSYNC fid %d datasync:%d\n",
1400 fid->fid, datasync); 1399 fid->fid, datasync);
1401 err = 0; 1400 err = 0;
1402 clnt = fid->clnt; 1401 clnt = fid->clnt;
@@ -1407,7 +1406,7 @@ int p9_client_fsync(struct p9_fid *fid, int datasync)
1407 goto error; 1406 goto error;
1408 } 1407 }
1409 1408
1410 P9_DPRINTK(P9_DEBUG_9P, "<<< RFSYNC fid %d\n", fid->fid); 1409 p9_debug(P9_DEBUG_9P, "<<< RFSYNC fid %d\n", fid->fid);
1411 1410
1412 p9_free_req(clnt, req); 1411 p9_free_req(clnt, req);
1413 1412
@@ -1423,12 +1422,13 @@ int p9_client_clunk(struct p9_fid *fid)
1423 struct p9_req_t *req; 1422 struct p9_req_t *req;
1424 1423
1425 if (!fid) { 1424 if (!fid) {
1426 P9_EPRINTK(KERN_WARNING, "Trying to clunk with NULL fid\n"); 1425 pr_warn("%s (%d): Trying to clunk with NULL fid\n",
1426 __func__, task_pid_nr(current));
1427 dump_stack(); 1427 dump_stack();
1428 return 0; 1428 return 0;
1429 } 1429 }
1430 1430
1431 P9_DPRINTK(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid); 1431 p9_debug(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid);
1432 err = 0; 1432 err = 0;
1433 clnt = fid->clnt; 1433 clnt = fid->clnt;
1434 1434
@@ -1438,7 +1438,7 @@ int p9_client_clunk(struct p9_fid *fid)
1438 goto error; 1438 goto error;
1439 } 1439 }
1440 1440
1441 P9_DPRINTK(P9_DEBUG_9P, "<<< RCLUNK fid %d\n", fid->fid); 1441 p9_debug(P9_DEBUG_9P, "<<< RCLUNK fid %d\n", fid->fid);
1442 1442
1443 p9_free_req(clnt, req); 1443 p9_free_req(clnt, req);
1444error: 1444error:
@@ -1456,7 +1456,7 @@ int p9_client_remove(struct p9_fid *fid)
1456 struct p9_client *clnt; 1456 struct p9_client *clnt;
1457 struct p9_req_t *req; 1457 struct p9_req_t *req;
1458 1458
1459 P9_DPRINTK(P9_DEBUG_9P, ">>> TREMOVE fid %d\n", fid->fid); 1459 p9_debug(P9_DEBUG_9P, ">>> TREMOVE fid %d\n", fid->fid);
1460 err = 0; 1460 err = 0;
1461 clnt = fid->clnt; 1461 clnt = fid->clnt;
1462 1462
@@ -1466,7 +1466,7 @@ int p9_client_remove(struct p9_fid *fid)
1466 goto error; 1466 goto error;
1467 } 1467 }
1468 1468
1469 P9_DPRINTK(P9_DEBUG_9P, "<<< RREMOVE fid %d\n", fid->fid); 1469 p9_debug(P9_DEBUG_9P, "<<< RREMOVE fid %d\n", fid->fid);
1470 1470
1471 p9_free_req(clnt, req); 1471 p9_free_req(clnt, req);
1472error: 1472error:
@@ -1481,7 +1481,7 @@ int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags)
1481 struct p9_req_t *req; 1481 struct p9_req_t *req;
1482 struct p9_client *clnt; 1482 struct p9_client *clnt;
1483 1483
1484 P9_DPRINTK(P9_DEBUG_9P, ">>> TUNLINKAT fid %d %s %d\n", 1484 p9_debug(P9_DEBUG_9P, ">>> TUNLINKAT fid %d %s %d\n",
1485 dfid->fid, name, flags); 1485 dfid->fid, name, flags);
1486 1486
1487 clnt = dfid->clnt; 1487 clnt = dfid->clnt;
@@ -1490,7 +1490,7 @@ int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags)
1490 err = PTR_ERR(req); 1490 err = PTR_ERR(req);
1491 goto error; 1491 goto error;
1492 } 1492 }
1493 P9_DPRINTK(P9_DEBUG_9P, "<<< RUNLINKAT fid %d %s\n", dfid->fid, name); 1493 p9_debug(P9_DEBUG_9P, "<<< RUNLINKAT fid %d %s\n", dfid->fid, name);
1494 1494
1495 p9_free_req(clnt, req); 1495 p9_free_req(clnt, req);
1496error: 1496error:
@@ -1509,7 +1509,7 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
1509 int err, rsize, non_zc = 0; 1509 int err, rsize, non_zc = 0;
1510 1510
1511 1511
1512 P9_DPRINTK(P9_DEBUG_9P, ">>> TREAD fid %d offset %llu %d\n", 1512 p9_debug(P9_DEBUG_9P, ">>> TREAD fid %d offset %llu %d\n",
1513 fid->fid, (long long unsigned) offset, count); 1513 fid->fid, (long long unsigned) offset, count);
1514 err = 0; 1514 err = 0;
1515 clnt = fid->clnt; 1515 clnt = fid->clnt;
@@ -1552,7 +1552,7 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
1552 goto free_and_error; 1552 goto free_and_error;
1553 } 1553 }
1554 1554
1555 P9_DPRINTK(P9_DEBUG_9P, "<<< RREAD count %d\n", count); 1555 p9_debug(P9_DEBUG_9P, "<<< RREAD count %d\n", count);
1556 1556
1557 if (non_zc) { 1557 if (non_zc) {
1558 if (data) { 1558 if (data) {
@@ -1584,7 +1584,7 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
1584 struct p9_client *clnt; 1584 struct p9_client *clnt;
1585 struct p9_req_t *req; 1585 struct p9_req_t *req;
1586 1586
1587 P9_DPRINTK(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %d\n", 1587 p9_debug(P9_DEBUG_9P, ">>> TWRITE fid %d offset %llu count %d\n",
1588 fid->fid, (long long unsigned) offset, count); 1588 fid->fid, (long long unsigned) offset, count);
1589 err = 0; 1589 err = 0;
1590 clnt = fid->clnt; 1590 clnt = fid->clnt;
@@ -1626,7 +1626,7 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
1626 goto free_and_error; 1626 goto free_and_error;
1627 } 1627 }
1628 1628
1629 P9_DPRINTK(P9_DEBUG_9P, "<<< RWRITE count %d\n", count); 1629 p9_debug(P9_DEBUG_9P, "<<< RWRITE count %d\n", count);
1630 1630
1631 p9_free_req(clnt, req); 1631 p9_free_req(clnt, req);
1632 return count; 1632 return count;
@@ -1646,7 +1646,7 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1646 struct p9_req_t *req; 1646 struct p9_req_t *req;
1647 u16 ignored; 1647 u16 ignored;
1648 1648
1649 P9_DPRINTK(P9_DEBUG_9P, ">>> TSTAT fid %d\n", fid->fid); 1649 p9_debug(P9_DEBUG_9P, ">>> TSTAT fid %d\n", fid->fid);
1650 1650
1651 if (!ret) 1651 if (!ret)
1652 return ERR_PTR(-ENOMEM); 1652 return ERR_PTR(-ENOMEM);
@@ -1667,7 +1667,7 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1667 goto error; 1667 goto error;
1668 } 1668 }
1669 1669
1670 P9_DPRINTK(P9_DEBUG_9P, 1670 p9_debug(P9_DEBUG_9P,
1671 "<<< RSTAT sz=%x type=%x dev=%x qid=%x.%llx.%x\n" 1671 "<<< RSTAT sz=%x type=%x dev=%x qid=%x.%llx.%x\n"
1672 "<<< mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n" 1672 "<<< mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n"
1673 "<<< name=%s uid=%s gid=%s muid=%s extension=(%s)\n" 1673 "<<< name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
@@ -1696,7 +1696,7 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid,
1696 GFP_KERNEL); 1696 GFP_KERNEL);
1697 struct p9_req_t *req; 1697 struct p9_req_t *req;
1698 1698
1699 P9_DPRINTK(P9_DEBUG_9P, ">>> TGETATTR fid %d, request_mask %lld\n", 1699 p9_debug(P9_DEBUG_9P, ">>> TGETATTR fid %d, request_mask %lld\n",
1700 fid->fid, request_mask); 1700 fid->fid, request_mask);
1701 1701
1702 if (!ret) 1702 if (!ret)
@@ -1718,7 +1718,7 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid,
1718 goto error; 1718 goto error;
1719 } 1719 }
1720 1720
1721 P9_DPRINTK(P9_DEBUG_9P, 1721 p9_debug(P9_DEBUG_9P,
1722 "<<< RGETATTR st_result_mask=%lld\n" 1722 "<<< RGETATTR st_result_mask=%lld\n"
1723 "<<< qid=%x.%llx.%x\n" 1723 "<<< qid=%x.%llx.%x\n"
1724 "<<< st_mode=%8.8x st_nlink=%llu\n" 1724 "<<< st_mode=%8.8x st_nlink=%llu\n"
@@ -1784,8 +1784,8 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst)
1784 err = 0; 1784 err = 0;
1785 clnt = fid->clnt; 1785 clnt = fid->clnt;
1786 wst->size = p9_client_statsize(wst, clnt->proto_version); 1786 wst->size = p9_client_statsize(wst, clnt->proto_version);
1787 P9_DPRINTK(P9_DEBUG_9P, ">>> TWSTAT fid %d\n", fid->fid); 1787 p9_debug(P9_DEBUG_9P, ">>> TWSTAT fid %d\n", fid->fid);
1788 P9_DPRINTK(P9_DEBUG_9P, 1788 p9_debug(P9_DEBUG_9P,
1789 " sz=%x type=%x dev=%x qid=%x.%llx.%x\n" 1789 " sz=%x type=%x dev=%x qid=%x.%llx.%x\n"
1790 " mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n" 1790 " mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n"
1791 " name=%s uid=%s gid=%s muid=%s extension=(%s)\n" 1791 " name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
@@ -1802,7 +1802,7 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst)
1802 goto error; 1802 goto error;
1803 } 1803 }
1804 1804
1805 P9_DPRINTK(P9_DEBUG_9P, "<<< RWSTAT fid %d\n", fid->fid); 1805 p9_debug(P9_DEBUG_9P, "<<< RWSTAT fid %d\n", fid->fid);
1806 1806
1807 p9_free_req(clnt, req); 1807 p9_free_req(clnt, req);
1808error: 1808error:
@@ -1818,8 +1818,8 @@ int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *p9attr)
1818 1818
1819 err = 0; 1819 err = 0;
1820 clnt = fid->clnt; 1820 clnt = fid->clnt;
1821 P9_DPRINTK(P9_DEBUG_9P, ">>> TSETATTR fid %d\n", fid->fid); 1821 p9_debug(P9_DEBUG_9P, ">>> TSETATTR fid %d\n", fid->fid);
1822 P9_DPRINTK(P9_DEBUG_9P, 1822 p9_debug(P9_DEBUG_9P,
1823 " valid=%x mode=%x uid=%d gid=%d size=%lld\n" 1823 " valid=%x mode=%x uid=%d gid=%d size=%lld\n"
1824 " atime_sec=%lld atime_nsec=%lld\n" 1824 " atime_sec=%lld atime_nsec=%lld\n"
1825 " mtime_sec=%lld mtime_nsec=%lld\n", 1825 " mtime_sec=%lld mtime_nsec=%lld\n",
@@ -1833,7 +1833,7 @@ int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *p9attr)
1833 err = PTR_ERR(req); 1833 err = PTR_ERR(req);
1834 goto error; 1834 goto error;
1835 } 1835 }
1836 P9_DPRINTK(P9_DEBUG_9P, "<<< RSETATTR fid %d\n", fid->fid); 1836 p9_debug(P9_DEBUG_9P, "<<< RSETATTR fid %d\n", fid->fid);
1837 p9_free_req(clnt, req); 1837 p9_free_req(clnt, req);
1838error: 1838error:
1839 return err; 1839 return err;
@@ -1849,7 +1849,7 @@ int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb)
1849 err = 0; 1849 err = 0;
1850 clnt = fid->clnt; 1850 clnt = fid->clnt;
1851 1851
1852 P9_DPRINTK(P9_DEBUG_9P, ">>> TSTATFS fid %d\n", fid->fid); 1852 p9_debug(P9_DEBUG_9P, ">>> TSTATFS fid %d\n", fid->fid);
1853 1853
1854 req = p9_client_rpc(clnt, P9_TSTATFS, "d", fid->fid); 1854 req = p9_client_rpc(clnt, P9_TSTATFS, "d", fid->fid);
1855 if (IS_ERR(req)) { 1855 if (IS_ERR(req)) {
@@ -1866,7 +1866,7 @@ int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb)
1866 goto error; 1866 goto error;
1867 } 1867 }
1868 1868
1869 P9_DPRINTK(P9_DEBUG_9P, "<<< RSTATFS fid %d type 0x%lx bsize %ld " 1869 p9_debug(P9_DEBUG_9P, "<<< RSTATFS fid %d type 0x%lx bsize %ld "
1870 "blocks %llu bfree %llu bavail %llu files %llu ffree %llu " 1870 "blocks %llu bfree %llu bavail %llu files %llu ffree %llu "
1871 "fsid %llu namelen %ld\n", 1871 "fsid %llu namelen %ld\n",
1872 fid->fid, (long unsigned int)sb->type, (long int)sb->bsize, 1872 fid->fid, (long unsigned int)sb->type, (long int)sb->bsize,
@@ -1889,7 +1889,7 @@ int p9_client_rename(struct p9_fid *fid,
1889 err = 0; 1889 err = 0;
1890 clnt = fid->clnt; 1890 clnt = fid->clnt;
1891 1891
1892 P9_DPRINTK(P9_DEBUG_9P, ">>> TRENAME fid %d newdirfid %d name %s\n", 1892 p9_debug(P9_DEBUG_9P, ">>> TRENAME fid %d newdirfid %d name %s\n",
1893 fid->fid, newdirfid->fid, name); 1893 fid->fid, newdirfid->fid, name);
1894 1894
1895 req = p9_client_rpc(clnt, P9_TRENAME, "dds", fid->fid, 1895 req = p9_client_rpc(clnt, P9_TRENAME, "dds", fid->fid,
@@ -1899,7 +1899,7 @@ int p9_client_rename(struct p9_fid *fid,
1899 goto error; 1899 goto error;
1900 } 1900 }
1901 1901
1902 P9_DPRINTK(P9_DEBUG_9P, "<<< RRENAME fid %d\n", fid->fid); 1902 p9_debug(P9_DEBUG_9P, "<<< RRENAME fid %d\n", fid->fid);
1903 1903
1904 p9_free_req(clnt, req); 1904 p9_free_req(clnt, req);
1905error: 1905error:
@@ -1917,7 +1917,7 @@ int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
1917 err = 0; 1917 err = 0;
1918 clnt = olddirfid->clnt; 1918 clnt = olddirfid->clnt;
1919 1919
1920 P9_DPRINTK(P9_DEBUG_9P, ">>> TRENAMEAT olddirfid %d old name %s" 1920 p9_debug(P9_DEBUG_9P, ">>> TRENAMEAT olddirfid %d old name %s"
1921 " newdirfid %d new name %s\n", olddirfid->fid, old_name, 1921 " newdirfid %d new name %s\n", olddirfid->fid, old_name,
1922 newdirfid->fid, new_name); 1922 newdirfid->fid, new_name);
1923 1923
@@ -1928,7 +1928,7 @@ int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
1928 goto error; 1928 goto error;
1929 } 1929 }
1930 1930
1931 P9_DPRINTK(P9_DEBUG_9P, "<<< RRENAMEAT newdirfid %d new name %s\n", 1931 p9_debug(P9_DEBUG_9P, "<<< RRENAMEAT newdirfid %d new name %s\n",
1932 newdirfid->fid, new_name); 1932 newdirfid->fid, new_name);
1933 1933
1934 p9_free_req(clnt, req); 1934 p9_free_req(clnt, req);
@@ -1956,7 +1956,7 @@ struct p9_fid *p9_client_xattrwalk(struct p9_fid *file_fid,
1956 attr_fid = NULL; 1956 attr_fid = NULL;
1957 goto error; 1957 goto error;
1958 } 1958 }
1959 P9_DPRINTK(P9_DEBUG_9P, 1959 p9_debug(P9_DEBUG_9P,
1960 ">>> TXATTRWALK file_fid %d, attr_fid %d name %s\n", 1960 ">>> TXATTRWALK file_fid %d, attr_fid %d name %s\n",
1961 file_fid->fid, attr_fid->fid, attr_name); 1961 file_fid->fid, attr_fid->fid, attr_name);
1962 1962
@@ -1973,7 +1973,7 @@ struct p9_fid *p9_client_xattrwalk(struct p9_fid *file_fid,
1973 goto clunk_fid; 1973 goto clunk_fid;
1974 } 1974 }
1975 p9_free_req(clnt, req); 1975 p9_free_req(clnt, req);
1976 P9_DPRINTK(P9_DEBUG_9P, "<<< RXATTRWALK fid %d size %llu\n", 1976 p9_debug(P9_DEBUG_9P, "<<< RXATTRWALK fid %d size %llu\n",
1977 attr_fid->fid, *attr_size); 1977 attr_fid->fid, *attr_size);
1978 return attr_fid; 1978 return attr_fid;
1979clunk_fid: 1979clunk_fid:
@@ -1994,7 +1994,7 @@ int p9_client_xattrcreate(struct p9_fid *fid, const char *name,
1994 struct p9_req_t *req; 1994 struct p9_req_t *req;
1995 struct p9_client *clnt; 1995 struct p9_client *clnt;
1996 1996
1997 P9_DPRINTK(P9_DEBUG_9P, 1997 p9_debug(P9_DEBUG_9P,
1998 ">>> TXATTRCREATE fid %d name %s size %lld flag %d\n", 1998 ">>> TXATTRCREATE fid %d name %s size %lld flag %d\n",
1999 fid->fid, name, (long long)attr_size, flags); 1999 fid->fid, name, (long long)attr_size, flags);
2000 err = 0; 2000 err = 0;
@@ -2005,7 +2005,7 @@ int p9_client_xattrcreate(struct p9_fid *fid, const char *name,
2005 err = PTR_ERR(req); 2005 err = PTR_ERR(req);
2006 goto error; 2006 goto error;
2007 } 2007 }
2008 P9_DPRINTK(P9_DEBUG_9P, "<<< RXATTRCREATE fid %d\n", fid->fid); 2008 p9_debug(P9_DEBUG_9P, "<<< RXATTRCREATE fid %d\n", fid->fid);
2009 p9_free_req(clnt, req); 2009 p9_free_req(clnt, req);
2010error: 2010error:
2011 return err; 2011 return err;
@@ -2019,7 +2019,7 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
2019 struct p9_req_t *req; 2019 struct p9_req_t *req;
2020 char *dataptr; 2020 char *dataptr;
2021 2021
2022 P9_DPRINTK(P9_DEBUG_9P, ">>> TREADDIR fid %d offset %llu count %d\n", 2022 p9_debug(P9_DEBUG_9P, ">>> TREADDIR fid %d offset %llu count %d\n",
2023 fid->fid, (long long unsigned) offset, count); 2023 fid->fid, (long long unsigned) offset, count);
2024 2024
2025 err = 0; 2025 err = 0;
@@ -2056,7 +2056,7 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
2056 goto free_and_error; 2056 goto free_and_error;
2057 } 2057 }
2058 2058
2059 P9_DPRINTK(P9_DEBUG_9P, "<<< RREADDIR count %d\n", count); 2059 p9_debug(P9_DEBUG_9P, "<<< RREADDIR count %d\n", count);
2060 2060
2061 if (non_zc) 2061 if (non_zc)
2062 memmove(data, dataptr, count); 2062 memmove(data, dataptr, count);
@@ -2080,7 +2080,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
2080 2080
2081 err = 0; 2081 err = 0;
2082 clnt = fid->clnt; 2082 clnt = fid->clnt;
2083 P9_DPRINTK(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d " 2083 p9_debug(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d "
2084 "minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev)); 2084 "minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev));
2085 req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddd", fid->fid, name, mode, 2085 req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddd", fid->fid, name, mode,
2086 MAJOR(rdev), MINOR(rdev), gid); 2086 MAJOR(rdev), MINOR(rdev), gid);
@@ -2092,7 +2092,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
2092 trace_9p_protocol_dump(clnt, req->rc); 2092 trace_9p_protocol_dump(clnt, req->rc);
2093 goto error; 2093 goto error;
2094 } 2094 }
2095 P9_DPRINTK(P9_DEBUG_9P, "<<< RMKNOD qid %x.%llx.%x\n", qid->type, 2095 p9_debug(P9_DEBUG_9P, "<<< RMKNOD qid %x.%llx.%x\n", qid->type,
2096 (unsigned long long)qid->path, qid->version); 2096 (unsigned long long)qid->path, qid->version);
2097 2097
2098error: 2098error:
@@ -2111,7 +2111,7 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
2111 2111
2112 err = 0; 2112 err = 0;
2113 clnt = fid->clnt; 2113 clnt = fid->clnt;
2114 P9_DPRINTK(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n", 2114 p9_debug(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n",
2115 fid->fid, name, mode, gid); 2115 fid->fid, name, mode, gid);
2116 req = p9_client_rpc(clnt, P9_TMKDIR, "dsdd", fid->fid, name, mode, 2116 req = p9_client_rpc(clnt, P9_TMKDIR, "dsdd", fid->fid, name, mode,
2117 gid); 2117 gid);
@@ -2123,7 +2123,7 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
2123 trace_9p_protocol_dump(clnt, req->rc); 2123 trace_9p_protocol_dump(clnt, req->rc);
2124 goto error; 2124 goto error;
2125 } 2125 }
2126 P9_DPRINTK(P9_DEBUG_9P, "<<< RMKDIR qid %x.%llx.%x\n", qid->type, 2126 p9_debug(P9_DEBUG_9P, "<<< RMKDIR qid %x.%llx.%x\n", qid->type,
2127 (unsigned long long)qid->path, qid->version); 2127 (unsigned long long)qid->path, qid->version);
2128 2128
2129error: 2129error:
@@ -2141,7 +2141,7 @@ int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status)
2141 2141
2142 err = 0; 2142 err = 0;
2143 clnt = fid->clnt; 2143 clnt = fid->clnt;
2144 P9_DPRINTK(P9_DEBUG_9P, ">>> TLOCK fid %d type %i flags %d " 2144 p9_debug(P9_DEBUG_9P, ">>> TLOCK fid %d type %i flags %d "
2145 "start %lld length %lld proc_id %d client_id %s\n", 2145 "start %lld length %lld proc_id %d client_id %s\n",
2146 fid->fid, flock->type, flock->flags, flock->start, 2146 fid->fid, flock->type, flock->flags, flock->start,
2147 flock->length, flock->proc_id, flock->client_id); 2147 flock->length, flock->proc_id, flock->client_id);
@@ -2158,7 +2158,7 @@ int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status)
2158 trace_9p_protocol_dump(clnt, req->rc); 2158 trace_9p_protocol_dump(clnt, req->rc);
2159 goto error; 2159 goto error;
2160 } 2160 }
2161 P9_DPRINTK(P9_DEBUG_9P, "<<< RLOCK status %i\n", *status); 2161 p9_debug(P9_DEBUG_9P, "<<< RLOCK status %i\n", *status);
2162error: 2162error:
2163 p9_free_req(clnt, req); 2163 p9_free_req(clnt, req);
2164 return err; 2164 return err;
@@ -2174,7 +2174,7 @@ int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *glock)
2174 2174
2175 err = 0; 2175 err = 0;
2176 clnt = fid->clnt; 2176 clnt = fid->clnt;
2177 P9_DPRINTK(P9_DEBUG_9P, ">>> TGETLOCK fid %d, type %i start %lld " 2177 p9_debug(P9_DEBUG_9P, ">>> TGETLOCK fid %d, type %i start %lld "
2178 "length %lld proc_id %d client_id %s\n", fid->fid, glock->type, 2178 "length %lld proc_id %d client_id %s\n", fid->fid, glock->type,
2179 glock->start, glock->length, glock->proc_id, glock->client_id); 2179 glock->start, glock->length, glock->proc_id, glock->client_id);
2180 2180
@@ -2191,7 +2191,7 @@ int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *glock)
2191 trace_9p_protocol_dump(clnt, req->rc); 2191 trace_9p_protocol_dump(clnt, req->rc);
2192 goto error; 2192 goto error;
2193 } 2193 }
2194 P9_DPRINTK(P9_DEBUG_9P, "<<< RGETLOCK type %i start %lld length %lld " 2194 p9_debug(P9_DEBUG_9P, "<<< RGETLOCK type %i start %lld length %lld "
2195 "proc_id %d client_id %s\n", glock->type, glock->start, 2195 "proc_id %d client_id %s\n", glock->type, glock->start,
2196 glock->length, glock->proc_id, glock->client_id); 2196 glock->length, glock->proc_id, glock->client_id);
2197error: 2197error:
@@ -2208,7 +2208,7 @@ int p9_client_readlink(struct p9_fid *fid, char **target)
2208 2208
2209 err = 0; 2209 err = 0;
2210 clnt = fid->clnt; 2210 clnt = fid->clnt;
2211 P9_DPRINTK(P9_DEBUG_9P, ">>> TREADLINK fid %d\n", fid->fid); 2211 p9_debug(P9_DEBUG_9P, ">>> TREADLINK fid %d\n", fid->fid);
2212 2212
2213 req = p9_client_rpc(clnt, P9_TREADLINK, "d", fid->fid); 2213 req = p9_client_rpc(clnt, P9_TREADLINK, "d", fid->fid);
2214 if (IS_ERR(req)) 2214 if (IS_ERR(req))
@@ -2219,7 +2219,7 @@ int p9_client_readlink(struct p9_fid *fid, char **target)
2219 trace_9p_protocol_dump(clnt, req->rc); 2219 trace_9p_protocol_dump(clnt, req->rc);
2220 goto error; 2220 goto error;
2221 } 2221 }
2222 P9_DPRINTK(P9_DEBUG_9P, "<<< RREADLINK target %s\n", *target); 2222 p9_debug(P9_DEBUG_9P, "<<< RREADLINK target %s\n", *target);
2223error: 2223error:
2224 p9_free_req(clnt, req); 2224 p9_free_req(clnt, req);
2225 return err; 2225 return err;