summaryrefslogtreecommitdiffstats
path: root/fs/ramfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-01-08 22:15:13 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-20 21:29:35 -0400
commit48fde701aff662559b38d9a609574068f22d00fe (patch)
treeaa6b203dc671b51d58575b65eb08310ff8309b60 /fs/ramfs
parent6b4231e2f92adbcf96fb2a3fa751d7ca0a61b21f (diff)
downloadlinux-stable-48fde701aff662559b38d9a609574068f22d00fe.tar.gz
linux-stable-48fde701aff662559b38d9a609574068f22d00fe.tar.bz2
linux-stable-48fde701aff662559b38d9a609574068f22d00fe.zip
switch open-coded instances of d_make_root() to new helper
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ramfs')
-rw-r--r--fs/ramfs/inode.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index aec766abe3af..b6612d2ed718 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -210,7 +210,6 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent)
{
struct ramfs_fs_info *fsi;
struct inode *inode = NULL;
- struct dentry *root;
int err;
save_mount_options(sb, data);
@@ -234,14 +233,8 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_time_gran = 1;
inode = ramfs_get_inode(sb, NULL, S_IFDIR | fsi->mount_opts.mode, 0);
- if (!inode) {
- err = -ENOMEM;
- goto fail;
- }
-
- root = d_alloc_root(inode);
- sb->s_root = root;
- if (!root) {
+ sb->s_root = d_make_root(inode);
+ if (!sb->s_root) {
err = -ENOMEM;
goto fail;
}
@@ -250,7 +243,6 @@ int ramfs_fill_super(struct super_block *sb, void *data, int silent)
fail:
kfree(fsi);
sb->s_fs_info = NULL;
- iput(inode);
return err;
}