diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-03-27 03:00:54 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-04-17 21:42:36 -0400 |
commit | f3dcc13f6fa20af1171eac7a537a4b89b1a84849 (patch) | |
tree | 4f1fb766af5a1a5110a5054894af1902ef02cb63 /fs/xfs/linux-2.6 | |
parent | 59a33f9f776b051018ec98af95bd9fe8ba9d0f3e (diff) |
[XFS] cleanup root inode handling in xfs_fs_fill_super
- rename rootvp to root for clarify
- remove useless vn_to_inode call
- check is_bad_inode before calling d_alloc_root
- use iput instead of VN_RELE in the error case
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30708a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index cb9ce90d1deb..72e55db948d2 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1307,7 +1307,7 @@ xfs_fs_fill_super( | |||
1307 | void *data, | 1307 | void *data, |
1308 | int silent) | 1308 | int silent) |
1309 | { | 1309 | { |
1310 | struct inode *rootvp; | 1310 | struct inode *root; |
1311 | struct xfs_mount *mp = NULL; | 1311 | struct xfs_mount *mp = NULL; |
1312 | struct xfs_mount_args *args = xfs_args_allocate(sb, silent); | 1312 | struct xfs_mount_args *args = xfs_args_allocate(sb, silent); |
1313 | int error; | 1313 | int error; |
@@ -1345,19 +1345,18 @@ xfs_fs_fill_super( | |||
1345 | sb->s_time_gran = 1; | 1345 | sb->s_time_gran = 1; |
1346 | set_posix_acl_flag(sb); | 1346 | set_posix_acl_flag(sb); |
1347 | 1347 | ||
1348 | rootvp = igrab(mp->m_rootip->i_vnode); | 1348 | root = igrab(mp->m_rootip->i_vnode); |
1349 | if (!rootvp) { | 1349 | if (!root) { |
1350 | error = ENOENT; | 1350 | error = ENOENT; |
1351 | goto fail_unmount; | 1351 | goto fail_unmount; |
1352 | } | 1352 | } |
1353 | 1353 | if (is_bad_inode(root)) { | |
1354 | sb->s_root = d_alloc_root(vn_to_inode(rootvp)); | 1354 | error = EINVAL; |
1355 | if (!sb->s_root) { | ||
1356 | error = ENOMEM; | ||
1357 | goto fail_vnrele; | 1355 | goto fail_vnrele; |
1358 | } | 1356 | } |
1359 | if (is_bad_inode(sb->s_root->d_inode)) { | 1357 | sb->s_root = d_alloc_root(root); |
1360 | error = EINVAL; | 1358 | if (!sb->s_root) { |
1359 | error = ENOMEM; | ||
1361 | goto fail_vnrele; | 1360 | goto fail_vnrele; |
1362 | } | 1361 | } |
1363 | 1362 | ||
@@ -1379,7 +1378,7 @@ fail_vnrele: | |||
1379 | dput(sb->s_root); | 1378 | dput(sb->s_root); |
1380 | sb->s_root = NULL; | 1379 | sb->s_root = NULL; |
1381 | } else { | 1380 | } else { |
1382 | VN_RELE(rootvp); | 1381 | iput(root); |
1383 | } | 1382 | } |
1384 | 1383 | ||
1385 | fail_unmount: | 1384 | fail_unmount: |