diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-08 22:15:13 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:35 -0400 |
commit | 48fde701aff662559b38d9a609574068f22d00fe (patch) | |
tree | aa6b203dc671b51d58575b65eb08310ff8309b60 /fs/ocfs2 | |
parent | 6b4231e2f92adbcf96fb2a3fa751d7ca0a61b21f (diff) |
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/ocfs2')
-rw-r--r-- | fs/ocfs2/dlmfs/dlmfs.c | 14 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 3 |
2 files changed, 3 insertions, 14 deletions
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index abfac0d7ae9c..3b5825ef3193 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c | |||
@@ -582,24 +582,14 @@ static int dlmfs_fill_super(struct super_block * sb, | |||
582 | void * data, | 582 | void * data, |
583 | int silent) | 583 | int silent) |
584 | { | 584 | { |
585 | struct inode * inode; | ||
586 | struct dentry * root; | ||
587 | |||
588 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 585 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
589 | sb->s_blocksize = PAGE_CACHE_SIZE; | 586 | sb->s_blocksize = PAGE_CACHE_SIZE; |
590 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 587 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
591 | sb->s_magic = DLMFS_MAGIC; | 588 | sb->s_magic = DLMFS_MAGIC; |
592 | sb->s_op = &dlmfs_ops; | 589 | sb->s_op = &dlmfs_ops; |
593 | inode = dlmfs_get_root_inode(sb); | 590 | sb->s_root = d_make_root(dlmfs_get_root_inode(sb)); |
594 | if (!inode) | 591 | if (!sb->s_root) |
595 | return -ENOMEM; | ||
596 | |||
597 | root = d_alloc_root(inode); | ||
598 | if (!root) { | ||
599 | iput(inode); | ||
600 | return -ENOMEM; | 592 | return -ENOMEM; |
601 | } | ||
602 | sb->s_root = root; | ||
603 | return 0; | 593 | return 0; |
604 | } | 594 | } |
605 | 595 | ||
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 2b1184f7097f..337687c3e233 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1166,9 +1166,8 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1166 | goto read_super_error; | 1166 | goto read_super_error; |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | root = d_alloc_root(inode); | 1169 | root = d_make_root(inode); |
1170 | if (!root) { | 1170 | if (!root) { |
1171 | iput(inode); | ||
1172 | status = -ENOMEM; | 1171 | status = -ENOMEM; |
1173 | mlog_errno(status); | 1172 | mlog_errno(status); |
1174 | goto read_super_error; | 1173 | goto read_super_error; |