Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Feb 2013 20:58:00 +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: r246563 - head/sys/fs/ext2fs
Message-ID:  <201302082058.r18Kw0C9039175@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Fri Feb  8 20:58:00 2013
New Revision: 246563
URL: http://svnweb.freebsd.org/changeset/base/246563

Log:
  ext2fs: make e2fs_maxcontig local and remove tautological check.
  
  e2fs_maxcontig was modelled after UFS when bringing the
  "Orlov allocator" to ext2. On UFS fs_maxcontig is kept in the
  superblock and is used by userland tools (fsck and growfs),
  
  In ext2 this information is volatile so it is not available
  for userland tools, so in this case it doesn't have sense
  to carry it in the in-memory superblock.
  
  Also remove a pointless check for MAX(1, x) > 0.
  
  Submitted by:	Christoph Mallon
  MFC after:	2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2fs.h

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c	Fri Feb  8 20:30:19 2013	(r246562)
+++ head/sys/fs/ext2fs/ext2_vfsops.c	Fri Feb  8 20:58:00 2013	(r246563)
@@ -527,6 +527,7 @@ ext2_mountfs(struct vnode *devvp, struct
 	int ronly;
 	int i, size;
 	int32_t *lp;
+	int32_t e2fs_maxcontig;
 
 	ronly = vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0);
 	/* XXX: use VOP_ACESS to check FS perms */
@@ -601,12 +602,8 @@ ext2_mountfs(struct vnode *devvp, struct
 	 * in ext2fs doesn't have these variables, so we can calculate 
 	 * them here.
 	 */
-	ump->um_e2fs->e2fs_maxcontig = MAX(1, MAXPHYS / ump->um_e2fs->e2fs_bsize);
-	if (ump->um_e2fs->e2fs_maxcontig > 0)
-		ump->um_e2fs->e2fs_contigsumsize =
-		    MIN(ump->um_e2fs->e2fs_maxcontig, EXT2_MAXCONTIG);
-	else
-		ump->um_e2fs->e2fs_contigsumsize = 0;
+	e2fs_maxcontig = MAX(1, MAXPHYS / ump->um_e2fs->e2fs_bsize);
+	ump->um_e2fs->e2fs_contigsumsize = MIN(e2fs_maxcontig, EXT2_MAXCONTIG);
 	if (ump->um_e2fs->e2fs_contigsumsize > 0) {
 		size = ump->um_e2fs->e2fs_gcount * sizeof(int32_t);
 		ump->um_e2fs->e2fs_maxcluster = malloc(size, M_EXT2MNT, M_WAITOK);

Modified: head/sys/fs/ext2fs/ext2fs.h
==============================================================================
--- head/sys/fs/ext2fs/ext2fs.h	Fri Feb  8 20:30:19 2013	(r246562)
+++ head/sys/fs/ext2fs/ext2fs.h	Fri Feb  8 20:58:00 2013	(r246563)
@@ -170,7 +170,6 @@ struct m_ext2fs {
 	char     e2fs_wasvalid;   /* valid at mount time */
 	off_t    e2fs_maxfilesize;
 	struct   ext2_gd *e2fs_gd; /* Group Descriptors */
-	int32_t  e2fs_maxcontig;	/* max number of contiguous blks */
 	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 */



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