Whamcloud - gitweb
LU-2675 lmv: remove lmv_init_{lock,unlock}()
[fs/lustre-release.git] / lustre / lmv / lmv_obd.c
index 6681ecf..2a0746d 100644 (file)
@@ -435,7 +435,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 
        CDEBUG(D_CONFIG, "Target uuid: %s. index %d\n", uuidp->uuid, index);
 
-        lmv_init_lock(lmv);
+       mutex_lock(&lmv->lmv_init_mutex);
 
        if (lmv->desc.ld_tgt_count == 0) {
                struct obd_device *mdc_obd;
@@ -443,7 +443,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                mdc_obd = class_find_client_obd(uuidp, LUSTRE_MDC_NAME,
                                                &obd->obd_uuid);
                if (!mdc_obd) {
-                       lmv_init_unlock(lmv);
+                       mutex_unlock(&lmv->lmv_init_mutex);
                        CERROR("%s: Target %s not attached: rc = %d\n",
                               obd->obd_name, uuidp->uuid, -EINVAL);
                        RETURN(-EINVAL);
@@ -455,7 +455,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                CERROR("%s: UUID %s already assigned at LOV target index %d:"
                       " rc = %d\n", obd->obd_name,
                       obd_uuid2str(&tgt->ltd_uuid), index, -EEXIST);
-               lmv_init_unlock(lmv);
+               mutex_unlock(&lmv->lmv_init_mutex);
                RETURN(-EEXIST);
        }
 
@@ -469,7 +469,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                        newsize = newsize << 1;
                OBD_ALLOC(newtgts, sizeof(*newtgts) * newsize);
                if (newtgts == NULL) {
-                       lmv_init_unlock(lmv);
+                       mutex_unlock(&lmv->lmv_init_mutex);
                        RETURN(-ENOMEM);
                }
 
@@ -492,7 +492,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 
        OBD_ALLOC_PTR(tgt);
        if (!tgt) {
-               lmv_init_unlock(lmv);
+               mutex_unlock(&lmv->lmv_init_mutex);
                RETURN(-ENOMEM);
        }
 
@@ -521,7 +521,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
                }
        }
 
-       lmv_init_unlock(lmv);
+       mutex_unlock(&lmv->lmv_init_mutex);
        RETURN(rc);
 }
 
@@ -537,14 +537,14 @@ int lmv_check_connect(struct obd_device *obd)
         if (lmv->connected)
                 RETURN(0);
 
-        lmv_init_lock(lmv);
+       mutex_lock(&lmv->lmv_init_mutex);
         if (lmv->connected) {
-                lmv_init_unlock(lmv);
+               mutex_unlock(&lmv->lmv_init_mutex);
                 RETURN(0);
         }
 
         if (lmv->desc.ld_tgt_count == 0) {
-                lmv_init_unlock(lmv);
+               mutex_unlock(&lmv->lmv_init_mutex);
                 CERROR("%s: no targets configured.\n", obd->obd_name);
                 RETURN(-EINVAL);
         }
@@ -552,7 +552,7 @@ int lmv_check_connect(struct obd_device *obd)
        LASSERT(lmv->tgts != NULL);
 
        if (lmv->tgts[0] == NULL) {
-               lmv_init_unlock(lmv);
+               mutex_unlock(&lmv->lmv_init_mutex);
                CERROR("%s: no target configured for index 0.\n",
                       obd->obd_name);
                RETURN(-EINVAL);
@@ -574,7 +574,7 @@ int lmv_check_connect(struct obd_device *obd)
        lmv->connected = 1;
        easize = lmv_mds_md_size(lmv->desc.ld_tgt_count, LMV_MAGIC);
        lmv_init_ea_size(obd->obd_self_export, easize, 0, 0, 0);
-       lmv_init_unlock(lmv);
+       mutex_unlock(&lmv->lmv_init_mutex);
        RETURN(0);
 
  out_disc:
@@ -595,7 +595,7 @@ int lmv_check_connect(struct obd_device *obd)
                 }
         }
         class_disconnect(lmv->exp);
-        lmv_init_unlock(lmv);
+       mutex_unlock(&lmv->lmv_init_mutex);
         RETURN(rc);
 }
 
@@ -1371,7 +1371,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        lmv->lmv_placement = PLACEMENT_CHAR_POLICY;
 
        spin_lock_init(&lmv->lmv_lock);
-       mutex_init(&lmv->init_mutex);
+       mutex_init(&lmv->lmv_init_mutex);
 
 #ifdef LPROCFS
        obd->obd_vars = lprocfs_lmv_obd_vars;