Commit 6deffc89 authored by Eric Van Hensbergen's avatar Eric Van Hensbergen

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: default avatarEric Van Hensbergen <ericvh@kernel.org>
parent 46c30cb8
...@@ -38,7 +38,7 @@ enum { ...@@ -38,7 +38,7 @@ enum {
/* String options */ /* String options */
Opt_uname, Opt_remotename, Opt_cache, Opt_cachetag, Opt_uname, Opt_remotename, Opt_cache, Opt_cachetag,
/* Options that take no arguments */ /* Options that take no arguments */
Opt_nodevmap, Opt_noxattr, Opt_nodevmap, Opt_noxattr, Opt_directio, Opt_ignoreqv,
/* Access options */ /* Access options */
Opt_access, Opt_posixacl, Opt_access, Opt_posixacl,
/* Lock timeout option */ /* Lock timeout option */
...@@ -56,6 +56,8 @@ static const match_table_t tokens = { ...@@ -56,6 +56,8 @@ static const match_table_t tokens = {
{Opt_remotename, "aname=%s"}, {Opt_remotename, "aname=%s"},
{Opt_nodevmap, "nodevmap"}, {Opt_nodevmap, "nodevmap"},
{Opt_noxattr, "noxattr"}, {Opt_noxattr, "noxattr"},
{Opt_directio, "directio"},
{Opt_ignoreqv, "ignoreqv"},
{Opt_cache, "cache=%s"}, {Opt_cache, "cache=%s"},
{Opt_cachetag, "cachetag=%s"}, {Opt_cachetag, "cachetag=%s"},
{Opt_access, "access=%s"}, {Opt_access, "access=%s"},
...@@ -125,7 +127,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) ...@@ -125,7 +127,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
if (v9ses->nodev) if (v9ses->nodev)
seq_puts(m, ",nodevmap"); seq_puts(m, ",nodevmap");
if (v9ses->cache) if (v9ses->cache)
seq_printf(m, ",%s", v9fs_cache_modes[v9ses->cache]); seq_printf(m, ",cache=%s", v9fs_cache_modes[v9ses->cache]);
#ifdef CONFIG_9P_FSCACHE #ifdef CONFIG_9P_FSCACHE
if (v9ses->cachetag && v9ses->cache == CACHE_FSCACHE) if (v9ses->cachetag && v9ses->cache == CACHE_FSCACHE)
seq_printf(m, ",cachetag=%s", v9ses->cachetag); seq_printf(m, ",cachetag=%s", v9ses->cachetag);
...@@ -147,6 +149,10 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) ...@@ -147,6 +149,10 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
break; break;
} }
if (v9ses->flags & V9FS_IGNORE_QV)
seq_puts(m, ",ignoreqv");
if (v9ses->flags & V9FS_DIRECT_IO)
seq_puts(m, ",directio");
if (v9ses->flags & V9FS_POSIX_ACL) if (v9ses->flags & V9FS_POSIX_ACL)
seq_puts(m, ",posixacl"); seq_puts(m, ",posixacl");
...@@ -276,6 +282,12 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) ...@@ -276,6 +282,12 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
case Opt_noxattr: case Opt_noxattr:
v9ses->flags |= V9FS_NO_XATTR; v9ses->flags |= V9FS_NO_XATTR;
break; break;
case Opt_directio:
v9ses->flags |= V9FS_DIRECT_IO;
break;
case Opt_ignoreqv:
v9ses->flags |= V9FS_IGNORE_QV;
break;
case Opt_cachetag: case Opt_cachetag:
#ifdef CONFIG_9P_FSCACHE #ifdef CONFIG_9P_FSCACHE
kfree(v9ses->cachetag); kfree(v9ses->cachetag);
......
...@@ -37,7 +37,10 @@ enum p9_session_flags { ...@@ -37,7 +37,10 @@ enum p9_session_flags {
V9FS_ACCESS_USER = 0x08, V9FS_ACCESS_USER = 0x08,
V9FS_ACCESS_CLIENT = 0x10, V9FS_ACCESS_CLIENT = 0x10,
V9FS_POSIX_ACL = 0x20, V9FS_POSIX_ACL = 0x20,
V9FS_NO_XATTR = 0x40 V9FS_NO_XATTR = 0x40,
V9FS_IGNORE_QV = 0x80, /* ignore qid.version for cache hints */
V9FS_DIRECT_IO = 0x100,
V9FS_SYNC = 0x200
}; };
/* possible values of ->cache */ /* possible values of ->cache */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment