Whamcloud - gitweb
b=6427
[fs/lustre-release.git] / lustre / lmv / lmv_obd.c
index 6c4b487..d69c956 100644 (file)
@@ -96,7 +96,7 @@ static int lmv_set_mdc_active(struct lmv_obd *lmv, struct obd_uuid *uuid,
                 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;
         }
 
@@ -552,27 +552,27 @@ static int lmv_setup(struct obd_device *obd, obd_count len, void *buf)
         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);
         }
 
@@ -1153,8 +1153,9 @@ repeat:
         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) {
                 /*
@@ -1164,7 +1165,8 @@ repeat:
                  */
                 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;