[1/2] net/9p: distinguish zero-copy requests

Message ID 5b4019594a93bc77b0e3298457c3d9ec0e08fbb5.1669072186.git.linux_oss@crudebyte.com
State New
Headers
Series net/9p: fix response size check in p9_check_errors() |

Commit Message

Christian Schoenebeck Nov. 21, 2022, 11:03 p.m. UTC
  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(+)
  

Patch

diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 13abe013af21..b0a6dec20b92 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -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;
diff --git a/net/9p/client.c b/net/9p/client.c
index aaa37b07e30a..30dd82f49b28 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -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);