~ubuntu-branches/debian/jessie/ufsutils/jessie

« back to all changes in this revision

Viewing changes to sbin/tunefs/tunefs.c

  • Committer: Bazaar Package Importer
  • Author(s): Guillem Jover, Robert Millan, Guillem Jover, Peter Pentchev
  • Date: 2011-05-31 03:50:05 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110531035005-wyiyk25p99ivd0k0
Tags: 8.2-1
[ Robert Millan ]
* Set ufsutils-udeb to kfreebsd-any.

[ Guillem Jover ]
* New upstream version (based on FreeBSD 8.2)
* Now using Standards-Version 3.9.2 (no changes needed).
* Switch to source format “3.0 (quilt)”.
  - Remove quilt from Build-Depends.
  - Remove patch target in debian/rules.
  - Remove now unneeded README.source.
  - Refresh all patches.
* Reorganize source code:
  - Switch from debian/upstream.sh to debian/rules get-orig-source target.
  - Switch from CVS to Subversion to retrieve the source code.
  - Use the same source layout as upstream (no more relocations),
    i.e. lib/, sbin/, sys/sys, sys/ufs.
  - Move libport/ to port/.
  - Merge libdisklabel/ into port/.
* Remove unneeded linking against libtermcap, thus removing the need for
  ncurses.
* Add an empty debian/watch file explaining that there's no packaged
  upstream releases. Suggested by Peter Pentchev.
* Update CVS to Subversion reference to upstream source code in
  debian/copyright.
* Remove unused lib variable from debian/rules.
* Use dpkg-buildflags to set CPPFLAGS, CFLAGS and LDFLAGS.
  Based on a patch by Peter Pentchev.
* Remove bogus reference to BSD license in /usr/share/common-licenses.
* Always set -I../../sys, even on GNU/kFreeBSD systems.

[ Peter Pentchev ]
* Remove duplicate section “utils” from ufsutils binary package.
* Remove XC- prefix from Package-Type.
* Honour CPPFLAGS and LDFLAGS and do not link with CFLAGS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 1983, 1993
 
3
 *      The Regents of the University of California.  All rights reserved.
 
4
 *
 
5
 * Redistribution and use in source and binary forms, with or without
 
6
 * modification, are permitted provided that the following conditions
 
7
 * are met:
 
8
 * 1. Redistributions of source code must retain the above copyright
 
9
 *    notice, this list of conditions and the following disclaimer.
 
10
 * 2. Redistributions in binary form must reproduce the above copyright
 
11
 *    notice, this list of conditions and the following disclaimer in the
 
12
 *    documentation and/or other materials provided with the distribution.
 
13
 * 4. Neither the name of the University nor the names of its contributors
 
14
 *    may be used to endorse or promote products derived from this software
 
15
 *    without specific prior written permission.
 
16
 *
 
17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 
23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 
26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 
27
 * SUCH DAMAGE.
 
28
 */
 
29
 
 
30
#if 0
 
31
#ifndef lint
 
32
static const char copyright[] =
 
33
"@(#) Copyright (c) 1983, 1993\n\
 
34
        The Regents of the University of California.  All rights reserved.\n";
 
35
#endif /* not lint */
 
36
 
 
37
#ifndef lint
 
38
static char sccsid[] = "@(#)tunefs.c    8.2 (Berkeley) 4/19/94";
 
39
#endif /* not lint */
 
40
#endif
 
41
#include <sys/cdefs.h>
 
42
__FBSDID("$FreeBSD$");
 
43
 
 
44
/*
 
45
 * tunefs: change layout parameters to an existing file system.
 
46
 */
 
47
#include <sys/param.h>
 
48
#include <sys/mount.h>
 
49
#include <sys/disklabel.h>
 
50
#include <sys/stat.h>
 
51
#ifndef HAVE_BSD_STATFS
 
52
#include <sys/statvfs.h>
 
53
#define statfs statvfs
 
54
#define f_flags f_flag
 
55
#endif
 
56
 
 
57
#if HAVE_BSD_MOUNT
 
58
#include <ufs/ufs/ufsmount.h>
 
59
#endif
 
