BSD 4_2 release
[unix-history] / usr / src / etc / tunefs.c
index 47a7885..b0c946c 100644 (file)
@@ -1,17 +1,19 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)tunefs.c    4.2 (Berkeley) 2/26/83";
+static char *sccsid = "@(#)tunefs.c    4.4 (Berkeley) 7/1/83";
 #endif lint
 
 /*
  * tunefs: change layout parameters to an existing file system.
  */
 
 #endif lint
 
 /*
  * tunefs: change layout parameters to an existing file system.
  */
 
-#include <stdio.h>
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/fs.h>
 #include <sys/inode.h>
 
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/fs.h>
 #include <sys/inode.h>
 
+#include <stdio.h>
+#include <fstab.h>
+
 union {
        struct  fs sb;
        char pad[MAXBSIZE];
 union {
        struct  fs sb;
        char pad[MAXBSIZE];
@@ -30,11 +32,15 @@ main(argc, argv)
        int Aflag = 0;
        char device[MAXPATHLEN];
        extern char *sprintf();
        int Aflag = 0;
        char device[MAXPATHLEN];
        extern char *sprintf();
+       struct fstab *fs;
 
        argc--, argv++; 
        if (argc < 2)
                goto usage;
        special = argv[argc - 1];
 
        argc--, argv++; 
        if (argc < 2)
                goto usage;
        special = argv[argc - 1];
+       fs = getfsfile(special);
+       if (fs)
+               special = fs->fs_spec;
 again:
        if (stat(special, &st) < 0) {
                if (*special != '/') {
 again:
        if (stat(special, &st) < 0) {
                if (*special != '/') {
@@ -132,7 +138,7 @@ again:
 usage:
        fprintf(stderr, "Usage: tunefs tuneup-options special-device\n");
        fprintf(stderr, "where tuneup-options are:\n");
 usage:
        fprintf(stderr, "Usage: tunefs tuneup-options special-device\n");
        fprintf(stderr, "where tuneup-options are:\n");
-       fprintf(stderr, "\t-a maximum contigouous blocks\n");
+       fprintf(stderr, "\t-a maximum contiguous blocks\n");
        fprintf(stderr, "\t-d rotational delay between contiguous blocks\n");
        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-d rotational delay between contiguous blocks\n");
        fprintf(stderr, "\t-e maximum blocks per file in a cylinder group\n");
        fprintf(stderr, "\t-m minimum percentage of free space\n");