diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-01-29 04:05:59 +0300 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-15 17:57:35 +0300 |
commit | bb2f8a55153ec58e66a496224504ac9be919c8f1 (patch) | |
tree | 25a0d7b4d74b42ca6389fa8f4c41c9378ccd75de /net/9p/protocol.c | |
parent | 6f69c395cefb26ebba2c9bb725296a3a4a9200ec (diff) | |
download | linux-bb2f8a55153ec58e66a496224504ac9be919c8f1.tar.xz |
[net/9p] Read side zerocopy changes for 9P2000.L protocol.
Modify p9_client_read() to check the transport preference and act accordingly.
If the preference is P9_TRANS_PREF_PAYLOAD_SEP, send the payload
separately instead of putting it directly on PDU.
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/protocol.c')
-rw-r--r-- | net/9p/protocol.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c index 5936c50d0c93..7bca2421bfc8 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c @@ -114,6 +114,17 @@ pdu_write_u(struct p9_fcall *pdu, const char __user *udata, size_t size) return size - len; } +static size_t +pdu_write_urw(struct p9_fcall *pdu, const char *kdata, const char __user *udata, + size_t size) +{ + BUG_ON(pdu->size > P9_IOHDRSZ); + pdu->pubuf = (char __user *)udata; + pdu->pkbuf = (char *)kdata; + pdu->pbuf_size = size; + return 0; +} + /* b - int8_t w - int16_t @@ -445,6 +456,16 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt, errcode = -EFAULT; } break; + case 'E':{ + int32_t cnt = va_arg(ap, int32_t); + const char *k = va_arg(ap, const void *); + const char *u = va_arg(ap, const void *); + errcode = p9pdu_writef(pdu, proto_version, "d", + cnt); + if (!errcode && pdu_write_urw(pdu, k, u, cnt)) + errcode = -EFAULT; + } + break; case 'U':{ int32_t count = va_arg(ap, int32_t); const char __user *udata = |