CDEBUG(D_INFO, "lmv idx %d is %s conn "LPX64"\n",
i, tgt->uuid.uuid, tgt->ltd_exp->exp_handle.h_cookie);
- if (strncmp(uuid->uuid, tgt->uuid.uuid, sizeof uuid->uuid) == 0)
+ if (obd_uuid_equals(uuid, &tgt->uuid))
break;
}
struct lmv_obd *lmv = &obd->u.lmv;
ENTRY;
- if (lcfg->lcfg_inllen1 < 1) {
+ if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
CERROR("LMV setup requires a descriptor\n");
RETURN(-EINVAL);
}
- if (lcfg->lcfg_inllen2 < 1) {
+ if (LUSTRE_CFG_BUFLEN(lcfg, 2) < 1) {
CERROR("LMV setup requires an MDT UUID list\n");
RETURN(-EINVAL);
}
- desc = (struct lmv_desc *)lcfg->lcfg_inlbuf1;
- if (sizeof(*desc) > lcfg->lcfg_inllen1) {
+ desc = (struct lmv_desc *)lustre_cfg_buf(lcfg, 1);
+ if (sizeof(*desc) > LUSTRE_CFG_BUFLEN(lcfg, 1)) {
CERROR("descriptor size wrong: %d > %d\n",
- (int)sizeof(*desc), lcfg->lcfg_inllen1);
+ (int)sizeof(*desc), LUSTRE_CFG_BUFLEN(lcfg, 1));
RETURN(-EINVAL);
}
- uuids = (struct obd_uuid *)lcfg->lcfg_inlbuf2;
- if (sizeof(*uuids) * desc->ld_tgt_count != lcfg->lcfg_inllen2) {
+ uuids = (struct obd_uuid *)lustre_cfg_buf(lcfg, 2);
+ if (sizeof(*uuids) * desc->ld_tgt_count != LUSTRE_CFG_BUFLEN(lcfg, 2)) {
CERROR("UUID array size wrong: %u * %u != %u\n",
- sizeof(*uuids), desc->ld_tgt_count, lcfg->lcfg_inllen2);
+ sizeof(*uuids), desc->ld_tgt_count, LUSTRE_CFG_BUFLEN(lcfg, 2));
RETURN(-EINVAL);
}
CDEBUG(D_OTHER, "getattr_lock for %*s on "DLID4" -> "DLID4"\n",
namelen, filename, OLID4(id), OLID4(&rid));
- rc = md_getattr_lock(lmv->tgts[id_group(&rid)].ltd_exp, &rid,
- filename, namelen, (valid | OBD_MD_FID),
+ rc = md_getattr_lock(lmv->tgts[id_group(&rid)].ltd_exp,
+ &rid, filename, namelen,
+ valid == OBD_MD_FLID ? valid : valid | OBD_MD_FID,
ea_size, request);
if (rc == 0) {
/*
*/
body = lustre_msg_buf((*request)->rq_repmsg, 0, sizeof(*body));
LASSERT(body != NULL);
- LASSERT((body->valid & OBD_MD_FID) != 0);
+ LASSERT((body->valid & OBD_MD_FID) != 0
+ || body->valid == OBD_MD_FLID);
if (body->valid & OBD_MD_MDS) {
struct ptlrpc_request *req = NULL;
}
int lmv_obd_create_single(struct obd_export *exp, struct obdo *oa,
+ void *acl, int acl_size,
struct lov_stripe_md **ea, struct obd_trans_info *oti)
{
struct obd_device *obd = exp->exp_obd;
LASSERT(ea == NULL);
LASSERT(oa->o_mds < lmv->desc.ld_tgt_count);
- rc = obd_create(lmv->tgts[oa->o_mds].ltd_exp,
- oa, &obj_mdp, oti);
+ rc = obd_create(lmv->tgts[oa->o_mds].ltd_exp, oa,
+ acl, acl_size, &obj_mdp, oti);
RETURN(rc);
}
* values for "master" object, as it will be used.
*/
int lmv_obd_create(struct obd_export *exp, struct obdo *oa,
+ void *acl, int acl_size,
struct lov_stripe_md **ea, struct obd_trans_info *oti)
{
struct obd_device *obd = exp->exp_obd;
LASSERT(oa != NULL);
if (ea == NULL) {
- rc = lmv_obd_create_single(exp, oa, NULL, oti);
+ rc = lmv_obd_create_single(exp, oa, acl, acl_size, NULL, oti);
if (rc)
CERROR("Can't create object, rc = %d\n", rc);
RETURN(rc);
}
+ /* acl is only suppied when mds create single remote obj */
+ LASSERT(acl == NULL && acl_size == 0);
+
if (*ea == NULL) {
rc = obd_alloc_diskmd(exp, (struct lov_mds_md **)ea);
if (rc < 0) {
oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLTYPE | OBD_MD_FLMODE |
OBD_MD_FLUID | OBD_MD_FLGID | OBD_MD_FLID;
- rc = obd_create(lmv->tgts[c].ltd_exp, oa, &obj_mdp, oti);
+ rc = obd_create(lmv->tgts[c].ltd_exp, oa, NULL, 0,
+ &obj_mdp, oti);
if (rc) {
CERROR("obd_create() failed on MDT target %d, "
"error %d\n", c, rc);