From 8b9bcb0cfe1829808b0733da8b2f131d316a5f4e Mon Sep 17 00:00:00 2001 From: bobijam Date: Fri, 24 Apr 2009 02:18:16 +0000 Subject: [PATCH] Branch b1_8 b=18683 i=joahnn i=sheng.yang If no options are given, tunefs.lustre/mkfs.lustre just print info. --- lustre/utils/mkfs_lustre.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 8b772e4..5b874aa 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -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: */ + 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)) { -- 1.8.3.1