diff options
author | Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com> | 2011-02-13 16:23:59 -0800 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-03-15 09:57:35 -0500 |
commit | 1fc52481c2b886c445bb167dfd16ee6de6922ef7 (patch) | |
tree | 5d854af0b495441e02ef895570e3d8fac4b0a6a3 /net/9p | |
parent | bb2f8a55153ec58e66a496224504ac9be919c8f1 (diff) | |
download | kernel_samsung_smdk4412-1fc52481c2b886c445bb167dfd16ee6de6922ef7.tar.gz kernel_samsung_smdk4412-1fc52481c2b886c445bb167dfd16ee6de6922ef7.tar.bz2 kernel_samsung_smdk4412-1fc52481c2b886c445bb167dfd16ee6de6922ef7.zip |
[net/9p] Write side zerocopy changes for 9P2000.L protocol.
Modify p9_client_write() 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')
-rw-r--r-- | net/9p/client.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 82079f902f5..412c52e1de7 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1333,12 +1333,21 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata, if (count < rsize) rsize = count; - if (data) - req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid, offset, - rsize, data); - else - req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid, offset, - rsize, udata); + + /* Don't bother zerocopy form small IO (< 1024) */ + if (((clnt->trans_mod->pref & P9_TRANS_PREF_PAYLOAD_MASK) == + P9_TRANS_PREF_PAYLOAD_SEP) && (rsize > 1024)) { + req = p9_client_rpc(clnt, P9_TWRITE, "dqE", fid->fid, offset, + rsize, data, udata); + } else { + + if (data) + req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid, + offset, rsize, data); + else + req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid, + offset, rsize, udata); + } if (IS_ERR(req)) { err = PTR_ERR(req); goto error; |