fstyp.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* fstyp
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <locale.h>
#include <fcntl.h>
#include <errno.h>
#include <strings.h>
#include <sys/inttypes.h>
#define MAXLABELS 20
#define LINEMAX 256
static int vflag = 0; /* verbose output */
static int errflag = 0;
static char *special;
static void usage(void);
extern char *getfullrawname();
int
{
int c;
char device[MAXPATHLEN];
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
switch (c) {
case 'v': /* dump super block */
vflag++;
break;
case '?':
errflag++;
}
}
usage();
return (31+1);
}
/*
* insure that the special device is raw since > 32-bit seeks
* will not work with block devices (bugs 1248701 and 4045593).
*/
}
if (*special == '\0') {
usage();
}
gettext("%s: not a raw disk device\n"),
usage();
}
gettext("fstyp: malloc failed\n"));
}
if (*special == '\0') {
gettext("fstyp: malloc failed\n"));
}
if (*special == '\0') {
gettext("%s: not a raw disk device\n"),
usage();
}
}
}
}
static void
usage(void)
{
}
static union {
} fsun;
static union {
} cgun;
static int
{
time_t t;
(void) close(0);
return (1);
}
return (1);
}
return (31+1);
return (31+1);
if (!vflag)
return (0);
ctime(&t));
printf("sblkno\t%d\tcblkno\t%d\tiblkno\t%d\tdblkno\t%d\n",
printf("sbsize\t%d\tcgsize\t%d\tcgoffset %d\tcgmask\t0x%08x\n",
printf("ncg\t%d\tsize\t%d\tblocks\t%d\n",
printf("bsize\t%d\tshift\t%d\tmask\t0x%08x\n",
printf("fsize\t%d\tshift\t%d\tmask\t0x%08x\n",
printf("frag\t%d\tshift\t%d\tfsbtodb\t%d\n",
printf("minfree\t%d%%\tmaxbpg\t%d\toptim\t%s\n",
printf("maxcontig %d\trotdelay %dms\trps\t%d\n",
printf("csaddr\t%d\tcssize\t%d\tshift\t%d\tmask\t0x%08x\n",
printf("ntrak\t%d\tnsect\t%d\tspc\t%d\tncyl\t%d\n",
printf("cpg\t%d\tbpg\t%d\tfpg\t%d\tipg\t%d\n",
printf("nindir\t%d\tinopb\t%d\tnspf\t%d\n",
printf("nbfree\t%d\tndir\t%d\tnifree\t%d\tnffree\t%d\n",
printf("cgrotor\t%d\tfmod\t%d\tronly\t%d\tlogbno\t%d\n",
printf("fs_reclaim%s%s\n",
} else {
printf("fs_reclaim is not set\n");
}
} else {
}
} else {
"insufficient space to maintain rotational tables\n"));
}
for (i = 0; i < nrpos; i++) {
continue;
/*CSTYLED*/
printf("%5d", j);
if (k % 12 == 0)
printf("\n\t\t");
break;
}
}
}
printf("\ncs[].cs_(nbfree,ndir,nifree,nffree):\n\t");
return (1);
}
}
if (i && i % 4 == 0)
printf("\n\t");
printf("(%ld,%ld,%ld,%ld) ",
}
printf("\n");
}
printf("\n");
(void) close(0);
return (0);
}
static void
{
*sp = 0;
while (nb--)
}
static int
{
return (0);
}
return (1);
}
static void
{
int i;
long tb = 0;
printf("\nlog\n");
else
0);
"dumplog: %s: error reading log allocation\n"),
name);
return;
}
"\tphysical block\t%" PRId32
}
printf("\n");
"dumplog: %s: error reading log state\n"), name);
return;
}
printf("logstate\tError\n");
else
printf("logstate\tOkay\n");
else
}
static void
{
int i, j;
time_t t;
printf("\ncg %d:\n", c);
return;
}
if (!cg_chkmagic(cgp))
/* print FFFS 4.3 cyl grp format. */
printf("magic\t%x\ttell\t%lx\ttime\t%s",
printf("cgx\t%d\tncyl\t%d\tniblk\t%d\tndblk\t%d\n",
printf("nbfree\t%d\tndir\t%d\tnifree\t%d\tnffree\t%d\n",
printf("rotor\t%d\tirotor\t%d\tfrotor\t%d\nfrsum",
}
printf("b:\n");
printf("\n");
}
/* print Old cyl grp format. */
printf("magic\t%x\ttell\t%lx\ttime\t%s",
printf("cgx\t%d\tncyl\t%d\tniblk\t%d\tndblk\t%d\n",
printf("nbfree\t%d\tndir\t%d\tnifree\t%d\tnffree\t%d\n",
printf("rotor\t%d\tirotor\t%d\tfrotor\t%d\nfrsum",
}
printf("b:\n");
for (j = 0; j < NRPOS; j++)
printf("\n");
}
}
}
static void
{
int i;
int count = 0, j;
unsigned char *cp = (unsigned char *)p;
for (i = 0; i < max; i++) {
if (count)
count++;
printf("%d", i);
j = i;
i++;
if (i != j)
printf("-%d", i);
}
}
printf("\n");
}