Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jan 2016 02:41:49 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r294653 - head/sys/fs/ext2fs
Message-ID:  <201601240241.u0O2fnPW055654@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Jan 24 02:41:49 2016
New Revision: 294653
URL: https://svnweb.freebsd.org/changeset/base/294653

Log:
  Rename some directory index constants.
  
  Directory index was introduced in ext3. We don't always use the
  prefix to denote the ext2 variant they belong to but when we
  do we should try to be accurate.

Modified:
  head/sys/fs/ext2fs/ext2_dinode.h
  head/sys/fs/ext2fs/ext2_htree.c
  head/sys/fs/ext2fs/ext2_inode_cnv.c
  head/sys/fs/ext2fs/ext2_lookup.c

Modified: head/sys/fs/ext2fs/ext2_dinode.h
==============================================================================
--- head/sys/fs/ext2fs/ext2_dinode.h	Sun Jan 24 02:25:41 2016	(r294652)
+++ head/sys/fs/ext2fs/ext2_dinode.h	Sun Jan 24 02:41:49 2016	(r294653)
@@ -51,7 +51,7 @@
 /*
  * Inode flags
  * The system supports EXT2_IMMUTABLE, EXT2_APPEND and EXT2_NODUMP flags.
- * The current implementation also uses EXT4_INDEX, EXT4_EXTENTS and
+ * The current implementation also uses EXT3_INDEX, EXT4_EXTENTS and
  * EXT4_HUGE_FILE with some restrictions, imposed the lack of write
  * support.
  */
@@ -63,7 +63,7 @@
 #define	EXT2_APPEND		0x00000020 /* Writes to file may only append */
 #define	EXT2_NODUMP		0x00000040	/* Do not dump file */
 #define	EXT2_NOATIME		0x00000080	/* Do not update atime */
-#define	EXT4_INDEX		0x00001000	/* Hash-indexed directory */
+#define	EXT3_INDEX		0x00001000	/* Hash-indexed directory */
 #define	EXT4_IMAGIC		0x00002000	/* AFS directory */
 #define	EXT4_JOURNAL_DATA	0x00004000 /* File data should be journaled */
 #define	EXT4_NOTAIL		0x00008000 /* File tail should not be merged */

Modified: head/sys/fs/ext2fs/ext2_htree.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_htree.c	Sun Jan 24 02:25:41 2016	(r294652)
+++ head/sys/fs/ext2fs/ext2_htree.c	Sun Jan 24 02:41:49 2016	(r294653)
@@ -90,7 +90,7 @@ int
 ext2_htree_has_idx(struct inode *ip)
 {
 	if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) &&
-	    ip->i_flag & IN_E4INDEX)
+	    ip->i_flag & IN_E3INDEX)
 		return (1);
 	else
 		return (0);
@@ -653,7 +653,7 @@ ext2_htree_create_index(struct vnode *vp
 		    ((char *)ep + ep->e2d_reclen);
 	ep->e2d_reclen = buf1 + blksize - (char *)ep;
 
-	dp->i_flag |= IN_E4INDEX;
+	dp->i_flag |= IN_E3INDEX;
 
 	/*
 	 * Initialize index root.

Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_inode_cnv.c	Sun Jan 24 02:25:41 2016	(r294652)
+++ head/sys/fs/ext2fs/ext2_inode_cnv.c	Sun Jan 24 02:41:49 2016	(r294653)
@@ -110,7 +110,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, stru
 	ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0;
 	ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0;
 	ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0;
-	ip->i_flag |= (ei->e2di_flags & EXT4_INDEX) ? IN_E4INDEX : 0;
+	ip->i_flag |= (ei->e2di_flags & EXT3_INDEX) ? IN_E3INDEX : 0;
 	ip->i_flag |= (ei->e2di_flags & EXT4_EXTENTS) ? IN_E4EXTENTS : 0;
 	ip->i_blocks = ei->e2di_nblock;
 	if (E2DI_HAS_HUGE_FILE(ip)) {
@@ -160,7 +160,7 @@ ext2_i2ei(struct inode *ip, struct ext2f
 	ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0;
 	ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0;
 	ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0;
-	ei->e2di_flags |= (ip->i_flag & IN_E4INDEX) ? EXT4_INDEX: 0;
+	ei->e2di_flags |= (ip->i_flag & IN_E3INDEX) ? EXT3_INDEX: 0;
 	ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS: 0;
 	ei->e2di_nblock = ip->i_blocks & 0xffffffff;
 	ei->e2di_nblock_high = ip->i_blocks >> 32 & 0xffff;

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_lookup.c	Sun Jan 24 02:25:41 2016	(r294652)
+++ head/sys/fs/ext2fs/ext2_lookup.c	Sun Jan 24 02:41:49 2016	(r294653)
@@ -888,7 +888,7 @@ ext2_direnter(struct inode *ip, struct v
 	if (ext2_htree_has_idx(dp)) {
 		error = ext2_htree_add_entry(dvp, &newdir, cnp);
 		if (error) {
-			dp->i_flag &= ~IN_E4INDEX;
+			dp->i_flag &= ~IN_E3INDEX;
 			dp->i_flag |= IN_CHANGE | IN_UPDATE;
 		}
 		return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601240241.u0O2fnPW055654>