diff options
Diffstat (limited to 'fs/9p/vfs_super.c')
-rw-r--r-- | fs/9p/vfs_super.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 1d12ba0ed3db..c55c614500ad 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/sched.h> | 39 | #include <linux/sched.h> |
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | #include <linux/statfs.h> | 41 | #include <linux/statfs.h> |
42 | #include <linux/magic.h> | ||
42 | #include <net/9p/9p.h> | 43 | #include <net/9p/9p.h> |
43 | #include <net/9p/client.h> | 44 | #include <net/9p/client.h> |
44 | 45 | ||
@@ -46,6 +47,7 @@ | |||
46 | #include "v9fs_vfs.h" | 47 | #include "v9fs_vfs.h" |
47 | #include "fid.h" | 48 | #include "fid.h" |
48 | #include "xattr.h" | 49 | #include "xattr.h" |
50 | #include "acl.h" | ||
49 | 51 | ||
50 | static const struct super_operations v9fs_super_ops, v9fs_super_ops_dotl; | 52 | static const struct super_operations v9fs_super_ops, v9fs_super_ops_dotl; |
51 | 53 | ||
@@ -66,7 +68,7 @@ static int v9fs_set_super(struct super_block *s, void *data) | |||
66 | * v9fs_fill_super - populate superblock with info | 68 | * v9fs_fill_super - populate superblock with info |
67 | * @sb: superblock | 69 | * @sb: superblock |
68 | * @v9ses: session information | 70 | * @v9ses: session information |
69 | * @flags: flags propagated from v9fs_get_sb() | 71 | * @flags: flags propagated from v9fs_mount() |
70 | * | 72 | * |
71 | */ | 73 | */ |
72 | 74 | ||
@@ -88,22 +90,25 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses, | |||
88 | sb->s_flags = flags | MS_ACTIVE | MS_SYNCHRONOUS | MS_DIRSYNC | | 90 | sb->s_flags = flags | MS_ACTIVE | MS_SYNCHRONOUS | MS_DIRSYNC | |
89 | MS_NOATIME; | 91 | MS_NOATIME; |
90 | 92 | ||
93 | #ifdef CONFIG_9P_FS_POSIX_ACL | ||
94 | if ((v9ses->flags & V9FS_ACCESS_MASK) == V9FS_ACCESS_CLIENT) | ||
95 | sb->s_flags |= MS_POSIXACL; | ||
96 | #endif | ||
97 | |||
91 | save_mount_options(sb, data); | 98 | save_mount_options(sb, data); |
92 | } | 99 | } |
93 | 100 | ||
94 | /** | 101 | /** |
95 | * v9fs_get_sb - mount a superblock | 102 | * v9fs_mount - mount a superblock |
96 | * @fs_type: file system type | 103 | * @fs_type: file system type |
97 | * @flags: mount flags | 104 | * @flags: mount flags |
98 | * @dev_name: device name that was mounted | 105 | * @dev_name: device name that was mounted |
99 | * @data: mount options | 106 | * @data: mount options |
100 | * @mnt: mountpoint record to be instantiated | ||
101 | * | 107 | * |
102 | */ | 108 | */ |
103 | 109 | ||
104 | static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | 110 | static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, |
105 | const char *dev_name, void *data, | 111 | const char *dev_name, void *data) |
106 | struct vfsmount *mnt) | ||
107 | { | 112 | { |
108 | struct super_block *sb = NULL; | 113 | struct super_block *sb = NULL; |
109 | struct inode *inode = NULL; | 114 | struct inode *inode = NULL; |
@@ -117,7 +122,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | |||
117 | 122 | ||
118 | v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); | 123 | v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); |
119 | if (!v9ses) | 124 | if (!v9ses) |
120 | return -ENOMEM; | 125 | return ERR_PTR(-ENOMEM); |
121 | 126 | ||
122 | fid = v9fs_session_init(v9ses, dev_name, data); | 127 | fid = v9fs_session_init(v9ses, dev_name, data); |
123 | if (IS_ERR(fid)) { | 128 | if (IS_ERR(fid)) { |
@@ -149,7 +154,6 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | |||
149 | goto release_sb; | 154 | goto release_sb; |
150 | } | 155 | } |
151 | sb->s_root = root; | 156 | sb->s_root = root; |
152 | |||
153 | if (v9fs_proto_dotl(v9ses)) { | 157 | if (v9fs_proto_dotl(v9ses)) { |
154 | struct p9_stat_dotl *st = NULL; | 158 | struct p9_stat_dotl *st = NULL; |
155 | st = p9_client_getattr_dotl(fid, P9_STATS_BASIC); | 159 | st = p9_client_getattr_dotl(fid, P9_STATS_BASIC); |
@@ -174,19 +178,21 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | |||
174 | p9stat_free(st); | 178 | p9stat_free(st); |
175 | kfree(st); | 179 | kfree(st); |
176 | } | 180 | } |
177 | 181 | retval = v9fs_get_acl(inode, fid); | |
182 | if (retval) | ||
183 | goto release_sb; | ||
178 | v9fs_fid_add(root, fid); | 184 | v9fs_fid_add(root, fid); |
179 | 185 | ||
180 | P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n"); | 186 | P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n"); |
181 | simple_set_mnt(mnt, sb); | 187 | return dget(sb->s_root); |
182 | return 0; | ||
183 | 188 | ||
184 | clunk_fid: | 189 | clunk_fid: |
185 | p9_client_clunk(fid); | 190 | p9_client_clunk(fid); |
186 | close_session: | 191 | close_session: |
187 | v9fs_session_close(v9ses); | 192 | v9fs_session_close(v9ses); |
188 | kfree(v9ses); | 193 | kfree(v9ses); |
189 | return retval; | 194 | return ERR_PTR(retval); |
195 | |||
190 | release_sb: | 196 | release_sb: |
191 | /* | 197 | /* |
192 | * we will do the session_close and root dentry release | 198 | * we will do the session_close and root dentry release |
@@ -196,7 +202,7 @@ release_sb: | |||
196 | */ | 202 | */ |
197 | p9_client_clunk(fid); | 203 | p9_client_clunk(fid); |
198 | deactivate_locked_super(sb); | 204 | deactivate_locked_super(sb); |
199 | return retval; | 205 | return ERR_PTR(retval); |
200 | } | 206 | } |
201 | 207 | ||
202 | /** | 208 | /** |
@@ -249,7 +255,7 @@ static int v9fs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
249 | if (v9fs_proto_dotl(v9ses)) { | 255 | if (v9fs_proto_dotl(v9ses)) { |
250 | res = p9_client_statfs(fid, &rs); | 256 | res = p9_client_statfs(fid, &rs); |
251 | if (res == 0) { | 257 | if (res == 0) { |
252 | buf->f_type = rs.type; | 258 | buf->f_type = V9FS_MAGIC; |
253 | buf->f_bsize = rs.bsize; | 259 | buf->f_bsize = rs.bsize; |
254 | buf->f_blocks = rs.blocks; | 260 | buf->f_blocks = rs.blocks; |
255 | buf->f_bfree = rs.bfree; | 261 | buf->f_bfree = rs.bfree; |
@@ -292,7 +298,7 @@ static const struct super_operations v9fs_super_ops_dotl = { | |||
292 | 298 | ||
293 | struct file_system_type v9fs_fs_type = { | 299 | struct file_system_type v9fs_fs_type = { |
294 | .name = "9p", | 300 | .name = "9p", |
295 | .get_sb = v9fs_get_sb, | 301 | .mount = v9fs_mount, |
296 | .kill_sb = v9fs_kill_super, | 302 | .kill_sb = v9fs_kill_super, |
297 | .owner = THIS_MODULE, | 303 | .owner = THIS_MODULE, |
298 | .fs_flags = FS_RENAME_DOES_D_MOVE, | 304 | .fs_flags = FS_RENAME_DOES_D_MOVE, |