pdu->id = r_type;
pdu->tag = r_tag;
- P9_DPRINTK(P9_DEBUG_MUX, "pdu: type: %d tag: %d size=%d offset=%d\n",
- pdu->id, pdu->tag, pdu->size, pdu->offset);
+ P9_DPRINTK(P9_DEBUG_9P, "<<< size=%d type: %d tag: %d\n", pdu->size,
+ pdu->id, pdu->tag);
if (type)
*type = r_type;
err = p9pdu_readf(req->rc, c->dotu, "ds", &msize, &version);
if (err) {
P9_DPRINTK(P9_DEBUG_9P, "version error %d\n", err);
+ p9pdu_dump(1, req->rc);
goto error;
}
err = p9pdu_readf(req->rc, clnt->dotu, "Q", &qid);
if (err) {
+ p9pdu_dump(1, req->rc);
p9_free_req(clnt, req);
goto error;
}
err = p9pdu_readf(req->rc, clnt->dotu, "Q", &qid);
if (err) {
+ p9pdu_dump(1, req->rc);
p9_free_req(clnt, req);
goto error;
}
}
err = p9pdu_readf(req->rc, clnt->dotu, "R", &nwqids, &wqids);
- p9_free_req(clnt, req);
- if (err)
+ if (err) {
+ p9pdu_dump(1, req->rc);
+ p9_free_req(clnt, req);
goto clunk_fid;
+ }
+ p9_free_req(clnt, req);
P9_DPRINTK(P9_DEBUG_9P, "<<< RWALK nwqid %d:\n", nwqids);
}
err = p9pdu_readf(req->rc, clnt->dotu, "Qd", &qid, &iounit);
- p9_free_req(clnt, req);
- if (err)
- goto error;
+ if (err) {
+ p9pdu_dump(1, req->rc);
+ goto free_and_error;
+ }
P9_DPRINTK(P9_DEBUG_9P, "<<< ROPEN qid %x.%llx.%x iounit %x\n",
qid.type, qid.path, qid.version, iounit);
fid->mode = mode;
fid->iounit = iounit;
+free_and_error:
+ p9_free_req(clnt, req);
error:
return err;
}
}
err = p9pdu_readf(req->rc, clnt->dotu, "Qd", &qid, &iounit);
- p9_free_req(clnt, req);
- if (err)
- goto error;
+ if (err) {
+ p9pdu_dump(1, req->rc);
+ goto free_and_error;
+ }
P9_DPRINTK(P9_DEBUG_9P, "<<< RCREATE qid %x.%llx.%x iounit %x\n",
qid.type, qid.path, qid.version, iounit);
fid->mode = mode;
fid->iounit = iounit;
+free_and_error:
+ p9_free_req(clnt, req);
error:
return err;
}
}
err = p9pdu_readf(req->rc, clnt->dotu, "D", &count, &dataptr);
- if (err)
+ if (err) {
+ p9pdu_dump(1, req->rc);
goto free_and_error;
+ }
P9_DPRINTK(P9_DEBUG_9P, "<<< RREAD count %d\n", count);
}
err = p9pdu_readf(req->rc, clnt->dotu, "d", &count);
- if (err)
+ if (err) {
+ p9pdu_dump(1, req->rc);
goto free_and_error;
+ }
+
P9_DPRINTK(P9_DEBUG_9P, "<<< RWRITE count %d\n", count);
p9_free_req(clnt, req);
}
err = p9pdu_readf(req->rc, clnt->dotu, "wS", &ignored, ret);
- p9_free_req(clnt, req);
- if (err)
- goto error;
+ if (err) {
+ ret = ERR_PTR(err);
+ p9pdu_dump(1, req->rc);
+ goto free_and_error;
+ }
P9_DPRINTK(P9_DEBUG_9P,
- "<<< RSTAT sz=%x type=%x dev=%x qid=%2.2x %4.4x %8.8llx"
- " mode=%8.8x uid=%d gid=%d size=%lld %s\n",
+ "<<< RSTAT sz=%x type=%x dev=%x qid=%x.%llx.%x\n"
+ "<<< mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n"
+ "<<< name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
+ "<<< uid=%d gid=%d n_muid=%d\n",
ret->size, ret->type, ret->dev, ret->qid.type,
- ret->qid.version, ret->qid.path, ret->mode,
- ret->n_uid, ret->n_gid, ret->length, ret->name);
+ ret->qid.path, ret->qid.version, ret->mode,
+ ret->atime, ret->mtime, ret->length, ret->name,
+ ret->uid, ret->gid, ret->muid, ret->extension,
+ ret->n_uid, ret->n_gid, ret->n_muid);
- return ret;
+free_and_error:
+ p9_free_req(clnt, req);
error:
- return ERR_PTR(err);
+ return ret;
}
EXPORT_SYMBOL(p9_client_stat);
struct p9_client *clnt;
P9_DPRINTK(P9_DEBUG_9P, ">>> TWSTAT fid %d\n", fid->fid);
+ P9_DPRINTK(P9_DEBUG_9P,
+ " sz=%x type=%x dev=%x qid=%x.%llx.%x\n"
+ " mode=%8.8x atime=%8.8x mtime=%8.8x length=%llx\n"
+ " name=%s uid=%s gid=%s muid=%s extension=(%s)\n"
+ " uid=%d gid=%d n_muid=%d\n",
+ wst->size, wst->type, wst->dev, wst->qid.type,
+ wst->qid.path, wst->qid.version, wst->mode,
+ wst->atime, wst->mtime, wst->length, wst->name,
+ wst->uid, wst->gid, wst->muid, wst->extension,
+ wst->n_uid, wst->n_gid, wst->n_muid);
err = 0;
clnt = fid->clnt;
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/uaccess.h>
+#include <linux/sched.h>
#include <net/9p/9p.h>
#include <net/9p/client.h>
#include "protocol.h"
static int
p9pdu_writef(struct p9_fcall *pdu, int optional, const char *fmt, ...);
-#define PACKET_DEBUG 0
-
void
p9pdu_dump(int way, struct p9_fcall *pdu)
{
n += scnprintf(buf + n, buflen - n, "\n");
if (way)
- printk(KERN_NOTICE "[[(%d)[ %s\n", datalen, buf);
+ P9_DPRINTK(P9_DEBUG_PKT, "[[[(%d) %s\n", datalen, buf);
else
- printk(KERN_NOTICE "]](%d)] %s\n", datalen, buf);
+ P9_DPRINTK(P9_DEBUG_PKT, "]]](%d) %s\n", datalen, buf);
}
EXPORT_SYMBOL(p9pdu_dump);
int p9stat_read(char *buf, int len, struct p9_wstat *st, int dotu)
{
struct p9_fcall fake_pdu;
+ int ret;
fake_pdu.size = len;
fake_pdu.capacity = len;
fake_pdu.sdata = buf;
fake_pdu.offset = 0;
- return p9pdu_readf(&fake_pdu, dotu, "S", st);
+ ret = p9pdu_readf(&fake_pdu, dotu, "S", st);
+ if (ret) {
+ P9_DPRINTK(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret);
+ p9pdu_dump(1, &fake_pdu);
+ }
+
+ return ret;
}
EXPORT_SYMBOL(p9stat_read);
err = p9pdu_writef(pdu, 0, "d", size);
pdu->size = size;
- if (PACKET_DEBUG)
+ if ((p9_debug_level & P9_DEBUG_PKT) == P9_DEBUG_PKT)
p9pdu_dump(0, pdu);
+ P9_DPRINTK(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n", pdu->size,
+ pdu->id, pdu->tag);
+
return err;
}