Skip to content

Commit 46c30cb

Browse files
committed
9p: Add additional debug flags and open modes
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>
1 parent 8142db4 commit 46c30cb

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

include/net/9p/9p.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ enum p9_debug_flags {
4242
P9_DEBUG_PKT = (1<<10),
4343
P9_DEBUG_FSC = (1<<11),
4444
P9_DEBUG_VPKT = (1<<12),
45+
P9_DEBUG_CACHE = (1<<13),
46+
P9_DEBUG_MMAP = (1<<14),
4547
};
4648

4749
#ifdef CONFIG_NET_9P_DEBUG
@@ -213,6 +215,10 @@ enum p9_open_mode_t {
213215
P9_ORCLOSE = 0x40,
214216
P9_OAPPEND = 0x80,
215217
P9_OEXCL = 0x1000,
218+
P9L_MODE_MASK = 0x1FFF, /* don't send anything under this to server */
219+
P9L_DIRECT = 0x2000, /* cache disabled */
220+
P9L_NOWRITECACHE = 0x4000, /* no write caching */
221+
P9L_LOOSE = 0x8000, /* loose cache */
216222
};
217223

218224
/**

net/9p/client.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,9 +1230,9 @@ int p9_client_open(struct p9_fid *fid, int mode)
12301230
return -EINVAL;
12311231

12321232
if (p9_is_proto_dotl(clnt))
1233-
req = p9_client_rpc(clnt, P9_TLOPEN, "dd", fid->fid, mode);
1233+
req = p9_client_rpc(clnt, P9_TLOPEN, "dd", fid->fid, mode & P9L_MODE_MASK);
12341234
else
1235-
req = p9_client_rpc(clnt, P9_TOPEN, "db", fid->fid, mode);
1235+
req = p9_client_rpc(clnt, P9_TOPEN, "db", fid->fid, mode & P9L_MODE_MASK);
12361236
if (IS_ERR(req)) {
12371237
err = PTR_ERR(req);
12381238
goto error;
@@ -1277,7 +1277,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, const char *name, u32 flags,
12771277
return -EINVAL;
12781278

12791279
req = p9_client_rpc(clnt, P9_TLCREATE, "dsddg", ofid->fid, name, flags,
1280-
mode, gid);
1280+
mode & P9L_MODE_MASK, gid);
12811281
if (IS_ERR(req)) {
12821282
err = PTR_ERR(req);
12831283
goto error;
@@ -1321,7 +1321,7 @@ int p9_client_fcreate(struct p9_fid *fid, const char *name, u32 perm, int mode,
13211321
return -EINVAL;
13221322

13231323
req = p9_client_rpc(clnt, P9_TCREATE, "dsdb?s", fid->fid, name, perm,
1324-
mode, extension);
1324+
mode & P9L_MODE_MASK, extension);
13251325
if (IS_ERR(req)) {
13261326
err = PTR_ERR(req);
13271327
goto error;

0 commit comments

Comments
 (0)