svn commit: r281842 - in stable/9/sys: conf fs/ext2fs modules/ext2fs

Pedro F. Giffuni pfg at FreeBSD.org
Wed Apr 22 00:40:44 UTC 2015


Author: pfg
Date: Wed Apr 22 00:40:41 2015
New Revision: 281842
URL: https://svnweb.freebsd.org/changeset/base/281842

Log:
  MFC	r281670, r281703:
  Drop experimental ext2fs dir_index support.
  
  The htree directory index is a highly desirable feature for research
  purposes and was meant to improve performance in our ext2/3 driver.
  Unfortunately our implementation has two problems:
  
  - It never really delivered any performance improvement.
  - It appears to corrupt the filesystem in undetermined circumstances.
  
  Strictly speaking dir_index is not required for read/write support in
  ext2/3 and our limited ext4 support still works fine without it.
  
  Regain stability in the ext2 driver by removing it. We may need it back
  (fixed) if we want to support encrypted ext4 support but thanks to the
  wonders of version control we can always revert this change and bring it
  back.
  
  PR:	191895
  PR:	198731
  PR:	199309

Deleted:
  stable/9/sys/fs/ext2fs/ext2_hash.c
  stable/9/sys/fs/ext2fs/ext2_htree.c
Modified:
  stable/9/sys/conf/files
  stable/9/sys/fs/ext2fs/ext2_dir.h
  stable/9/sys/fs/ext2fs/ext2_extern.h
  stable/9/sys/fs/ext2fs/ext2_lookup.c
  stable/9/sys/fs/ext2fs/ext2_vfsops.c
  stable/9/sys/fs/ext2fs/ext2fs.h
  stable/9/sys/modules/ext2fs/Makefile
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/conf/files
==============================================================================
--- stable/9/sys/conf/files	Wed Apr 22 00:38:11 2015	(r281841)
+++ stable/9/sys/conf/files	Wed Apr 22 00:40:41 2015	(r281842)
@@ -2428,8 +2428,6 @@ fs/ext2fs/ext2_bmap.c		optional ext2fs
 fs/ext2fs/ext2_extents.c	optional ext2fs
 fs/ext2fs/ext2_inode.c		optional ext2fs
 fs/ext2fs/ext2_inode_cnv.c	optional ext2fs
-fs/ext2fs/ext2_hash.c		optional ext2fs
-fs/ext2fs/ext2_htree.c		optional ext2fs
 fs/ext2fs/ext2_lookup.c		optional ext2fs
 fs/ext2fs/ext2_subr.c		optional ext2fs
 fs/ext2fs/ext2_vfsops.c		optional ext2fs

Modified: stable/9/sys/fs/ext2fs/ext2_dir.h
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_dir.h	Wed Apr 22 00:38:11 2015	(r281841)
+++ stable/9/sys/fs/ext2fs/ext2_dir.h	Wed Apr 22 00:40:41 2015	(r281842)
@@ -40,21 +40,6 @@ struct	ext2fs_direct {
 	uint16_t e2d_namlen;		/* length of string in e2d_name */
 	char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */
 };