60
#include <ufs/ufs/dinode.h>
 
61
#include <ufs/ffs/fs.h>
 
62
 
 
63
#include <ctype.h>
 
64
#include <err.h>
 
65
#include <fcntl.h>
 
66
#include <fstab.h>
 
67
#include <libufs.h>
 
68
#include <paths.h>
 
69
#include <stdio.h>
 
70
#include <stdlib.h>
 
71
#include <string.h>
 
72
#include <unistd.h>
 
73
 
 
74
/* the optimization warning string template */
 
75
#define OPTWARN "should optimize for %s with minfree %s %d%%"
 
76
 
 
77
struct uufsd disk;
 
78
#define sblock disk.d_fs
 
79
 
 
80
void usage(void);
 
81
void printfs(void);
 
82
 
 
83
int
 
84
main(int argc, char *argv[])
 
85
{
 
86
        char *avalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue;
 
87
        const char *special, *on;
 
88
        const char *name;
 
89
        int active;
 
90
        int Aflag, aflag, eflag, evalue, fflag, fvalue, Jflag, Lflag, lflag;
 
91
        int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue;
 
92
        int ch, found_arg, i;
 
93
        const char *chg[2];
 
94
#ifdef HAVE_BSD_MOUNT
 
95
        struct ufs_args args;
 
96
#endif
 
97
#ifdef HAVE_BSD_STATFS
 
98
        struct statfs stfs;
 
99
#endif
 
100
 
 
101
        if (argc < 3)
 
102
                usage();
 
103
        Aflag = aflag = eflag = fflag = Jflag = Lflag = lflag = mflag = 0;
 
104
        Nflag = nflag = oflag = pflag = sflag = 0;
 
105
        avalue = Jvalue = Lvalue = lvalue = Nvalue = nvalue = NULL;
 
106
        evalue = fvalue = mvalue = ovalue = svalue = 0;
 
107
        active = 0;
 
108
        found_arg = 0;          /* At least one arg is required. */
 
109
        while ((ch = getopt(argc, argv, "Aa:e:f:J:L:l:m:N:n:o:ps:")) != -1)
 
110
                switch (ch) {
 
111
 
 
112
                case 'A':
 
113
                        found_arg = 1;
 
114
                        Aflag++;
 
115
                        break;
 
116
 
 
117
                case 'a':
 
118
                        found_arg = 1;
 
119
                        name = "POSIX.1e ACLs";
 
120
                        avalue = optarg;
 
121
                        if (strcmp(avalue, "enable") &&
 
122
                            strcmp(avalue, "disable")) {
 
123
                                errx(10, "bad %s (options are %s)",
 
124
                                    name, "`enable' or `disable'");
 
125
                        }
 
126
                        aflag = 1;
 
127
                        break;
 
128
 
 
129
                case 'e':
 
130
                        found_arg = 1;
 
131
                        name = "maximum blocks per file in a cylinder group";
 
132
                        evalue = atoi(optarg);
 
133
                        if (evalue < 1)
 
134
                                errx(10, "%s must be >= 1 (was %s)",
 
135
                                    name, optarg);
 
136
                        eflag = 1;
 
137
                        break;
 
138
 
 
139
                case 'f':
 
140
                        found_arg = 1;
 
141
                        name = "average file size";
 
142
                        fvalue = atoi(optarg);
 
143
                        if (fvalue < 1)
 
144
                                errx(10, "%s must be >= 1 (was %s)",
 
145
                                    name, optarg);
 
146
                        fflag = 1;
 
147
                        break;
 
148
 
 
149
                case 'J':
 
150
                        found_arg = 1;
 
151
                        name = "gjournaled file system";
 
152
                        Jvalue = optarg;
 
153
                        if (strcmp(Jvalue, "enable") &&
 
154
                            strcmp(Jvalue, "disable")) {
 
155
                                errx(10, "bad %s (options are %s)",
 
156
                                    name, "`enable' or `disable'");
 
157
                        }
 
158
                        Jflag = 1;
 
159
                        break;
 
160
 
 
161
 
 
162
                case 'L':
 
163
                        found_arg = 1;
 
164
                        name = "volume label";
 
165
                        Lvalue = optarg;
 
166
                        i = -1;
 
167
                        while (isalnum(Lvalue[++i]));
 
168
                        if (Lvalue[i] != '\0') {
 
169
                                errx(10,
 
170
                                "bad %s. Valid characters are alphanumerics.",
 
171
                                    name);
 
172
                        }
 
173
                        if (strlen(Lvalue) >= MAXVOLLEN) {
 
174
                                errx(10, "bad %s. Length is longer than %d.",
 
175
                                    name, MAXVOLLEN - 1);
 
176
                        }
 
177
                        Lflag = 1;
 
178
                        break;
 
179
 
 
180
                case 'l':
 
181
                        found_arg = 1;
 
182
                        name = "multilabel MAC file system";
 
183
                        lvalue = optarg;
 
184
                        if (strcmp(lvalue, "enable") &&
 
185
                            strcmp(lvalue, "disable")) {
 
186
                                errx(10, "bad %s (options are %s)",
 
187
                                    name, "`enable' or `disable'");
 
188
                        }
 
189
                        lflag = 1;
 
190
                        break;
 
191
 
 
192
                case 'm':
 
193
                        found_arg = 1;
 
194
                        name = "minimum percentage of free space";
 
195
                        mvalue = atoi(optarg);
 
196
                        if (mvalue < 0 || mvalue > 99)
 
197
                                errx(10, "bad %s (%s)", name, optarg);
 
198
                        mflag = 1;
 
199
                        break;
 
200
 
 
201
                case 'N':
 
202
                        found_arg = 1;
 
203
                        name = "NFSv4 ACLs";
 
204
                        Nvalue = optarg;
 
205
                        if (strcmp(Nvalue, "enable") &&
 
206
                            strcmp(Nvalue, "disable")) {
 
207
                                errx(10, "bad %s (options are %s)",
 
208
                                    name, "`enable' or `disable'");
 
209
                        }
 
210
                        Nflag = 1;
 
211
                        break;
 
212
 
 
213
                case 'n':
 
214
                        found_arg = 1;
 
215
                        name = "soft updates";
 
216
                        nvalue = optarg;
 
217
                        if (strcmp(nvalue, "enable") != 0 &&
 
218
                            strcmp(nvalue, "disable") != 0) {
 
219
                                errx(10, "bad %s (options are %s)",
 
220
                                    name, "`enable' or `disable'");
 
221
                        }
 
222
                        nflag = 1;
 
223
                        break;
 
224
 
 
225
                case 'o':
 
226
                        found_arg = 1;
 
227
                        name = "optimization preference";
 
228
                        if (strcmp(optarg, "space") == 0)
 
229
                                ovalue = FS_OPTSPACE;
 
230
                        else if (strcmp(optarg, "time") == 0)
 
231
                                ovalue = FS_OPTTIME;
 
232
                        else
 
233
                                errx(10,
 
234
                                    "bad %s (options are `space' or `time')",
 
235
                                    name);
 
236
                        oflag = 1;
 
237
                        break;
 
238
 
 
239
                case 'p':
 
240
                        found_arg = 1;
 
241
                        pflag = 1;
 
242
                        break;
 
243
 
 
244
                case 's':
 
245
                        found_arg = 1;
 
246
                        name = "expected number of files per directory";
 
247
                        svalue = atoi(optarg);
 
248
                        if (svalue < 1)
 
249
                                errx(10, "%s must be >= 1 (was %s)",
 
250
                                    name, optarg);
 
251
                        sflag = 1;
 
252
                        break;
 
253
 
 
254
                default:
 
255
                        usage();
 
256
                }
 
257
        argc -= optind;
 
258
        argv += optind;
 
259
        if (found_arg == 0 || argc != 1)
 
260
                usage();
 
261
 
 
262
        on = special = argv[0];
 
263
        if (ufs_disk_fillout(&disk, special) == -1)
 
264
                goto err;
 
265
        if (disk.d_name != special) {
 
266
                special = disk.d_name;
 
267
#ifdef HAVE_BSD_STATFS
 
268
                if (statfs(special, &stfs) == 0 &&
 
269
                    strcmp(special, stfs.f_mntonname) == 0)
 
270
                        active = 1;
 
271
#endif
 
272
        }
 
273
 
 
274
        if (pflag) {
 
275
                printfs();
 
276
                exit(0);
 
277
        }
 
278
        if (Lflag) {
 
279
                name = "volume label";
 
280
                strlcpy(sblock.fs_volname, Lvalue, MAXVOLLEN);
 
281
        }
 
282
        if (aflag) {
 
283
                name = "POSIX.1e ACLs";
 
284
                if (strcmp(avalue, "enable") == 0) {
 
285
                        if (sblock.fs_flags & FS_ACLS) {
 
286
                                warnx("%s remains unchanged as enabled", name);
 
287
                        } else if (sblock.fs_flags & FS_NFS4ACLS) {
 
288
                                warnx("%s and NFSv4 ACLs are mutually "
 
289
                                    "exclusive", name);
 
290
                        } else {
 
291
                                sblock.fs_flags |= FS_ACLS;
 
292
                                warnx("%s set", name);
 
293
                        }
 
294
                } else if (strcmp(avalue, "disable") == 0) {
 
295
                        if ((~sblock.fs_flags & FS_ACLS) ==
 
296
                            FS_ACLS) {
 
297
                                warnx("%s remains unchanged as disabled",
 
298
                                    name);
 
299
                        } else {
 
300
                                sblock.fs_flags &= ~FS_ACLS;
 
301
                                warnx("%s cleared", name);
 
302
                        }
 
303
                }
 
304
        }
 
305
        if (eflag) {
 
306
                name = "maximum blocks per file in a cylinder group";
 
307
                if (sblock.fs_maxbpg == evalue)
 
308
                        warnx("%s remains unchanged as %d", name, evalue);
 
309
                else {
 
310
                        warnx("%s changes from %d to %d",
 
311
                            name, sblock.fs_maxbpg, evalue);
 
312
                        sblock.fs_maxbpg = evalue;
 
313
                }
 
314
        }
 
315
        if (fflag) {
 
316
                name = "average file size";
 
317
                if (sblock.fs_avgfilesize == (unsigned)fvalue) {
 
318
                        warnx("%s remains unchanged as %d", name, fvalue);
 
319
                }
 
320
                else {
 
321
                        warnx("%s changes from %d to %d",
 
322
                                        name, sblock.fs_avgfilesize, fvalue);
 
323
                        sblock.fs_avgfilesize = fvalue;
 
324
                }
 
325
        }
 
326
        if (Jflag) {
 
327
                name = "gjournal";
 
328
                if (strcmp(Jvalue, "enable") == 0) {
 
329
                        if (sblock.fs_flags & FS_GJOURNAL) {
 
330
                                warnx("%s remains unchanged as enabled", name);
 
331
                        } else {
 
332
                                sblock.fs_flags |= FS_GJOURNAL;
 
333
                                warnx("%s set", name);
 
334
                        }
 
335
                } else if (strcmp(Jvalue, "disable") == 0) {
 
336
                        if ((~sblock.fs_flags & FS_GJOURNAL) ==
 
337
                            FS_GJOURNAL) {
 
338
                                warnx("%s remains unchanged as disabled",
 
339
                                    name);
 
340
                        } else {
 
341
                                sblock.fs_flags &= ~FS_GJOURNAL;
 
342
                                warnx("%s cleared", name);
 
343
                        }
 
344
                }
 
345
        }
 
346
        if (lflag) {
 
347
                name = "multilabel";
 
348
                if (strcmp(lvalue, "enable") == 0) {
 
349
                        if (sblock.fs_flags & FS_MULTILABEL) {
 
350
                                warnx("%s remains unchanged as enabled", name);
 
351
                        } else {
 
352
                                sblock.fs_flags |= FS_MULTILABEL;
 
353
                                warnx("%s set", name);
 
354
                        }
 
355
                } else if (strcmp(lvalue, "disable") == 0) {
 
356
                        if ((~sblock.fs_flags & FS_MULTILABEL) ==
 
357
                            FS_MULTILABEL) {
 
358
                                warnx("%s remains unchanged as disabled",
 
359
                                    name);
 
360
                        } else {
 
361
                                sblock.fs_flags &= ~FS_MULTILABEL;
 
362
                                warnx("%s cleared", name);
 
363
                        }
 
364
                }
 
365
        }
 
366
        if (mflag) {
 
367
                name = "minimum percentage of free space";
 
368
                if (sblock.fs_minfree == mvalue)
 
369
                        warnx("%s remains unchanged as %d%%", name, mvalue);
 
370
                else {
 
371
                        warnx("%s changes from %d%% to %d%%",
 
372
                                    name, sblock.fs_minfree, mvalue);
 
373
                        sblock.fs_minfree = mvalue;
 
374
                        if (mvalue >= MINFREE && sblock.fs_optim == FS_OPTSPACE)
 
375
                                warnx(OPTWARN, "time", ">=", MINFREE);
 
376
                        if (mvalue < MINFREE && sblock.fs_optim == FS_OPTTIME)
 
377
                                warnx(OPTWARN, "space", "<", MINFREE);
 
378
                }
 
379
        }
 
380
        if (Nflag) {
 
381
                name = "NFSv4 ACLs";
 
382
                if (strcmp(Nvalue, "enable") == 0) {
 
383
                        if (sblock.fs_flags & FS_NFS4ACLS) {
 
384
                                warnx("%s remains unchanged as enabled", name);
 
385
                        } else if (sblock.fs_flags & FS_ACLS) {
 
386
                                warnx("%s and POSIX.1e ACLs are mutually "
 
387
                                    "exclusive", name);
 
388
                        } else {
 
389
                                sblock.fs_flags |= FS_NFS4ACLS;
 
390
                                warnx("%s set", name);
 
391
                        }
 
392
                } else if (strcmp(Nvalue, "disable") == 0) {
 
393
                        if ((~sblock.fs_flags & FS_NFS4ACLS) ==
 
394
                            FS_NFS4ACLS) {
 
395
                                warnx("%s remains unchanged as disabled",
 
396
                                    name);
 
397
                        } else {
 
398
                                sblock.fs_flags &= ~FS_NFS4ACLS;
 
399
                                warnx("%s cleared", name);
 
400
                        }
 
401
                }
 
402
        }
 
403
        if (nflag) {
 
404
                name = "soft updates";
 
405
                if (strcmp(nvalue, "enable") == 0) {
 
406
                        if (sblock.fs_flags & FS_DOSOFTDEP)
 
407
                                warnx("%s remains unchanged as enabled", name);
 
408
                        else if (sblock.fs_clean == 0) {
 
409
                                warnx("%s cannot be enabled until fsck is run",
 
410
                                    name);
 
411
                        } else {
 
412
                                sblock.fs_flags |= FS_DOSOFTDEP;
 
413
                                warnx("%s set", name);
 
414
                        }
 
415
                } else if (strcmp(nvalue, "disable") == 0) {
 
416
                        if ((~sblock.fs_flags & FS_DOSOFTDEP) == FS_DOSOFTDEP)
 
417
                                warnx("%s remains unchanged as disabled", name);
 
418
                        else {
 
419
                                sblock.fs_flags &= ~FS_DOSOFTDEP;
 
420
                                warnx("%s cleared", name);
 
421
                        }
 
422
                }
 
423
        }
 
424
        if (oflag) {
 
425
                name = "optimization preference";
 
426
                chg[FS_OPTSPACE] = "space";
 
427
                chg[FS_OPTTIME] = "time";
 
428
                if (sblock.fs_optim == ovalue)
 
429
                        warnx("%s remains unchanged as %s", name, chg[ovalue]);
 
430
                else {
 
431
                        warnx("%s changes from %s to %s",
 
432
                                    name, chg[sblock.fs_optim], chg[ovalue]);
 
433
                        sblock.fs_optim = ovalue;
 
434
                        if (sblock.fs_minfree >= MINFREE &&
 
435
                            ovalue == FS_OPTSPACE)
 
436
                                warnx(OPTWARN, "time", ">=", MINFREE);
 
437
                        if (sblock.fs_minfree < MINFREE && ovalue == FS_OPTTIME)
 
438
                                warnx(OPTWARN, "space", "<", MINFREE);
 
439
                }
 
440
        }
 
441
        if (sflag) {
 
442
                name = "expected number of files per directory";
 
443
                if (sblock.fs_avgfpdir == (unsigned)svalue) {
 
444
                        warnx("%s remains unchanged as %d", name, svalue);
 
445
                }
 
446
                else {
 
447
                        warnx("%s changes from %d to %d",
 
448
                                        name, sblock.fs_avgfpdir, svalue);
 
449
                        sblock.fs_avgfpdir = svalue;
 
450
                }
 
451
        }
 
452
 
 
453
        if (sbwrite(&disk, Aflag) == -1)
 
454
                goto err;
 
455
        ufs_disk_close(&disk);
 
456
#if HAVE_BSD_MOUNT && HAVE_BSD_STATFS
 
457
        if (active) {
 
458
                bzero(&args, sizeof(args));
 
459
                if (mount("ufs", on,
 
460
                    stfs.f_flags | MNT_UPDATE | MNT_RELOAD, &args) < 0)
 
461
                        err(9, "%s: reload", special);
 
462
                warnx("file system reloaded");
 
463
        }
 
464
#endif
 
465
        exit(0);
 
466
err:
 
467
        if (disk.d_error != NULL)
 
468
                errx(11, "%s: %s", special, disk.d_error);
 
469
        else
 
470
                err(12, "%s", special);
 
471
}
 
