svn commit: r221128 - head/sys/fs/ext2fs

John Baldwin jhb at FreeBSD.org
Wed Apr 27 18:25:36 UTC 2011


Author: jhb
Date: Wed Apr 27 18:25:35 2011
New Revision: 221128
URL: http://svn.freebsd.org/changeset/base/221128

Log:
  Use a private EXT2_ROOTINO constant instead of redefining ROOTINO.
  
  Submitted by:	Pedro F. Giffuni  giffunip at yahoo

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/fs/ext2fs/inode.h

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_lookup.c	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/ext2_lookup.c	Wed Apr 27 18:25:35 2011	(r221128)
@@ -57,9 +57,10 @@
 
 #include <fs/ext2fs/inode.h>
 #include <fs/ext2fs/ext2_mount.h>
-#include <fs/ext2fs/ext2_extern.h>
 #include <fs/ext2fs/ext2fs.h>
+#include <fs/ext2fs/ext2_dinode.h>
 #include <fs/ext2fs/ext2_dir.h>
+#include <fs/ext2fs/ext2_extern.h>
 
 #ifdef DIAGNOSTIC
 static int dirchk = 1;
@@ -1056,7 +1057,7 @@ ext2_checkpath(source, target, cred)
 		error = EEXIST;
 		goto out;
 	}
-	rootino = ROOTINO;
+	rootino = EXT2_ROOTINO;
 	error = 0;
 	if (target->i_number == rootino)
 		goto out;

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/ext2_vfsops.c	Wed Apr 27 18:25:35 2011	(r221128)
@@ -983,7 +983,7 @@ ext2_fhtovp(struct mount *mp, struct fid
 
 	ufhp = (struct ufid *)fhp;
 	fs = VFSTOEXT2(mp)->um_e2fs;
-	if (ufhp->ufid_ino < ROOTINO ||
+	if (ufhp->ufid_ino < EXT2_ROOTINO ||
 	    ufhp->ufid_ino > fs->e2fs_gcount * fs->e2fs->e2fs_ipg)
 		return (ESTALE);
 
@@ -1063,7 +1063,7 @@ ext2_root(struct mount *mp, int flags, s
 	struct vnode *nvp;
 	int error;
 
-	error = VFS_VGET(mp, (ino_t)ROOTINO, LK_EXCLUSIVE, &nvp);
+	error = VFS_VGET(mp, EXT2_ROOTINO, LK_EXCLUSIVE, &nvp);
 	if (error)
 		return (error);
 	*vpp = nvp;

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Wed Apr 27 18:25:35 2011	(r221128)
@@ -71,12 +71,13 @@
 
 #include <ufs/ufs/dir.h>
 
-#include <fs/ext2fs/inode.h>
-#include <fs/ext2fs/ext2_mount.h>
 #include <fs/ext2fs/fs.h>
+#include <fs/ext2fs/inode.h>
 #include <fs/ext2fs/ext2_extern.h>
 #include <fs/ext2fs/ext2fs.h>
+#include <fs/ext2fs/ext2_dinode.h>
 #include <fs/ext2fs/ext2_dir.h>
+#include <fs/ext2fs/ext2_mount.h>
 
 static int ext2_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *);
 static void ext2_itimes_locked(struct vnode *);
@@ -1581,7 +1582,7 @@ ext2_vinit(mntp, fifoops, vpp)
 	if (vp->v_type == VFIFO)
 		vp->v_op = fifoops;
 
-	if (ip->i_number == ROOTINO)
+	if (ip->i_number == EXT2_ROOTINO)
 		vp->v_vflag |= VV_ROOT;
 	ip->i_modrev = init_va_filerev();
 	*vpp = vp;

Modified: head/sys/fs/ext2fs/inode.h
==============================================================================
--- head/sys/fs/ext2fs/inode.h	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/inode.h	Wed Apr 27 18:25:35 2011	(r221128)
@@ -41,8 +41,6 @@
 #include <sys/lock.h>
 #include <sys/queue.h>
 
-#define	ROOTINO	((ino_t)2)
-
 #define	NDADDR	12			/* Direct addresses in inode. */
 #define	NIADDR	3			/* Indirect addresses in inode. */
 


More information about the svn-src-head mailing list