-
-enum slotstatus {
-	NONE,
-	COMPACT,
-	FOUND
-};
-
-struct ext2fs_searchslot {
-	enum slotstatus slotstatus;
-	doff_t slotoffset;	/* offset of area with free space */
-	int slotsize;		/* size of area at slotoffset */
-	int slotfreespace;	/* amount of space free in slot */
-	int slotneeded;		/* sizeof the entry we are seeking */
-};
-
 /*
  * The new version of the directory entry.  Since EXT2 structures are
  * stored in intel byte order, and the name_len field could never be

Modified: stable/9/sys/fs/ext2fs/ext2_extern.h
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_extern.h	Wed Apr 22 00:38:11 2015	(r281841)
+++ stable/9/sys/fs/ext2fs/ext2_extern.h	Wed Apr 22 00:40:41 2015	(r281842)
@@ -40,15 +40,12 @@
 #define	_FS_EXT2FS_EXT2_EXTERN_H_
 
 struct ext2fs_dinode;
-struct ext2fs_direct_2;
-struct ext2fs_searchslot;
 struct indir;
 struct inode;
 struct mount;
 struct vfsconf;
 struct vnode;
 
-int	ext2_add_entry(struct vnode *, struct ext2fs_direct_2 *);
 int	ext2_alloc(struct inode *, daddr_t, e4fs_daddr_t, int,
 	    struct ucred *, e4fs_daddr_t *);
 int	ext2_balloc(struct inode *,
@@ -86,18 +83,6 @@ int	ext2_dirempty(struct inode *, ino_t,
 int	ext2_checkpath(struct inode *, struct inode *, struct ucred *);
 int	cg_has_sb(int i);
 int	ext2_inactive(struct vop_inactive_args *);
-int	ext2_htree_add_entry(struct vnode *, struct ext2fs_direct_2 *,
-	    struct componentname *);
-int	ext2_htree_create_index(struct vnode *, struct componentname *,
-	    struct ext2fs_direct_2 *);
-int	ext2_htree_has_idx(struct inode *);
-int	ext2_htree_hash(const char *, int, uint32_t *, int, uint32_t *,
-	    uint32_t *);
-int	ext2_htree_lookup(struct inode *, const char *, int, struct buf **,
-	    int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
-int	ext2_search_dirblock(struct inode *, void *, int *, const char *, int,
-	    int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *);
-
 
 /* Flags to low-level allocation routines.
  * The low 16-bits are reserved for IO_ flags from vnode.h.

Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_lookup.c	Wed Apr 22 00:38:11 2015	(r281841)
+++ stable/9/sys/fs/ext2fs/ext2_lookup.c	Wed Apr 22 00:40:41 2015	(r281842)
@@ -113,19 +113,9 @@ static u_char dt_to_ext2_ft[] = {
 
 static int	ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de,
 		    int entryoffsetinblock);
-static int	ext2_is_dot_entry(struct componentname *cnp);
 static int	ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp,
 		    struct componentname *cnp, ino_t *dd_ino);
 
-static int
-ext2_is_dot_entry(struct componentname *cnp)
-{
-	if (cnp->cn_namelen <= 2 && cnp->cn_nameptr[0] == '.' &&
-	    (cnp->cn_nameptr[1] == '.' || cnp->cn_nameptr[1] == '0'))
-		return (1);
-	return (0);
-}
-
 /*
  * Vnode op for reading directories.
  */
