From owner-p4-projects@FreeBSD.ORG Tue Jul 21 03:39:01 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5EA801065674; Tue, 21 Jul 2009 03:39:00 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 065441065673 for ; Tue, 21 Jul 2009 03:39:00 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DE7E38FC19 for ; Tue, 21 Jul 2009 03:38:59 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6L3cxhK052521 for ; Tue, 21 Jul 2009 03:38:59 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6L3cxW8052519 for perforce@freebsd.org; Tue, 21 Jul 2009 03:38:59 GMT (envelope-from truncs@FreeBSD.org) Date: Tue, 21 Jul 2009 03:38:59 GMT Message-Id: <200907210338.n6L3cxW8052519@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to truncs@FreeBSD.org using -f From: Aditya Sarawgi To: Perforce Change Reviews Cc: Subject: PERFORCE change 166343 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2009 03:39:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=166343 Change 166343 by truncs@aditya on 2009/07/21 03:38:36 Cleanup. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#26 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#14 edit .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/fs.h#10 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#26 (text+ko) ==== @@ -329,8 +329,6 @@ struct m_ext2fs { struct ext2fs * e2fs; - struct buf * e2fs_buf; - struct buf ** e2fs_group_desc; char e2fs_fsmnt[MAXMNTLEN];/* name mounted on */ char e2fs_ronly; /* mounted read-only flag */ char e2fs_fmod; /* super block modified flag */ @@ -352,12 +350,6 @@ uint32_t e2fs_gcount; /* Number of groups */ uint32_t e2fs_first_inode;/* First inode on fs */ int32_t e2fs_isize; /* Size of inode */ - uint8_t e2fs_lib; /* Loaded inode bitmap */ - uint8_t e2fs_lbb; /* Loaded block bitmap */ - uint32_t e2fs_ibn[EXT2_MAX_GROUP_LOADED]; /* Inode bitmap number */ - struct buf * e2fs_ib[EXT2_MAX_GROUP_LOADED];/* Inode bitmap */ - uint32_t e2fs_bbn[EXT2_MAX_GROUP_LOADED]; /* Block bitmap number */ - struct buf * e2fs_bb[EXT2_MAX_GROUP_LOADED];/* Block bitmap */ uint32_t e2fs_mount_opt; uint32_t e2fs_blocksize_bits; char e2fs_wasvalid; /* valid at mount time */ ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#14 (text+ko) ==== @@ -299,55 +299,6 @@ return (0); } -/* - * Checks that the data in the descriptor blocks make sense - * this is taken from ext2/super.c. - */ -/* -static int -ext2_check_descriptors(struct m_ext2fs *sb) -{ - struct ext2_gd *gdp = NULL; - unsigned long block = sb->e2fs->e2fs_first_dblock; - int desc_block = 0; - int i; - - for (i = 0; i < sb->e2fs_gcount; i++) { - examine next descriptor block */ /* - if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0) - gdp = (struct ext2_gd *) - sb->e2fs_group_desc[desc_block++]->b_data; - if (gdp->ext2bgd_b_bitmap < block || - gdp->ext2bgd_b_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { - printf ("ext2_check_descriptors: " - "Block bitmap for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->ext2bgd_b_bitmap); - return (0); - } - if (gdp->ext2bgd_i_bitmap < block || - gdp->ext2bgd_i_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) { - printf ("ext2_check_descriptors: " - "Inode bitmap for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->ext2bgd_i_bitmap); - return (0); - } - if (gdp->ext2bgd_i_tables < block || - gdp->ext2bgd_i_tables + sb->e2fs_itpg >= - block + EXT2_BLOCKS_PER_GROUP(sb)) { - printf ("ext2_check_descriptors: " - "Inode table for group %d" - " not in group (block %lu)!\n", - i, (unsigned long) gdp->ext2bgd_i_tables); - return (0); - } - block += EXT2_BLOCKS_PER_GROUP(sb); - gdp++; - } - return (1); -} -*/ static int ext2_check_sb_compat(struct ext2fs *es, struct cdev *dev, int ronly) { @@ -425,8 +376,6 @@ db_count = (fs->e2fs_gcount + EXT2_DESC_PER_BLOCK(fs) - 1) / EXT2_DESC_PER_BLOCK(fs); fs->e2fs_gdbcount = db_count; - fs->e2fs_group_desc = malloc(db_count * sizeof (struct buf *), - M_EXT2MNT, M_WAITOK); fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); @@ -453,14 +402,6 @@ brelse(bp); bp = NULL; } - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) { - fs->e2fs_ibn[i] = 0; - fs->e2fs_ib[i] = NULL; - fs->e2fs_bbn[i] = 0; - fs->e2fs_bb[i] = NULL; - } - fs->e2fs_lib = 0; - fs->e2fs_lbb = 0; if (es->e2fs_rev == E2FS_REV0 || (es->e2fs_features_rocompat & EXT2F_ROCOMPAT_LARGEFILE) == 0) fs->e2fs_maxfilesize = 0x7fffffff; @@ -652,10 +593,6 @@ if ((error = compute_sb_data(devvp, ump->um_e2fs->e2fs, ump->um_e2fs))) goto out; - /* - * We don't free the group descriptors allocated by compute_sb_data() - * until ext2_unmount(). This is OK since the mount will succeed. - */ brelse(bp); bp = NULL; fs = ump->um_e2fs; @@ -721,7 +658,7 @@ { struct ext2mount *ump; struct m_ext2fs *fs; - int error, flags, ronly, i; + int error, flags, ronly; flags = 0; if (mntflags & MNT_FORCE) { @@ -740,19 +677,6 @@ ext2_sbupdate(ump, MNT_WAIT); } - /* release buffers containing group descriptors */ -/* for(i = 0; i < fs->e2fs_gdbcount; i++) - ULCK_BUF(fs->e2fs_group_desc[i]) - free(fs->e2fs_group_desc, M_EXT2MNT); -*/ - /* release cached inode/block bitmaps */ - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->e2fs_ib[i]) - ULCK_BUF(fs->e2fs_ib[i]) - for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) - if (fs->e2fs_bb[i]) - ULCK_BUF(fs->e2fs_bb[i]) - DROP_GIANT(); g_topology_lock(); g_vfs_close(ump->um_cp); ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/fs.h#10 (text+ko) ==== @@ -66,13 +66,6 @@ */ /* - * Convert cylinder group to base address of its global summary info. - */ -#define fs_cs(fs, cgindx) (((struct ext2_gd *) \ - (fs->e2fs_group_desc[cgindx / EXT2_DESC_PER_BLOCK(fs)]->b_data)) \ - [cgindx % EXT2_DESC_PER_BLOCK(fs)]) - -/* * Turn file system block numbers into disk block addresses. * This maps file system blocks to device size blocks. */