Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fc52481 authored by Venkateswararao Jujjuri (JV)'s avatar Venkateswararao Jujjuri (JV) Committed by Eric Van Hensbergen
Browse files

[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: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent bb2f8a55
Loading
Loading
Loading
Loading
+15 −6
Original line number Original line Diff line number Diff line
@@ -1333,12 +1333,21 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,


	if (count < rsize)
	if (count < rsize)
		rsize = count;
		rsize = count;

	/* 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)
		if (data)
		req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid, offset,
			req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid,
								rsize, data);
					offset, rsize, data);
		else
		else
		req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid, offset,
			req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid,
								rsize, udata);
					offset, rsize, udata);
	}
	if (IS_ERR(req)) {
	if (IS_ERR(req)) {
		err = PTR_ERR(req);
		err = PTR_ERR(req);
		goto error;
		goto error;