X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmgc%2Fmgc_request.c;h=ff0b0c134310c7674cfc465ba2d0abd0f6d0e1f6;hp=6617160a35701cb53b00c24e4f2e52cdb3ace868;hb=6722a95fd0416fa6f24140130ea8a1e0df5f1542;hpb=6fbfb01be3c45c60c418ca37280d2378f91bc565;ds=sidebyside diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 6617160..ff0b0c1 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -118,7 +118,7 @@ int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id, int type) EXPORT_SYMBOL(mgc_logname2resid); /********************** config llog list **********************/ -static struct list_head config_llog_list = LIST_HEAD_INIT(config_llog_list); +static LIST_HEAD(config_llog_list); static DEFINE_SPINLOCK(config_list_lock); /* protects config_llog_list */ /* Take a reference to a config log */ @@ -647,15 +647,15 @@ static int mgc_requeue_thread(void *data) l_wait_event(rq_waitq, rq_state & (RQ_STOP | RQ_PRECLEANUP), &lwi); - /* - * iterate & processing through the list. for each cld, process - * its depending sptlrpc cld firstly (if any) and then itself. - * - * it's guaranteed any item in the list must have - * reference > 0; and if cld_lostlock is set, at - * least one reference is taken by the previous enqueue. - */ - cld_prev = NULL; + /* + * iterate & processing through the list. for each cld, process + * its depending sptlrpc cld firstly (if any) and then itself. + * + * it's guaranteed any item in the list must have + * reference > 0; and if cld_lostlock is set, at + * least one reference is taken by the previous enqueue. + */ + cld_prev = NULL; spin_lock(&config_list_lock); rq_state &= ~RQ_PRECLEANUP; @@ -685,9 +685,7 @@ static int mgc_requeue_thread(void *data) config_log_put(cld_prev); /* Wait a bit to see if anyone else needs a requeue */ - lwi = (struct l_wait_info) { 0 }; - l_wait_event(rq_waitq, rq_state & (RQ_NOW | RQ_STOP), - &lwi); + wait_event_idle(rq_waitq, rq_state & (RQ_NOW | RQ_STOP)); spin_lock(&config_list_lock); } @@ -930,7 +928,7 @@ static int mgc_cleanup(struct obd_device *obd) /* COMPAT_146 - old config logs may have added profiles we don't know about */ - if (obd->obd_type->typ_refcnt <= 1) + if (atomic_read(&obd->obd_type->typ_refcnt) <= 1) /* Only for the last mgc */ class_del_profiles(); @@ -2073,7 +2071,7 @@ restart: atomic_read(&mgc->u.cli.cl_mgc_refcount) > 0 && !retry) { struct obd_import *imp; struct l_wait_info lwi; - int secs = cfs_time_seconds(obd_timeout); + long timeout = cfs_time_seconds(obd_timeout); mutex_unlock(&cld->cld_lock); imp = class_exp2cliimp(mgc->u.cli.cl_mgc_mgsexp); @@ -2086,7 +2084,7 @@ restart: * FULL or closed */ ptlrpc_pinger_force(imp); - lwi = LWI_TIMEOUT(secs, NULL, NULL); + lwi = LWI_TIMEOUT(timeout, NULL, NULL); l_wait_event(imp->imp_recovery_waitq, !mgc_import_in_recovery(imp), &lwi);