Whamcloud - gitweb
Branch b1_8
authorbobijam <bobijam>
Fri, 24 Apr 2009 02:18:16 +0000 (02:18 +0000)
committerbobijam <bobijam>
Fri, 24 Apr 2009 02:18:16 +0000 (02:18 +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 8b772e4..5b874aa 100644 (file)
@@ -1094,7 +1094,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);
@@ -1109,7 +1109,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;
@@ -1338,6 +1338,10 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop,
                 return EINVAL;
         }
 
+        /* single argument: <device> */
+        if (argc == 2)
+                ++print_only;
+
 #ifndef TUNEFS
         if (mop->mo_ldd.ldd_flags & LDD_F_SV_TYPE_MDT && 0 == upcall) {
                 if (access("/usr/sbin/l_getgroups", R_OK | X_OK)) {