summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-02-08 20:58:00 +0000
committerpfg <pfg@FreeBSD.org>2013-02-08 20:58:00 +0000
commit9694490e0d77386d377b15305ceca5de581af61d (patch)
tree957664bfe9179f22a93447b484711a0425d1e978
parentf908ac5c6e119b1a2dab329c1177ceeae5d937be (diff)
downloadFreeBSD-src-9694490e0d77386d377b15305ceca5de581af61d.zip
FreeBSD-src-9694490e0d77386d377b15305ceca5de581af61d.tar.gz
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
-rw-r--r--sys/fs/ext2fs/ext2_vfsops.c9
-rw-r--r--sys/fs/ext2fs/ext2fs.h1
2 files changed, 3 insertions, 7 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c
index 136f01c..d0f3edb 100644
--- a/sys/fs/ext2fs/ext2_vfsops.c
+++ b/sys/fs/ext2fs/ext2_vfsops.c
@@ -527,6 +527,7 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp)
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 mount *mp)
* 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);
diff --git a/sys/fs/ext2fs/ext2fs.h b/sys/fs/ext2fs/ext2fs.h
index c5a4c15..02cdcda 100644
--- a/sys/fs/ext2fs/ext2fs.h
+++ b/sys/fs/ext2fs/ext2fs.h
@@ -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 */
OpenPOWER on IntegriCloud