Commit 019e9351 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging/lustre/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: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/12115
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675Reviewed-by: default avatarBob Glossman <bob.glossman@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@gmail.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2995737
...@@ -512,7 +512,7 @@ struct lmv_obd { ...@@ -512,7 +512,7 @@ struct lmv_obd {
struct obd_uuid cluuid; struct obd_uuid cluuid;
struct obd_export *exp; struct obd_export *exp;
struct mutex init_mutex; struct mutex lmv_init_mutex;
int connected; int connected;
int max_easize; int max_easize;
int max_def_easize; int max_def_easize;
......
...@@ -42,9 +42,6 @@ ...@@ -42,9 +42,6 @@
#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) \ #define LL_IT2STR(it) \
((it) ? ldlm_it2str((it)->it_op) : "0") ((it) ? ldlm_it2str((it)->it_op) : "0")
......
...@@ -425,7 +425,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp, ...@@ -425,7 +425,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); 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) { if (lmv->desc.ld_tgt_count == 0) {
struct obd_device *mdc_obd; struct obd_device *mdc_obd;
...@@ -433,7 +433,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp, ...@@ -433,7 +433,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
mdc_obd = class_find_client_obd(uuidp, LUSTRE_MDC_NAME, mdc_obd = class_find_client_obd(uuidp, LUSTRE_MDC_NAME,
&obd->obd_uuid); &obd->obd_uuid);
if (!mdc_obd) { if (!mdc_obd) {
lmv_init_unlock(lmv); mutex_unlock(&lmv->lmv_init_mutex);
CERROR("%s: Target %s not attached: rc = %d\n", CERROR("%s: Target %s not attached: rc = %d\n",
obd->obd_name, uuidp->uuid, -EINVAL); obd->obd_name, uuidp->uuid, -EINVAL);
return -EINVAL; return -EINVAL;
...@@ -445,7 +445,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp, ...@@ -445,7 +445,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", CERROR("%s: UUID %s already assigned at LOV target index %d: rc = %d\n",
obd->obd_name, obd->obd_name,
obd_uuid2str(&tgt->ltd_uuid), index, -EEXIST); obd_uuid2str(&tgt->ltd_uuid), index, -EEXIST);
lmv_init_unlock(lmv); mutex_unlock(&lmv->lmv_init_mutex);
return -EEXIST; return -EEXIST;
} }
...@@ -459,7 +459,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp, ...@@ -459,7 +459,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
newsize <<= 1; newsize <<= 1;
newtgts = kcalloc(newsize, sizeof(*newtgts), GFP_NOFS); newtgts = kcalloc(newsize, sizeof(*newtgts), GFP_NOFS);
if (!newtgts) { if (!newtgts) {
lmv_init_unlock(lmv); mutex_unlock(&lmv->lmv_init_mutex);
return -ENOMEM; return -ENOMEM;
} }
...@@ -481,7 +481,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp, ...@@ -481,7 +481,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
tgt = kzalloc(sizeof(*tgt), GFP_NOFS); tgt = kzalloc(sizeof(*tgt), GFP_NOFS);
if (!tgt) { if (!tgt) {
lmv_init_unlock(lmv); mutex_unlock(&lmv->lmv_init_mutex);
return -ENOMEM; return -ENOMEM;
} }
...@@ -507,7 +507,7 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp, ...@@ -507,7 +507,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; return rc;
} }
...@@ -522,14 +522,14 @@ int lmv_check_connect(struct obd_device *obd) ...@@ -522,14 +522,14 @@ int lmv_check_connect(struct obd_device *obd)
if (lmv->connected) if (lmv->connected)
return 0; return 0;
lmv_init_lock(lmv); mutex_lock(&lmv->lmv_init_mutex);
if (lmv->connected) { if (lmv->connected) {
lmv_init_unlock(lmv); mutex_unlock(&lmv->lmv_init_mutex);
return 0; return 0;
} }
if (lmv->desc.ld_tgt_count == 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); CERROR("%s: no targets configured.\n", obd->obd_name);
return -EINVAL; return -EINVAL;
} }
...@@ -551,7 +551,7 @@ int lmv_check_connect(struct obd_device *obd) ...@@ -551,7 +551,7 @@ int lmv_check_connect(struct obd_device *obd)
lmv->connected = 1; lmv->connected = 1;
easize = lmv_get_easize(lmv); easize = lmv_get_easize(lmv);
lmv_init_ea_size(obd->obd_self_export, easize, 0, 0, 0); lmv_init_ea_size(obd->obd_self_export, easize, 0, 0, 0);
lmv_init_unlock(lmv); mutex_unlock(&lmv->lmv_init_mutex);
return 0; return 0;
out_disc: out_disc:
...@@ -572,7 +572,7 @@ int lmv_check_connect(struct obd_device *obd) ...@@ -572,7 +572,7 @@ int lmv_check_connect(struct obd_device *obd)
} }
} }
class_disconnect(lmv->exp); class_disconnect(lmv->exp);
lmv_init_unlock(lmv); mutex_unlock(&lmv->lmv_init_mutex);
return rc; return rc;
} }
...@@ -1269,7 +1269,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg) ...@@ -1269,7 +1269,7 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
lmv->lmv_placement = PLACEMENT_CHAR_POLICY; lmv->lmv_placement = PLACEMENT_CHAR_POLICY;
spin_lock_init(&lmv->lmv_lock); spin_lock_init(&lmv->lmv_lock);
mutex_init(&lmv->init_mutex); mutex_init(&lmv->lmv_init_mutex);
lprocfs_lmv_init_vars(&lvars); lprocfs_lmv_init_vars(&lvars);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment