From 1400c3218795628f2d774dddbd3379997d006cef Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 12 Sep 2002 09:24:32 +0000 Subject: [PATCH] Allow the default stripe_count to be specified in the XML config, and also read this value instead of the "stripe_offset" for which we have no use. Set an objid for lctl create, so we get one step closer to support of test_brw for LOV devices. --- lustre/utils/lconf | 34 +++++++++++++++++----------------- lustre/utils/lmc | 10 +++++----- lustre/utils/obd.c | 3 ++- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 7a1ee27..9138a4d 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -46,7 +46,7 @@ def usage(): config.xml Lustre configuration in xml format. --get URL to fetch a config file --node Load config for --d | --cleanup Cleans up config. (Shutdown) +-d | --cleanup Cleans up config. (Shutdown) -v | --verbose Print system commands as they are run -h | --help Print this help --gdb Prints message after creating gdb module script @@ -56,10 +56,10 @@ config.xml Lustre configuration in xml format. config file is doing what it should be doing. (Implies -v) --nomod Skip load/unload module step. --nosetup Skip device setup/cleanup step. ---reformat Reformat all devices (without question) +--reformat Reformat all devices (without question) """ TODO = """ ---ldap server LDAP server with lustre config database +--ldap server LDAP server with lustre config database --makeldiff Translate xml source to LDIFF This are perhaps not needed: --lustre="src dir" Base directory of lustre sources. Used to search @@ -697,8 +697,8 @@ class Network(Module): debug("nid:", self.nid) self.add_module('portals/linux/oslib/', 'portals') - if node_needs_router(): - self.add_module('portals/linux/router', 'kptlrouter') + if node_needs_router(): + self.add_module('portals/linux/router', 'kptlrouter') if self.net_type == 'tcp': self.add_module('portals/linux/socknal', 'ksocknal') if self.net_type == 'elan': @@ -745,14 +745,14 @@ class Network(Module): if not srv: panic("no server for nid", lo) else: - try: + try: lctl.disconnect(srv.net_type, srv.nid, srv.port, srv.uuid) - except CommandError, e: - print "disconnect failed: ", self.name - e.dump() - try: + except CommandError, e: + print "disconnect failed: ", self.name + e.dump() + try: lctl.del_route(self.net_type, self.nid, lo, hi) - except CommandError, e: + except CommandError, e: print "del_route failed: ", self.name e.dump() @@ -792,7 +792,7 @@ class LOV(Module): self.stripe_off = get_attr_int(dev_node, 'stripeoffset', 0) self.pattern = get_attr_int(dev_node, 'pattern', 0) self.devlist = get_all_refs(dev_node, 'osc') - self.stripe_cnt = len(self.devlist) + self.stripe_cnt = get_attr_int(dev_node, 'stripecount', len(self.devlist)) self.add_module('lustre/mdc', 'mdc') self.add_module('lustre/lov', 'lov') @@ -805,8 +805,8 @@ class LOV(Module): else: panic('osc not found:', osc_uuid) mdc_uuid = prepare_mdc(self.dom_node.parentNode, self.mds_uuid) - self.info(self.mds_uuid, self.stripe_cnt, self.stripe_sz, self.stripe_off, self.pattern, - self.devlist, self.mds_name) + self.info(self.mds_uuid, self.stripe_cnt, self.stripe_sz, + self.stripe_off, self.pattern, self.devlist, self.mds_name) lctl.newdev(attach="lov %s %s" % (self.name, self.uuid), setup ="%s" % (mdc_uuid)) @@ -1271,7 +1271,7 @@ def init_route_config(lustre): list = lustre.getElementsByTagName('node') for node in list: if get_attr(node, 'router'): - router_flag = 1 + router_flag = 1 for (local_type, local_nid) in local_node: gw = None netlist = node.getElementsByTagName('network') @@ -1390,8 +1390,8 @@ def doHost(lustreNode, hosts): init_node(dom_node) init_route_config(lustreNode) else: - global router_flag - router_flag = 1 + global router_flag + router_flag = 1 # Two step process: (1) load modules, (2) setup lustre # if not cleaning, load modules first. diff --git a/lustre/utils/lmc b/lustre/utils/lmc index d490166..2d1ad26 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -78,7 +78,7 @@ Commands: Create a MDS using the device Requires --node ---lov lov_name [mds_name stripe_sz stripe_off pattern] +--lov lov_name [mds_name stripe_sz sub_stripe_count pattern] Creates a logical volume When used with other commands, it specifics the lov to modify @@ -254,12 +254,12 @@ class GenConfig: ost.appendChild(self.ref("obd", obd_uuid)) return ost - def lov(self, name, uuid, mds_uuid, stripe_sz, stripe_off, pattern): + def lov(self, name, uuid, mds_uuid, stripe_sz, stripe_count, pattern): lov = self.newService("lov", name, uuid) lov.appendChild(self.ref("mds", mds_uuid)) devs = self.addElement(lov, "devices" ) devs.setAttribute("stripesize", stripe_sz) - devs.setAttribute("stripeoffset", stripe_off) + devs.setAttribute("stripecount", stripe_count) devs.setAttribute("pattern", pattern) return lov @@ -582,7 +582,7 @@ def add_lov(gen, lustre, options, args): name = options['lov'] mds_name = args[0] stripe_sz = args[1] - stripe_off = args[2] + stripe_count = args[2] pattern = args[3] uuid = new_uuid(name) @@ -591,7 +591,7 @@ def add_lov(gen, lustre, options, args): error("LOV: ", name, " already exists.") mds_uuid = name2uuid(lustre, mds_name) - lov = gen.lov(name, uuid, mds_uuid, stripe_sz, stripe_off, pattern) + lov = gen.lov(name, uuid, mds_uuid, stripe_sz, stripe_count, pattern) lustre.appendChild(lov) # add an lovconfig entry to the mds profile diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 3f04568..51bab66 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -807,7 +807,8 @@ int jt_obd_create(int argc, char **argv) for (i = 1, next_count = verbose; i <= count; i++) { data.ioc_obdo1.o_mode = mode; - data.ioc_obdo1.o_valid = OBD_MD_FLMODE; + data.ioc_obdo1.o_id = i; + data.ioc_obdo1.o_valid = OBD_MD_FLMODE | OBD_MD_FLID; rc = ioctl(fd, OBD_IOC_CREATE, &data); SHMEM_BUMP(); -- 1.8.3.1