struct list_head *e = rec->rec_active.next;
list_del_init(e);
- if (rec->rec_type == LNET_COOKIE_TYPE_EQ) {
- lnet_eq_free(list_entry(e, struct lnet_eq, eq_list));
-
- } else if (rec->rec_type == LNET_COOKIE_TYPE_MD) {
+ if (rec->rec_type == LNET_COOKIE_TYPE_MD) {
lnet_md_free(list_entry(e, struct lnet_libmd, md_list));
} else { /* NB: Active MEs should be attached on portals */
INIT_LIST_HEAD(&the_lnet.ln_mt_localNIRecovq);
INIT_LIST_HEAD(&the_lnet.ln_mt_peerNIRecovq);
init_waitqueue_head(&the_lnet.ln_dc_waitq);
- LNetInvalidateEQHandle(&the_lnet.ln_mt_eqh);
+ the_lnet.ln_mt_eq = NULL;
init_completion(&the_lnet.ln_started);
rc = lnet_slab_setup();
the_lnet.ln_mt_zombie_rstqs = NULL;
}
- if (!LNetEQHandleIsInvalid(the_lnet.ln_mt_eqh)) {
- rc = LNetEQFree(the_lnet.ln_mt_eqh);
- LNetInvalidateEQHandle(&the_lnet.ln_mt_eqh);
+ if (the_lnet.ln_mt_eq) {
+ rc = LNetEQFree(the_lnet.ln_mt_eq);
+ the_lnet.ln_mt_eq = NULL;
LASSERT(rc == 0);
}
int rc, rc2;
if (set_eq) {
- rc = LNetEQAlloc(0, lnet_ping_target_event_handler,
- &the_lnet.ln_ping_target_eq);
- if (rc != 0) {
+ the_lnet.ln_ping_target_eq =
+ LNetEQAlloc(0, lnet_ping_target_event_handler);
+ if (IS_ERR(the_lnet.ln_ping_target_eq)) {
+ rc = PTR_ERR(the_lnet.ln_ping_target_eq);
CERROR("Can't allocate ping buffer EQ: %d\n", rc);
return rc;
}
if (the_lnet.ln_push_target)
return -EALREADY;
- rc = LNetEQAlloc(0, lnet_push_target_event_handler,
- &the_lnet.ln_push_target_eq);
- if (rc) {
+ the_lnet.ln_push_target_eq =
+ LNetEQAlloc(0, lnet_push_target_event_handler);
+ if (IS_ERR(the_lnet.ln_push_target_eq)) {
+ rc = PTR_ERR(the_lnet.ln_push_target_eq);
CERROR("Can't allocated push target EQ: %d\n", rc);
return rc;
}
if (rc) {
LNetEQFree(the_lnet.ln_push_target_eq);
- LNetInvalidateEQHandle(&the_lnet.ln_push_target_eq);
+ the_lnet.ln_push_target_eq = NULL;
}
return rc;
the_lnet.ln_push_target_nnis = 0;
LNetEQFree(the_lnet.ln_push_target_eq);
- LNetInvalidateEQHandle(&the_lnet.ln_push_target_eq);
+ the_lnet.ln_push_target_eq = NULL;
}
static int
lnet_ping_target_update(pbuf, ping_mdh);
- rc = LNetEQAlloc(0, lnet_mt_event_handler, &the_lnet.ln_mt_eqh);
- if (rc != 0) {
+ the_lnet.ln_mt_eq = LNetEQAlloc(0, lnet_mt_event_handler);
+ if (IS_ERR(the_lnet.ln_mt_eq)) {
+ rc = PTR_ERR(the_lnet.ln_mt_eq);
CERROR("Can't allocate monitor thread EQ: %d\n", rc);
goto err_stop_ping;
}
static int lnet_ping(struct lnet_process_id id, signed long timeout,
struct lnet_process_id __user *ids, int n_ids)
{
- struct lnet_handle_eq eqh;
+ struct lnet_eq *eq;
struct lnet_handle_md mdh;
struct lnet_event event;
struct lnet_md md = { NULL };
return -ENOMEM;
/* NB 2 events max (including any unlink event) */
- rc = LNetEQAlloc(2, LNET_EQ_HANDLER_NONE, &eqh);
- if (rc != 0) {
+ eq = LNetEQAlloc(2, LNET_EQ_HANDLER_NONE);
+ if (IS_ERR(eq)) {
+ rc = PTR_ERR(eq);
CERROR("Can't allocate EQ: %d\n", rc);
goto fail_ping_buffer_decref;
}
md.max_size = 0;
md.options = LNET_MD_TRUNCATE;
md.user_ptr = NULL;
- md.eq_handle = eqh;
+ md.eq_handle = eq;
rc = LNetMDBind(md, LNET_UNLINK, &mdh);
if (rc != 0) {
sigprocmask(SIG_SETMASK, &set, &blocked);
}
- rc2 = LNetEQPoll(&eqh, 1, timeout, &event, &which);
+ rc2 = LNetEQPoll(&eq, 1, timeout, &event, &which);
if (unlinked)
cfs_restore_sigs(blocked);
rc = pbuf->pb_info.pi_nnis;
fail_free_eq:
- rc2 = LNetEQFree(eqh);
+ rc2 = LNetEQFree(eq);
if (rc2 != 0)
CERROR("rc2 %d\n", rc2);
LASSERT(rc2 == 0);