From 1fef622a409fcfafd09c41952a818b5eaff77337 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 28 Sep 2005 18:26:07 +0000 Subject: [PATCH] Branch b1_4 Remove last vestiges of "mgmt" and "mgmt_cli", which was never used. The lustre/mgmt directory has been an empty shell for a long time. The new mountconfig code uses "mgc" and "mgs". --- lustre/conf/lustre.dtd | 10 ++---- lustre/doc/lmc.lyx | 13 ------- lustre/include/linux/Makefile.am | 2 +- lustre/include/linux/lustre_mgmt.h | 29 --------------- lustre/include/linux/obd.h | 15 -------- lustre/ldlm/ldlm_lib.c | 45 ------------------------ lustre/mgmt/.cvsignore | 12 ------- lustre/utils/lconf | 72 +++----------------------------------- lustre/utils/lmc | 51 ++++----------------------- 9 files changed, 13 insertions(+), 236 deletions(-) delete mode 100644 lustre/include/linux/lustre_mgmt.h delete mode 100644 lustre/mgmt/.cvsignore diff --git a/lustre/conf/lustre.dtd b/lustre/conf/lustre.dtd index ff37771..360f4a0 100644 --- a/lustre/conf/lustre.dtd +++ b/lustre/conf/lustre.dtd @@ -33,7 +33,7 @@ + echoclient_ref | mountpoint_ref)*> - - - @@ -63,8 +60,7 @@ failover ( 1 | 0 ) #IMPLIED> + obd_ref #REQUIRED> @@ -133,8 +129,6 @@ - - diff --git a/lustre/doc/lmc.lyx b/lustre/doc/lmc.lyx index aa44852..1c27a15 100644 --- a/lustre/doc/lmc.lyx +++ b/lustre/doc/lmc.lyx @@ -604,19 +604,6 @@ Node on which the echo-client resides. \end_deeper \layout Description ---add\SpecialChar ~ -mgmt Management/monitoring service. -\begin_deeper -\layout Description - ---node\SpecialChar ~ -nodename -\emph on - -\emph default -Node on which the mgmt service resides. -\layout Description - \end_deeper \layout List \labelwidthstring 00.00.0000 diff --git a/lustre/include/linux/Makefile.am b/lustre/include/linux/Makefile.am index aa0153d..70f20f8 100644 --- a/lustre/include/linux/Makefile.am +++ b/lustre/include/linux/Makefile.am @@ -10,7 +10,7 @@ linux_HEADERS = lustre_idl.h endif EXTRA_DIST = lprocfs_status.h lustre_debug.h lustre_ha.h lustre_lib.h \ - lustre_mgmt.h obd_cache.h obd_lov.h lustre_dlm.h lustre_handles.h \ + obd_cache.h obd_lov.h lustre_dlm.h lustre_handles.h \ lustre_net.h obd_class.h obd_ost.h obd_support.h lustre_commit_confd.h \ lustre_export.h lustre_log.h obd_echo.h \ lustre_compat25.h lustre_fsfilt.h lustre_import.h lustre_mds.h obd.h \ diff --git a/lustre/include/linux/lustre_mgmt.h b/lustre/include/linux/lustre_mgmt.h deleted file mode 100644 index 6c67d00..0000000 --- a/lustre/include/linux/lustre_mgmt.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - */ - -#ifndef LUSTRE_MGMT_H -#define LUSTRE_MGMT_H - -#define LUSTRE_MGMTCLI_NAME "mgmt_cli" - -/* For the convenience and type-safety of inter_module_getters. */ - -struct obd_device; -struct obd_uuid; - -/* - * The caller is responsible for ensuring that relevant_uuid -- if non-NULL -- - * points to valid memory until deregister is called. If relevant_uuid is NULL, - * all management events will be propagated to the registrant. Notice that - * deregister doesn't take a relevant_uuid-matching parameter; I should probably - * fix that at some point. - */ -typedef int (*mgmtcli_register_for_events_t)(struct obd_device *mgmt_obd, - struct obd_device *notify_obd, - struct obd_uuid *relevant_uuid); - -typedef int (*mgmtcli_deregister_for_events_t)(struct obd_device *mgmt_obd, - struct obd_device *notify_obd); - -#endif /* LUSTRE_MGMT_H */ diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 2afa6b9..23a7827 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -274,8 +274,6 @@ struct client_obd { //struct llog_canceld_ctxt *cl_llcd; /* it's included by obd_llog_ctxt */ void *cl_llcd_offset; - struct obd_device *cl_mgmtcli_obd; - /* the grant values are protected by loi_list_lock below */ long cl_dirty; /* all _dirty_ in bytes */ long cl_dirty_max; /* allowed w/o rpc */ @@ -320,18 +318,6 @@ struct client_obd { struct ptlrpc_request_pool *cl_rq_pool; /* emergency pool of requests */ }; -/* Like a client, with some hangers-on. Keep mc_client_obd first so that we - * can reuse the various client setup/connect functions. */ -struct mgmtcli_obd { - struct client_obd mc_client_obd; /* nested */ - struct ptlrpc_thread *mc_ping_thread; - struct obd_export *mc_ping_exp; /* XXX single-target */ - struct list_head mc_registered; - void *mc_hammer; -}; - -#define mc_import mc_client_obd.cl_import - struct mds_obd { struct ptlrpc_service *mds_service; struct ptlrpc_service *mds_setattr_service; @@ -586,7 +572,6 @@ struct obd_device { struct lov_obd lov; struct cache_obd cobd; struct ptlbd_obd ptlbd; - struct mgmtcli_obd mgmtcli; } u; /* Fields used by LProcFS */ unsigned int obd_cntr_base; diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 3e1bbb3..684cfdc 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -35,7 +35,6 @@ #include #include /* for LUSTRE_OSC_NAME */ #include /* for LUSTRE_MDC_NAME */ -#include #include #include @@ -195,10 +194,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) struct obd_uuid server_uuid; int rq_portal, rp_portal, connect_op; char *name = obddev->obd_type->typ_name; - char *mgmt_name = NULL; int rc; - struct obd_device *mgmt_obd; - mgmtcli_register_for_events_t register_f; ENTRY; /* In a more perfect world, we would hang a ptlrpc_client off of @@ -211,10 +207,6 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) rq_portal = MDS_REQUEST_PORTAL; rp_portal = MDC_REPLY_PORTAL; connect_op = MDS_CONNECT; - } else if (!strcmp(name, LUSTRE_MGMTCLI_NAME)) { - rq_portal = MGMT_REQUEST_PORTAL; - rp_portal = MGMT_REPLY_PORTAL; - connect_op = MGMT_CONNECT; } else { CERROR("unknown client OBD type \"%s\", can't setup\n", name); @@ -317,37 +309,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) name, obddev->obd_name, imp->imp_target_uuid.uuid); imp->imp_invalid = 1; - - if (LUSTRE_CFG_BUFLEN(lcfg, 4) > 0) - mgmt_name = lustre_cfg_string(lcfg, 4); - } else { - mgmt_name = lustre_cfg_string(lcfg, 3); - } - } - - if (mgmt_name != NULL) { - /* Register with management client if we need to. */ - CDEBUG(D_HA, "%s registering with %s for events about %s\n", - obddev->obd_name, mgmt_name, server_uuid.uuid); - - mgmt_obd = class_name2obd(mgmt_name); - if (!mgmt_obd) { - CERROR("can't find mgmtcli %s to register\n", - mgmt_name); - GOTO(err_import, rc = -ENOSYS); } - - register_f = PORTAL_SYMBOL_GET(mgmtcli_register_for_events); - if (!register_f) { - CERROR("can't i_m_g mgmtcli_register_for_events\n"); - GOTO(err_import, rc = -ENOSYS); - } - - rc = register_f(mgmt_obd, obddev, &imp->imp_target_uuid); - PORTAL_SYMBOL_PUT(mgmtcli_register_for_events); - - if (!rc) - cli->cl_mgmtcli_obd = mgmt_obd; } spin_lock_init(&cli->cl_qchk_lock); @@ -370,13 +332,6 @@ int client_obd_cleanup(struct obd_device *obddev) if (!cli->cl_import) RETURN(-EINVAL); - if (cli->cl_mgmtcli_obd) { - mgmtcli_deregister_for_events_t dereg_f; - - dereg_f = PORTAL_SYMBOL_GET(mgmtcli_deregister_for_events); - dereg_f(cli->cl_mgmtcli_obd, obddev); - PORTAL_SYMBOL_PUT(mgmtcli_deregister_for_events); - } class_destroy_import(cli->cl_import); cli->cl_import = NULL; diff --git a/lustre/mgmt/.cvsignore b/lustre/mgmt/.cvsignore deleted file mode 100644 index c79cb94..0000000 --- a/lustre/mgmt/.cvsignore +++ /dev/null @@ -1,12 +0,0 @@ -.Xrefs -config.log -config.status -configure -Makefile -.deps -tags -TAGS -autoMakefile.in -autoMakefile -*.ko -*.mod.c diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 0a7f3c5..27fd902 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -105,7 +105,6 @@ subsystem_names = { "log" : (1 << 6), "llite" : (1 << 7), "rpc" : (1 << 8), - "mgmt" : (1 << 9), "portals" : (1 << 10), "nal" : (1 << 11), "pinger" : (1 << 12), @@ -1547,27 +1546,6 @@ class RouteTable(Module): e.dump() cleanup_error(e.rc) -class Management(Module): - def __init__(self, db): - Module.__init__(self, 'MGMT', db) - self.add_lustre_module('lvfs', 'lvfs') - self.add_lustre_module('obdclass', 'obdclass') - self.add_lustre_module('ptlrpc', 'ptlrpc') - self.add_lustre_module('mgmt', 'mgmt_svc') - - def prepare(self): - if is_prepared(self.name): - return - self.info() - lctl.newdev("mgmt", self.name, self.uuid) - - def safe_to_clean(self): - return 1 - - def cleanup(self): - if is_prepared(self.name): - Module.cleanup(self) - # This is only needed to load the modules; the LDLM device # is now created automatically. class LDLM(Module): @@ -2088,16 +2066,6 @@ class OSD(Module): if not self.osdtype == 'obdecho': clean_loop(self.devpath) -def mgmt_uuid_for_fs(mtpt_name): - if not mtpt_name: - return '' - mtpt_db = toplustreDB.lookup_name(mtpt_name) - fs_uuid = mtpt_db.get_first_ref('filesystem') - fs = toplustreDB.lookup(fs_uuid) - if not fs: - return '' - return fs.get_first_ref('mgmt') - # Generic client module, used by OSC and MDC class Client(Module): def __init__(self, tgtdb, uuid, module, fs_name, self_name=None, @@ -2125,11 +2093,6 @@ class Client(Module): self.uuid = uuid self.lookup_server(self.tgt_dev_uuid) self.lookup_backup_targets() - mgmt_uuid = mgmt_uuid_for_fs(fs_name) - if mgmt_uuid: - self.mgmt_name = mgmtcli_name_for_uuid(mgmt_uuid) - else: - self.mgmt_name = '' self.fs_name = fs_name if not module_dir: module_dir = module @@ -2187,8 +2150,8 @@ class Client(Module): debug("%s active" % self.target_uuid) inactive_p = "" lctl.newdev(self.module, self.name, self.uuid, - setup ="%s %s %s %s" % (self.target_uuid, srv.nid_uuid, - inactive_p, self.mgmt_name)) + setup ="%s %s %s" % (self.target_uuid, srv.nid_uuid, + inactive_p)) else: panic("Unable to create OSC for ", self.target_uuid) @@ -2248,15 +2211,6 @@ class OSC(Client): def permits_inactive(self): return 1 -def mgmtcli_name_for_uuid(uuid): - return 'MGMTCLI_%s' % uuid - -class ManagementClient(Client): - def __init__(self, db, uuid): - Client.__init__(self, db, uuid, 'mgmt_cli', '', - self_name = mgmtcli_name_for_uuid(db.getUUID()), - module_dir = 'mgmt') - class COBD(Module): def __init__(self, db): Module.__init__(self, 'COBD', db) @@ -2366,7 +2320,6 @@ class Mountpoint(Module): fs = self.db.lookup(self.fs_uuid) self.mds_uuid = fs.get_first_ref('mds') self.obd_uuid = fs.get_first_ref('obd') - self.mgmt_uuid = fs.get_first_ref('mgmt') obd = self.db.lookup(self.obd_uuid) client_uuid = generate_client_uuid(self.name) self.vosc = VOSC(obd, client_uuid, self.name) @@ -2374,19 +2327,12 @@ class Mountpoint(Module): self.add_lustre_module('mdc', 'mdc') self.add_lustre_module('llite', 'llite') - if self.mgmt_uuid: - self.mgmtcli = ManagementClient(db.lookup(self.mgmt_uuid), - client_uuid) - else: - self.mgmtcli = None def prepare(self): if fs_is_mounted(self.path): log(self.path, "already mounted.") return run_acceptors() - if self.mgmtcli: - self.mgmtcli.prepare() self.vosc.prepare() self.mdc.prepare() mdc_name = self.mdc.name @@ -2435,20 +2381,14 @@ class Mountpoint(Module): self.mdc.cleanup() self.vosc.cleanup() - if self.mgmtcli: - self.mgmtcli.cleanup() def load_module(self): - if self.mgmtcli: - self.mgmtcli.load_module() self.vosc.load_module() Module.load_module(self) def cleanup_module(self): Module.cleanup_module(self) self.vosc.cleanup_module() - if self.mgmtcli: - self.mgmtcli.cleanup_module() # ============================================================ @@ -2480,8 +2420,6 @@ def getServiceLevel(self): ret = 6 elif type in ('ldlm',): ret = 20 - elif type in ('mgmt',): - ret = 25 elif type in ('osd', 'cobd'): ret = 30 elif type in ('mdsdev',): @@ -2667,8 +2605,6 @@ def newService(db): n = Mountpoint(db) elif type == 'echoclient': n = ECHO_CLIENT(db) - elif type == 'mgmt': - n = Management(db) else: panic("unknown service type:", type) return n @@ -3086,7 +3022,7 @@ def sys_set_debug_path(): def validate_upcall(upcall): import os - if upcall in ('DEFAULT',): + if upcall in ('DEFAULT','NONE'): pass elif os.path.exists(upcall): if not os.access(upcall, os.X_OK): @@ -3310,7 +3246,7 @@ lconf_options = [ ('make_service_scripts', "Create per-service symlinks for use with clumanager"), # Client recovery options ('recover', "Recover a device"), - ('group', "The group of devices to configure or cleanup", PARAM), + ('group,g', "The group of devices to configure or cleanup", PARAM), ('tgt_uuid', "The failed target (required for recovery)", PARAM), ('client_uuid', "The failed client (required for recovery)", PARAM), ('conn_uuid', "The failed connection (required for recovery)", PARAM), diff --git a/lustre/utils/lmc b/lustre/utils/lmc index ce2f4fd..cc9ef6c 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -137,10 +137,6 @@ Object creation command summary: --add echo_client --node nodename - ---add mgmt - Management/monitoring service - --node node_name - --mgmt mgmt_service_name """ PARAM = Lustre.Options.PARAM @@ -218,8 +214,6 @@ lmc_options = [ # cobd ('real_obd', "Specify the real device for the cache obd system.", PARAM), ('cache_obd', "Specify the cache device for the cache obd system.", PARAM), - - ('mgmt', "Specify management/monitoring service name.", PARAM, ""), ] def error(*args): @@ -470,13 +464,6 @@ class GenConfig: mdd.appendChild(self.ref("target", mds_uuid)) return mdd - def mgmt(self, mgmt_name, mgmt_uuid, node_uuid): - mgmt = self.newService("mgmt", mgmt_name, mgmt_uuid) - mgmt.appendChild(self.ref("node", node_uuid)) - # Placeholder until mgmt-service failover. - mgmt.appendChild(self.ref("active", mgmt_uuid)) - return mgmt - def mountpoint(self, name, uuid, fs_uuid, path, clientoptions): mtpt = self.newService("mountpoint", name, uuid) mtpt.appendChild(self.ref("filesystem", fs_uuid)) @@ -485,12 +472,10 @@ class GenConfig: self.addElement(mtpt, "clientoptions", clientoptions) return mtpt - def filesystem(self, name, uuid, mds_uuid, obd_uuid, mgmt_uuid): + def filesystem(self, name, uuid, mds_uuid, obd_uuid): fs = self.newService("filesystem", name, uuid) fs.appendChild(self.ref("mds", mds_uuid)) fs.appendChild(self.ref("obd", obd_uuid)) - if mgmt_uuid: - fs.appendChild(self.ref("mgmt", mgmt_uuid)) return fs def echo_client(self, name, uuid, osc_uuid): @@ -761,23 +746,6 @@ def add_mds(gen, lustre, options): lustre.appendChild(mdd) -def add_mgmt(gen, lustre, options): - node_name = get_option(options, 'node') - node_uuid = name2uuid(lustre, node_name, 'node') - mgmt_name = get_option(options, 'mgmt') - if not mgmt_name: - mgmt_name = new_name('MGMT_' + node_name) - mgmt_uuid = name2uuid(lustre, mgmt_name, 'mgmt', fatal=0) - if not mgmt_uuid: - mgmt_uuid = new_uuid(mgmt_name) - mgmt = gen.mgmt(mgmt_name, mgmt_uuid, node_uuid) - lustre.appendChild(mgmt) - else: - mgmt = lookup(lustre, mgmt_uuid) - - node = findByName(lustre, node_name, "node") - node_add_profile(gen, node, 'mgmt', mgmt_uuid) - def add_ost(gen, lustre, options): node_name = get_option(options, 'node') lovname = get_option(options, 'lov') @@ -947,25 +915,21 @@ def add_default_lov(gen, lustre, mds_name, lov_name): lovconfig = gen.lovconfig(lovconfig_name, lovconfig_uuid, uuid) lustre.appendChild(lovconfig) -def new_filesystem(gen, lustre, mds_uuid, obd_uuid, mgmt_uuid): +def new_filesystem(gen, lustre, mds_uuid, obd_uuid): fs_name = new_name("FS_fsname") fs_uuid = new_uuid(fs_name) mds = lookup(lustre, mds_uuid) mds.appendChild(gen.ref("filesystem", fs_uuid)) - fs = gen.filesystem(fs_name, fs_uuid, mds_uuid, obd_uuid, mgmt_uuid) + fs = gen.filesystem(fs_name, fs_uuid, mds_uuid, obd_uuid) lustre.appendChild(fs) return fs_uuid -def get_fs_uuid(gen, lustre, mds_name, obd_name, mgmt_name): +def get_fs_uuid(gen, lustre, mds_name, obd_name): mds_uuid = name2uuid(lustre, mds_name, tag='mds') obd_uuid = name2uuid(lustre, obd_name, tag='lov', fatal=0) - if mgmt_name: - mgmt_uuid = name2uuid(lustre, mgmt_name, tag='mgmt', fatal=1) - else: - mgmt_uuid = '' fs_uuid = lookup_filesystem(lustre, mds_uuid, obd_uuid) if not fs_uuid: - fs_uuid = new_filesystem(gen, lustre, mds_uuid, obd_uuid, mgmt_uuid) + fs_uuid = new_filesystem(gen, lustre, mds_uuid, obd_uuid) return fs_uuid def add_mtpt(gen, lustre, options): @@ -993,8 +957,7 @@ def add_mtpt(gen, lustre, options): lov_add_obd(gen, lov, ost_uuid) if fs_name == '': - mgmt_name = get_option(options, 'mgmt') - fs_uuid = get_fs_uuid(gen, lustre, mds_name, lov_name, mgmt_name) + fs_uuid = get_fs_uuid(gen, lustre, mds_name, lov_name) else: fs_uuid = name2uuid(lustre, fs_name, tag='filesystem') @@ -1138,8 +1101,6 @@ def add(devtype, gen, lustre, options): add_echo_client(gen, lustre, options) elif devtype == 'cobd': add_cobd(gen, lustre, options) - elif devtype == 'mgmt': - add_mgmt(gen, lustre, options) else: error("unknown device type:", devtype) -- 1.8.3.1