Skip to contentSkip to conversation

kill xfs_root

PATCH In review Christoph Hellwig 1 participant 1 message Dec 14, 2007 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 kill xfs_root

The only caller (xfs_fs_fill_super) can simplify call igrab on the root inode.

fs/xfs/linux-2.6/xfs_ksyms.c +0 -1
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c
===================================================================
@@ -309,4 +309,3 @@ EXPORT_SYMBOL(xfs_ichgtime_fast);
 EXPORT_SYMBOL(xfs_free_eofblocks);
 
 EXPORT_SYMBOL(xfs_do_force_shutdown);
-EXPORT_SYMBOL(xfs_root);
fs/xfs/linux-2.6/xfs_super.c +4 -2
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
@@ -1287,9 +1287,11 @@ xfs_fs_fill_super(
 	sb->s_time_gran = 1;
 	set_posix_acl_flag(sb);
 
-	error = xfs_root(mp, &rootvp);
-	if (error)
+	rootvp = igrab(mp->m_rootip->i_vnode);
+	if (!rootvp) {
+		error = ENOENT;
 		goto fail_unmount;
+	}
 
 	sb->s_root = d_alloc_root(vn_to_inode(rootvp));
 	if (!sb->s_root) {
fs/xfs/xfs_vfsops.c +0 -20
Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c
===================================================================
@@ -808,26 +808,6 @@ fscorrupt_out2:
 }
 
 /*
- * xfs_root extracts the root vnode from a vfs.
- *
- * vfsp -- the vfs struct for the desired file system
- * vpp  -- address of the caller's vnode pointer which should be
- *         set to the desired fs root vnode
- */
-int
-xfs_root(
-	xfs_mount_t	*mp,
-	bhv_vnode_t	**vpp)
-{
-	bhv_vnode_t	*vp;
-
-	vp = XFS_ITOV(mp->m_rootip);
-	VN_HOLD(vp);
-	*vpp = vp;
-	return 0;
-}
-
-/*
  * xfs_sync flushes any pending I/O to file system vfsp.
  *
  * This routine is called by vfs_sync() to make sure that things make it
fs/xfs/xfs_vfsops.h +0 -1
Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.h
===================================================================
@@ -13,7 +13,6 @@ int xfs_mount(struct xfs_mount *mp, stru
 int xfs_unmount(struct xfs_mount *mp, int flags, struct cred *credp);
 int xfs_mntupdate(struct xfs_mount *mp, int *flags,
 		struct xfs_mount_args *args);
-int xfs_root(struct xfs_mount *mp, bhv_vnode_t **vpp);
 int xfs_sync(struct xfs_mount *mp, int flags);
 void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
 		int lnnum);