@@ -583,7 +583,15 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
goto reterr;
p9pdu_finalize(req->tc);
- err = c->trans_mod->request(c, req);
+ /* try to zero copy request for few of the operations */
+ if (zero_copy(request)) {
+ err = c->trans_mode->zc_request(c, req);
+ if (err == EAGAIN) {
+ err = c->trans_mode->request(c, req);
+ }
+
+ } else
+ err = c->trans_mod->request(c, req);
if (err < 0) {
if (err != -ERESTARTSYS)
c->status = Disconnected;
@@ -1012,6 +1012,7 @@ static struct p9_trans_module p9_tcp_trans = {
.create = p9_fd_create_tcp,
.close = p9_fd_close,
.request = p9_fd_request,
+ .zc_request = p9_no_zero_copy_request,
.cancel = p9_fd_cancel,
.owner = THIS_MODULE,
};
@@ -446,6 +446,7 @@ static struct p9_trans_module p9_virtio_trans = {
.create = p9_virtio_create,
.close = p9_virtio_close,
.request = p9_virtio_request,
+ .zc_request = p9_virtio_zero_copy_request,
.cancel = p9_virtio_cancel,
.maxsize = PAGE_SIZE*16,
.def = 0,