From: Nathan Scott Date: Tue, 12 Nov 2002 04:01:08 +0000 (+0000) Subject: Update some documentation, rationalise some headers, tidy some dead X-Git-Tag: v2.4.0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33a1236776b7e98992dd1146d4246c9ff9f850c4;p=thirdparty%2Fxfsprogs-dev.git Update some documentation, rationalise some headers, tidy some dead mkfs code, leftover from IRIX libdisk. rationalise headers - we'd already included this header. --- diff --git a/db/bmap.c b/db/bmap.c index a114b736c..fe6fe380b 100644 --- a/db/bmap.c +++ b/db/bmap.c @@ -31,7 +31,6 @@ */ #include -#include #include "command.h" #include "data.h" #include "type.h" diff --git a/db/check.c b/db/check.c index d670ee050..aaec90bd5 100644 --- a/db/check.c +++ b/db/check.c @@ -32,7 +32,6 @@ #include #include -#include #include #include "bmap.h" #include "check.h" diff --git a/db/command.c b/db/command.c index f8f982330..044d097a8 100644 --- a/db/command.c +++ b/db/command.c @@ -31,7 +31,6 @@ */ #include -#include #include "addr.h" #include "agf.h" #include "agfl.h" diff --git a/db/dquot.c b/db/dquot.c index ef28914a2..c58d2d546 100644 --- a/db/dquot.c +++ b/db/dquot.c @@ -31,7 +31,6 @@ */ #include -#include #include "bit.h" #include "bmap.h" #include "command.h" diff --git a/db/fprint.c b/db/fprint.c index 55607f331..601fff8d2 100644 --- a/db/fprint.c +++ b/db/fprint.c @@ -31,7 +31,6 @@ */ #include -#include #include #include #include "type.h" diff --git a/db/frag.c b/db/frag.c index cfa33d2e5..74fb3e016 100644 --- a/db/frag.c +++ b/db/frag.c @@ -31,7 +31,6 @@ */ #include -#include #include #include "bmap.h" #include "command.h" diff --git a/db/freesp.c b/db/freesp.c index 8d19440bf..4af233154 100644 --- a/db/freesp.c +++ b/db/freesp.c @@ -31,7 +31,6 @@ */ #include -#include #include "command.h" #include "data.h" #include "freesp.h" diff --git a/db/init.c b/db/init.c index c03134448..d12e76e32 100644 --- a/db/init.c +++ b/db/init.c @@ -31,7 +31,6 @@ */ #include -#include #include #include "command.h" #include "data.h" diff --git a/doc/README.quota b/doc/README.quota index eb2dab49d..6ec89c6a2 100644 --- a/doc/README.quota +++ b/doc/README.quota @@ -145,11 +145,15 @@ system is administered. user accounting with limit enforcement disabled. quotaon(8) contains some examples of frequently used procedures. - o Turning on quotas on the root filesystem is slightly different from - the above. quotaon(8) must be used on the root XFS filesystem - first; quotas will be turned on the next time the system is - rebooted. It is useful to use repquota(8) with the -v option to - monitor the effect of quotaon/off at various stages. + o Turning on quotas on the root filesystem is slightly different + from the above. In more recent versions of XFS, the quota mount + flags must be passed in with the "rootflags=" boot parameter. + In older versions of XFS and (quota-tools) quotaon(8) must be + used on the root XFS filesystem first; and quotas will be turned + on the next time the system is rebooted. + + o It is useful to use repquota(8) with the -v option to monitor + the XFS quota state at various stages. o quotacheck(8) has no effect on XFS filesystems. The first time quota accounting is turned on, XFS does an automatic quotacheck @@ -223,7 +227,7 @@ GETTING STARTED EXAMPLES ->>> Enabling quota enforcement on a non-root XFS filesystem +>>> Enabling quota enforcement on an XFS filesystem [root@troppo]# echo /dev/hdb10 /mnt/xqm xfs rw,usrquota 0 0 >>/etc/fstab [root@troppo]# mount /mnt/xqm @@ -296,9 +300,8 @@ supported on Linux/XFS, as the concept of a project is specific to IRIX. A filesystem that has used user quota on IRIX, however, can be migrated to Linux, and vice-versa, as the ondisk format is shared between both versions of XFS (and Linux/XFS is "endian clean"). Group quota support -is planned for a future release of IRIX, and the same level of ondisk -compatibility will be available as for user quota, once this work has -been completed. +has been implemented only in more recent versions of IRIX 6.5f, and the +same level of ondisk compatibility is now available as for user quota. Have fun, diff --git a/include/Makefile b/include/Makefile index 745a0a088..7a83872b3 100644 --- a/include/Makefile +++ b/include/Makefile @@ -45,7 +45,7 @@ HFILES = handle.h jdm.h libxfs.h libxlog.h xqm.h \ xfs_rtalloc.h xfs_sb.h xfs_trans.h xfs_trans_space.h xfs_types.h LHFILES = xfs_acl.h xfs_cap.h xfs_mac.h -DKHFILES = mountinfo.h volume.h fstyp.h dvh.h +DKHFILES = volume.h fstyp.h dvh.h LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules \ $(LHFILES) $(DKHFILES) LDIRT = xfs diff --git a/include/mountinfo.h b/include/mountinfo.h deleted file mode 100644 index 1c9773f08..000000000 --- a/include/mountinfo.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ - */ -#ifndef __MOUNTINFO_H__ -#define __MOUNTINFO_H__ - -/* - * mountinfo.h - * Header for disk volume/partition check routines - */ - -#define MNT_CAUSE_NONE 0x00 -#define MNT_CAUSE_MOUNTED 0x01 /* partition already mounted */ -#define MNT_CAUSE_OVERLAP 0x02 /* partitions overlap */ -#define MNT_CAUSE_NODEV 0x04 /* no /dev/rdsk /dev/dsk entry */ -#define MNT_CAUSE_UNUSED 0x08 /* unallocated partition */ -#define MNT_CAUSE_MULTIMOUNT 0x10 /* multiple owners */ -#define MNT_CAUSE_LVOL_OWNED 0x20 /* owned by logical vol */ -#define MNT_CAUSE_XVM_MNT 0x40 /* mounted xvm subvolume */ -#define MNT_CAUSE_XVM_PART 0x80 /* xvm-owned partition */ -#define MNT_CAUSE__END 0x100 /* last entry */ - -typedef struct mnt_check_state_s { - /* currently unused, remains from IRIX */ -} mnt_check_state_t; - -/* prototypes */ -extern int mnt_check_init (mnt_check_state_t **); -extern int mnt_find_mount_conflicts (mnt_check_state_t *, char *); -extern int mnt_find_mounted_partitions (mnt_check_state_t *, char *); -extern int mnt_causes_test (mnt_check_state_t *, int); -extern void mnt_causes_show (mnt_check_state_t *, FILE *, char *); -extern void mnt_plist_show (mnt_check_state_t *, FILE *, char *); -extern int mnt_check_end (mnt_check_state_t *); - -#endif /* __MOUNTINFO_H__ */ diff --git a/libdisk/Makefile b/libdisk/Makefile index f54904d0b..948e4b6d4 100644 --- a/libdisk/Makefile +++ b/libdisk/Makefile @@ -38,8 +38,8 @@ LT_CURRENT = 0 LT_REVISION = 0 LT_AGE = 0 -CFILES = fstype.c pttype.c md.c xvm.c evms.c lvm.c drivers.c mountinfo.c -HFILES = fstype.h pttype.h md.h xvm.h evms.h +CFILES = drivers.c fstype.c pttype.c md.c xvm.c evms.c lvm.c +HFILES = drivers.h fstype.h pttype.h md.h xvm.h evms.h default: $(LTLIBRARY) diff --git a/libdisk/drivers.c b/libdisk/drivers.c index 0468dd452..724fe3029 100644 --- a/libdisk/drivers.c +++ b/libdisk/drivers.c @@ -30,17 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include -#include -#include -#include -#include -#include - -extern int md_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); -extern int lvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); -extern int xvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); -extern int evms_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); +#include "drivers.h" void get_subvol_stripe_wrapper(char *dev, sv_type_t type, int *sunit, int *swidth) @@ -79,8 +69,7 @@ get_driver_block_major(const char *driver) char buf[64], puf[64]; int major = -1; -#define PROC_DEVICES "/proc/devices" - if ((f = fopen(PROC_DEVICES, "r")) == NULL) + if ((f = fopen("/proc/devices", "r")) == NULL) return major; while (fgets(buf, sizeof(buf), f)) /* skip to block dev section */ if (strncmp("Block devices:\n", buf, sizeof(buf)) == 0) diff --git a/libdisk/drivers.h b/libdisk/drivers.h new file mode 100644 index 000000000..395f40579 --- /dev/null +++ b/libdisk/drivers.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ + */ + +#include +#include +#include +#include +#include +#include + +/* + * This stuff is all very platform specific. + */ + +#ifdef __linux__ +extern int md_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); +extern int lvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); +extern int xvm_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); +extern int evms_get_subvol_stripe(char*, sv_type_t, int*, int*, struct stat64*); +#else +#define stat64 stat +#define md_get_subvol_stripe(dev, type, a, b, stat) (-1) +#define lvm_get_subvol_stripe(dev, type, a, b, stat) (-1) +#define xvm_get_subvol_stripe(dev, type, a, b, stat) (-1) +#define evms_get_subvol_stripe(dev, type, a, b, stat) (-1) +#endif diff --git a/libdisk/mountinfo.c b/libdisk/mountinfo.c deleted file mode 100644 index a639447da..000000000 --- a/libdisk/mountinfo.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston MA 02111-1307, USA. - * - * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, - * Mountain View, CA 94043, or: - * - * http://www.sgi.com - * - * For further information regarding this notice, see: - * - * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "mountinfo.h" - -int -mnt_check_init(mnt_check_state_t **check_state) -{ - return(0); -} - -int -mnt_find_mount_conflicts(mnt_check_state_t *check_state, char *devname) -{ -#define PROC_MOUNTED "/proc/mounts" - int sts = 0; - FILE *f; - struct mntent *mnt; - struct stat64 ns, ms; - char mounts[MAXPATHLEN]; - - if (stat64(devname, &ns) < 0) - return sts; - - strcpy(mounts, access(PROC_MOUNTED, R_OK)? PROC_MOUNTED : MOUNTED); - if ((f = setmntent(mounts, "r")) == NULL) - return sts; - while ((mnt = getmntent(f)) != NULL) { - if (stat64(mnt->mnt_fsname, &ms) < 0) - continue; - if (S_ISBLK(ms.st_mode) && ns.st_rdev == ms.st_rdev) - break; - if (!S_ISBLK(ms.st_mode) && !strcmp(devname, mnt->mnt_fsname)) - break; - } - endmntent(f); - if (mnt) - sts = 1; - return sts; -} - -int -mnt_find_mounted_partitions(mnt_check_state_t *check_state, char *devname) -{ - return 0; -} - -int -mnt_causes_test(mnt_check_state_t *check_state, int cause) -{ - switch(cause) { - case MNT_CAUSE_MOUNTED: - return(1); - - default: - fprintf(stderr, "mnt_causes_test: unknown cause %d\n", cause); - exit(99); - } -} - -void -mnt_causes_show(mnt_check_state_t *check_state, FILE *fp, char *prefix) -{ - fprintf(fp, "mnt_causes_show: not implemented. Called with %s\n", - prefix); - exit(98); -} - -void -mnt_plist_show(mnt_check_state_t *check_state, FILE *fp, char *prefix) -{ - /* - * Need to do some work for volume mgmt. - */ -} - -int -mnt_check_end(mnt_check_state_t *check_state) -{ - return(0); -} diff --git a/libdisk/pttype.c b/libdisk/pttype.c index e84429d24..12ed223eb 100644 --- a/libdisk/pttype.c +++ b/libdisk/pttype.c @@ -40,13 +40,13 @@ #define blksize 512 -static __uint32_t -twos_complement_32bit_sum(__uint32_t *base, int size) +static u_int32_t +twos_complement_32bit_sum(u_int32_t *base, int size) { int i; - __uint32_t sum = 0; + u_int32_t sum = 0; - size = size / sizeof(__uint32_t); + size = size / sizeof(u_int32_t); for (i = 0; i < size; i++) sum = sum - ntohl(base[i]); return sum; @@ -55,12 +55,12 @@ twos_complement_32bit_sum(__uint32_t *base, int size) static int sgi_parttable(char *base) { - __uint32_t csum; + u_int32_t csum; struct volume_header *vh = (struct volume_header *)base; if (ntohl(vh->vh_magic) != VHMAGIC) return 0; - csum = twos_complement_32bit_sum((__uint32_t *)vh, + csum = twos_complement_32bit_sum((u_int32_t *)vh, sizeof(struct volume_header)); return !csum; } diff --git a/libdisk/pttype.h b/libdisk/pttype.h index 3d0b71fff..3193eba45 100644 --- a/libdisk/pttype.h +++ b/libdisk/pttype.h @@ -20,8 +20,8 @@ typedef struct { unsigned short nsect; /* Sectors per track */ unsigned char spare3[4]; /* Even more magic... */ struct sun_partition { - __uint32_t start_cylinder; - __uint32_t num_sectors; + u_int32_t start_cylinder; + u_int32_t num_sectors; } partitions[8]; unsigned short magic; /* Magic number */ unsigned short csum; /* Label xor'd checksum */ diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8 index 65787ecf0..c8439381d 100644 --- a/man/man8/mkfs.xfs.8 +++ b/man/man8/mkfs.xfs.8 @@ -6,7 +6,7 @@ mkfs.xfs \- construct an XFS filesystem \f3mkfs.xfs\f1 [ \f3\-b\f1 subopt=value ] [ \f3\-d\f1 subopt[=value] ] [ \f3\-i\f1 subopt=value ] [ \f3\-l\f1 subopt[=value] ] [ \f3\-n\f1 subopt[=value] ] [ \f3\-p\f1 protofile ] [ \f3\-q\f1 ] - [ \f3\-r\f1 subopt[=value] ] [ \f3\-C\f1 ] [ \f3\-L\f1 label ] device + [ \f3\-r\f1 subopt[=value] ] [ \f3\-N\f1 ] [ \f3\-L\f1 label ] device .fi .SH DESCRIPTION .I mkfs.xfs @@ -73,8 +73,8 @@ The block size is specified either as a base two logarithm value with .BR log= , or in bytes with .BR size= . -The default value is 4096 bytes (4 KB) on systems with a 4KB pagesize. -The minimum value for block size is 512; the maximum is 65536 (64 KB). +The default value is 4096 bytes (4 KB), the minimum is 512, and the +maximum is 65536 (64 KB). XFS on Linux currently only supports pagesize or smaller blocks. .TP .B \-d @@ -586,19 +586,6 @@ This suboption is only needed if the real-time section of the filesystem should occupy less space than the size of the partition or logical volume containing the section. .TP -.B \-C -Disable overlapping partition/volume checks. -.IP -By default \f2mkfs.xfs\f1 checks to see if the destination partition or logical -volume overlaps any mounted or reserved partitions in the system. If an -overlap or mount conflict is found, the user will be notified and prevented -from potentially corrupting the existing data. For systems with -a large number of disks, this additional checking may add noticable overhead -to the command's execution time. For situations where command performance is -necessary, this switch may be used to disable the safeguards. Due to the -potential for user-error causing corrupted filesystems or other on-disk -data corruption, we strongly discourage use of this switch in normal operation. -.TP \f3\-L\f1 \f2label\f1 Set the filesystem label. XFS filesystem labels can be at most 12 characters long; if @@ -610,6 +597,10 @@ will not proceed with creating the filesystem. Refer to the and .IR xfs_admin (8) manual entries for additional information. +.TP +.B \-N +Causes the file system parameters to be printed out without really +creating the file system. .SH SEE ALSO mkfs(8), mount(8), diff --git a/mkfs/fstyp.c b/mkfs/fstyp.c index 7b787d319..038cfed5d 100644 --- a/mkfs/fstyp.c +++ b/mkfs/fstyp.c @@ -30,11 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include -#include -#include -#include -#include +#include #include /* diff --git a/mkfs/proto.c b/mkfs/proto.c index c67cf8751..5113620a0 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -31,6 +31,7 @@ */ #include +#include #include "proto.h" /* diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 0e67fc1c5..bd6ff68f2 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -433,7 +432,6 @@ main(int argc, char **argv) int dirblocklog; int dirblocksize; int dirversion; - int do_overlap_checks; char *dsize; int dsu; int dsw; @@ -468,8 +466,6 @@ main(int argc, char **argv) int lsu; int lsunit; int min_logblocks; - mnt_check_state_t *mnt_check_state; - int mnt_partition_count; xfs_mount_t *mp; xfs_mount_t mbuf; xfs_extlen_t nbmblocks; @@ -478,6 +474,7 @@ main(int argc, char **argv) xfs_alloc_rec_t *nrec; int nsflag; int nvflag; + int Nflag; char *p; char *protofile; char *protostring; @@ -508,7 +505,7 @@ main(int argc, char **argv) loginternal = 1; logversion = 1; logagno = logblocks = rtblocks = 0; - nlflag = nsflag = nvflag = 0; + Nflag = nlflag = nsflag = nvflag = 0; dirblocklog = dirblocksize = dirversion = 0; qflag = 0; imaxpct = inodelog = inopblock = isize = 0; @@ -520,16 +517,13 @@ main(int argc, char **argv) dsize = logsize = rtsize = rtextsize = protofile = NULL; opterr = 0; dsu = dsw = dsunit = dswidth = nodsflag = lalign = lsu = lsunit = 0; - do_overlap_checks = 1; extent_flagging = 0; force_overwrite = 0; worst_freelist = 0; - while ((c = getopt(argc, argv, "b:d:i:l:L:n:p:qr:CfV")) != EOF) { + while ((c = getopt(argc, argv, "b:d:i:l:L:n:Np:qr:CfV")) != EOF) { switch (c) { case 'C': - do_overlap_checks = 0; - break; case 'f': force_overwrite = 1; break; @@ -584,7 +578,8 @@ main(int argc, char **argv) reqval('d', dopts, D_AGCOUNT); if (daflag) respec('d', dopts, D_AGCOUNT); - agcount = (__uint64_t)atoll(value); + agcount = (__uint64_t) + strtoul(value, NULL, 10); if ((__int64_t)agcount <= 0) illegal(value, "d agcount"); daflag = 1; @@ -937,6 +932,9 @@ main(int argc, char **argv) } } break; + case 'N': + Nflag = 1; + break; case 'p': if (protofile) respec('p', 0, 0); @@ -1260,50 +1258,6 @@ main(int argc, char **argv) } } - if (!xi.disfile && do_overlap_checks) { - /* - * do partition overlap check - * If this is a straight file we assume that it's been created - * before the call to mnt_check_init() - */ - - if (mnt_check_init(&mnt_check_state) == -1) { - fprintf(stderr, - "unable to initialize mount checking " - "routines, bypassing protection checks.\n"); - } else { - mnt_partition_count = mnt_find_mount_conflicts( - mnt_check_state, dfile); - - /* - * ignore -1 return codes, since 3rd party devices - * may not be part of hinv. - */ - if (mnt_partition_count > 0) { - if (mnt_causes_test(mnt_check_state, MNT_CAUSE_MOUNTED)) { - fprintf(stderr, "%s: " - "%s is already in use.\n", - progname, dfile); - } else if (mnt_causes_test(mnt_check_state, MNT_CAUSE_OVERLAP)) { - fprintf(stderr, "%s: " - "%s overlaps partition(s) " - "already in use.\n", - progname, dfile); - } else { - mnt_causes_show(mnt_check_state, stderr, progname); - } - fprintf(stderr, "\n"); - fflush(stderr); - mnt_plist_show(mnt_check_state, stderr, progname); - fprintf(stderr, "\n"); - } - mnt_check_end(mnt_check_state); - if (mnt_partition_count > 0) { - usage(); - } - } - } - if (!liflag && !ldflag) loginternal = xi.logdev == 0; if (xi.logname) @@ -1813,6 +1767,27 @@ an AG size that is one stripe unit smaller, for example %llu\n", XFS_SB_VERSION_MKFS(iaflag, dsunit != 0, extent_flagging, dirversion == 2, logversion == 2); + if (!qflag || Nflag) { + printf( + "meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" + "data =%-22s bsize=%-6d blocks=%lld, imaxpct=%d\n" + " =%-22s sunit=%-6d swidth=%d blks, unwritten=%d\n" + "naming =version %-14d bsize=%-6d\n" + "log =%-22s bsize=%-6d blocks=%lld, version=%d\n" + " =%-22s sunit=%d blks\n" + "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n", + dfile, isize, (long long)agcount, (long long)agsize, + "", blocksize, (long long)dblocks, sbp->sb_imax_pct, + "", dsunit, dswidth, extent_flagging, + dirversion, dirversion == 1 ? blocksize : dirblocksize, + logfile, 1 << blocklog, (long long)logblocks, + logversion, "", lsunit, + rtfile, rtextblocks << blocklog, + (long long)rtblocks, (long long)rtextents); + if (Nflag) + exit(0); + } + /* * Zero out the first 68k in on the device, to obliterate any old * filesystem signatures out there. This should take care of @@ -1831,23 +1806,6 @@ an AG size that is one stripe unit smaller, for example %llu\n", XFS_SB_ALL_BITS); libxfs_writebuf(buf, 1); - if (!qflag) - printf( - "meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n" - "data =%-22s bsize=%-6d blocks=%lld, imaxpct=%d\n" - " =%-22s sunit=%-6d swidth=%d blks, unwritten=%d\n" - "naming =version %-14d bsize=%-6d\n" - "log =%-22s bsize=%-6d blocks=%lld, version=%d\n" - " =%-22s sunit=%d blks\n" - "realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n", - dfile, isize, (long long)agcount, (long long)agsize, - "", blocksize, (long long)dblocks, sbp->sb_imax_pct, - "", dsunit, dswidth, extent_flagging, - dirversion, dirversion == 1 ? blocksize : dirblocksize, - logfile, 1 << blocklog, (long long)logblocks, - logversion, "", lsunit, - rtfile, rtextblocks << blocklog, - (long long)rtblocks, (long long)rtextents); /* * If the data area is a file, then grow it out to its final size * so that the reads for the end of the device in the mount code