diff options
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/v9fs.c | 16 | ||||
-rw-r--r-- | fs/9p/v9fs.h | 8 | ||||
-rw-r--r-- | fs/9p/vfs_inode.c | 4 |
3 files changed, 16 insertions, 12 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 8ac246700b70..68f82be3bf37 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c | |||
@@ -84,7 +84,7 @@ static struct p9_trans_module *v9fs_match_trans(const substring_t *name) | |||
84 | 84 | ||
85 | enum { | 85 | enum { |
86 | /* Options that take integer arguments */ | 86 | /* Options that take integer arguments */ |
87 | Opt_debug, Opt_msize, Opt_uid, Opt_gid, Opt_afid, | 87 | Opt_debug, Opt_msize, Opt_dfltuid, Opt_dfltgid, Opt_afid, |
88 | /* String options */ | 88 | /* String options */ |
89 | Opt_uname, Opt_remotename, Opt_trans, | 89 | Opt_uname, Opt_remotename, Opt_trans, |
90 | /* Options that take no arguments */ | 90 | /* Options that take no arguments */ |
@@ -98,8 +98,8 @@ enum { | |||
98 | static match_table_t tokens = { | 98 | static match_table_t tokens = { |
99 | {Opt_debug, "debug=%x"}, | 99 | {Opt_debug, "debug=%x"}, |
100 | {Opt_msize, "msize=%u"}, | 100 | {Opt_msize, "msize=%u"}, |
101 | {Opt_uid, "uid=%u"}, | 101 | {Opt_dfltuid, "dfltuid=%u"}, |
102 | {Opt_gid, "gid=%u"}, | 102 | {Opt_dfltgid, "dfltgid=%u"}, |
103 | {Opt_afid, "afid=%u"}, | 103 | {Opt_afid, "afid=%u"}, |
104 | {Opt_uname, "uname=%s"}, | 104 | {Opt_uname, "uname=%s"}, |
105 | {Opt_remotename, "aname=%s"}, | 105 | {Opt_remotename, "aname=%s"}, |
@@ -159,11 +159,11 @@ static void v9fs_parse_options(struct v9fs_session_info *v9ses) | |||
159 | case Opt_msize: | 159 | case Opt_msize: |
160 | v9ses->maxdata = option; | 160 | v9ses->maxdata = option; |
161 | break; | 161 | break; |
162 | case Opt_uid: | 162 | case Opt_dfltuid: |
163 | v9ses->uid = option; | 163 | v9ses->dfltuid = option; |
164 | break; | 164 | break; |
165 | case Opt_gid: | 165 | case Opt_dfltgid: |
166 | v9ses->gid = option; | 166 | v9ses->dfltgid = option; |
167 | break; | 167 | break; |
168 | case Opt_afid: | 168 | case Opt_afid: |
169 | v9ses->afid = option; | 169 | v9ses->afid = option; |
@@ -219,6 +219,8 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses, | |||
219 | 219 | ||
220 | strcpy(v9ses->name, V9FS_DEFUSER); | 220 | strcpy(v9ses->name, V9FS_DEFUSER); |
221 | strcpy(v9ses->remotename, V9FS_DEFANAME); | 221 | strcpy(v9ses->remotename, V9FS_DEFANAME); |
222 | v9ses->dfltuid = V9FS_DEFUID; | ||
223 | v9ses->dfltgid = V9FS_DEFGID; | ||
222 | 224 | ||
223 | v9ses->options = kstrdup(data, GFP_KERNEL); | 225 | v9ses->options = kstrdup(data, GFP_KERNEL); |
224 | v9fs_parse_options(v9ses); | 226 | v9fs_parse_options(v9ses); |
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h index 804b3ef8feab..8e0999b3d0cc 100644 --- a/fs/9p/v9fs.h +++ b/fs/9p/v9fs.h | |||
@@ -38,8 +38,8 @@ struct v9fs_session_info { | |||
38 | char *options; /* copy of mount options */ | 38 | char *options; /* copy of mount options */ |
39 | char *name; /* user name to mount as */ | 39 | char *name; /* user name to mount as */ |
40 | char *remotename; /* name of remote hierarchy being mounted */ | 40 | char *remotename; /* name of remote hierarchy being mounted */ |
41 | unsigned int uid; /* default uid/muid for legacy support */ | 41 | unsigned int dfltuid; /* default uid/muid for legacy support */ |
42 | unsigned int gid; /* default gid for legacy support */ | 42 | unsigned int dfltgid; /* default gid for legacy support */ |
43 | struct p9_trans_module *trans; /* 9p transport */ | 43 | struct p9_trans_module *trans; /* 9p transport */ |
44 | struct p9_client *clnt; /* 9p client */ | 44 | struct p9_client *clnt; /* 9p client */ |
45 | struct dentry *debugfs_dir; | 45 | struct dentry *debugfs_dir; |
@@ -67,9 +67,11 @@ void v9fs_session_cancel(struct v9fs_session_info *v9ses); | |||
67 | #define V9FS_MAGIC 0x01021997 | 67 | #define V9FS_MAGIC 0x01021997 |
68 | 68 | ||
69 | /* other default globals */ | 69 | /* other default globals */ |
70 | #define V9FS_PORT 564 | 70 | #define V9FS_PORT 564 |
71 | #define V9FS_DEFUSER "nobody" | 71 | #define V9FS_DEFUSER "nobody" |
72 | #define V9FS_DEFANAME "" | 72 | #define V9FS_DEFANAME "" |
73 | #define V9FS_DEFUID (-2) | ||
74 | #define V9FS_DEFGID (-2) | ||
73 | 75 | ||
74 | static inline struct v9fs_session_info *v9fs_inode2v9ses(struct inode *inode) | 76 | static inline struct v9fs_session_info *v9fs_inode2v9ses(struct inode *inode) |
75 | { | 77 | { |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 2270d06ccd56..f08a35d2973a 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -805,8 +805,8 @@ v9fs_stat2inode(struct p9_stat *stat, struct inode *inode, | |||
805 | inode->i_mtime.tv_sec = stat->mtime; | 805 | inode->i_mtime.tv_sec = stat->mtime; |
806 | inode->i_ctime.tv_sec = stat->mtime; | 806 | inode->i_ctime.tv_sec = stat->mtime; |
807 | 807 | ||
808 | inode->i_uid = v9ses->uid; | 808 | inode->i_uid = v9ses->dfltuid; |
809 | inode->i_gid = v9ses->gid; | 809 | inode->i_gid = v9ses->dfltgid; |
810 | 810 | ||
811 | if (v9fs_extended(v9ses)) { | 811 | if (v9fs_extended(v9ses)) { |
812 | inode->i_uid = stat->n_uid; | 812 | inode->i_uid = stat->n_uid; |