summaryrefslogtreecommitdiffstats
path: root/fs
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
parentca85c07809ca19de3391cb79ee1198f3dd91fa8d (diff)
downloadop-kernel-dev-318ceed088497d1ca839b1172518ac4cc7096b82.zip
op-kernel-dev-318ceed088497d1ca839b1172518ac4cc7096b82.tar.gz
tidy up after d_make_root() conversion
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/pstore/inode.c24
-rw-r--r--fs/ramfs/inode.c20
2 files changed, 13 insertions, 31 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index ec7d1fb..f37c32b 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -278,9 +278,7 @@ fail:
int pstore_fill_super(struct super_block *sb, void *data, int silent)
{
- struct inode *inode = NULL;
- struct dentry *root;
- int err;
+ struct inode *inode;
save_mount_options(sb, data);
@@ -296,25 +294,17 @@ int pstore_fill_super(struct super_block *sb, void *data, int silent)
parse_options(data);
inode = pstore_get_inode(sb, NULL, S_IFDIR | 0755, 0);
- if (!inode) {
- err = -ENOMEM;
- goto fail;
- }
- /* override ramfs "dir" options so we catch unlink(2) */
- inode->i_op = &pstore_dir_inode_operations;
-
- root = d_make_root(inode);
- sb->s_root = root;
- if (!root) {
- err = -ENOMEM;
- goto fail;
+ if (inode) {
+ /* override ramfs "dir" options so we catch unlink(2) */
+ inode->i_op = &pstore_dir_inode_operations;
}
+ sb->s_root = d_make_root(inode);
+ if (!sb->s_root)
+ return -ENOMEM;
pstore_get_records(0);
return 0;
-fail:
- return err;
}
static struct dentry *pstore_mount(struct file_system_type *fs_type,
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index b6612d2..a1fdabe 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)
int ramfs_fill_super(struct super_block *sb, void *data, int silent)
{
struct ramfs_fs_info *fsi;
- struct inode *inode = NULL;
+ struct inode *inode;
int err;
save_mount_options(sb, data);
fsi = kzalloc(sizeof(struct ramfs_fs_info), GFP_KERNEL);
sb->s_fs_info = fsi;
- if (!fsi) {
- err = -ENOMEM;
- goto fail;
- }
+ if (!fsi)
+ return -ENOMEM;
err = ramfs_parse_options(data, &fsi->mount_opts);
if (err)
- goto fail;
+ return err;
sb->s_maxbytes = MAX_LFS_FILESIZE;
sb->s_blocksize = PAGE_CACHE_SIZE;
@@ -234,16 +232,10 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent)
inode = ramfs_get_inode(sb, NULL, S_IFDIR | fsi->mount_opts.mode, 0);
sb->s_root = d_make_root(inode);
- if (!sb->s_root) {
- err = -ENOMEM;
- goto fail;
- }
+ if (!sb->s_root)
+ return -ENOMEM;
return 0;
-fail:
- kfree(fsi);
- sb->s_fs_info = NULL;
- return err;
}
struct dentry *ramfs_mount(struct file_system_type *fs_type,
OpenPOWER on IntegriCloud