Commit b4d0b08a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
  9p: fix sparse warnings
  9p: rdma: RDMA Transport Support for 9P
  9p: fix format warning
  9p: fix debug build error
parents 33217379 e45c5405
...@@ -178,7 +178,7 @@ v9fs_file_read(struct file *filp, char __user *udata, size_t count, ...@@ -178,7 +178,7 @@ v9fs_file_read(struct file *filp, char __user *udata, size_t count,
int ret; int ret;
struct p9_fid *fid; struct p9_fid *fid;
P9_DPRINTK(P9_DEBUG_VFS, "count %d offset %lld\n", count, *offset); P9_DPRINTK(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset);
fid = filp->private_data; fid = filp->private_data;
if (count > (fid->clnt->msize - P9_IOHDRSZ)) if (count > (fid->clnt->msize - P9_IOHDRSZ))
......
...@@ -56,9 +56,9 @@ enum p9_debug_flags { ...@@ -56,9 +56,9 @@ enum p9_debug_flags {
P9_DEBUG_PKT = (1<<10), P9_DEBUG_PKT = (1<<10),
}; };
#ifdef CONFIG_NET_9P_DEBUG
extern unsigned int p9_debug_level; extern unsigned int p9_debug_level;
#ifdef CONFIG_NET_9P_DEBUG
#define P9_DPRINTK(level, format, arg...) \ #define P9_DPRINTK(level, format, arg...) \
do { \ do { \
if ((p9_debug_level & level) == level) {\ if ((p9_debug_level & level) == level) {\
......
...@@ -182,6 +182,7 @@ struct p9_fid { ...@@ -182,6 +182,7 @@ struct p9_fid {
struct list_head dlist; /* list of all fids attached to a dentry */ struct list_head dlist; /* list of all fids attached to a dentry */
}; };
int p9_client_version(struct p9_client *);
struct p9_client *p9_client_create(const char *dev_name, char *options); struct p9_client *p9_client_create(const char *dev_name, char *options);
void p9_client_destroy(struct p9_client *clnt); void p9_client_destroy(struct p9_client *clnt);
void p9_client_disconnect(struct p9_client *clnt); void p9_client_disconnect(struct p9_client *clnt);
...@@ -206,6 +207,7 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst); ...@@ -206,6 +207,7 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst);
struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
void p9_client_cb(struct p9_client *c, struct p9_req_t *req); void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int);
int p9stat_read(char *, int, struct p9_wstat *, int); int p9stat_read(char *, int, struct p9_wstat *, int);
void p9stat_free(struct p9_wstat *); void p9stat_free(struct p9_wstat *);
......
...@@ -20,6 +20,12 @@ config NET_9P_VIRTIO ...@@ -20,6 +20,12 @@ config NET_9P_VIRTIO
This builds support for a transports between This builds support for a transports between
guest partitions and a host partition. guest partitions and a host partition.
config NET_9P_RDMA
depends on NET_9P && INFINIBAND && EXPERIMENTAL
tristate "9P RDMA Transport (Experimental)"
help
This builds support for a RDMA transport.
config NET_9P_DEBUG config NET_9P_DEBUG
bool "Debug information" bool "Debug information"
depends on NET_9P depends on NET_9P
......
obj-$(CONFIG_NET_9P) := 9pnet.o obj-$(CONFIG_NET_9P) := 9pnet.o
obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o
obj-$(CONFIG_NET_9P_RDMA) += 9pnet_rdma.o
9pnet-objs := \ 9pnet-objs := \
mod.o \ mod.o \
...@@ -11,3 +12,6 @@ obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o ...@@ -11,3 +12,6 @@ obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o
9pnet_virtio-objs := \ 9pnet_virtio-objs := \
trans_virtio.o \ trans_virtio.o \
9pnet_rdma-objs := \
trans_rdma.o \
...@@ -159,6 +159,7 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag) ...@@ -159,6 +159,7 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag)
if (!c->reqs[row]) { if (!c->reqs[row]) {
printk(KERN_ERR "Couldn't grow tag array\n"); printk(KERN_ERR "Couldn't grow tag array\n");
spin_unlock_irqrestore(&c->lock, flags);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
for (col = 0; col < P9_ROW_MAXTAG; col++) { for (col = 0; col < P9_ROW_MAXTAG; col++) {
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
static int static int
p9pdu_writef(struct p9_fcall *pdu, int optional, const char *fmt, ...); p9pdu_writef(struct p9_fcall *pdu, int optional, const char *fmt, ...);
#ifdef CONFIG_NET_9P_DEBUG
void void
p9pdu_dump(int way, struct p9_fcall *pdu) p9pdu_dump(int way, struct p9_fcall *pdu)
{ {
...@@ -81,6 +82,12 @@ p9pdu_dump(int way, struct p9_fcall *pdu) ...@@ -81,6 +82,12 @@ p9pdu_dump(int way, struct p9_fcall *pdu)
else else
P9_DPRINTK(P9_DEBUG_PKT, "]]](%d) %s\n", datalen, buf); P9_DPRINTK(P9_DEBUG_PKT, "]]](%d) %s\n", datalen, buf);
} }
#else
void
p9pdu_dump(int way, struct p9_fcall *pdu)
{
}
#endif
EXPORT_SYMBOL(p9pdu_dump); EXPORT_SYMBOL(p9pdu_dump);
void p9stat_free(struct p9_wstat *stbuf) void p9stat_free(struct p9_wstat *stbuf)
...@@ -179,7 +186,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) ...@@ -179,7 +186,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
} }
break; break;
case 's':{ case 's':{
char **ptr = va_arg(ap, char **); char **sptr = va_arg(ap, char **);
int16_t len; int16_t len;
int size; int size;
...@@ -189,17 +196,17 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) ...@@ -189,17 +196,17 @@ p9pdu_vreadf(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
size = MAX(len, 0); size = MAX(len, 0);
*ptr = kmalloc(size + 1, GFP_KERNEL); *sptr = kmalloc(size + 1, GFP_KERNEL);
if (*ptr == NULL) { if (*sptr == NULL) {
errcode = -EFAULT; errcode = -EFAULT;
break; break;
} }
if (pdu_read(pdu, *ptr, size)) { if (pdu_read(pdu, *sptr, size)) {
errcode = -EFAULT; errcode = -EFAULT;
kfree(*ptr); kfree(*sptr);
*ptr = NULL; *sptr = NULL;
} else } else
(*ptr)[size] = 0; (*sptr)[size] = 0;
} }
break; break;
case 'Q':{ case 'Q':{
...@@ -373,13 +380,13 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) ...@@ -373,13 +380,13 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
} }
break; break;
case 's':{ case 's':{
const char *ptr = va_arg(ap, const char *); const char *sptr = va_arg(ap, const char *);
int16_t len = 0; int16_t len = 0;
if (ptr) if (sptr)
len = MIN(strlen(ptr), USHORT_MAX); len = MIN(strlen(sptr), USHORT_MAX);
errcode = p9pdu_writef(pdu, optional, "w", len); errcode = p9pdu_writef(pdu, optional, "w", len);
if (!errcode && pdu_write(pdu, ptr, len)) if (!errcode && pdu_write(pdu, sptr, len))
errcode = -EFAULT; errcode = -EFAULT;
} }
break; break;
...@@ -419,7 +426,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap) ...@@ -419,7 +426,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int optional, const char *fmt, va_list ap)
case 'U':{ case 'U':{
int32_t count = va_arg(ap, int32_t); int32_t count = va_arg(ap, int32_t);
const char __user *udata = const char __user *udata =
va_arg(ap, const void *); va_arg(ap, const void __user *);
errcode = errcode =
p9pdu_writef(pdu, optional, "d", count); p9pdu_writef(pdu, optional, "d", count);
if (!errcode && pdu_write_u(pdu, udata, count)) if (!errcode && pdu_write_u(pdu, udata, count))
...@@ -542,8 +549,10 @@ int p9pdu_finalize(struct p9_fcall *pdu) ...@@ -542,8 +549,10 @@ int p9pdu_finalize(struct p9_fcall *pdu)
err = p9pdu_writef(pdu, 0, "d", size); err = p9pdu_writef(pdu, 0, "d", size);
pdu->size = size; pdu->size = size;
#ifdef CONFIG_NET_9P_DEBUG
if ((p9_debug_level & P9_DEBUG_PKT) == P9_DEBUG_PKT) if ((p9_debug_level & P9_DEBUG_PKT) == P9_DEBUG_PKT)
p9pdu_dump(0, pdu); p9pdu_dump(0, pdu);
#endif
P9_DPRINTK(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n", pdu->size, P9_DPRINTK(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n", pdu->size,
pdu->id, pdu->tag); pdu->id, pdu->tag);
......
...@@ -678,11 +678,9 @@ static int p9_fd_request(struct p9_client *client, struct p9_req_t *req) ...@@ -678,11 +678,9 @@ static int p9_fd_request(struct p9_client *client, struct p9_req_t *req)
static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req) static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req)
{ {
struct p9_trans_fd *ts = client->trans;
struct p9_conn *m = ts->conn;
int ret = 1; int ret = 1;
P9_DPRINTK(P9_DEBUG_TRANS, "mux %p req %p\n", m, req); P9_DPRINTK(P9_DEBUG_TRANS, "client %p req %p\n", client, req);
spin_lock(&client->lock); spin_lock(&client->lock);
list_del(&req->req_list); list_del(&req->req_list);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment