Commit 2dfd89c4 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre/mgc: Adjust comments to better conform to coding style

This patch fixes "Block comments use a trailing */ on a separate line"
warnings from checkpatch
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1df232ee
...@@ -90,7 +90,8 @@ static int mgc_name2resid(char *name, int len, struct ldlm_res_id *res_id, ...@@ -90,7 +90,8 @@ static int mgc_name2resid(char *name, int len, struct ldlm_res_id *res_id,
int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type) int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type)
{ {
/* fsname is at most 8 chars long, maybe contain "-". /* fsname is at most 8 chars long, maybe contain "-".
* e.g. "lustre", "SUN-000" */ * e.g. "lustre", "SUN-000"
*/
return mgc_name2resid(fsname, strlen(fsname), res_id, type); return mgc_name2resid(fsname, strlen(fsname), res_id, type);
} }
EXPORT_SYMBOL(mgc_fsname2resid); EXPORT_SYMBOL(mgc_fsname2resid);
...@@ -102,7 +103,8 @@ static int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id, int type ...@@ -102,7 +103,8 @@ static int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id, int type
/* logname consists of "fsname-nodetype". /* logname consists of "fsname-nodetype".
* e.g. "lustre-MDT0001", "SUN-000-client" * e.g. "lustre-MDT0001", "SUN-000-client"
* there is an exception: llog "params" */ * there is an exception: llog "params"
*/
name_end = strrchr(logname, '-'); name_end = strrchr(logname, '-');
if (!name_end) if (!name_end)
len = strlen(logname); len = strlen(logname);
...@@ -125,7 +127,8 @@ static int config_log_get(struct config_llog_data *cld) ...@@ -125,7 +127,8 @@ static int config_log_get(struct config_llog_data *cld)
} }
/* Drop a reference to a config log. When no longer referenced, /* Drop a reference to a config log. When no longer referenced,
we can free the config log data */ * we can free the config log data
*/
static void config_log_put(struct config_llog_data *cld) static void config_log_put(struct config_llog_data *cld)
{ {
CDEBUG(D_INFO, "log %s refs %d\n", cld->cld_logname, CDEBUG(D_INFO, "log %s refs %d\n", cld->cld_logname,
...@@ -252,7 +255,8 @@ static struct config_llog_data *config_recover_log_add(struct obd_device *obd, ...@@ -252,7 +255,8 @@ static struct config_llog_data *config_recover_log_add(struct obd_device *obd,
char logname[32]; char logname[32];
/* we have to use different llog for clients and mdts for cmd /* we have to use different llog for clients and mdts for cmd
* where only clients are notified if one of cmd server restarts */ * where only clients are notified if one of cmd server restarts
*/
LASSERT(strlen(fsname) < sizeof(logname) / 2); LASSERT(strlen(fsname) < sizeof(logname) / 2);
strcpy(logname, fsname); strcpy(logname, fsname);
LASSERT(lcfg.cfg_instance); LASSERT(lcfg.cfg_instance);
...@@ -483,8 +487,9 @@ static void do_requeue(struct config_llog_data *cld) ...@@ -483,8 +487,9 @@ static void do_requeue(struct config_llog_data *cld)
LASSERT(atomic_read(&cld->cld_refcount) > 0); LASSERT(atomic_read(&cld->cld_refcount) > 0);
/* Do not run mgc_process_log on a disconnected export or an /* Do not run mgc_process_log on a disconnected export or an
export which is being disconnected. Take the client * export which is being disconnected. Take the client
semaphore to make the check non-racy. */ * semaphore to make the check non-racy.
*/
down_read(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem); down_read(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem);
if (cld->cld_mgcexp->exp_obd->u.cli.cl_conn_count != 0) { if (cld->cld_mgcexp->exp_obd->u.cli.cl_conn_count != 0) {
CDEBUG(D_MGC, "updating log %s\n", cld->cld_logname); CDEBUG(D_MGC, "updating log %s\n", cld->cld_logname);
...@@ -529,8 +534,9 @@ static int mgc_requeue_thread(void *data) ...@@ -529,8 +534,9 @@ static int mgc_requeue_thread(void *data)
} }
/* Always wait a few seconds to allow the server who /* Always wait a few seconds to allow the server who
caused the lock revocation to finish its setup, plus some * caused the lock revocation to finish its setup, plus some
random so everyone doesn't try to reconnect at once. */ * random so everyone doesn't try to reconnect at once.
*/
to = MGC_TIMEOUT_MIN_SECONDS * HZ; to = MGC_TIMEOUT_MIN_SECONDS * HZ;
to += rand * HZ / 100; /* rand is centi-seconds */ to += rand * HZ / 100; /* rand is centi-seconds */
lwi = LWI_TIMEOUT(to, NULL, NULL); lwi = LWI_TIMEOUT(to, NULL, NULL);
...@@ -559,7 +565,8 @@ static int mgc_requeue_thread(void *data) ...@@ -559,7 +565,8 @@ static int mgc_requeue_thread(void *data)
LASSERT(atomic_read(&cld->cld_refcount) > 0); LASSERT(atomic_read(&cld->cld_refcount) > 0);
/* Whether we enqueued again or not in mgc_process_log, /* Whether we enqueued again or not in mgc_process_log,
* we're done with the ref from the old enqueue */ * we're done with the ref from the old enqueue
*/
if (cld_prev) if (cld_prev)
config_log_put(cld_prev); config_log_put(cld_prev);
cld_prev = cld; cld_prev = cld;
...@@ -575,7 +582,8 @@ static int mgc_requeue_thread(void *data) ...@@ -575,7 +582,8 @@ static int mgc_requeue_thread(void *data)
config_log_put(cld_prev); config_log_put(cld_prev);
/* break after scanning the list so that we can drop /* break after scanning the list so that we can drop
* refcount to losing lock clds */ * refcount to losing lock clds
*/
if (unlikely(stopped)) { if (unlikely(stopped)) {
spin_lock(&config_list_lock); spin_lock(&config_list_lock);
break; break;
...@@ -598,7 +606,8 @@ static int mgc_requeue_thread(void *data) ...@@ -598,7 +606,8 @@ static int mgc_requeue_thread(void *data)
} }
/* Add a cld to the list to requeue. Start the requeue thread if needed. /* Add a cld to the list to requeue. Start the requeue thread if needed.
We are responsible for dropping the config log reference from here on out. */ * We are responsible for dropping the config log reference from here on out.
*/
static void mgc_requeue_add(struct config_llog_data *cld) static void mgc_requeue_add(struct config_llog_data *cld)
{ {
CDEBUG(D_INFO, "log %s: requeue (r=%d sp=%d st=%x)\n", CDEBUG(D_INFO, "log %s: requeue (r=%d sp=%d st=%x)\n",
...@@ -635,7 +644,8 @@ static int mgc_llog_init(const struct lu_env *env, struct obd_device *obd) ...@@ -635,7 +644,8 @@ static int mgc_llog_init(const struct lu_env *env, struct obd_device *obd)
int rc; int rc;
/* setup only remote ctxt, the local disk context is switched per each /* setup only remote ctxt, the local disk context is switched per each
* filesystem during mgc_fs_setup() */ * filesystem during mgc_fs_setup()
*/
rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CONFIG_REPL_CTXT, obd, rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CONFIG_REPL_CTXT, obd,
&llog_client_ops); &llog_client_ops);
if (rc) if (rc)
...@@ -697,7 +707,8 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) ...@@ -697,7 +707,8 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
static int mgc_cleanup(struct obd_device *obd) static int mgc_cleanup(struct obd_device *obd)
{ {
/* COMPAT_146 - old config logs may have added profiles we don't /* COMPAT_146 - old config logs may have added profiles we don't
know about */ * know about
*/
if (obd->obd_type->typ_refcnt <= 1) if (obd->obd_type->typ_refcnt <= 1)
/* Only for the last mgc */ /* Only for the last mgc */
class_del_profiles(); class_del_profiles();
...@@ -794,7 +805,8 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, ...@@ -794,7 +805,8 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
break; break;
} }
/* Make sure not to re-enqueue when the mgc is stopping /* Make sure not to re-enqueue when the mgc is stopping
(we get called from client_disconnect_export) */ * (we get called from client_disconnect_export)
*/
if (!lock->l_conn_export || if (!lock->l_conn_export ||
!lock->l_conn_export->exp_obd->u.cli.cl_conn_count) { !lock->l_conn_export->exp_obd->u.cli.cl_conn_count) {
CDEBUG(D_MGC, "log %.8s: disconnecting, won't requeue\n", CDEBUG(D_MGC, "log %.8s: disconnecting, won't requeue\n",
...@@ -816,7 +828,8 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, ...@@ -816,7 +828,8 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
/* Not sure where this should go... */ /* Not sure where this should go... */
/* This is the timeout value for MGS_CONNECT request plus a ping interval, such /* This is the timeout value for MGS_CONNECT request plus a ping interval, such
* that we can have a chance to try the secondary MGS if any. */ * that we can have a chance to try the secondary MGS if any.
*/
#define MGC_ENQUEUE_LIMIT (INITIAL_CONNECT_TIMEOUT + (AT_OFF ? 0 : at_min) \ #define MGC_ENQUEUE_LIMIT (INITIAL_CONNECT_TIMEOUT + (AT_OFF ? 0 : at_min) \
+ PING_INTERVAL) + PING_INTERVAL)
#define MGC_TARGET_REG_LIMIT 10 #define MGC_TARGET_REG_LIMIT 10
...@@ -880,7 +893,8 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm, ...@@ -880,7 +893,8 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
cld->cld_resid.name[0]); cld->cld_resid.name[0]);
/* We need a callback for every lockholder, so don't try to /* We need a callback for every lockholder, so don't try to
ldlm_lock_match (see rev 1.1.2.11.2.47) */ * ldlm_lock_match (see rev 1.1.2.11.2.47)
*/
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
&RQF_LDLM_ENQUEUE, LUSTRE_DLM_VERSION, &RQF_LDLM_ENQUEUE, LUSTRE_DLM_VERSION,
LDLM_ENQUEUE); LDLM_ENQUEUE);
...@@ -895,7 +909,8 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm, ...@@ -895,7 +909,8 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm,
rc = ldlm_cli_enqueue(exp, &req, &einfo, &cld->cld_resid, NULL, flags, rc = ldlm_cli_enqueue(exp, &req, &einfo, &cld->cld_resid, NULL, flags,
NULL, 0, LVB_T_NONE, lockh, 0); NULL, 0, LVB_T_NONE, lockh, 0);
/* A failed enqueue should still call the mgc_blocking_ast, /* A failed enqueue should still call the mgc_blocking_ast,
where it will be requeued if needed ("grant failed"). */ * where it will be requeued if needed ("grant failed").
*/
ptlrpc_req_finished(req); ptlrpc_req_finished(req);
return rc; return rc;
} }
...@@ -1373,7 +1388,8 @@ static int mgc_process_recover_log(struct obd_device *obd, ...@@ -1373,7 +1388,8 @@ static int mgc_process_recover_log(struct obd_device *obd,
} }
/* always update the index even though it might have errors with /* always update the index even though it might have errors with
* handling the recover logs */ * handling the recover logs
*/
cfg->cfg_last_idx = res->mcr_offset; cfg->cfg_last_idx = res->mcr_offset;
eof = res->mcr_offset == res->mcr_size; eof = res->mcr_offset == res->mcr_size;
...@@ -1400,7 +1416,8 @@ static int mgc_process_recover_log(struct obd_device *obd, ...@@ -1400,7 +1416,8 @@ static int mgc_process_recover_log(struct obd_device *obd,
mne_swab = !!ptlrpc_rep_need_swab(req); mne_swab = !!ptlrpc_rep_need_swab(req);
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 2, 50, 0) #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 2, 50, 0)
/* This import flag means the server did an extra swab of IR MNE /* This import flag means the server did an extra swab of IR MNE
* records (fixed in LU-1252), reverse it here if needed. LU-1644 */ * records (fixed in LU-1252), reverse it here if needed. LU-1644
*/
if (unlikely(req->rq_import->imp_need_mne_swab)) if (unlikely(req->rq_import->imp_need_mne_swab))
mne_swab = !mne_swab; mne_swab = !mne_swab;
#else #else
...@@ -1489,7 +1506,8 @@ static int mgc_process_cfg_log(struct obd_device *mgc, ...@@ -1489,7 +1506,8 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
/* logname and instance info should be the same, so use our /* logname and instance info should be the same, so use our
* copy of the instance for the update. The cfg_last_idx will * copy of the instance for the update. The cfg_last_idx will
* be updated here. */ * be updated here.
*/
rc = class_config_parse_llog(env, ctxt, cld->cld_logname, rc = class_config_parse_llog(env, ctxt, cld->cld_logname,
&cld->cld_cfg); &cld->cld_cfg);
...@@ -1529,9 +1547,10 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld) ...@@ -1529,9 +1547,10 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
LASSERT(cld); LASSERT(cld);
/* I don't want multiple processes running process_log at once -- /* I don't want multiple processes running process_log at once --
sounds like badness. It actually might be fine, as long as * sounds like badness. It actually might be fine, as long as
we're not trying to update from the same log * we're not trying to update from the same log
simultaneously (in which case we should use a per-log sem.) */ * simultaneously (in which case we should use a per-log sem.)
*/
mutex_lock(&cld->cld_lock); mutex_lock(&cld->cld_lock);
if (cld->cld_stopping) { if (cld->cld_stopping) {
mutex_unlock(&cld->cld_lock); mutex_unlock(&cld->cld_lock);
...@@ -1556,7 +1575,8 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld) ...@@ -1556,7 +1575,8 @@ int mgc_process_log(struct obd_device *mgc, struct config_llog_data *cld)
CDEBUG(D_MGC, "Can't get cfg lock: %d\n", rcl); CDEBUG(D_MGC, "Can't get cfg lock: %d\n", rcl);
/* mark cld_lostlock so that it will requeue /* mark cld_lostlock so that it will requeue
* after MGC becomes available. */ * after MGC becomes available.
*/
cld->cld_lostlock = 1; cld->cld_lostlock = 1;
/* Get extra reference, it will be put in requeue thread */ /* Get extra reference, it will be put in requeue thread */
config_log_get(cld); config_log_get(cld);
...@@ -1642,7 +1662,8 @@ static int mgc_process_config(struct obd_device *obd, u32 len, void *buf) ...@@ -1642,7 +1662,8 @@ static int mgc_process_config(struct obd_device *obd, u32 len, void *buf)
/* COMPAT_146 */ /* COMPAT_146 */
/* FIXME only set this for old logs! Right now this forces /* FIXME only set this for old logs! Right now this forces
us to always skip the "inside markers" check */ * us to always skip the "inside markers" check
*/
cld->cld_cfg.cfg_flags |= CFG_F_COMPAT146; cld->cld_cfg.cfg_flags |= CFG_F_COMPAT146;
rc = mgc_process_log(obd, cld); rc = mgc_process_log(obd, cld);
......
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