[v4,07/11] 9p: Add additional debug flags and open modes

Message ID 20230218003323.2322580-8-ericvh@kernel.org
State New
Headers
Series Performance fixes for 9p filesystem |

Commit Message

Eric Van Hensbergen Feb. 18, 2023, 12:33 a.m. UTC
  Add some additional debug flags to assist with debugging
cache changes.  Also add some additional open modes so we
can track cache state in fids more directly.

Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
---
 include/net/9p/9p.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Dominique Martinet Feb. 18, 2023, 8:05 a.m. UTC | #1
Eric Van Hensbergen wrote on Sat, Feb 18, 2023 at 12:33:19AM +0000:
> Add some additional debug flags to assist with debugging
> cache changes.  Also add some additional open modes so we
> can track cache state in fids more directly.
> 
> Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>

New debug flags can't hurt.

For open modes: don't we send the mode verbatim to servers? won't they
be confused?
I guess I'll see in the next patch if you trim it down, but we might
want to add a P9_MODE_MASK or something with values we're allowed to
send and have client.c filter it out?
  

Patch

diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 429adf6be29c..61c20b89becd 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -42,6 +42,8 @@  enum p9_debug_flags {
 	P9_DEBUG_PKT =		(1<<10),
 	P9_DEBUG_FSC =		(1<<11),
 	P9_DEBUG_VPKT =		(1<<12),
+	P9_DEBUG_CACHE =	(1<<13),
+	P9_DEBUG_MMAP =		(1<<14),
 };
 
 #ifdef CONFIG_NET_9P_DEBUG
@@ -213,6 +215,9 @@  enum p9_open_mode_t {
 	P9_ORCLOSE = 0x40,
 	P9_OAPPEND = 0x80,
 	P9_OEXCL = 0x1000,
+	P9L_DIRECT = 0x2000, /* cache disabled */
+	P9L_NOWRITECACHE = 0x4000, /* no write caching  */
+	P9L_LOOSE = 0x8000, /* loose cache */
 };
 
 /**