Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Tue, 28 Apr 2009 01:22:24 +0000 (01:22 +0000)
committerbobijam <bobijam>
Tue, 28 Apr 2009 01:22:24 +0000 (01:22 +0000)
b=18683
i=joahnn
i=sheng.yang

If no options are given, tunefs.lustre/mkfs.lustre just print info.

lustre/utils/mkfs_lustre.c

index 95dce17..41f5b19 100644 (file)
@@ -1135,7 +1135,7 @@ static char *convert_hostnames(char *s1)
                 sep = *s2;
                 *s2 = '\0';
                 nid = libcfs_str2nid(s1);
-                
+
                 if (nid == LNET_NID_ANY) {
                         fprintf(stderr, "%s: Can't parse NID '%s'\n", progname, s1);
                         free(converted);
@@ -1150,7 +1150,7 @@ static char *convert_hostnames(char *s1)
                         free(converted);
                         return NULL;
                 }
-                                        
+
                 c += snprintf(c, left, "%s%c", libcfs_nid2str(nid), sep);
                 left = converted + MAXNIDSTR - c;
                 s1 = s2 + 1;
@@ -1375,6 +1375,10 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop,
                 return EINVAL;
         }
 
+        /* single argument: <device> */
+        if (argc == 2)
+                ++print_only;
+
         return 0;
 }