diff options
Diffstat (limited to 'sbin/tunefs/tunefs.c')
-rw-r--r-- | sbin/tunefs/tunefs.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c index e277a71..3677d89 100644 --- a/sbin/tunefs/tunefs.c +++ b/sbin/tunefs/tunefs.c @@ -74,6 +74,7 @@ void bwrite(daddr_t, char *, int); int bread(daddr_t, char *, int); void getsb(struct fs *, char *); void usage __P((void)); +void printfs __P((void)); int main(argc, argv) @@ -117,6 +118,10 @@ again: Aflag++; continue; + case 'p': + printfs(); + exit(0); + case 'a': name = "maximum contiguous block count"; if (argc < 1) @@ -233,6 +238,7 @@ usage() fprintf(stderr, "\t-e maximum blocks per file in a cylinder group\n"); fprintf(stderr, "\t-m minimum percentage of free space\n"); fprintf(stderr, "\t-o optimization preference (`space' or `time')\n"); + fprintf(stderr, "\t-p no change - just prints current tuneable settings\n"); exit(2); } @@ -253,6 +259,27 @@ getsb(fs, file) } void +printfs() +{ + warnx("maximum contiguous block count: (-a) %d", + sblock.fs_maxcontig); + warnx("rotational delay between contiguous blocks: (-d) %d ms", + sblock.fs_rotdelay); + warnx("maximum blocks per file in a cylinder group: (-e) %d", + sblock.fs_maxbpg); + warnx("minimum percentage of free space: (-m) %d%%", + sblock.fs_minfree); + warnx("optimization preference: (-o) %s", + sblock.fs_optim == FS_OPTSPACE ? "space" : "time"); + if (sblock.fs_minfree >= MINFREE && + sblock.fs_optim == FS_OPTSPACE) + warnx(OPTWARN, "time", ">=", MINFREE); + if (sblock.fs_minfree < MINFREE && + sblock.fs_optim == FS_OPTTIME) + warnx(OPTWARN, "space", "<", MINFREE); +} + +void bwrite(blk, buf, size) daddr_t blk; char *buf; |