public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cleanup root inode handling in xfs_fs_fill_super
@ 2008-03-19 20:47 Christoph Hellwig
  2008-03-21 18:06 ` Josef 'Jeff' Sipek
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2008-03-19 20:47 UTC (permalink / raw)
  To: xfs

 - 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


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c	2008-02-27 00:40:51.000000000 +0100
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c	2008-02-27 00:43:04.000000000 +0100
@@ -1307,7 +1307,7 @@ xfs_fs_fill_super(
 	void			*data,
 	int			silent)
 {
-	struct inode		*rootvp;
+	struct inode		*root;
 	struct xfs_mount	*mp = NULL;
 	struct xfs_mount_args	*args = xfs_args_allocate(sb, silent);
 	int			error;
@@ -1345,19 +1345,18 @@ xfs_fs_fill_super(
 	sb->s_time_gran = 1;
 	set_posix_acl_flag(sb);
 
-	rootvp = igrab(mp->m_rootip->i_vnode);
-	if (!rootvp) {
+	root = igrab(mp->m_rootip->i_vnode);
+	if (!root) {
 		error = ENOENT;
 		goto fail_unmount;
 	}
-
-	sb->s_root = d_alloc_root(vn_to_inode(rootvp));
-	if (!sb->s_root) {
-		error = ENOMEM;
+	if (is_bad_inode(root)) {
+		error = EINVAL;
 		goto fail_vnrele;
 	}
-	if (is_bad_inode(sb->s_root->d_inode)) {
-		error = EINVAL;
+	sb->s_root = d_alloc_root(root);
+	if (!sb->s_root) {
+		error = ENOMEM;
 		goto fail_vnrele;
 	}
 
@@ -1379,7 +1378,7 @@ fail_vnrele:
 		dput(sb->s_root);
 		sb->s_root = NULL;
 	} else {
-		VN_RELE(rootvp);
+		iput(root);
 	}
 
 fail_unmount:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cleanup root inode handling in xfs_fs_fill_super
  2008-03-19 20:47 [PATCH] cleanup root inode handling in xfs_fs_fill_super Christoph Hellwig
@ 2008-03-21 18:06 ` Josef 'Jeff' Sipek
  0 siblings, 0 replies; 2+ messages in thread
From: Josef 'Jeff' Sipek @ 2008-03-21 18:06 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Wed, Mar 19, 2008 at 09:47:24PM +0100, Christoph Hellwig wrote:
>  - 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
 
Looks good.

Josef 'Jeff' Sipek.

-- 
FORTUNE PROVIDES QUESTIONS FOR THE GREAT ANSWERS: #19
A:      To be or not to be.
Q:      What is the square root of 4b^2?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-21 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-19 20:47 [PATCH] cleanup root inode handling in xfs_fs_fill_super Christoph Hellwig
2008-03-21 18:06 ` Josef 'Jeff' Sipek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox