Whamcloud - gitweb
Need to include mount_utils.h in the _SOURCES for the tools that use it.
[fs/lustre-release.git] / lustre / utils / mount_lustre.c
index 004890c..0ac707c 100644 (file)
 #include <sys/mount.h>
 #include <mntent.h>
 #include <getopt.h>
-#include <sys/utsname.h>
 #include "obdctl.h"
 #include <lustre_ver.h>
 #include <glob.h>
 #include <ctype.h>
 #include <limits.h>
+#include "mount_utils.h"
 
 #define MAX_HW_SECTORS_KB_PATH  "queue/max_hw_sectors_kb"
 #define MAX_SECTORS_KB_PATH     "queue/max_sectors_kb"
@@ -47,7 +47,7 @@ int          verbose = 0;
 int          nomtab = 0;
 int          fake = 0;
 int          force = 0;
-static char *progname = NULL;
+char         *progname = NULL;
 
 void usage(FILE *out)
 {
@@ -69,6 +69,7 @@ void usage(FILE *out)
                 "\t<mntopt>: one or more comma separated of:\n"
                 "\t\t(no)flock,(no)user_xattr,(no)acl\n"
                 "\t\tnosvc: only start MGC/MGS obds\n"
+                "\t\tnomgs: only start target obds, using existing MGS\n"
                 "\t\texclude=<ostname>[:<ostname>] : colon-separated list of "
                 "inactive OSTs (e.g. lustre-OST0001)\n"
                 );
@@ -206,6 +207,7 @@ static const struct opt_map opt_map[] = {
   { "nouser",   1, 0         },      /* Forbid ordinary user to mount */
   { "noowner",  1, 0         },      /* Device owner has no special privs */
   { "_netdev",  0, 0         },      /* Device accessible only via network */
+  { "loop",     0, 0         },
   { NULL,       0, 0         }
 };
 /****************************************************************************/
@@ -494,7 +496,8 @@ int main(int argc, char *const argv[])
         if (verbose) {
                 for (i = 0; i < argc; i++)
                         printf("arg[%d] = %s\n", i, argv[i]);
-                printf("source = %s (%s), target = %s\n", usource, source, target);
+                printf("source = %s (%s), target = %s\n", usource, source,
+                       target);
                 printf("options = %s\n", orig_options);
         }
 
@@ -549,9 +552,11 @@ int main(int argc, char *const argv[])
 
         if (set_tunables(source, strlen(source)) && verbose)
                 fprintf(stderr, "%s: unable to set tunables for %s"
-                                " (may cause reduced IO performance)",
+                                " (may cause reduced IO performance)\n",
                                 argv[0], source);
 
+        register_service_tags(usource, source, target);
+
         if (!fake)
                 /* flags and target get to lustre_get_sb, but not
                    lustre_fill_super.  Lustre ignores the flags, but mount