Whamcloud - gitweb
LU-8837 lmv: don't use lqr_alloc spinlock in lmv
[fs/lustre-release.git] / lustre / lmv / lmv_obd.c
index b639d7f..a32a763 100644 (file)
@@ -1523,7 +1523,7 @@ static struct lu_tgt_desc *lmv_locate_tgt_rr(struct lmv_obd *lmv, __u32 *mdt)
 
        ENTRY;
 
-       spin_lock(&lmv->lmv_qos.lq_rr.lqr_alloc);
+       spin_lock(&lmv->lmv_lock);
        for (i = 0; i < lmv->lmv_mdt_descs.ltd_tgts_size; i++) {
                index = (i + lmv->lmv_qos_rr_index) %
                        lmv->lmv_mdt_descs.ltd_tgts_size;
@@ -1534,11 +1534,11 @@ static struct lu_tgt_desc *lmv_locate_tgt_rr(struct lmv_obd *lmv, __u32 *mdt)
                *mdt = tgt->ltd_index;
                lmv->lmv_qos_rr_index = (*mdt + 1) %
                                        lmv->lmv_mdt_descs.ltd_tgts_size;
-               spin_unlock(&lmv->lmv_qos.lq_rr.lqr_alloc);
+               spin_unlock(&lmv->lmv_lock);
 
                RETURN(tgt);
        }
-       spin_unlock(&lmv->lmv_qos.lq_rr.lqr_alloc);
+       spin_unlock(&lmv->lmv_lock);
 
        RETURN(ERR_PTR(-ENODEV));
 }
@@ -3194,10 +3194,8 @@ static int lmv_unpackmd(struct obd_export *exp, struct lmv_stripe_md **lsmp,
                }
 
                if (lmv_dir_striped(lsm)) {
-                       for (i = 0; i < lsm->lsm_md_stripe_count; i++) {
-                               if (lsm->lsm_md_oinfo[i].lmo_root)
-                                       iput(lsm->lsm_md_oinfo[i].lmo_root);
-                       }
+                       for (i = 0; i < lsm->lsm_md_stripe_count; i++)
+                               iput(lsm->lsm_md_oinfo[i].lmo_root);
                        lsm_size = lmv_stripe_md_size(lsm->lsm_md_stripe_count);
                } else {
                        lsm_size = lmv_stripe_md_size(0);
@@ -3662,7 +3660,7 @@ static const struct md_ops lmv_md_ops = {
 
 static int __init lmv_init(void)
 {
-       return class_register_type(&lmv_obd_ops, &lmv_md_ops, true, NULL,
+       return class_register_type(&lmv_obd_ops, &lmv_md_ops, true,
                                   LUSTRE_LMV_NAME, NULL);
 }