1994-05-26 06:35:07 +00:00
|
|
|
/*
|
2002-06-21 06:18:05 +00:00
|
|
|
* Copyright (c) 2002 Networks Associates Technology, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This software was developed for the FreeBSD Project by Marshall
|
|
|
|
* Kirk McKusick and Network Associates Laboratories, the Security
|
|
|
|
* Research Division of Network Associates, Inc. under DARPA/SPAWAR
|
|
|
|
* contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
|
|
|
|
* research program
|
|
|
|
*
|
|
|
|
* Copyright (c) 1982, 1989, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
* (c) UNIX System Laboratories, Inc.
|
1994-05-26 06:35:07 +00:00
|
|
|
* Copyright (c) 1983, 1992, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef lint
|
1998-06-15 07:00:01 +00:00
|
|
|
static const char copyright[] =
|
1994-05-26 06:35:07 +00:00
|
|
|
"@(#) Copyright (c) 1983, 1992, 1993\n\
|
|
|
|
The Regents of the University of California. All rights reserved.\n";
|
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#ifndef lint
|
1998-06-15 07:00:01 +00:00
|
|
|
#if 0
|
1997-03-11 12:12:26 +00:00
|
|
|
static char sccsid[] = "@(#)dumpfs.c 8.5 (Berkeley) 4/29/95";
|
1998-06-15 07:00:01 +00:00
|
|
|
#endif
|
|
|
|
static const char rcsid[] =
|
1999-08-28 00:22:10 +00:00
|
|
|
"$FreeBSD$";
|
1994-05-26 06:35:07 +00:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/time.h>
|
2002-05-12 21:37:08 +00:00
|
|
|
#include <sys/disklabel.h>
|
1994-05-26 06:35:07 +00:00
|
|
|
|
2002-06-21 06:18:05 +00:00
|
|
|
#include <ufs/ufs/dinode.h>
|
1994-05-26 06:35:07 +00:00
|
|
|
#include <ufs/ffs/fs.h>
|
|
|
|
|
1997-03-11 12:12:26 +00:00
|
|
|
#include <err.h>
|
2002-10-22 19:55:44 +00:00
|
|
|
#include <errno.h>
|
1997-03-11 12:12:26 +00:00
|
|
|
#include <fcntl.h>
|
1994-05-26 06:35:07 +00:00
|
|
|
#include <fstab.h>
|
2002-07-11 21:44:03 +00:00
|
|
|
#include <libufs.h>
|
1994-05-26 06:35:07 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
1997-03-11 12:12:26 +00:00
|
|
|
#include <unistd.h>
|
1994-05-26 06:35:07 +00:00
|
|
|
|
2002-07-11 21:44:03 +00:00
|
|
|
#define afs disk.d_fs
|
2003-01-19 01:31:49 +00:00
|
|
|
#define acg disk.d_cg
|
1994-05-26 06:35:07 +00:00
|
|
|
|
2002-07-11 21:44:03 +00:00
|
|
|
struct uufsd disk;
|
2002-06-21 06:18:05 +00:00
|
|
|
|
2002-03-20 22:57:10 +00:00
|
|
|
int dumpfs(const char *);
|
2003-01-19 05:51:36 +00:00
|
|
|
int dumpcg(void);
|
2002-03-20 22:57:10 +00:00
|
|
|
void pbits(void *, int);
|
|
|
|
void usage(void) __dead2;
|
1994-05-26 06:35:07 +00:00
|
|
|
|
|
|
|
int
|
2002-03-20 22:57:10 +00:00
|
|
|
main(int argc, char *argv[])
|
1994-05-26 06:35:07 +00:00
|
|
|
{
|
2003-01-19 01:02:25 +00:00
|
|
|
int eval;
|
|
|
|
|
|
|
|
eval = 0;
|
|
|
|
|
|
|
|
while (getopt(argc, argv, "") != -1)
|
|
|
|
usage();
|
1994-05-26 06:35:07 +00:00
|
|
|
argc -= optind;
|
|
|
|
argv += optind;
|
|
|
|
|
|
|
|
if (argc < 1)
|
|
|
|
usage();
|
|
|
|
|
2003-01-19 01:02:25 +00:00
|
|
|
while (*argv != NULL)
|
|
|
|
eval |= dumpfs(*argv++);
|
1994-05-26 06:35:07 +00:00
|
|
|
exit(eval);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2002-03-20 22:57:10 +00:00
|
|
|
dumpfs(const char *name)
|
1994-05-26 06:35:07 +00:00
|
|
|
{
|
2002-06-21 06:18:05 +00:00
|
|
|
time_t time;
|
|
|
|
int64_t fssize;
|
2002-07-11 21:46:12 +00:00
|
|
|
int i;
|
1994-05-26 06:35:07 +00:00
|
|
|
|
2002-07-11 21:44:03 +00:00
|
|
|
if (ufs_disk_fillout(&disk, name) == -1)
|
2002-06-21 06:18:05 +00:00
|
|
|
goto err;
|
1997-03-11 12:12:26 +00:00
|
|
|
|
2002-08-11 15:38:51 +00:00
|
|
|
switch (disk.d_ufs) {
|
|
|
|
case 2:
|
2002-06-21 06:18:05 +00:00
|
|
|
fssize = afs.fs_size;
|
|
|
|
time = afs.fs_time;
|
|
|
|
printf("magic\t%x (UFS2)\ttime\t%s",
|
|
|
|
afs.fs_magic, ctime(&time));
|
2002-11-27 02:18:58 +00:00
|
|
|
printf("superblock location\t%qd\tid\t[ %x %x ]\n",
|
2002-06-21 06:18:05 +00:00
|
|
|
afs.fs_sblockloc, afs.fs_id[0], afs.fs_id[1]);
|
|
|
|
printf("ncg\t%d\tsize\t%qd\tblocks\t%d\n",
|
|
|
|
afs.fs_ncg, fssize, afs.fs_dsize);
|
2002-08-11 15:38:51 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2002-06-21 06:18:05 +00:00
|
|
|
fssize = afs.fs_old_size;
|
2002-11-17 23:50:41 +00:00
|
|
|
time = afs.fs_old_time;
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("magic\t%x (UFS1)\ttime\t%s",
|
2002-11-17 23:50:41 +00:00
|
|
|
afs.fs_magic, ctime(&time));
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("id\t[ %x %x ]\n", afs.fs_id[0], afs.fs_id[1]);
|
|
|
|
printf("ncg\t%d\tsize\t%qd\tblocks\t%d\n",
|
|
|
|
afs.fs_ncg, fssize, afs.fs_dsize);
|
2002-08-11 15:38:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2002-06-21 06:18:05 +00:00
|
|
|
}
|
1994-05-26 06:35:07 +00:00
|
|
|
printf("bsize\t%d\tshift\t%d\tmask\t0x%08x\n",
|
|
|
|
afs.fs_bsize, afs.fs_bshift, afs.fs_bmask);
|
|
|
|
printf("fsize\t%d\tshift\t%d\tmask\t0x%08x\n",
|
|
|
|
afs.fs_fsize, afs.fs_fshift, afs.fs_fmask);
|
|
|
|
printf("frag\t%d\tshift\t%d\tfsbtodb\t%d\n",
|
|
|
|
afs.fs_frag, afs.fs_fragshift, afs.fs_fsbtodb);
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("minfree\t%d%%\toptim\t%s\tsymlinklen %d\n",
|
1994-05-26 06:35:07 +00:00
|
|
|
afs.fs_minfree, afs.fs_optim == FS_OPTSPACE ? "space" : "time",
|
2002-06-21 06:18:05 +00:00
|
|
|
afs.fs_maxsymlinklen);
|
2002-08-11 15:38:51 +00:00
|
|
|
switch (disk.d_ufs) {
|
|
|
|
case 2:
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("%s %d\tmaxbpg\t%d\tmaxcontig %d\tcontigsumsize %d\n",
|
|
|
|
"maxbsize", afs.fs_maxbsize, afs.fs_maxbpg,
|
|
|
|
afs.fs_maxcontig, afs.fs_contigsumsize);
|
|
|
|
printf("nbfree\t%qd\tndir\t%qd\tnifree\t%qd\tnffree\t%qd\n",
|
|
|
|
afs.fs_cstotal.cs_nbfree, afs.fs_cstotal.cs_ndir,
|
|
|
|
afs.fs_cstotal.cs_nifree, afs.fs_cstotal.cs_nffree);
|
|
|
|
printf("bpg\t%d\tfpg\t%d\tipg\t%d\n",
|
|
|
|
afs.fs_fpg / afs.fs_frag, afs.fs_fpg, afs.fs_ipg);
|
|
|
|
printf("nindir\t%d\tinopb\t%d\tmaxfilesize\t%qu\n",
|
|
|
|
afs.fs_nindir, afs.fs_inopb, afs.fs_maxfilesize);
|
|
|
|
printf("sbsize\t%d\tcgsize\t%d\tcsaddr\t%d\tcssize\t%d\n",
|
|
|
|
afs.fs_sbsize, afs.fs_cgsize, afs.fs_csaddr, afs.fs_cssize);
|
2002-08-11 15:38:51 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("maxbpg\t%d\tmaxcontig %d\tcontigsumsize %d\n",
|
|
|
|
afs.fs_maxbpg, afs.fs_maxcontig, afs.fs_contigsumsize);
|
|
|
|
printf("nbfree\t%d\tndir\t%d\tnifree\t%d\tnffree\t%d\n",
|
|
|
|
afs.fs_old_cstotal.cs_nbfree, afs.fs_old_cstotal.cs_ndir,
|
|
|
|
afs.fs_old_cstotal.cs_nifree, afs.fs_old_cstotal.cs_nffree);
|
|
|
|
printf("cpg\t%d\tbpg\t%d\tfpg\t%d\tipg\t%d\n",
|
|
|
|
afs.fs_old_cpg, afs.fs_fpg / afs.fs_frag, afs.fs_fpg,
|
|
|
|
afs.fs_ipg);
|
|
|
|
printf("nindir\t%d\tinopb\t%d\tnspf\t%d\tmaxfilesize\t%qu\n",
|
|
|
|
afs.fs_nindir, afs.fs_inopb, afs.fs_old_nspf,
|
|
|
|
afs.fs_maxfilesize);
|
|
|
|
printf("sbsize\t%d\tcgsize\t%d\tcgoffset %d\tcgmask\t0x%08x\n",
|
|
|
|
afs.fs_sbsize, afs.fs_cgsize, afs.fs_old_cgoffset,
|
|
|
|
afs.fs_old_cgmask);
|
|
|
|
printf("csaddr\t%d\tcssize\t%d\n",
|
|
|
|
afs.fs_old_csaddr, afs.fs_cssize);
|
|
|
|
printf("rotdelay %dms\trps\t%d\ttrackskew %d\tinterleave %d\n",
|
|
|
|
afs.fs_old_rotdelay, afs.fs_old_rps, afs.fs_old_trackskew,
|
|
|
|
afs.fs_old_interleave);
|
|
|
|
printf("nsect\t%d\tnpsect\t%d\tspc\t%d\n",
|
|
|
|
afs.fs_old_nsect, afs.fs_old_npsect, afs.fs_old_spc);
|
2002-08-11 15:38:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2002-06-21 06:18:05 +00:00
|
|
|
}
|
1994-05-26 06:35:07 +00:00
|
|
|
printf("sblkno\t%d\tcblkno\t%d\tiblkno\t%d\tdblkno\t%d\n",
|
|
|
|
afs.fs_sblkno, afs.fs_cblkno, afs.fs_iblkno, afs.fs_dblkno);
|
1994-08-20 16:57:45 +00:00
|
|
|
printf("cgrotor\t%d\tfmod\t%d\tronly\t%d\tclean\t%d\n",
|
|
|
|
afs.fs_cgrotor, afs.fs_fmod, afs.fs_ronly, afs.fs_clean);
|
1999-07-18 02:33:05 +00:00
|
|
|
printf("flags\t");
|
|
|
|
if (afs.fs_flags == 0)
|
|
|
|
printf("none");
|
|
|
|
if (afs.fs_flags & FS_UNCLEAN)
|
|
|
|
printf("unclean ");
|
|
|
|
if (afs.fs_flags & FS_DOSOFTDEP)
|
|
|
|
printf("soft-updates ");
|
2002-06-21 06:18:05 +00:00
|
|
|
if (afs.fs_flags & FS_NEEDSFSCK)
|
|
|
|
printf("needs fsck run ");
|
|
|
|
if (afs.fs_flags & FS_INDEXDIRS)
|
|
|
|
printf("indexed directories ");
|
|
|
|
if ((afs.fs_flags &
|
|
|
|
~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS)) != 0)
|
|
|
|
printf("unknown flags (%#x)", afs.fs_flags &
|
|
|
|
~(FS_UNCLEAN | FS_DOSOFTDEP |
|
|
|
|
FS_NEEDSFSCK | FS_INDEXDIRS));
|
1999-07-18 02:33:05 +00:00
|
|
|
putchar('\n');
|
1994-05-26 06:35:07 +00:00
|
|
|
printf("\ncs[].cs_(nbfree,ndir,nifree,nffree):\n\t");
|
2001-01-15 18:30:40 +00:00
|
|
|
afs.fs_csp = calloc(1, afs.fs_cssize);
|
2002-08-11 15:38:51 +00:00
|
|
|
if (bread(&disk, fsbtodb(&afs, afs.fs_csaddr), afs.fs_csp, afs.fs_cssize) == -1)
|
2002-06-21 06:18:05 +00:00
|
|
|
goto err;
|
1994-05-26 06:35:07 +00:00
|
|
|
for (i = 0; i < afs.fs_ncg; i++) {
|
|
|
|
struct csum *cs = &afs.fs_cs(&afs, i);
|
|
|
|
if (i && i % 4 == 0)
|
|
|
|
printf("\n\t");
|
|
|
|
printf("(%d,%d,%d,%d) ",
|
|
|
|
cs->cs_nbfree, cs->cs_ndir, cs->cs_nifree, cs->cs_nffree);
|
|
|
|
}
|
|
|
|
printf("\n");
|
2002-06-21 06:18:05 +00:00
|
|
|
if (fssize % afs.fs_fpg) {
|
2002-08-11 15:38:51 +00:00
|
|
|
if (disk.d_ufs == 1)
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("cylinders in last group %d\n",
|
|
|
|
howmany(afs.fs_old_size % afs.fs_fpg,
|
|
|
|
afs.fs_old_spc / afs.fs_old_nspf));
|
|
|
|
printf("blocks in last group %d\n\n",
|
|
|
|
(fssize % afs.fs_fpg) / afs.fs_frag);
|
1994-05-26 06:35:07 +00:00
|
|
|
}
|
2003-01-19 05:51:36 +00:00
|
|
|
while ((i = cgread(&disk)) != 0) {
|
|
|
|
if (i == -1 || dumpcg())
|
1994-05-26 06:35:07 +00:00
|
|
|
goto err;
|
2003-01-19 05:51:36 +00:00
|
|
|
}
|
2002-07-11 21:44:03 +00:00
|
|
|
ufs_disk_close(&disk);
|
1994-05-26 06:35:07 +00:00
|
|
|
return (0);
|
|
|
|
|
2003-01-18 04:20:20 +00:00
|
|
|
err: if (disk.d_error != NULL)
|
|
|
|
warnx("%s: %s", name, disk.d_error);
|
|
|
|
else if (errno)
|
|
|
|
warn("%s", name);
|
2002-10-22 19:27:09 +00:00
|
|
|
ufs_disk_close(&disk);
|
1994-05-26 06:35:07 +00:00
|
|
|
return (1);
|
2002-07-11 21:46:12 +00:00
|
|
|
}
|
1994-05-26 06:35:07 +00:00
|
|
|
|
|
|
|
int
|
2003-01-19 05:51:36 +00:00
|
|
|
dumpcg(void)
|
1994-05-26 06:35:07 +00:00
|
|
|
{
|
2002-06-21 06:18:05 +00:00
|
|
|
time_t time;
|
1994-05-26 06:35:07 +00:00
|
|
|
off_t cur;
|
|
|
|
int i, j;
|
|
|
|
|
2003-01-19 05:51:36 +00:00
|
|
|
printf("\ncg %d:\n", disk.d_lcg);
|
|
|
|
cur = fsbtodb(&afs, cgtod(&afs, disk.d_lcg)) * disk.d_bsize;
|
2002-08-11 15:38:51 +00:00
|
|
|
switch (disk.d_ufs) {
|
|
|
|
case 2:
|
2002-06-21 06:18:05 +00:00
|
|
|
time = acg.cg_time;
|
|
|
|
printf("magic\t%x\ttell\t%qx\ttime\t%s",
|
|
|
|
acg.cg_magic, cur, ctime(&time));
|
|
|
|
printf("cgx\t%d\tndblk\t%d\tniblk\t%d\tinitiblk %d\n",
|
|
|
|
acg.cg_cgx, acg.cg_ndblk, acg.cg_niblk, acg.cg_initediblk);
|
2002-08-11 15:38:51 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2002-11-17 23:50:41 +00:00
|
|
|
time = acg.cg_old_time;
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("magic\t%x\ttell\t%qx\ttime\t%s",
|
2002-11-17 23:50:41 +00:00
|
|
|
acg.cg_magic, cur, ctime(&time));
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("cgx\t%d\tncyl\t%d\tniblk\t%d\tndblk\t%d\n",
|
|
|
|
acg.cg_cgx, acg.cg_old_ncyl, acg.cg_old_niblk,
|
|
|
|
acg.cg_ndblk);
|
2002-08-11 15:38:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2002-06-21 06:18:05 +00:00
|
|
|
}
|
1994-05-26 06:35:07 +00:00
|
|
|
printf("nbfree\t%d\tndir\t%d\tnifree\t%d\tnffree\t%d\n",
|
|
|
|
acg.cg_cs.cs_nbfree, acg.cg_cs.cs_ndir,
|
|
|
|
acg.cg_cs.cs_nifree, acg.cg_cs.cs_nffree);
|
|
|
|
printf("rotor\t%d\tirotor\t%d\tfrotor\t%d\nfrsum",
|
|
|
|
acg.cg_rotor, acg.cg_irotor, acg.cg_frotor);
|
|
|
|
for (i = 1, j = 0; i < afs.fs_frag; i++) {
|
|
|
|
printf("\t%d", acg.cg_frsum[i]);
|
|
|
|
j += i * acg.cg_frsum[i];
|
|
|
|
}
|
|
|
|
printf("\nsum of frsum: %d", j);
|
|
|
|
if (afs.fs_contigsumsize > 0) {
|
|
|
|
for (i = 1; i < afs.fs_contigsumsize; i++) {
|
|
|
|
if ((i - 1) % 8 == 0)
|
|
|
|
printf("\nclusters %d-%d:", i,
|
|
|
|
afs.fs_contigsumsize - 1 < i + 7 ?
|
|
|
|
afs.fs_contigsumsize - 1 : i + 7);
|
|
|
|
printf("\t%d", cg_clustersum(&acg)[i]);
|
|
|
|
}
|
|
|
|
printf("\nclusters size %d and over: %d\n",
|
|
|
|
afs.fs_contigsumsize,
|
|
|
|
cg_clustersum(&acg)[afs.fs_contigsumsize]);
|
|
|
|
printf("clusters free:\t");
|
|
|
|
pbits(cg_clustersfree(&acg), acg.cg_nclusterblks);
|
|
|
|
} else
|
|
|
|
printf("\n");
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("inodes used:\t");
|
1994-05-26 06:35:07 +00:00
|
|
|
pbits(cg_inosused(&acg), afs.fs_ipg);
|
2002-06-21 06:18:05 +00:00
|
|
|
printf("blks free:\t");
|
1994-05-26 06:35:07 +00:00
|
|
|
pbits(cg_blksfree(&acg), afs.fs_fpg);
|
|
|
|
return (0);
|
2002-07-11 21:46:12 +00:00
|
|
|
}
|
1994-05-26 06:35:07 +00:00
|
|
|
|
|
|
|
void
|
2002-03-20 22:57:10 +00:00
|
|
|
pbits(void *vp, int max)
|
1994-05-26 06:35:07 +00:00
|
|
|
{
|
2002-03-20 17:55:10 +00:00
|
|
|
int i;
|
|
|
|
char *p;
|
1994-05-26 06:35:07 +00:00
|
|
|
int count, j;
|
|
|
|
|
|
|
|
for (count = i = 0, p = vp; i < max; i++)
|
|
|
|
if (isset(p, i)) {
|
|
|
|
if (count)
|
|
|
|
printf(",%s", count % 6 ? " " : "\n\t");
|
|
|
|
count++;
|
|
|
|
printf("%d", i);
|
|
|
|
j = i;
|
|
|
|
while ((i+1)<max && isset(p, i+1))
|
|
|
|
i++;
|
|
|
|
if (i != j)
|
|
|
|
printf("-%d", i);
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-03-20 22:57:10 +00:00
|
|
|
usage(void)
|
1994-05-26 06:35:07 +00:00
|
|
|
{
|
|
|
|
(void)fprintf(stderr, "usage: dumpfs filesys | device\n");
|
|
|
|
exit(1);
|
|
|
|
}
|