From: John L. Hammond Date: Mon, 29 Sep 2014 18:12:52 +0000 (-0500) Subject: LU-2675 lmv: remove lmv_init_{lock,unlock}() X-Git-Tag: 2.6.91~30 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7c814c2971be916520bd552f44173b41140ebac6 LU-2675 lmv: remove lmv_init_{lock,unlock}() In struct lmv_obd rename the init_mutex member to lmv_init_mutex. Remove the compat macros lmv_init_{lock,unlock}() and use mutex_{lock,unlock}(&lmv->lmv_init_mutex) instead. Signed-off-by: John L. Hammond Change-Id: Iae1f5d6b7fd1f96ba430d5e7af97c51ce3e042a8 Reviewed-on: http://review.whamcloud.com/12115 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 1dc0315..fa96ced 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -442,7 +442,7 @@ struct lmv_obd { struct obd_export *exp; struct proc_dir_entry *targets_proc_entry; - struct mutex init_mutex; + struct mutex lmv_init_mutex; int connected; int max_easize; int max_def_easize; diff --git a/lustre/lmv/lmv_internal.h b/lustre/lmv/lmv_internal.h index 1110718..82780bb 100644 --- a/lustre/lmv/lmv_internal.h +++ b/lustre/lmv/lmv_internal.h @@ -43,9 +43,6 @@ #define LMV_MAX_TGT_COUNT 128 -#define lmv_init_lock(lmv) mutex_lock(&lmv->init_mutex); -#define lmv_init_unlock(lmv) mutex_unlock(&lmv->init_mutex); - #define LL_IT2STR(it) \ ((it) ? ldlm_it2str((it)->it_op) : "0") diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 6681ecf..2a0746d 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -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;