Whamcloud - gitweb
add "mount --nosvc"
authorhuanghua <huanghua>
Tue, 6 Dec 2005 04:43:47 +0000 (04:43 +0000)
committerhuanghua <huanghua>
Tue, 6 Dec 2005 04:43:47 +0000 (04:43 +0000)
lustre/include/linux/lustre_disk.h
lustre/obdclass/obd_mount.c
lustre/utils/mount_lustre.c

index a85324c..b916ef4 100644 (file)
@@ -122,6 +122,7 @@ struct lustre_mount_data {
 };
 
 #define LMD_FLG_RECOVER      0x0001  /* Allow recovery */
+#define LMD_FLG_NOSVC        0x0002  /* Only start MGS/MGC for servers, no other services */
 #define LMD_FLG_MNTCNF       0x1000  /* MountConf compat */
 #define LMD_FLG_CLIENT       0x2000  /* Mounting a client only; no real device */
 
index 5607ccb..7a35abe 100644 (file)
@@ -1152,6 +1152,11 @@ static int server_fill_super(struct super_block *sb)
         if (rc) 
                 GOTO(out_mnt, rc);
 
+        /*Only start MGS/MGC on servers, no other services, even not
+         *actually mount the filesystem. */
+        if (lmd->lmd_flags & LMD_FLG_NOSVC)
+                RETURN(0);
+
         /* Set up all obd devices for service */
         if (IS_OST(lsi->lsi_ldd) || IS_MDT(lsi->lsi_ldd)) {
                 rc = server_start_targets(sb, mnt);
@@ -1249,6 +1254,9 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
                         lmd->lmd_flags |= LMD_FLG_RECOVER;
                 if (strncmp(s1, "norecov", 7) == 0)
                         lmd->lmd_flags &= ~LMD_FLG_RECOVER;
+                if (strncmp(s1, "nosvc", 5) == 0)
+                        lmd->lmd_flags |= LMD_FLG_NOSVC;
+
                 /* Linux 2.4 doesn't pass the device, so we stuck it at the 
                    end of the options. */
                 if (strncmp(s1, "device=", 7) == 0) {
index 5aefe32..4efa7fa 100644 (file)
@@ -192,6 +192,7 @@ static const struct opt_map opt_map[] = {
   { "noflock",  1, 1, 0         },      /* Disable flock support */
   { "user_xattr",   0, 0, 0     },      /* Enable get/set user xattr */
   { "nouser_xattr", 1, 1, 0     },      /* Disable user xattr */
+  { "nosvc",    0, 0, 0         },      /* Only start MGS/MGC, no other services */
   { NULL,       0, 0, 0         }
 };
 /****************************************************************************/