[1/2] net/9p: distinguish zero-copy requests
Commit Message
Signed-off-by: Christian Schoenebeck <linux_oss@crudebyte.com>
---
include/net/9p/9p.h | 2 ++
net/9p/client.c | 4 ++++
2 files changed, 6 insertions(+)
@@ -530,6 +530,7 @@ struct p9_rstatfs {
* @tag: transaction id of the request
* @offset: used by marshalling routines to track current position in buffer
* @capacity: used by marshalling routines to track total malloc'd capacity
+ * @zc: whether zero-copy is used
* @sdata: payload
*
* &p9_fcall represents the structure for all 9P RPC
@@ -546,6 +547,7 @@ struct p9_fcall {
size_t offset;
size_t capacity;
+ bool zc;
struct kmem_cache *cache;
u8 *sdata;
@@ -680,6 +680,8 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
if (IS_ERR(req))
return req;
+ req->tc.zc = req->rc.zc = false;
+
if (signal_pending(current)) {
sigpending = 1;
clear_thread_flag(TIF_SIGPENDING);
@@ -778,6 +780,8 @@ static struct p9_req_t *p9_client_zc_rpc(struct p9_client *c, int8_t type,
if (IS_ERR(req))
return req;
+ req->tc.zc = req->rc.zc = true;
+
if (signal_pending(current)) {
sigpending = 1;
clear_thread_flag(TIF_SIGPENDING);