Module Name: src Committed By: mlelstv Date: Sat Feb 27 12:07:40 UTC 2010
Modified Files: src/usr.sbin/dumpfs: dumpfs.c Log Message: Adjust for change in kernel that stores physical block numbers in superblock that point to the journal. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/usr.sbin/dumpfs/dumpfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/dumpfs/dumpfs.c diff -u src/usr.sbin/dumpfs/dumpfs.c:1.56 src/usr.sbin/dumpfs/dumpfs.c:1.57 --- src/usr.sbin/dumpfs/dumpfs.c:1.56 Sat Feb 27 10:49:58 2010 +++ src/usr.sbin/dumpfs/dumpfs.c Sat Feb 27 12:07:40 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: dumpfs.c,v 1.56 2010/02/27 10:49:58 wiz Exp $ */ +/* $NetBSD: dumpfs.c,v 1.57 2010/02/27 12:07:40 mlelstv Exp $ */ /* * Copyright (c) 1983, 1992, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)dumpfs.c 8.5 (Berkeley) 4/29/95"; #else -__RCSID("$NetBSD: dumpfs.c,v 1.56 2010/02/27 10:49:58 wiz Exp $"); +__RCSID("$NetBSD: dumpfs.c,v 1.57 2010/02/27 12:07:40 mlelstv Exp $"); #endif #endif /* not lint */ @@ -750,12 +750,12 @@ count = afs.fs_journallocs[1]; blklen = afs.fs_journallocs[2]; - for (bno=0; bno<count; bno += skip / DEV_BSIZE) { + for (bno=0; bno<count; bno += skip / blklen) { skip = blklen; - boff = bno * DEV_BSIZE; - if (bno * DEV_BSIZE >= 2 * blklen && + boff = bno * blklen; + if (bno * blklen >= 2 * blklen && ((head >= tail && (boff < tail || boff >= head)) || (head < tail && (boff >= head && boff < tail)))) continue; @@ -763,7 +763,7 @@ printf("journal block %lu offset %lld\n", (unsigned long)bno, (long long) boff); - if (lseek(fd, (off_t)(off*DEV_BSIZE) + boff, SEEK_SET) + if (lseek(fd, (off_t)(off*blklen) + boff, SEEK_SET) == (off_t)-1) return (1); if (read(fd, &jbuf, blklen) != (ssize_t)blklen) { @@ -791,8 +791,10 @@ break; } - if (blklen) - skip = (skip + blklen - 1) / blklen * blklen; + if (blklen == 0) + break; + + skip = (skip + blklen - 1) / blklen * blklen; if (skip == 0) break;