Skip to content

Commit 6deffc8

Browse files
committed
fs/9p: Add new mount modes
Add some additional mount modes for cache management including specifying directio as a mount option and an option for ignore qid.version for determining whether or not a file is cacheable. Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
1 parent 46c30cb commit 6deffc8

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

fs/9p/v9fs.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum {
3838
/* String options */
3939
Opt_uname, Opt_remotename, Opt_cache, Opt_cachetag,
4040
/* Options that take no arguments */
41-
Opt_nodevmap, Opt_noxattr,
41+
Opt_nodevmap, Opt_noxattr, Opt_directio, Opt_ignoreqv,
4242
/* Access options */
4343
Opt_access, Opt_posixacl,
4444
/* Lock timeout option */
@@ -56,6 +56,8 @@ static const match_table_t tokens = {
5656
{Opt_remotename, "aname=%s"},
5757
{Opt_nodevmap, "nodevmap"},
5858
{Opt_noxattr, "noxattr"},
59+
{Opt_directio, "directio"},
60+
{Opt_ignoreqv, "ignoreqv"},
5961
{Opt_cache, "cache=%s"},
6062
{Opt_cachetag, "cachetag=%s"},
6163
{Opt_access, "access=%s"},
@@ -125,7 +127,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
125127
if (v9ses->nodev)
126128
seq_puts(m, ",nodevmap");
127129
if (v9ses->cache)
128-
seq_printf(m, ",%s", v9fs_cache_modes[v9ses->cache]);
130+
seq_printf(m, ",cache=%s", v9fs_cache_modes[v9ses->cache]);
129131
#ifdef CONFIG_9P_FSCACHE
130132
if (v9ses->cachetag && v9ses->cache == CACHE_FSCACHE)
131133
seq_printf(m, ",cachetag=%s", v9ses->cachetag);
@@ -147,6 +149,10 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
147149
break;
148150
}
149151

152+
if (v9ses->flags & V9FS_IGNORE_QV)
153+
seq_puts(m, ",ignoreqv");
154+
if (v9ses->flags & V9FS_DIRECT_IO)
155+
seq_puts(m, ",directio");
150156
if (v9ses->flags & V9FS_POSIX_ACL)
151157
seq_puts(m, ",posixacl");
152158

@@ -276,6 +282,12 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
276282
case Opt_noxattr:
277283
v9ses->flags |= V9FS_NO_XATTR;
278284
break;
285+
case Opt_directio:
286+
v9ses->flags |= V9FS_DIRECT_IO;
287+
break;
288+
case Opt_ignoreqv:
289+
v9ses->flags |= V9FS_IGNORE_QV;
290+
break;
279291
case Opt_cachetag:
280292
#ifdef CONFIG_9P_FSCACHE
281293
kfree(v9ses->cachetag);

fs/9p/v9fs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ enum p9_session_flags {
3737
V9FS_ACCESS_USER = 0x08,
3838
V9FS_ACCESS_CLIENT = 0x10,
3939
V9FS_POSIX_ACL = 0x20,
40-
V9FS_NO_XATTR = 0x40
40+
V9FS_NO_XATTR = 0x40,
41+
V9FS_IGNORE_QV = 0x80, /* ignore qid.version for cache hints */
42+
V9FS_DIRECT_IO = 0x100,
43+
V9FS_SYNC = 0x200
4144
};
4245

4346
/* possible values of ->cache */

0 commit comments

Comments
 (0)