From owner-svn-src-projects@FreeBSD.ORG Wed Jan 27 20:13:00 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1F01065670; Wed, 27 Jan 2010 20:13:00 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BC438FC13; Wed, 27 Jan 2010 20:13:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0RKD0au016795; Wed, 27 Jan 2010 20:13:00 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0RKD0MH016791; Wed, 27 Jan 2010 20:13:00 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201001272013.o0RKD0MH016791@svn.freebsd.org> From: Jeff Roberson Date: Wed, 27 Jan 2010 20:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203091 - in projects/suj: 6/sbin/fsck_ffs 7/sbin/fsck_ffs 8/sbin/fsck_ffs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2010 20:13:00 -0000 Author: jeff Date: Wed Jan 27 20:12:59 2010 New Revision: 203091 URL: http://svn.freebsd.org/changeset/base/203091 Log: - Merge r203088 from suj/head Modified: projects/suj/6/sbin/fsck_ffs/suj.c projects/suj/7/sbin/fsck_ffs/suj.c projects/suj/8/sbin/fsck_ffs/suj.c Modified: projects/suj/6/sbin/fsck_ffs/suj.c ============================================================================== --- projects/suj/6/sbin/fsck_ffs/suj.c Wed Jan 27 20:12:04 2010 (r203090) +++ projects/suj/6/sbin/fsck_ffs/suj.c Wed Jan 27 20:12:59 2010 (r203091) @@ -194,6 +194,8 @@ closedisk(const char *devnam) fs->fs_cstotal.cs_nifree += cgsum->cs_nifree; fs->fs_cstotal.cs_ndir += cgsum->cs_ndir; } + fs->fs_pendinginodes = 0; + fs->fs_pendingblocks = 0; fs->fs_clean = 1; fs->fs_time = time(NULL); fs->fs_mtime = time(NULL); @@ -446,25 +448,6 @@ iblk_write(struct ino_blk *iblk) err(1, "Failed to write inode block %jd", iblk->ib_blk); } -/* - * Return 1 if the inode was free and 0 if it is allocated. - */ -static int -ino_isfree(ino_t ino) -{ - struct suj_cg *sc; - uint8_t *inosused; - struct cg *cgp; - int cg; - - cg = ino_to_cg(fs, ino); - ino = ino % fs->fs_ipg; - sc = cg_lookup(cg); - cgp = sc->sc_cgp; - inosused = cg_inosused(cgp); - return isclr(inosused, ino); -} - static int blk_overlaps(struct jblkrec *brec, ufs2_daddr_t start, int frags) { @@ -1506,19 +1489,13 @@ ino_check(struct suj_ino *sino) * to worry about truncating directory entries as they must have * been removed for truncate to succeed. */ + ino = sino->si_ino; if (sino->si_trunc) { ino_trunc(ino, sino->si_trunc->jt_size); sino->si_trunc = NULL; } if (sino->si_hasrecs == 0) return; - ino = sino->si_ino; - /* - * XXX ino_isfree currently is skipping initialized inodes - * that are unreferenced. - */ - if (0 && ino_isfree(ino)) - return; rrec = (struct jrefrec *)TAILQ_FIRST(&sino->si_recs)->sr_rec; nlink = rrec->jr_nlink; newlinks = 0; @@ -1596,6 +1573,7 @@ blk_check(struct suj_blk *sblk) * Each suj_blk actually contains records for any fragments in that * block. As a result we must evaluate each record individually. */ + sino = NULL; TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) { brec = (struct jblkrec *)srec->sr_rec; frags = brec->jb_frags; @@ -2566,13 +2544,13 @@ suj_check(const char *filesys) cg_apply(cg_write); dblk_write(); cg_apply(cg_write_inos); + /* Write back superblock. */ + closedisk(filesys); } printf("** %jd journal records in %jd bytes for %.2f%% utilization\n", jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n", freeinos, freedir, freeblocks, freefrags); - /* Write back superblock. */ - closedisk(filesys); return (0); } Modified: projects/suj/7/sbin/fsck_ffs/suj.c ============================================================================== --- projects/suj/7/sbin/fsck_ffs/suj.c Wed Jan 27 20:12:04 2010 (r203090) +++ projects/suj/7/sbin/fsck_ffs/suj.c Wed Jan 27 20:12:59 2010 (r203091) @@ -194,6 +194,8 @@ closedisk(const char *devnam) fs->fs_cstotal.cs_nifree += cgsum->cs_nifree; fs->fs_cstotal.cs_ndir += cgsum->cs_ndir; } + fs->fs_pendinginodes = 0; + fs->fs_pendingblocks = 0; fs->fs_clean = 1; fs->fs_time = time(NULL); fs->fs_mtime = time(NULL); @@ -446,25 +448,6 @@ iblk_write(struct ino_blk *iblk) err(1, "Failed to write inode block %jd", iblk->ib_blk); } -/* - * Return 1 if the inode was free and 0 if it is allocated. - */ -static int -ino_isfree(ino_t ino) -{ - struct suj_cg *sc; - uint8_t *inosused; - struct cg *cgp; - int cg; - - cg = ino_to_cg(fs, ino); - ino = ino % fs->fs_ipg; - sc = cg_lookup(cg); - cgp = sc->sc_cgp; - inosused = cg_inosused(cgp); - return isclr(inosused, ino); -} - static int blk_overlaps(struct jblkrec *brec, ufs2_daddr_t start, int frags) { @@ -1506,19 +1489,13 @@ ino_check(struct suj_ino *sino) * to worry about truncating directory entries as they must have * been removed for truncate to succeed. */ + ino = sino->si_ino; if (sino->si_trunc) { ino_trunc(ino, sino->si_trunc->jt_size); sino->si_trunc = NULL; } if (sino->si_hasrecs == 0) return; - ino = sino->si_ino; - /* - * XXX ino_isfree currently is skipping initialized inodes - * that are unreferenced. - */ - if (0 && ino_isfree(ino)) - return; rrec = (struct jrefrec *)TAILQ_FIRST(&sino->si_recs)->sr_rec; nlink = rrec->jr_nlink; newlinks = 0; @@ -1596,6 +1573,7 @@ blk_check(struct suj_blk *sblk) * Each suj_blk actually contains records for any fragments in that * block. As a result we must evaluate each record individually. */ + sino = NULL; TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) { brec = (struct jblkrec *)srec->sr_rec; frags = brec->jb_frags; @@ -2566,13 +2544,13 @@ suj_check(const char *filesys) cg_apply(cg_write); dblk_write(); cg_apply(cg_write_inos); + /* Write back superblock. */ + closedisk(filesys); } printf("** %jd journal records in %jd bytes for %.2f%% utilization\n", jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n", freeinos, freedir, freeblocks, freefrags); - /* Write back superblock. */ - closedisk(filesys); return (0); } Modified: projects/suj/8/sbin/fsck_ffs/suj.c ============================================================================== --- projects/suj/8/sbin/fsck_ffs/suj.c Wed Jan 27 20:12:04 2010 (r203090) +++ projects/suj/8/sbin/fsck_ffs/suj.c Wed Jan 27 20:12:59 2010 (r203091) @@ -194,6 +194,8 @@ closedisk(const char *devnam) fs->fs_cstotal.cs_nifree += cgsum->cs_nifree; fs->fs_cstotal.cs_ndir += cgsum->cs_ndir; } + fs->fs_pendinginodes = 0; + fs->fs_pendingblocks = 0; fs->fs_clean = 1; fs->fs_time = time(NULL); fs->fs_mtime = time(NULL); @@ -446,25 +448,6 @@ iblk_write(struct ino_blk *iblk) err(1, "Failed to write inode block %jd", iblk->ib_blk); } -/* - * Return 1 if the inode was free and 0 if it is allocated. - */ -static int -ino_isfree(ino_t ino) -{ - struct suj_cg *sc; - uint8_t *inosused; - struct cg *cgp; - int cg; - - cg = ino_to_cg(fs, ino); - ino = ino % fs->fs_ipg; - sc = cg_lookup(cg); - cgp = sc->sc_cgp; - inosused = cg_inosused(cgp); - return isclr(inosused, ino); -} - static int blk_overlaps(struct jblkrec *brec, ufs2_daddr_t start, int frags) { @@ -1506,19 +1489,13 @@ ino_check(struct suj_ino *sino) * to worry about truncating directory entries as they must have * been removed for truncate to succeed. */ + ino = sino->si_ino; if (sino->si_trunc) { ino_trunc(ino, sino->si_trunc->jt_size); sino->si_trunc = NULL; } if (sino->si_hasrecs == 0) return; - ino = sino->si_ino; - /* - * XXX ino_isfree currently is skipping initialized inodes - * that are unreferenced. - */ - if (0 && ino_isfree(ino)) - return; rrec = (struct jrefrec *)TAILQ_FIRST(&sino->si_recs)->sr_rec; nlink = rrec->jr_nlink; newlinks = 0; @@ -1596,6 +1573,7 @@ blk_check(struct suj_blk *sblk) * Each suj_blk actually contains records for any fragments in that * block. As a result we must evaluate each record individually. */ + sino = NULL; TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) { brec = (struct jblkrec *)srec->sr_rec; frags = brec->jb_frags; @@ -2566,13 +2544,13 @@ suj_check(const char *filesys) cg_apply(cg_write); dblk_write(); cg_apply(cg_write_inos); + /* Write back superblock. */ + closedisk(filesys); } printf("** %jd journal records in %jd bytes for %.2f%% utilization\n", jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n", freeinos, freedir, freeblocks, freefrags); - /* Write back superblock. */ - closedisk(filesys); return (0); }