LASSERT (tx->tx_type != PTLLND_MSG_TYPE_NOOP);
ptllnd_set_tx_deadline(tx);
- list_add_tail(&tx->tx_list, &peer->plp_txq);
+ cfs_list_add_tail(&tx->tx_list, &peer->plp_txq);
ptllnd_check_sends(peer);
}
LASSERT (peer->plp_closing);
LASSERT (plni->plni_npeers > 0);
- LASSERT (list_empty(&peer->plp_txq));
- LASSERT (list_empty(&peer->plp_noopq));
- LASSERT (list_empty(&peer->plp_activeq));
+ LASSERT (cfs_list_empty(&peer->plp_txq));
+ LASSERT (cfs_list_empty(&peer->plp_noopq));
+ LASSERT (cfs_list_empty(&peer->plp_activeq));
plni->plni_npeers--;
LIBCFS_FREE(peer, sizeof(*peer));
}
void
-ptllnd_abort_txs(ptllnd_ni_t *plni, struct list_head *q)
+ptllnd_abort_txs(ptllnd_ni_t *plni, cfs_list_t *q)
{
- while (!list_empty(q)) {
- ptllnd_tx_t *tx = list_entry(q->next, ptllnd_tx_t, tx_list);
+ while (!cfs_list_empty(q)) {
+ ptllnd_tx_t *tx = cfs_list_entry(q->next, ptllnd_tx_t, tx_list);
tx->tx_status = -ESHUTDOWN;
- list_del(&tx->tx_list);
- list_add_tail(&tx->tx_list, &plni->plni_zombie_txs);
+ cfs_list_del(&tx->tx_list);
+ cfs_list_add_tail(&tx->tx_list, &plni->plni_zombie_txs);
}
}
peer->plp_closing = 1;
- if (!list_empty(&peer->plp_txq) ||
- !list_empty(&peer->plp_noopq) ||
- !list_empty(&peer->plp_activeq) ||
+ if (!cfs_list_empty(&peer->plp_txq) ||
+ !cfs_list_empty(&peer->plp_noopq) ||
+ !cfs_list_empty(&peer->plp_activeq) ||
error != 0) {
CWARN("Closing %s: %d\n", libcfs_id2str(peer->plp_id), error);
if (plni->plni_debug)
ptllnd_abort_txs(plni, &peer->plp_noopq);
ptllnd_abort_txs(plni, &peer->plp_activeq);
- list_del(&peer->plp_list);
+ cfs_list_del(&peer->plp_list);
ptllnd_peer_decref(peer);
}
LASSERT (LNET_NIDNET(id.nid) == LNET_NIDNET(ni->ni_nid));
- list_for_each_entry (plp, &plni->plni_peer_hash[hash], plp_list) {
+ cfs_list_for_each_entry (plp, &plni->plni_peer_hash[hash], plp_list) {
if (plp->plp_id.nid == id.nid &&
plp->plp_id.pid == id.pid) {
ptllnd_peer_addref(plp);
CFS_INIT_LIST_HEAD(&plp->plp_activeq);
ptllnd_peer_addref(plp);
- list_add_tail(&plp->plp_list, &plni->plni_peer_hash[hash]);
+ cfs_list_add_tail(&plp->plp_list, &plni->plni_peer_hash[hash]);
tx = ptllnd_new_tx(plp, PTLLND_MSG_TYPE_HELLO, 0);
if (tx == NULL) {
}
int
-ptllnd_count_q(struct list_head *q)
+ptllnd_count_q(cfs_list_t *q)
{
- struct list_head *e;
- int n = 0;
+ cfs_list_t *e;
+ int n = 0;
- list_for_each(e, q) {
+ cfs_list_for_each(e, q) {
n++;
}
plni->plni_peer_credits + plp->plp_lazy_credits);
CDEBUG(D_WARNING, "txq:\n");
- list_for_each_entry (tx, &plp->plp_txq, tx_list) {
+ cfs_list_for_each_entry (tx, &plp->plp_txq, tx_list) {
ptllnd_debug_tx(tx);
}
CDEBUG(D_WARNING, "noopq:\n");
- list_for_each_entry (tx, &plp->plp_noopq, tx_list) {
+ cfs_list_for_each_entry (tx, &plp->plp_noopq, tx_list) {
ptllnd_debug_tx(tx);
}
CDEBUG(D_WARNING, "activeq:\n");
- list_for_each_entry (tx, &plp->plp_activeq, tx_list) {
+ cfs_list_for_each_entry (tx, &plp->plp_activeq, tx_list) {
ptllnd_debug_tx(tx);
}
CDEBUG(D_WARNING, "zombies:\n");
- list_for_each_entry (tx, &plni->plni_zombie_txs, tx_list) {
+ cfs_list_for_each_entry (tx, &plni->plni_zombie_txs, tx_list) {
if (tx->tx_peer->plp_id.nid == id.nid &&
tx->tx_peer->plp_id.pid == id.pid)
ptllnd_debug_tx(tx);
}
CDEBUG(D_WARNING, "history:\n");
- list_for_each_entry (tx, &plni->plni_tx_history, tx_list) {
+ cfs_list_for_each_entry (tx, &plni->plni_tx_history, tx_list) {
if (tx->tx_peer->plp_id.nid == id.nid &&
tx->tx_peer->plp_id.pid == id.pid)
ptllnd_debug_tx(tx);
int max = plni->plni_max_tx_history;
while (plni->plni_ntx_history > max) {
- ptllnd_tx_t *tx = list_entry(plni->plni_tx_history.next,
- ptllnd_tx_t, tx_list);
- list_del(&tx->tx_list);
+ ptllnd_tx_t *tx = cfs_list_entry(plni->plni_tx_history.next,
+ ptllnd_tx_t, tx_list);
+ cfs_list_del(&tx->tx_list);
ptllnd_peer_decref(tx->tx_peer);
tx->tx_completing = 1;
- if (!list_empty(&tx->tx_list))
- list_del_init(&tx->tx_list);
+ if (!cfs_list_empty(&tx->tx_list))
+ cfs_list_del_init(&tx->tx_list);
if (tx->tx_status != 0) {
if (plni->plni_debug) {
}
plni->plni_ntx_history++;
- list_add_tail(&tx->tx_list, &plni->plni_tx_history);
+ cfs_list_add_tail(&tx->tx_list, &plni->plni_tx_history);
ptllnd_cull_tx_history(plni);
}
if (!peer->plp_sent_hello ||
peer->plp_credits == 0 ||
- !list_empty(&peer->plp_noopq) ||
+ !cfs_list_empty(&peer->plp_noopq) ||
peer->plp_outstanding_credits < PTLLND_CREDIT_HIGHWATER(plni))
return 0;
/* No tx to piggyback NOOP onto or no credit to send a tx */
- return (list_empty(&peer->plp_txq) || peer->plp_credits == 1);
+ return (cfs_list_empty(&peer->plp_txq) || peer->plp_credits == 1);
}
void
libcfs_id2str(peer->plp_id));
} else {
ptllnd_set_tx_deadline(tx);
- list_add_tail(&tx->tx_list, &peer->plp_noopq);
+ cfs_list_add_tail(&tx->tx_list, &peer->plp_noopq);
}
}
for (;;) {
- if (!list_empty(&peer->plp_noopq)) {
+ if (!cfs_list_empty(&peer->plp_noopq)) {
LASSERT (peer->plp_sent_hello);
- tx = list_entry(peer->plp_noopq.next,
- ptllnd_tx_t, tx_list);
- } else if (!list_empty(&peer->plp_txq)) {
- tx = list_entry(peer->plp_txq.next,
- ptllnd_tx_t, tx_list);
+ tx = cfs_list_entry(peer->plp_noopq.next,
+ ptllnd_tx_t, tx_list);
+ } else if (!cfs_list_empty(&peer->plp_txq)) {
+ tx = cfs_list_entry(peer->plp_txq.next,
+ ptllnd_tx_t, tx_list);
} else {
/* nothing to send right now */
break;
/* say HELLO first */
if (!peer->plp_sent_hello) {
- LASSERT (list_empty(&peer->plp_noopq));
+ LASSERT (cfs_list_empty(&peer->plp_noopq));
LASSERT (tx->tx_type == PTLLND_MSG_TYPE_HELLO);
peer->plp_sent_hello = 1;
break;
}
- list_del(&tx->tx_list);
- list_add_tail(&tx->tx_list, &peer->plp_activeq);
+ cfs_list_del(&tx->tx_list);
+ cfs_list_add_tail(&tx->tx_list, &peer->plp_activeq);
CDEBUG(D_NET, "Sending at TX=%p type=%s (%d)\n",tx,
ptllnd_msgtype2str(tx->tx_type),tx->tx_type);
tx->tx_lnetmsg = msg;
ptllnd_set_tx_deadline(tx);
- list_add_tail(&tx->tx_list, &peer->plp_activeq);
+ cfs_list_add_tail(&tx->tx_list, &peer->plp_activeq);
gettimeofday(&tx->tx_bulk_posted, NULL);
if (type == PTLLND_RDMA_READ)
PtlHandleIsEqual(tx->tx_reqmdh, PTL_INVALID_HANDLE))) {
if (error)
tx->tx_status = -EIO;
- list_del(&tx->tx_list);
- list_add_tail(&tx->tx_list, &plni->plni_zombie_txs);
+ cfs_list_del(&tx->tx_list);
+ cfs_list_add_tail(&tx->tx_list, &plni->plni_zombie_txs);
}
}
time_t now = cfs_time_current_sec();
ptllnd_tx_t *tx;
- list_for_each_entry (tx, &peer->plp_txq, tx_list) {
+ cfs_list_for_each_entry (tx, &peer->plp_txq, tx_list) {
if (tx->tx_deadline < now)
return tx;
}
- list_for_each_entry (tx, &peer->plp_noopq, tx_list) {
+ cfs_list_for_each_entry (tx, &peer->plp_noopq, tx_list) {
if (tx->tx_deadline < now)
return tx;
}
- list_for_each_entry (tx, &peer->plp_activeq, tx_list) {
+ cfs_list_for_each_entry (tx, &peer->plp_activeq, tx_list) {
if (tx->tx_deadline < now)
return tx;
}
int chunk = plni->plni_peer_hash_size;
int interval = now - (plni->plni_watchdog_nextt - p);
int i;
- struct list_head *hashlist;
- struct list_head *tmp;
- struct list_head *nxt;
+ cfs_list_t *hashlist;
+ cfs_list_t *tmp;
+ cfs_list_t *nxt;
- /* Time to check for RDMA timeouts on a few more peers:
+ /* Time to check for RDMA timeouts on a few more peers:
* I try to do checks every 'p' seconds on a proportion of the peer
* table and I need to check every connection 'n' times within a
* timeout interval, to ensure I detect a timeout on any connection
for (i = 0; i < chunk; i++) {
hashlist = &plni->plni_peer_hash[plni->plni_watchdog_peeridx];
- list_for_each_safe(tmp, nxt, hashlist) {
- ptllnd_check_peer(list_entry(tmp, ptllnd_peer_t, plp_list));
+ cfs_list_for_each_safe(tmp, nxt, hashlist) {
+ ptllnd_check_peer(cfs_list_entry(tmp, ptllnd_peer_t,
+ plp_list));
}
plni->plni_watchdog_peeridx = (plni->plni_watchdog_peeridx + 1) %
}
}
- while (!list_empty(&plni->plni_zombie_txs)) {
- tx = list_entry(plni->plni_zombie_txs.next,
+ while (!cfs_list_empty(&plni->plni_zombie_txs)) {
+ tx = cfs_list_entry(plni->plni_zombie_txs.next,
ptllnd_tx_t, tx_list);
- list_del_init(&tx->tx_list);
+ cfs_list_del_init(&tx->tx_list);
ptllnd_tx_done(tx);
}