int rc = 0;
ENTRY;
- if (lcfg->lcfg_inllen1 == 0 || lcfg->lcfg_inlbuf1 == NULL) {
+ if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1 ||
+ lustre_cfg_buf(lcfg, 1) == NULL) {
CERROR("%s: setup requires master device name\n",
obd->obd_name);
RETURN(-EINVAL);
}
- if (lcfg->lcfg_inllen2 == 0 || lcfg->lcfg_inlbuf2 == NULL) {
+ if (LUSTRE_CFG_BUFLEN(lcfg, 2) < 1 ||
+ lustre_cfg_buf(lcfg, 2) == NULL) {
CERROR("%s: setup requires cache device name\n",
obd->obd_name);
RETURN(-EINVAL);
}
- master = class_name2obd(lcfg->lcfg_inlbuf1);
+ master = class_name2obd(lustre_cfg_string(lcfg, 1));
if (!master) {
CERROR("%s: unable to find master: %s\n",
- obd->obd_name, lcfg->lcfg_inlbuf1);
+ obd->obd_name, lustre_cfg_string(lcfg, 1));
RETURN(-EINVAL);
}
sema_init(&cobd->sem, 1);
- OBD_ALLOC(cobd->master_name, lcfg->lcfg_inllen1);
+ OBD_ALLOC(cobd->master_name, LUSTRE_CFG_BUFLEN(lcfg, 1));
if (!cobd->master_name)
RETURN(-ENOMEM);
- memcpy(cobd->master_name, lcfg->lcfg_inlbuf1,
- lcfg->lcfg_inllen1);
+ memcpy(cobd->master_name, lustre_cfg_string(lcfg, 1),
+ LUSTRE_CFG_BUFLEN(lcfg, 1));
- OBD_ALLOC(cobd->cache_name, lcfg->lcfg_inllen2);
+ OBD_ALLOC(cobd->cache_name, LUSTRE_CFG_BUFLEN(lcfg, 2));
if (!cobd->cache_name)
GOTO(put_names, rc = -ENOMEM);
- memcpy(cobd->cache_name, lcfg->lcfg_inlbuf2,
- lcfg->lcfg_inllen2);
+ memcpy(cobd->cache_name, lustre_cfg_string(lcfg, 2),
+ LUSTRE_CFG_BUFLEN(lcfg, 2));
EXIT;
put_names:
if (rc) {
- OBD_FREE(cobd->master_name, lcfg->lcfg_inllen1);
+ OBD_FREE(cobd->master_name, LUSTRE_CFG_BUFLEN(lcfg, 1));
cobd->master_name = NULL;
}
return rc;
static int client_obd_connect(struct obd_device *obd, char *name,
struct lustre_handle *conn,
+ struct obd_connect_data *data,
unsigned long flags)
{
struct obd_device *cli_obd;
obd->obd_name, name);
RETURN(-EINVAL);
}
- rc = obd_connect(conn, cli_obd, &obd->obd_uuid, flags);
+ rc = obd_connect(conn, cli_obd, &obd->obd_uuid, data, flags);
if (rc) {
CERROR("error connecting to %s, err %d\n",
name, rc);
static int
cobd_connect(struct lustre_handle *conn, struct obd_device *obd,
- struct obd_uuid *cluuid, unsigned long flags)
+ struct obd_uuid *cluuid, struct obd_connect_data *data,
+ unsigned long flags)
{
struct lustre_handle cache_conn = { 0 };
struct cache_obd *cobd = &obd->u.cobd;
/* connecting cache */
rc = client_obd_connect(obd, cobd->cache_name,
- &cache_conn, flags);
+ &cache_conn, data, flags);
if (rc)
GOTO(err_discon, rc);
cobd->cache_exp = class_conn2export(&cache_conn);
RETURN(rc);
}
-static int cobd_get_info(struct obd_export *exp, obd_count keylen,
+static int cobd_get_info(struct obd_export *exp, __u32 keylen,
void *key, __u32 *vallen, void *val)
{
struct obd_device *obd = class_exp2obd(exp);
}
static int cobd_create(struct obd_export *exp, struct obdo *obdo,
+ void *acl, int acl_size,
struct lov_stripe_md **ea,
struct obd_trans_info *oti)
{
return -EINVAL;
}
cobd_exp = cobd_get_exp(obd);
- return obd_create(cobd_exp, obdo, ea, oti);
+ return obd_create(cobd_exp, obdo, acl, acl_size, ea, oti);
}
static int cobd_destroy(struct obd_export *exp, struct obdo *obdo,
}
static int cobd_getattr(struct obd_export *exp, struct obdo *oa,
- struct lov_stripe_md *lsm)
+ struct lov_stripe_md *ea)
{
struct obd_device *obd = class_exp2obd(exp);
struct obd_export *cobd_exp;
return -EINVAL;
}
cobd_exp = cobd_get_exp(obd);
- return obd_getattr(cobd_exp, oa, lsm);
+ return obd_getattr(cobd_exp, oa, ea);
}
static int cobd_getattr_async(struct obd_export *exp,
struct lustre_handle conn = {0};
rc = client_obd_disconnect(obd, cobd->master_exp, 0);
- rc = client_obd_connect(obd, cobd->cache_name, &conn, 0);
+ rc = client_obd_connect(obd, cobd->cache_name, &conn,
+ NULL, 0);
if (rc)
GOTO(out, rc);
cobd->cache_exp = class_conn2export(&conn);
cooksize = cache->u.cli.cl_max_mds_cookiesize;
rc = client_obd_disconnect(obd, cobd->cache_exp, 0);
- rc = client_obd_connect(obd, cobd->master_name, &conn, 0);
+ rc = client_obd_connect(obd, cobd->master_name, &conn,
+ NULL, 0);
if (rc)
GOTO(out, rc);
cobd->master_exp = class_conn2export(&conn);
}
static int cobd_md_getattr(struct obd_export *exp, struct lustre_id *id,
- __u64 valid, unsigned int ea_size,
- struct ptlrpc_request **request)
+ __u64 valid, const char *ea_name, int ea_namelen,
+ unsigned int ea_size, struct ptlrpc_request **request)
{
struct obd_device *obd = class_exp2obd(exp);
struct obd_export *cobd_exp;
return -EINVAL;
}
cobd_exp = cobd_get_exp(obd);
- return md_getattr(cobd_exp, id, valid, ea_size, request);
+ return md_getattr(cobd_exp, id, valid, NULL, 0, ea_size, request);
}
static int cobd_md_req2lustre_md (struct obd_export *mdc_exp,