From aad847cb6647561aba463fd7777a84177e26a360 Mon Sep 17 00:00:00 2001 From: huanghua Date: Tue, 6 Dec 2005 04:43:47 +0000 Subject: [PATCH] add "mount --nosvc" --- lustre/include/linux/lustre_disk.h | 1 + lustre/obdclass/obd_mount.c | 8 ++++++++ lustre/utils/mount_lustre.c | 1 + 3 files changed, 10 insertions(+) diff --git a/lustre/include/linux/lustre_disk.h b/lustre/include/linux/lustre_disk.h index a85324c..b916ef4 100644 --- a/lustre/include/linux/lustre_disk.h +++ b/lustre/include/linux/lustre_disk.h @@ -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 */ diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 5607ccb..7a35abe 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -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) { diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 5aefe32..4efa7fa 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -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 } }; /****************************************************************************/ -- 1.8.3.1