aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ramfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-02-12 22:08:01 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-20 21:29:37 -0400
commit318ceed088497d1ca839b1172518ac4cc7096b82 (patch)
tree7dfd07bfb5e8c5d5dbb0ba4ea523f334c98c66bb /fs/ramfs
parentca85c07809ca19de3391cb79ee1198f3dd91fa8d (diff)
tidy up after d_make_root() conversion
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ramfs')
-rw-r--r--fs/ramfs/inode.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index b6612d2ed718..a1fdabe21dec 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -209,21 +209,19 @@ static int ramfs_parse_options(char *data, struct ramfs_mount_opts *opts)
209int ramfs_fill_super(struct super_block *sb, void *data, int silent) 209int ramfs_fill_super(struct super_block *sb, void *data, int silent)
210{ 210{
211 struct ramfs_fs_info *fsi; 211 struct ramfs_fs_info *fsi;
212 struct inode *inode = NULL; 212 struct inode *inode;
213 int err; 213 int err;
214 214
215 save_mount_options(sb, data); 215 save_mount_options(sb, data);
216 216
217 fsi = kzalloc(sizeof(struct ramfs_fs_info), GFP_KERNEL); 217 fsi = kzalloc(sizeof(struct ramfs_fs_info), GFP_KERNEL);
218 sb->s_fs_info = fsi; 218 sb->s_fs_info = fsi;
219 if (!fsi) { 219 if (!fsi)
220 err = -ENOMEM; 220 return -ENOMEM;
221 goto fail;
222 }
223 221
224 err = ramfs_parse_options(data, &fsi->mount_opts); 222 err = ramfs_parse_options(data, &fsi->mount_opts);
225 if (err) 223 if (err)
226 goto fail; 224 return err;
227 225
228 sb->s_maxbytes = MAX_LFS_FILESIZE; 226 sb->s_maxbytes = MAX_LFS_FILESIZE;
229 sb->s_blocksize = PAGE_CACHE_SIZE; 227 sb->s_blocksize = PAGE_CACHE_SIZE;
@@ -234,16 +232,10 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent)
234 232
235 inode = ramfs_get_inode(sb, NULL, S_IFDIR | fsi->mount_opts.mode, 0); 233 inode = ramfs_get_inode(sb, NULL, S_IFDIR | fsi->mount_opts.mode, 0);
236 sb->s_root = d_make_root(inode); 234 sb->s_root = d_make_root(inode);
237 if (!sb->s_root) { 235 if (!sb->s_root)
238 err = -ENOMEM; 236 return -ENOMEM;
239 goto fail;
240 }
241 237
242 return 0; 238 return 0;
243fail:
244 kfree(fsi);
245 sb->s_fs_info = NULL;
246 return err;
247} 239}
248 240
249struct dentry *ramfs_mount(struct file_system_type *fs_type, 241struct dentry *ramfs_mount(struct file_system_type *fs_type,