@@ -306,9 +296,13 @@ ext2_lookup_ino(struct vnode *vdp, struc
 	struct buf *bp;			/* a buffer of directory entries */
 	struct ext2fs_direct_2 *ep;	/* the current directory entry */
 	int entryoffsetinblock;		/* offset of ep in bp's buffer */
-	struct ext2fs_searchslot ss;
+	enum {NONE, COMPACT, FOUND} slotstatus;
+	doff_t slotoffset;		/* offset of area with free space */
 	doff_t i_diroff;		/* cached i_diroff value */
 	doff_t i_offset;		/* cached i_offset value */
+	int slotsize;			/* size of area at slotoffset */
+	int slotfreespace;		/* amount of space free in slot */
+	int slotneeded;			/* size of the entry we're seeking */
 	int numdirpasses;		/* strategy for directory search */
 	doff_t endsearch;		/* offset to end directory search */
 	doff_t prevoff;			/* prev entry dp->i_offset */
@@ -316,13 +310,12 @@ ext2_lookup_ino(struct vnode *vdp, struc
 	struct vnode *tdp;		/* returned by VFS_VGET */
 	doff_t enduseful;		/* pointer past last used dir slot */
 	u_long bmask;			/* block offset mask */
-	int error;
+	int namlen, error;
 	struct ucred *cred = cnp->cn_cred;
 	int flags = cnp->cn_flags;
 	int nameiop = cnp->cn_nameiop;
 	ino_t ino, ino1;
 	int ltype;
-	int entry_found = 0;
 
 	int	DIRBLKSIZ = VTOI(vdp)->i_e2fs->e2fs_bsize;
 
@@ -333,57 +326,31 @@ ext2_lookup_ino(struct vnode *vdp, struc
 	bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1;
 restart:
 	bp = NULL;
-	ss.slotoffset = -1;
+	slotoffset = -1;
 
 	/*
 	 * We now have a segment name to search for, and a directory to search.
-	 *
+	 */
+
+	/*
 	 * Suppress search for slots unless creating
 	 * file and at end of pathname, in which case
 	 * we watch for a place to put the new file in
 	 * case it doesn't already exist.
 	 */
 	i_diroff = dp->i_diroff;
-	ss.slotstatus = FOUND;
-	ss.slotfreespace = ss.slotsize = ss.slotneeded = 0;
+	slotstatus = FOUND;
+	slotfreespace = slotsize = slotneeded = 0;
 	if ((nameiop == CREATE || nameiop == RENAME) &&
 	    (flags & ISLASTCN)) {
-		ss.slotstatus = NONE;
-		ss.slotneeded = EXT2_DIR_REC_LEN(cnp->cn_namelen);
+		slotstatus = NONE;
+		slotneeded = EXT2_DIR_REC_LEN(cnp->cn_namelen);
 		/* was
-		ss.slotneeded = (sizeof(struct direct) - MAXNAMLEN +
+		slotneeded = (sizeof(struct direct) - MAXNAMLEN +
 			cnp->cn_namelen + 3) &~ 3; */
 	}
 
 	/*
-	 * Try to lookup dir entry using htree directory index.
-	 *
-	 * If we got an error or we want to find '.' or '..' entry,
-	 * we will fall back to linear search.
-	 */
-	if (!ext2_is_dot_entry(cnp) && ext2_htree_has_idx(dp)) {
-		numdirpasses = 1;
-		entryoffsetinblock = 0;
-		switch (ext2_htree_lookup(dp, cnp->cn_nameptr, cnp->cn_namelen,
-				&bp, &entryoffsetinblock, &i_offset, &prevoff,
-				&enduseful, &ss)) {
-		case 0:
-			ep = (struct ext2fs_direct_2 *)((char *)bp->b_data +
-				(i_offset & bmask));
-			goto foundentry;
-		case ENOENT:
-			i_offset = roundup2(dp->i_size, DIRBLKSIZ);
-			goto notfound;
-		default:
-			/*
-			 * Something failed; just fallback to do a linear
-			 * search.
-			 */
-			break;
-		}
-	}
-
-	/*
 	 * If there is cached information on a previous search of
 	 * this directory, pick up where we last left off.
 	 * We cache only lookups as these are the most common
@@ -417,38 +384,96 @@ searchloop:
 		/*
 		 * If necessary, get the next directory block.
 		 */
-		if (bp != NULL)
-			brelse(bp);
-		error = ext2_blkatoff(vdp, (off_t)i_offset, NULL, &bp);
-		if (error != 0)
-			return (error);
-		entryoffsetinblock = 0;
+		if ((i_offset & bmask) == 0) {
+			if (bp != NULL)
+				brelse(bp);
+			if ((error =
+			    ext2_blkatoff(vdp, (off_t)i_offset, NULL,
+			    &bp)) != 0)
+				return (error);
+			entryoffsetinblock = 0;
+		}
 		/*
 		 * If still looking for a slot, and at a DIRBLKSIZE
 		 * boundary, have to start looking for free space again.
 		 */
-		if (ss.slotstatus == NONE &&
+		if (slotstatus == NONE &&
 		    (entryoffsetinblock & (DIRBLKSIZ - 1)) == 0) {
-			ss.slotoffset = -1;
-			ss.slotfreespace = 0;
+			slotoffset = -1;
+			slotfreespace = 0;
 		}
-		error = ext2_search_dirblock(dp, bp->b_data, &entry_found,
-				cnp->cn_nameptr, cnp->cn_namelen,
-				&entryoffsetinblock, &i_offset, &prevoff,
-				&enduseful, &ss);
-		if (error != 0) {
-			brelse(bp);
-			return (error);
+		/*
+		 * Get pointer to next entry.
+		 * Full validation checks are slow, so we only check
+		 * enough to insure forward progress through the
+		 * directory. Complete checks can be run by setting
+		 * "vfs.e2fs.dirchk" to be true.
+		 */
+		ep = (struct ext2fs_direct_2 *)
+			((char *)bp->b_data + entryoffsetinblock);
+		if (ep->e2d_reclen == 0 ||
+		    (dirchk && ext2_dirbadentry(vdp, ep, entryoffsetinblock))) {
+			int i;
+			ext2_dirbad(dp, i_offset, "mangled entry");
+			i = DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1));
+			i_offset += i;
+			entryoffsetinblock += i;
+			continue;
 		}
-		if (entry_found) {
-			ep = (struct ext2fs_direct_2 *)((char *)bp->b_data +
-				(entryoffsetinblock & bmask));
-foundentry:
-			ino = ep->e2d_ino;
-			goto found;
+
+		/*
+		 * If an appropriate sized slot has not yet been found,
+		 * check to see if one is available. Also accumulate space
+		 * in the current block so that we can determine if
+		 * compaction is viable.
+		 */
+		if (slotstatus != FOUND) {
+			int size = ep->e2d_reclen;
+
+			if (ep->e2d_ino != 0)
+				size -= EXT2_DIR_REC_LEN(ep->e2d_namlen);
+			if (size > 0) {
+				if (size >= slotneeded) {
+					slotstatus = FOUND;
+					slotoffset = i_offset;
+					slotsize = ep->e2d_reclen;
+				} else if (slotstatus == NONE) {
+					slotfreespace += size;
+					if (slotoffset == -1)
+						slotoffset = i_offset;
+					if (slotfreespace >= slotneeded) {
+						slotstatus = COMPACT;
+						slotsize = i_offset +
+						      ep->e2d_reclen - slotoffset;
+					}
+				}
+			}
 		}
+
+		/*
+		 * Check for a name match.
+		 */
+		if (ep->e2d_ino) {
+			namlen = ep->e2d_namlen;
+			if (namlen == cnp->cn_namelen &&
+			    !bcmp(cnp->cn_nameptr, ep->e2d_name,
+				(unsigned)namlen)) {
+				/*
+				 * Save directory entry's inode number and
+				 * reclen in ndp->ni_ufs area, and release
+				 * directory buffer.
+				 */
+				ino = ep->e2d_ino;
+				goto found;
+			}
+		}
+		prevoff = i_offset;
+		i_offset += ep->e2d_reclen;
+		entryoffsetinblock += ep->e2d_reclen;
+		if (ep->e2d_ino)
+			enduseful = i_offset;
 	}
-notfound:
+/* notfound: */
 	/*
 	 * If we started in the middle of the directory and failed
 	 * to find our target, we must check the beginning as well.
@@ -483,15 +508,15 @@ notfound:
 		 * can be put in the range from dp->i_offset to
 		 * dp->i_offset + dp->i_count.
 		 */
-		if (ss.slotstatus == NONE) {
+		if (slotstatus == NONE) {
 			dp->i_offset = roundup2(dp->i_size, DIRBLKSIZ);
 			dp->i_count = 0;
 			enduseful = dp->i_offset;
 		} else {
-			dp->i_offset = ss.slotoffset;
-			dp->i_count = ss.slotsize;
-			if (enduseful < ss.slotoffset + ss.slotsize)
-				enduseful = ss.slotoffset + ss.slotsize;
+			dp->i_offset = slotoffset;
+			dp->i_count = slotsize;
+			if (enduseful < slotoffset + slotsize)
+				enduseful = slotoffset + slotsize;
 		}
 		dp->i_endoff = roundup2(enduseful, DIRBLKSIZ);
 		/*
@@ -697,102 +722,6 @@ found:
 	return (0);
 }
 
-int
-ext2_search_dirblock(struct inode *ip, void *data, int *foundp,
-	const char *name, int namelen, int *entryoffsetinblockp,
-	doff_t *offp, doff_t *prevoffp, doff_t *endusefulp,
-	struct ext2fs_searchslot *ssp)
-{
-	struct vnode *vdp;
-	struct ext2fs_direct_2 *ep, *top;
-	uint32_t bsize = ip->i_e2fs->e2fs_bsize;
-	int offset = *entryoffsetinblockp;
-	int namlen;
-
-	vdp = ITOV(ip);
-
-	ep = (struct ext2fs_direct_2 *)((char *)data + offset);
-	top = (struct ext2fs_direct_2 *)((char *)data +
-		bsize - EXT2_DIR_REC_LEN(0));
-
-	while (ep < top) {
-		/*
-		 * Full validation checks are slow, so we only check
-		 * enough to insure forward progress through the
-		 * directory. Complete checks can be run by setting
-		 * "vfs.e2fs.dirchk" to be true.
-		 */
-		if (ep->e2d_reclen == 0 ||
-		    (dirchk && ext2_dirbadentry(vdp, ep, offset))) {
-			int i;
-			ext2_dirbad(ip, *offp, "mangled entry");
-			i = bsize - (offset & (bsize - 1));
-			*offp += i;
-			offset += i;
-			continue;
-		}
-
-		/*
-		 * If an appropriate sized slot has not yet been found,
-		 * check to see if one is available. Also accumulate space
-		 * in the current block so that we can determine if
-		 * compaction is viable.
-		 */
-		if (ssp->slotstatus != FOUND) {
-			int size = ep->e2d_reclen;
-
-			if (ep->e2d_ino != 0)
-				size -= EXT2_DIR_REC_LEN(ep->e2d_namlen);
-			if (size > 0) {
-				if (size >= ssp->slotneeded) {
-					ssp->slotstatus = FOUND;
-					ssp->slotoffset = *offp;
-					ssp->slotsize = ep->e2d_reclen;
-				} else if (ssp->slotstatus == NONE) {
-					ssp->slotfreespace += size;
-					if (ssp->slotoffset == -1)
-						ssp->slotoffset = *offp;
-					if (ssp->slotfreespace >= ssp->slotneeded) {
-						ssp->slotstatus = COMPACT;
-						ssp->slotsize = *offp +
-							ep->e2d_reclen -
-							ssp->slotoffset;
-					}
-				}
-			}
-		}
-
-		/*
-		 * Check for a name match.
-		 */
-		if (ep->e2d_ino) {
-			namlen = ep->e2d_namlen;
-			if (namlen == namelen &&
-			    !bcmp(name, ep->e2d_name, (unsigned)namlen)) {
-				/*
-				 * Save directory entry's inode number and
-				 * reclen in ndp->ni_ufs area, and release
-				 * directory buffer.
-				 */
-				*foundp = 1;
-				return (0);
-			}
-		}
-		*prevoffp = *offp;
-		*offp += ep->e2d_reclen;
-		offset += ep->e2d_reclen;
-		*entryoffsetinblockp = offset;
-		if (ep->e2d_ino)
-			*endusefulp = *offp;
-		/*
-		 * Get pointer to the next entry.
-		 */
-		ep = (struct ext2fs_direct_2 *)((char *)data + offset);
-	}
-
-	return (0);
-}
-
 void
 ext2_dirbad(struct inode *ip, doff_t offset, char *how)
 {
@@ -860,12 +789,16 @@ ext2_dirbadentry(struct vnode *dp, struc
 int
 ext2_direnter(struct inode *ip, struct vnode *dvp, struct componentname *cnp)
 {
+	struct ext2fs_direct_2 *ep, *nep;
 	struct inode *dp;
+	struct buf *bp;
 	struct ext2fs_direct_2 newdir;
 	struct iovec aiov;
 	struct uio auio;
-	int error, newentrysize;
-	int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize;
+	u_int dsize;
+	int error, loc, newentrysize, spacefree;
+	char *dirbuf;
+	int     DIRBLKSIZ = ip->i_e2fs->e2fs_bsize;
 
 
 #ifdef INVARIANTS
@@ -882,28 +815,6 @@ ext2_direnter(struct inode *ip, struct v
 		newdir.e2d_type = EXT2_FT_UNKNOWN;
 	bcopy(cnp->cn_nameptr, newdir.e2d_name, (unsigned)cnp->cn_namelen + 1);
 	newentrysize = EXT2_DIR_REC_LEN(newdir.e2d_namlen);
-
-	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_CHANGE | IN_UPDATE;
-		}
-		return (error);
-	}
-
-	if (EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_DIRHASHINDEX) &&
-	    !ext2_htree_has_idx(dp)) {
-		if ((dp->i_size / DIRBLKSIZ) == 1 &&
-		    dp->i_offset == DIRBLKSIZ) {
-			/*
-			 * Making indexed directory when one block is not
-			 * enough to save all entries.
-			 */
-			return ext2_htree_create_index(dvp, cnp, &newdir);
-		}
-	}
-
 	if (dp->i_count == 0) {
 		/*
 		 * If dp->i_count is 0, then namei could find no
@@ -935,29 +846,6 @@ ext2_direnter(struct inode *ip, struct v
 		return (error);
 	}
 
-	error = ext2_add_entry(dvp, &newdir);
-	if (!error && dp->i_endoff && dp->i_endoff < dp->i_size)
-		error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC,
-		    cnp->cn_cred, cnp->cn_thread);
-	return (error);
-}
-
-/*
- * Insert an entry into the directory block.
- * Compact the contents.
- */
-int
-ext2_add_entry(struct vnode *dvp, struct ext2fs_direct_2 *entry)
-{
-	struct ext2fs_direct_2 *ep, *nep;
-	struct inode *dp;
-	struct buf *bp;
-	u_int dsize;
-	int error, loc, newentrysize, spacefree;
-	char *dirbuf;
-
-	dp = VTOI(dvp);
-
 	/*
 	 * If dp->i_count is non-zero, then namei found space
 	 * for the new entry in the range dp->i_offset to
@@ -989,7 +877,6 @@ ext2_add_entry(struct vnode *dvp, struct
 	 * dp->i_offset + dp->i_count would yield the
 	 * space.
 	 */
-	newentrysize = EXT2_DIR_REC_LEN(entry->e2d_namlen);
 	ep = (struct ext2fs_direct_2 *)dirbuf;
 	dsize = EXT2_DIR_REC_LEN(ep->e2d_namlen);
 	spacefree = ep->e2d_reclen - dsize;
@@ -1015,15 +902,15 @@ ext2_add_entry(struct vnode *dvp, struct
 	if (ep->e2d_ino == 0) {
 		if (spacefree + dsize < newentrysize)
 			panic("ext2_direnter: compact1");
-		entry->e2d_reclen = spacefree + dsize;
+		newdir.e2d_reclen = spacefree + dsize;
 	} else {
 		if (spacefree < newentrysize)
 			panic("ext2_direnter: compact2");
-		entry->e2d_reclen = spacefree;
+		newdir.e2d_reclen = spacefree;
 		ep->e2d_reclen = dsize;
 		ep = (struct ext2fs_direct_2 *)((char *)ep + dsize);
 	}
-	bcopy((caddr_t)entry, (caddr_t)ep, (u_int)newentrysize);
+	bcopy((caddr_t)&newdir, (caddr_t)ep, (u_int)newentrysize);
 	if (DOINGASYNC(dvp)) {
 		bdwrite(bp);
 		error = 0;
@@ -1031,6 +918,9 @@ ext2_add_entry(struct vnode *dvp, struct
 		error = bwrite(bp);
 	}
 	dp->i_flag |= IN_CHANGE | IN_UPDATE;
+	if (!error && dp->i_endoff && dp->i_endoff < dp->i_size)
+		error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC,
+		    cnp->cn_cred, cnp->cn_thread);
 	return (error);
 }
 

Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_vfsops.c	Wed Apr 22 00:38:11 2015	(r281841)
+++ stable/9/sys/fs/ext2fs/ext2_vfsops.c	Wed Apr 22 00:40:41 2015	(r281842)
@@ -399,22 +399,8 @@ compute_sb_data(struct vnode *devvp, str
 	if (es->e2fs_rev == E2FS_REV0 ||
 	    !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_LARGEFILE))
 		fs->e2fs_maxfilesize = 0x7fffffff;
-	else {
-		fs->e2fs_maxfilesize = 0xffffffffffff;
-		if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_HUGE_FILE))
-			fs->e2fs_maxfilesize = 0x7fffffffffffffff;
-	}
-	if (es->e4fs_flags & E2FS_UNSIGNED_HASH) {
-		fs->e2fs_uhash = 3;
-	} else if ((es->e4fs_flags & E2FS_SIGNED_HASH) == 0) {
-#ifdef __CHAR_UNSIGNED__
-		es->e4fs_flags |= E2FS_UNSIGNED_HASH;
-		fs->e2fs_uhash = 3;
-#else
-		es->e4fs_flags |= E2FS_SIGNED_HASH;
-#endif
-	}
-
+	else
+		fs->e2fs_maxfilesize = 0x7fffffffffffffff;
 	return (0);
 }
 

Modified: stable/9/sys/fs/ext2fs/ext2fs.h
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2fs.h	Wed Apr 22 00:38:11 2015	(r281841)
+++ stable/9/sys/fs/ext2fs/ext2fs.h	Wed Apr 22 00:40:41 2015	(r281842)
@@ -147,7 +147,6 @@ struct m_ext2fs {
 	int32_t  e2fs_contigsumsize;    /* size of cluster summary array */
 	int32_t *e2fs_maxcluster;       /* max cluster in each cyl group */
 	struct   csum *e2fs_clustersum; /* cluster summary in each cyl group */
-	int32_t  e2fs_uhash;	  /* 3 if hash should be signed, 0 if not */
 };
 
 /* cluster summary information */
@@ -212,7 +211,6 @@ struct csum {
  * - EXT2F_INCOMPAT_FLEX_BG
  * - EXT2F_INCOMPAT_META_BG
  */
-#define	EXT2F_COMPAT_SUPP		EXT2F_COMPAT_DIRHASHINDEX
 #define	EXT2F_ROCOMPAT_SUPP		(EXT2F_ROCOMPAT_SPARSESUPER | \
 					 EXT2F_ROCOMPAT_LARGEFILE | \
 					 EXT2F_ROCOMPAT_EXTRA_ISIZE)
@@ -242,12 +240,6 @@ struct csum {
 #define	E2FS_ISCLEAN			0x0001	/* Unmounted cleanly */
 #define	E2FS_ERRORS			0x0002	/* Errors detected */
 
-/*
- * Filesystem miscellaneous flags
- */
-#define	E2FS_SIGNED_HASH	0x0001
-#define	E2FS_UNSIGNED_HASH	0x0002
-
 /* ext2 file system block group descriptor */
 
 struct ext2_gd {

Modified: stable/9/sys/modules/ext2fs/Makefile
==============================================================================
--- stable/9/sys/modules/ext2fs/Makefile	Wed Apr 22 00:38:11 2015	(r281841)
+++ stable/9/sys/modules/ext2fs/Makefile	Wed Apr 22 00:40:41 2015	(r281842)
@@ -3,8 +3,8 @@
 .PATH:	${.CURDIR}/../../fs/ext2fs
 KMOD=	ext2fs
 SRCS=	opt_ddb.h opt_directio.h opt_quota.h opt_suiddir.h vnode_if.h \
-	ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_extents.c ext2_hash.c \
-	ext2_htree.c ext2_inode.c ext2_inode_cnv.c ext2_lookup.c ext2_subr.c \
+	ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_extents.c \
+	ext2_inode.c ext2_inode_cnv.c ext2_lookup.c ext2_subr.c \
 	ext2_vfsops.c ext2_vnops.c
 
 .include <bsd.kmod.mk>


More information about the svn-src-stable-9 mailing list