LCFG_DETACH = 0x00cf002,
LCFG_SETUP = 0x00cf003,
LCFG_CLEANUP = 0x00cf004,
- LCFG_LOV_SET_CONFIG = 0x00cf005,
- LCFG_ADD_UUID = 0x00cf006,
- LCFG_DEL_UUID = 0x00cf007,
- LCFG_MOUNTOPT = 0x00cf008,
- LCFG_DEL_MOUNTOPT = 0x00cf009,
+ LCFG_ADD_UUID = 0x00cf005,
+ LCFG_DEL_UUID = 0x00cf006,
+ LCFG_MOUNTOPT = 0x00cf007,
+ LCFG_DEL_MOUNTOPT = 0x00cf008,
};
struct lustre_cfg {
len += size_round(lcfg->lcfg_inllen2);
len += size_round(lcfg->lcfg_inllen3);
len += size_round(lcfg->lcfg_inllen4);
- return size_round16(len);
-
+ return size_round(len);
}
static inline int lustre_cfg_pack(struct lustre_cfg *data, char **pbuf,
static int llog_test_1(struct obd_device *obd, char * name)
{
struct llog_handle *llh;
+ struct llog_obd_ctxt *ctxt = obd->obd_llog_ctxt[LLOG_TEST_ORIG_CTXT];
int rc;
int rc2;
ENTRY;
CERROR("1a: create a log with name: %s\n", name);
+ LASSERT(ctxt);
- rc = llog_create(obd, &llh, NULL, name);
+ rc = llog_create(ctxt, &llh, NULL, name);
if (rc) {
CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
RETURN(rc);
struct llog_handle *loghandle;
struct llog_logid logid;
int rc;
+ struct llog_obd_ctxt *ctxt = obd->obd_llog_ctxt[LLOG_TEST_ORIG_CTXT];
ENTRY;
CERROR("2a: re-open a log with name: %s\n", name);
- rc = llog_create(obd, llh, NULL, name);
+ rc = llog_create(ctxt, llh, NULL, name);
if (rc) {
CERROR("2a: re-open log with name %s failed: %d\n", name, rc);
RETURN(rc);
RETURN(rc);
CERROR("2b: create a log without specified NAME & LOGID\n");
- rc = llog_create(obd, &loghandle, NULL, NULL);
+ rc = llog_create(ctxt, &loghandle, NULL, NULL);
if (rc) {
CERROR("2b: create log failed\n");
RETURN(rc);
llog_close(loghandle);
CERROR("2b: re-open the log by LOGID\n");
- rc = llog_create(obd, &loghandle, &logid, NULL);
+ rc = llog_create(ctxt, &loghandle, &logid, NULL);
if (rc) {
CERROR("2b: re-open log by LOGID failed\n");
RETURN(rc);
int rc, i, buflen;
struct llog_mini_rec lmr;
struct llog_cookie cookie;
+ struct llog_obd_ctxt *ctxt = obd->obd_llog_ctxt[LLOG_TEST_ORIG_CTXT];
int num_recs = 0;
char *buf;
struct llog_rec_hdr rec;
sprintf(name, "%x", llog_test_rand+1);
CERROR("4a: create a catalog log with name: %s\n", name);
- rc = llog_create(obd, &cath, NULL, name);
+ rc = llog_create(ctxt, &cath, NULL, name);
if (rc) {
CERROR("1a: llog_create with name %s failed: %d\n", name, rc);
GOTO(out, rc);
char name[10];
int rc;
struct llog_mini_rec lmr;
+ struct llog_obd_ctxt *ctxt = obd->obd_llog_ctxt[LLOG_TEST_ORIG_CTXT];
ENTRY;
lmr.lmr_hdr.lrh_type = cpu_to_le32(0xf00f00);
CERROR("5a: re-open catalog by id\n");
- rc = llog_create(obd, &llh, &cat_logid, NULL);
+ rc = llog_create(ctxt, &llh, &cat_logid, NULL);
if (rc) {
CERROR("5a: llog_create with logid failed: %d\n", rc);
GOTO(out, rc);
RETURN(rc);
}
-static int llog_test6_process_rec(struct llog_handle *handle,
- struct llog_rec_hdr * rec, void * private)
-{
- return 0;
-}
-
/* Test client api; open log by name and process */
static int llog_test_6(struct obd_device *obd, char * name)
{
struct obd_device *mdc_obd;
- struct obd_uuid *mds_uuid = &obd->obd_log_exp->exp_obd->obd_uuid;
+ struct llog_obd_ctxt *ctxt = obd->obd_llog_ctxt[LLOG_TEST_ORIG_CTXT];
+ struct obd_uuid *mds_uuid = &ctxt->loc_exp->exp_obd->obd_uuid;
struct lustre_handle exph = {0, };
struct obd_export * exp;
struct obd_uuid uuid = {"LLOG_TEST6_UUID"};
struct llog_handle *llh = NULL;
+ struct llog_obd_ctxt *nctxt;
int rc;
CERROR("6a: re-open log %s using client API\n", name);
CERROR("6: failed to connect to MDC: %s\n", mdc_obd->obd_name);
RETURN(rc);
}
-
exp = class_conn2export(&exph);
- rc = llog_create(obd, &llh, NULL, name);
+
+ nctxt = mdc_obd->obd_llog_ctxt[LLOG_CONFIG_REPL_CTXT];
+ rc = llog_create(nctxt, &llh, NULL, name);
if (rc) {
CERROR("6: llog_create failed %d\n", rc);
RETURN(rc);
GOTO(parse_out, rc);
}
- rc = llog_process(llh, llog_test6_process_rec, NULL);
+ rc = llog_process(llh, (llog_cb_t)plain_print_cb, NULL);
parse_out:
if (rc)
CERROR("6: llog_process failed %d\n", rc);
rc = obd_disconnect(exp, 0);
RETURN(rc);
-
}
/* -------------------------------------------------------------------------
{
struct llog_handle *llh;
struct obd_run_ctxt saved;
+ struct llog_obd_ctxt *ctxt = obd->obd_llog_ctxt[LLOG_TEST_ORIG_CTXT];
int rc, err, cleanup_phase = 0;
char name[10];
ENTRY;
sprintf(name, "%x", llog_test_rand);
- push_ctxt(&saved, &obd->obd_log_exp->exp_obd->obd_ctxt, NULL);
+ push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
rc = llog_test_1(obd, name);
if (rc)
if (rc)
GOTO(cleanup, rc);
- GOTO(cleanup, rc);
cleanup:
switch (cleanup_phase) {
case 1:
if (!rc)
rc = err;
case 0:
- pop_ctxt(&saved, &obd->obd_log_exp->exp_obd->obd_ctxt, NULL);
+ pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_ctxt, NULL);
}
return rc;
}
+
+static int llog_test_llog_init(struct obd_device *obd, struct obd_device *tgt,
+ int count, struct llog_logid *logid)
+{
+ int rc;
+ ENTRY;
+
+ rc = llog_setup(obd, LLOG_TEST_ORIG_CTXT, tgt, 0, NULL, &llog_lvfs_ops);
+ RETURN(rc);
+}
+
+static int llog_test_llog_finish(struct obd_device *obd, int count)
+{
+ int rc;
+ ENTRY;
+
+ rc = llog_cleanup(obd->obd_llog_ctxt[LLOG_TEST_ORIG_CTXT]);
+ RETURN(rc);
+}
+
static int llog_test_cleanup(struct obd_device *obd, int flags)
{
- int rc = obd_disconnect(obd->obd_log_exp, 0);
+ int rc = obd_llog_finish(obd, 0);
if (rc)
- CERROR("failed to disconnect from log device: %d\n", rc);
+ CERROR("failed to llog_test_llog_finish: %d\n", rc);
+
return rc;
}
static int llog_test_setup(struct obd_device *obd, obd_count len, void *buf)
{
struct lustre_cfg *lcfg = buf;
- struct lustre_handle exph = {0, };
struct obd_device *tgt;
- struct obd_uuid fake_uuid = { "LLOG_TEST_UUID" };
int rc;
ENTRY;
RETURN(-EINVAL);
}
- rc = obd_connect(&exph, tgt, &fake_uuid);
- if (rc) {
- CERROR("fail to connect to target device %d\n", lcfg->lcfg_dev);
+ rc = obd_llog_init(obd, tgt, 0, NULL);
+ if (rc)
RETURN(rc);
- }
- obd->obd_log_exp = class_conn2export(&exph);
llog_test_rand = ll_insecure_random_int();
o_detach: llog_test_detach,
o_setup: llog_test_setup,
o_cleanup: llog_test_cleanup,
+ o_llog_init: llog_test_llog_init,
+ o_llog_finish: llog_test_llog_finish,
+
};
static int __init llog_test_init(void)
int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
{
int err = 0;
+ struct obd_export *exp;
ENTRY;
/* have we attached a type to this device? */
atomic_set(&obd->obd_refcount, 0);
err = obd_setup(obd, sizeof(*lcfg), lcfg);
- if (!err) {
- obd->obd_type->typ_refcnt++;
- obd->obd_set_up = 1;
- atomic_inc(&obd->obd_refcount);
+ if (err) {
+ RETURN(err);
+ }
+
+ obd->obd_type->typ_refcnt++;
+ obd->obd_set_up = 1;
+ atomic_inc(&obd->obd_refcount);
+
+ exp = class_new_export(obd);
+ if (exp == NULL) {
+ GOTO(err_cleanup, err = -ENOMEM);
+ }
+ memcpy(&exp->exp_client_uuid, &obd->obd_uuid,
+ sizeof(exp->exp_client_uuid));
+ obd->obd_self_export = exp;
+ class_export_put(exp);
+
+ if (OBT(obd) && OBP(obd, postsetup)) {
+ err = obd_postsetup(obd);
+ if (err)
+ GOTO(err_exp, err);
}
+
+ RETURN(err);
+
+err_exp:
+ class_unlink_export(obd->obd_self_export);
+ obd->obd_self_export = NULL;
+err_cleanup:
+ obd->obd_stopping = 1;
+ obd_cleanup(obd, 0);
+ obd->obd_set_up = obd->obd_stopping = 0;
+ obd->obd_type->typ_refcnt--;
+ atomic_dec(&obd->obd_refcount);
RETURN(err);
}
if (err)
RETURN(err);
+ LASSERT(obd->obd_self_export);
+ class_unlink_export(obd->obd_self_export);
+
if (atomic_read(&obd->obd_refcount) == 1 ||
flags & OBD_OPT_FORCE) {
/* this will stop new connections, and need to
obd->obd_minor, obd,
atomic_read(&obd->obd_refcount));
dump_exports(obd);
- RETURN(-EBUSY);
+ GOTO(out, err = -EBUSY);
}
class_disconnect_exports(obd, flags);
CDEBUG(D_IOCTL,
obd->obd_name);
}
+out:
err = obd_cleanup(obd, flags);
if (!err) {
obd->obd_set_up = obd->obd_stopping = 0;
CERROR("%s still has refcount %d after "
"cleanup.\n", obd->obd_name,
atomic_read(&obd->obd_refcount));
+ } else {
+ /* attempt to leave OBD in a usable state. */
+ obd->obd_stopping = 0;
+ if (OBT(obd) && OBP(obd, postsetup)) {
+ obd_postsetup(obd);
+ }
}
RETURN(err);
+
}
LIST_HEAD(lustre_profile_list);
GOTO(out, err = -ENOMEM);
memcpy(lprof->lp_osc, osc, osclen);
- LASSERT(mdclen == (strlen(mdc) + 1));
- OBD_ALLOC(lprof->lp_mdc, mdclen);
- if (lprof->lp_mdc == NULL)
- GOTO(out, err = -ENOMEM);
- memcpy(lprof->lp_mdc, mdc, mdclen);
+ if (mdclen > 0) {
+ LASSERT(mdclen == (strlen(mdc) + 1));
+ OBD_ALLOC(lprof->lp_mdc, mdclen);
+ if (lprof->lp_mdc == NULL)
+ GOTO(out, err = -ENOMEM);
+ memcpy(lprof->lp_mdc, mdc, mdclen);
+ }
list_add(&lprof->lp_list, &lustre_profile_list);
list_del(&lprof->lp_list);
OBD_FREE(lprof->lp_profile, strlen(lprof->lp_profile) + 1);
OBD_FREE(lprof->lp_osc, strlen(lprof->lp_osc) + 1);
- OBD_FREE(lprof->lp_mdc, strlen(lprof->lp_mdc) + 1);
+ if (lprof->lp_mdc)
+ OBD_FREE(lprof->lp_mdc, strlen(lprof->lp_mdc) + 1);
OBD_FREE(lprof, sizeof *lprof);
}
}
/* Commands that require a device */
obd = class_name2obd(lcfg->lcfg_dev_name);
if (obd == NULL) {
- CERROR("no device\n");
+ CERROR("no device for: %s\n", lcfg->lcfg_dev_name);
GOTO(out, err = -EINVAL);
}
GOTO(out, err = 0);
}
default: {
- err = obd_config(obd, lcfg);
- if (err)
- GOTO(out, err);
+ CERROR("Unknown command: %d\n", lcfg->lcfg_command);
+ GOTO(out, err = -EINVAL);
+
}
}
out:
GOTO(out, rc);
lcfg = (struct lustre_cfg* ) buf;
- if (cfg && lcfg->lcfg_dev_name) {
+ if (cfg && cfg->cfg_instance && lcfg->lcfg_dev_name) {
inst_len = strlen(lcfg->lcfg_dev_name) +
strlen(cfg->cfg_instance) + 2;
OBD_ALLOC(inst_name, inst_len);
+ if (inst_name == NULL)
+ GOTO(out, rc = -ENOMEM);
sprintf(inst_name, "%s-%s", lcfg->lcfg_dev_name,
cfg->cfg_instance);
old_name = lcfg->lcfg_dev_name;
RETURN(rc);
}
-int class_config_parse_llog(struct obd_export *exp, char *name,
+int class_config_parse_llog(struct llog_obd_ctxt *ctxt, char *name,
struct config_llog_instance *cfg)
{
+ struct obd_export *exp = ctxt->loc_exp;
struct llog_handle *llh;
- struct obd_device *obd = exp->exp_obd;
int rc, rc2;
ENTRY;
- if (obd->obd_log_exp == NULL) {
- CERROR("No log export on obd:%s\n", obd->obd_name);
+ if (exp == NULL) {
+ LBUG();
+ CERROR("No log export on obd\n");
RETURN(-ENOTCONN);
}
- rc = llog_create(obd, &llh, NULL, name);
+ rc = llog_create(ctxt, &llh, NULL, name);
if (rc)
RETURN(rc);
}
+static int class_config_dump_handler(struct llog_handle * handle,
+ struct llog_rec_hdr *rec, void *data)
+{
+ int cfg_len = rec->lrh_len;
+ char *cfg_buf = (char*) (rec + 1);
+ int rc = 0;
+
+ if (rec->lrh_type == OBD_CFG_REC) {
+ char *buf;
+ struct lustre_cfg *lcfg;
+
+ rc = lustre_cfg_getdata(&buf, cfg_len, cfg_buf, 1);
+ if (rc)
+ GOTO(out, rc);
+ lcfg = (struct lustre_cfg* ) buf;
+
+ CDEBUG(D_INFO, "lcfg command: %x\n", lcfg->lcfg_command);
+ if (lcfg->lcfg_dev_name)
+ CDEBUG(D_INFO, " devname: %s\n",
+ lcfg->lcfg_dev_name);
+ if (lcfg->lcfg_flags)
+ CDEBUG(D_INFO, " flags: %x\n", lcfg->lcfg_flags);
+ if (lcfg->lcfg_nid)
+ CDEBUG(D_INFO, " nid: "LPX64"\n",
+ lcfg->lcfg_nid);
+ if (lcfg->lcfg_nal)
+ CDEBUG(D_INFO, " nal: %x\n", lcfg->lcfg_nal);
+ if (lcfg->lcfg_inlbuf1)
+ CDEBUG(D_INFO, " inlbuf1: %s\n",lcfg->lcfg_inlbuf1);
+ if (lcfg->lcfg_inlbuf2)
+ CDEBUG(D_INFO, " inlbuf1: %s\n",lcfg->lcfg_inlbuf2);
+ if (lcfg->lcfg_inlbuf3)
+ CDEBUG(D_INFO, " inlbuf1: %s\n",lcfg->lcfg_inlbuf3);
+ if (lcfg->lcfg_inlbuf4)
+ CDEBUG(D_INFO, " inlbuf1: %s\n",lcfg->lcfg_inlbuf4);
+
+ lustre_cfg_freedata(buf, cfg_len);
+ } else if (rec->lrh_type == PTL_CFG_REC) {
+ ;
+ }
+out:
+ RETURN(rc);
+}
+
+int class_config_dump_llog(struct llog_obd_ctxt *ctxt, char *name,
+ struct config_llog_instance *cfg)
+{
+ struct obd_export *exp = ctxt->loc_exp;
+ struct llog_handle *llh;
+ int rc, rc2;
+ ENTRY;
+
+ if (exp == NULL) {
+ LBUG();
+ CERROR("No log export on obd\n");
+ RETURN(-ENOTCONN);
+ }
+
+ rc = llog_create(ctxt, &llh, NULL, name);
+ if (rc)
+ RETURN(rc);
+
+ rc = llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL);
+ if (rc)
+ GOTO(parse_out, rc);
+
+ rc = llog_process(llh, class_config_dump_handler, cfg);
+parse_out:
+ rc2 = llog_close(llh);
+ if (rc == 0)
+ rc = rc2;
+
+ RETURN(rc);
+
+}
+
spin_lock_init(&oed->oed_oscc.oscc_lock);
oed->oed_oscc.oscc_exp = exp;
oed->oed_oscc.oscc_kick_barrier = 100;
- oed->oed_oscc.oscc_grow_count = 2000;
- oed->oed_oscc.oscc_initial_create_count = 2000;
+ oed->oed_oscc.oscc_grow_count = 20;
+ oed->oed_oscc.oscc_initial_create_count = 20;
oed->oed_oscc.oscc_next_id = 2;
oed->oed_oscc.oscc_last_id = 1;
* Author: Andreas Dilger <adilger@clusterfs.com>
*
* This file is part of Lustre, http://www.lustre.org.
- *
+n *
* Lustre is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
#include <linux/lustre_net.h>
#include <portals/list.h>
-int llogd_create(struct ptlrpc_request *req)
+int llog_origin_handle_create(struct ptlrpc_request *req)
{
struct obd_export *exp = req->rq_export;
struct obd_device *obd = exp->exp_obd;
struct llogd_body *body;
struct obd_run_ctxt saved;
struct llog_logid *logid = NULL;
+ struct llog_obd_ctxt *ctxt;
char * name = NULL;
int size = sizeof (*body);
int rc, rc2;
ENTRY;
- LASSERT(obd->obd_log_exp != NULL);
-
body = lustre_swab_reqbuf(req, 0, sizeof(*body),
lustre_swab_llogd_body);
if (body == NULL) {
push_ctxt(&saved, &obd->obd_ctxt, NULL);
- rc = llog_create(obd, &loghandle, logid, name);
+ ctxt = obd->obd_llog_ctxt[LLOG_CONFIG_ORIG_CTXT];
+ rc = llog_create(ctxt, &loghandle, logid, name);
if (rc)
GOTO(out_pop, rc);
RETURN(rc);
}
-int llogd_next_block(struct ptlrpc_request *req)
+int llog_origin_handle_next_block(struct ptlrpc_request *req)
{
struct obd_export *exp = req->rq_export;
struct obd_device *obd = exp->exp_obd;
struct llog_handle *loghandle;
struct llogd_body *body;
struct obd_run_ctxt saved;
+ struct llog_obd_ctxt *ctxt;
__u8 *buf;
void * ptr;
int size[] = {sizeof (*body),
int rc, rc2;
ENTRY;
- LASSERT(obd->obd_log_exp != NULL);
-
body = lustre_swab_reqbuf(req, 0, sizeof(*body),
lustre_swab_llogd_body);
if (body == NULL) {
push_ctxt(&saved, &obd->obd_ctxt, NULL);
- rc = llog_create(obd, &loghandle, &body->lgd_logid, NULL);
+ ctxt = obd->obd_llog_ctxt[LLOG_CONFIG_ORIG_CTXT];
+ rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
if (rc)
GOTO(out_pop, rc);
RETURN(rc);
}
-int llogd_read_header(struct ptlrpc_request *req)
+int llog_origin_handle_read_header(struct ptlrpc_request *req)
{
struct obd_export *exp = req->rq_export;
struct obd_device *obd = exp->exp_obd;
struct llogd_body *body;
struct llog_log_hdr *hdr;
struct obd_run_ctxt saved;
+ struct llog_obd_ctxt *ctxt;
__u8 *buf;
int size[] = {sizeof (*hdr)};
int rc, rc2;
ENTRY;
- LASSERT(obd->obd_log_exp != NULL);
-
body = lustre_swab_reqbuf(req, 0, sizeof(*body),
lustre_swab_llogd_body);
if (body == NULL) {
push_ctxt(&saved, &obd->obd_ctxt, NULL);
- rc = llog_create(obd, &loghandle, &body->lgd_logid, NULL);
+ ctxt = obd->obd_llog_ctxt[LLOG_CONFIG_ORIG_CTXT];
+ rc = llog_create(ctxt, &loghandle, &body->lgd_logid, NULL);
if (rc)
GOTO(out_pop, rc);
RETURN(rc);
}
-int llogd_close(struct ptlrpc_request *req)
+int llog_origin_handle_close(struct ptlrpc_request *req)
{
int rc;
/* This is a callback from the llog_* functions.
* Assumes caller has already pushed us into the kernel context. */
-int llogd_client_create(struct obd_device *obd, struct llog_handle **res,
+int llog_client_create(struct llog_obd_ctxt *ctxt, struct llog_handle **res,
struct llog_logid *logid, char *name)
{
+ struct obd_device *obd = ctxt->loc_obd;
struct client_obd *cli = &obd->u.cli;
struct obd_import *imp = cli->cl_import;
struct llogd_body req_body;
bufcount++;
}
- req = ptlrpc_prep_req(imp, LLOGD_CREATE, bufcount, size, tmp);
+ req = ptlrpc_prep_req(imp, LLOG_ORIGIN_HANDLE_CREATE, bufcount, size, tmp);
if (!req)
GOTO(err_free, rc = -ENOMEM);
handle->lgh_id = body->lgd_logid;
handle->lgh_obd = obd;
+ handle->lgh_ctxt = ctxt;
out:
if (req)
ptlrpc_req_finished(req);
- RETURN(0);
+ RETURN(rc);
err_free:
llog_free_handle(handle);
return cli->cl_import;
}
-int llogd_client_next_block(struct llog_handle *loghandle,
+int llog_client_next_block(struct llog_handle *loghandle,
int *cur_idx, int next_idx,
__u64 *cur_offset, void *buf, int len)
{
int rc;
ENTRY;
- req = ptlrpc_prep_req(imp, LLOGD_NEXT_BLOCK, 1, &size, NULL);
+ req = ptlrpc_prep_req(imp, LLOG_ORIGIN_HANDLE_NEXT_BLOCK, 1, &size, NULL);
if (!req)
GOTO(out, rc = -ENOMEM);
}
-int llogd_client_read_header(struct llog_handle *handle)
+int llog_client_read_header(struct llog_handle *handle)
{
struct obd_import *imp = llog_lgh2imp(handle);
struct ptlrpc_request *req = NULL;
int rc;
ENTRY;
- req = ptlrpc_prep_req(imp, LLOGD_READ_HEADER, 1, &size, NULL);
+ req = ptlrpc_prep_req(imp, LLOG_ORIGIN_HANDLE_READ_HEADER, 1, &size, NULL);
if (!req)
GOTO(out, rc = -ENOMEM);
RETURN(rc);
}
-int llogd_client_close(struct llog_handle *handle)
+int llog_client_close(struct llog_handle *handle)
{
int rc = 0;
}
-struct llog_operations llogd_client_ops = {
- lop_next_block: llogd_client_next_block,
- lop_read_header: llogd_client_read_header,
- lop_create: llogd_client_create,
- lop_close: llogd_client_close,
+struct llog_operations llog_client_ops = {
+ lop_next_block: llog_client_next_block,
+ lop_read_header: llog_client_read_header,
+ lop_create: llog_client_create,
+ lop_close: llog_client_close,
};
void ptlrpc_request_handle_notconn(struct ptlrpc_request *);
void lustre_assert_wire_constants(void);
-void ptlrpc_lprocfs_register_service(struct obd_device *obddev,
+void ptlrpc_lprocfs_register_service(struct proc_dir_entry *proc_entry,
struct ptlrpc_service *svc);
void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc);
void ptlrpc_lprocfs_rpc_sent(struct ptlrpc_request *req);
/* service.c */
EXPORT_SYMBOL(ptlrpc_init_svc);
EXPORT_SYMBOL(ptlrpc_stop_all_threads);
+EXPORT_SYMBOL(ptlrpc_start_n_threads);
EXPORT_SYMBOL(ptlrpc_start_thread);
EXPORT_SYMBOL(ptlrpc_unregister_service);
EXPORT_SYMBOL(ptlrpc_fail_export);
EXPORT_SYMBOL(ptlrpc_recover_import);
-/*ptlrpc_lib.c*/
-EXPORT_SYMBOL(client_obd_setup);
-EXPORT_SYMBOL(client_obd_cleanup);
-
/* pinger.c */
EXPORT_SYMBOL(ptlrpc_pinger_add_import);
EXPORT_SYMBOL(ptlrpc_pinger_del_import);
EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);
/* llogd.c */
-EXPORT_SYMBOL(llogd_create);
-EXPORT_SYMBOL(llogd_next_block);
-EXPORT_SYMBOL(llogd_read_header);
-EXPORT_SYMBOL(llogd_close);
-EXPORT_SYMBOL(llogd_client_create);
-EXPORT_SYMBOL(llogd_client_next_block);
-EXPORT_SYMBOL(llogd_client_read_header);
-EXPORT_SYMBOL(llogd_client_close);
-EXPORT_SYMBOL(llogd_client_ops);
+EXPORT_SYMBOL(llog_origin_handle_create);
+EXPORT_SYMBOL(llog_origin_handle_next_block);
+EXPORT_SYMBOL(llog_origin_handle_read_header);
+EXPORT_SYMBOL(llog_origin_handle_close);
+EXPORT_SYMBOL(llog_client_ops);
#ifdef __KERNEL__
MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
return self.values[name]
else:
raise error.OptionError("bad option name: " + name)
+ def __getitem__(self, name):
+ if self.values.has_key(name):
+ return self.values[name]
+ else:
+ raise error.OptionError("bad option name: " + name)
def __setattr__(self, name, value):
self.values[name] = value
return 0;
}
-int jt_lcfg_lov_setconfig(int argc, char **argv)
+int jt_lcfg_lov_setup(int argc, char **argv)
{
struct lustre_cfg lcfg;
struct lov_desc desc;
int rc, i;
char *end;
- LCFG_INIT(lcfg, LCFG_LOV_SET_CONFIG, lcfg_devname);
+ LCFG_INIT(lcfg, LCFG_SETUP, lcfg_devname);
if (argc <= 6)
return CMD_HELP;
LCFG_INIT(lcfg, LCFG_MOUNTOPT, lcfg_devname);
- if (argc != 4)
+ if (argc < 3 || argc > 4)
return CMD_HELP;
/* profile name */
/* osc name */
lcfg.lcfg_inllen2 = strlen(argv[2]) + 1;
lcfg.lcfg_inlbuf2 = argv[2];
- /* mdc name */
- lcfg.lcfg_inllen3 = strlen(argv[3]) + 1;
- lcfg.lcfg_inlbuf3 = argv[3];
-
+ if (argc == 4) {
+ /* mdc name */
+ lcfg.lcfg_inllen3 = strlen(argv[3]) + 1;
+ lcfg.lcfg_inlbuf3 = argv[3];
+ }
rc = lcfg_ioctl(argv[0], OBD_DEV_ID, &lcfg);
if (rc < 0) {
fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),