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 <john.hammond@intel.com>
Change-Id: Iae1f5d6b7fd1f96ba430d5e7af97c51ce3e042a8
Reviewed-on: http://review.whamcloud.com/12115
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
struct obd_export *exp;
struct proc_dir_entry *targets_proc_entry;
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;
int connected;
int max_easize;
int max_def_easize;
#define LMV_MAX_TGT_COUNT 128
#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")
#define LL_IT2STR(it) \
((it) ? ldlm_it2str((it)->it_op) : "0")
CDEBUG(D_CONFIG, "Target uuid: %s. index %d\n", uuidp->uuid, index);
CDEBUG(D_CONFIG, "Target uuid: %s. index %d\n", uuidp->uuid, index);
+ mutex_lock(&lmv->lmv_init_mutex);
if (lmv->desc.ld_tgt_count == 0) {
struct obd_device *mdc_obd;
if (lmv->desc.ld_tgt_count == 0) {
struct obd_device *mdc_obd;
mdc_obd = class_find_client_obd(uuidp, LUSTRE_MDC_NAME,
&obd->obd_uuid);
if (!mdc_obd) {
mdc_obd = class_find_client_obd(uuidp, LUSTRE_MDC_NAME,
&obd->obd_uuid);
if (!mdc_obd) {
+ mutex_unlock(&lmv->lmv_init_mutex);
CERROR("%s: Target %s not attached: rc = %d\n",
obd->obd_name, uuidp->uuid, -EINVAL);
RETURN(-EINVAL);
CERROR("%s: Target %s not attached: rc = %d\n",
obd->obd_name, uuidp->uuid, -EINVAL);
RETURN(-EINVAL);
CERROR("%s: UUID %s already assigned at LOV target index %d:"
" rc = %d\n", obd->obd_name,
obd_uuid2str(&tgt->ltd_uuid), index, -EEXIST);
CERROR("%s: UUID %s already assigned at LOV target index %d:"
" rc = %d\n", obd->obd_name,
obd_uuid2str(&tgt->ltd_uuid), index, -EEXIST);
+ mutex_unlock(&lmv->lmv_init_mutex);
newsize = newsize << 1;
OBD_ALLOC(newtgts, sizeof(*newtgts) * newsize);
if (newtgts == NULL) {
newsize = newsize << 1;
OBD_ALLOC(newtgts, sizeof(*newtgts) * newsize);
if (newtgts == NULL) {
+ mutex_unlock(&lmv->lmv_init_mutex);
OBD_ALLOC_PTR(tgt);
if (!tgt) {
OBD_ALLOC_PTR(tgt);
if (!tgt) {
+ mutex_unlock(&lmv->lmv_init_mutex);
+ mutex_unlock(&lmv->lmv_init_mutex);
if (lmv->connected)
RETURN(0);
if (lmv->connected)
RETURN(0);
+ mutex_lock(&lmv->lmv_init_mutex);
+ mutex_unlock(&lmv->lmv_init_mutex);
RETURN(0);
}
if (lmv->desc.ld_tgt_count == 0) {
RETURN(0);
}
if (lmv->desc.ld_tgt_count == 0) {
+ mutex_unlock(&lmv->lmv_init_mutex);
CERROR("%s: no targets configured.\n", obd->obd_name);
RETURN(-EINVAL);
}
CERROR("%s: no targets configured.\n", obd->obd_name);
RETURN(-EINVAL);
}
LASSERT(lmv->tgts != NULL);
if (lmv->tgts[0] == NULL) {
LASSERT(lmv->tgts != NULL);
if (lmv->tgts[0] == NULL) {
+ mutex_unlock(&lmv->lmv_init_mutex);
CERROR("%s: no target configured for index 0.\n",
obd->obd_name);
RETURN(-EINVAL);
CERROR("%s: no target configured for index 0.\n",
obd->obd_name);
RETURN(-EINVAL);
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->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);
+ mutex_unlock(&lmv->lmv_init_mutex);
}
}
class_disconnect(lmv->exp);
}
}
class_disconnect(lmv->exp);
+ mutex_unlock(&lmv->lmv_init_mutex);
lmv->lmv_placement = PLACEMENT_CHAR_POLICY;
spin_lock_init(&lmv->lmv_lock);
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;
#ifdef LPROCFS
obd->obd_vars = lprocfs_lmv_obd_vars;