472
 
 
473
void
 
474
usage(void)
 
475
{
 
476
        fprintf(stderr, "%s\n%s\n%s\n%s\n",
 
477
"usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]",
 
478
"              [-J enable | disable ] [-L volname] [-l enable | disable]",
 
479
"              [-m minfree] [-N enable | disable] [-n enable | disable]",
 
480
"              [-o space | time] [-p] [-s avgfpdir] special | filesystem");
 
481
        exit(2);
 
482
}
 
483
 
 
484
void
 
485
printfs(void)
 
486
{
 
487
        warnx("POSIX.1e ACLs: (-a)                                %s",
 
488
                (sblock.fs_flags & FS_ACLS)? "enabled" : "disabled");
 
489
        warnx("NFSv4 ACLs: (-N)                                   %s",
 
490
                (sblock.fs_flags & FS_NFS4ACLS)? "enabled" : "disabled");
 
491
        warnx("MAC multilabel: (-l)                               %s",
 
492
                (sblock.fs_flags & FS_MULTILABEL)? "enabled" : "disabled");
 
493
        warnx("soft updates: (-n)                                 %s", 
 
494
                (sblock.fs_flags & FS_DOSOFTDEP)? "enabled" : "disabled");
 
495
        warnx("gjournal: (-J)                                     %s",
 
496
                (sblock.fs_flags & FS_GJOURNAL)? "enabled" : "disabled");
 
497
        warnx("maximum blocks per file in a cylinder group: (-e)  %d",
 
498
              sblock.fs_maxbpg);
 
499
        warnx("average file size: (-f)                            %d",
 
500
              sblock.fs_avgfilesize);
 
501
        warnx("average number of files in a directory: (-s)       %d",
 
502
              sblock.fs_avgfpdir);
 
503
        warnx("minimum percentage of free space: (-m)             %d%%",
 
504
              sblock.fs_minfree);
 
505
        warnx("optimization preference: (-o)                      %s",
 
506
              sblock.fs_optim == FS_OPTSPACE ? "space" : "time");
 
507
        if (sblock.fs_minfree >= MINFREE &&
 
508
            sblock.fs_optim == FS_OPTSPACE)
 
509
                warnx(OPTWARN, "time", ">=", MINFREE);
 
510
        if (sblock.fs_minfree < MINFREE &&
 
511
            sblock.fs_optim == FS_OPTTIME)
 
512
                warnx(OPTWARN, "space", "<", MINFREE);
 
513
        warnx("volume label: (-L)                                 %s",
 
514
                sblock.fs_volname);
 
515
}