peer->ibp_nid = nid;
peer->ibp_error = 0;
peer->ibp_last_alive = 0;
- cfs_atomic_set(&peer->ibp_refcount, 1); /* 1 ref for caller */
+ atomic_set(&peer->ibp_refcount, 1); /* 1 ref for caller */
CFS_INIT_LIST_HEAD(&peer->ibp_list); /* not in the peer table yet */
CFS_INIT_LIST_HEAD(&peer->ibp_conns);
LASSERT (net->ibn_shutdown == 0);
/* npeers only grows with the global lock held */
- cfs_atomic_inc(&net->ibn_npeers);
+ atomic_inc(&net->ibn_npeers);
write_unlock_irqrestore(&kiblnd_data.kib_global_lock, flags);
kib_net_t *net = peer->ibp_ni->ni_data;
LASSERT (net != NULL);
- LASSERT (cfs_atomic_read(&peer->ibp_refcount) == 0);
+ LASSERT (atomic_read(&peer->ibp_refcount) == 0);
LASSERT (!kiblnd_peer_active(peer));
LASSERT (peer->ibp_connecting == 0);
LASSERT (peer->ibp_accepting == 0);
* they are destroyed, so we can be assured that _all_ state to do
* with this peer has been cleaned up when its refcount drops to
* zero. */
- cfs_atomic_dec(&net->ibn_npeers);
+ atomic_dec(&net->ibn_npeers);
}
kib_peer_t *
CDEBUG(D_NET, "got peer [%p] -> %s (%d) version: %x\n",
peer, libcfs_nid2str(nid),
- cfs_atomic_read(&peer->ibp_refcount),
+ atomic_read(&peer->ibp_refcount),
peer->ibp_version);
return peer;
}
continue;
*nidp = peer->ibp_nid;
- *count = cfs_atomic_read(&peer->ibp_refcount);
+ *count = atomic_read(&peer->ibp_refcount);
read_unlock_irqrestore(&kiblnd_data.kib_global_lock,
flags);
spin_lock(&conn->ibc_lock);
CDEBUG(D_CONSOLE, "conn[%d] %p [version %x] -> %s: \n",
- cfs_atomic_read(&conn->ibc_refcount), conn,
+ atomic_read(&conn->ibc_refcount), conn,
conn->ibc_version, libcfs_nid2str(conn->ibc_peer->ibp_nid));
CDEBUG(D_CONSOLE, " state %d nposted %d/%d cred %d o_cred %d r_cred %d\n",
conn->ibc_state, conn->ibc_noops_posted,
LIBCFS_FREE(init_qp_attr, sizeof(*init_qp_attr));
/* 1 ref for caller and each rxmsg */
- cfs_atomic_set(&conn->ibc_refcount, 1 + IBLND_RX_MSGS(version));
+ atomic_set(&conn->ibc_refcount, 1 + IBLND_RX_MSGS(version));
conn->ibc_nrx = IBLND_RX_MSGS(version);
/* post receives */
conn->ibc_state = state;
/* 1 more conn */
- cfs_atomic_inc(&net->ibn_nconns);
+ atomic_inc(&net->ibn_nconns);
return conn;
failed_2:
int rc;
LASSERT (!in_interrupt());
- LASSERT (cfs_atomic_read(&conn->ibc_refcount) == 0);
+ LASSERT (atomic_read(&conn->ibc_refcount) == 0);
LASSERT (cfs_list_empty(&conn->ibc_early_rxs));
LASSERT (cfs_list_empty(&conn->ibc_tx_noops));
LASSERT (cfs_list_empty(&conn->ibc_tx_queue));
kiblnd_peer_decref(peer);
rdma_destroy_id(cmid);
- cfs_atomic_dec(&net->ibn_nconns);
+ atomic_dec(&net->ibn_nconns);
}
LIBCFS_FREE(conn, sizeof(*conn));
LASSERT (cfs_list_empty(&kiblnd_data.kib_devs));
CDEBUG(D_MALLOC, "before LND base cleanup: kmem %d\n",
- cfs_atomic_read(&libcfs_kmemory));
+ atomic_read(&libcfs_kmemory));
switch (kiblnd_data.kib_init) {
default:
wake_up_all(&kiblnd_data.kib_failover_waitq);
i = 2;
- while (cfs_atomic_read(&kiblnd_data.kib_nthreads) != 0) {
+ while (atomic_read(&kiblnd_data.kib_nthreads) != 0) {
i++;
CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, /* power of 2? */
"Waiting for %d threads to terminate\n",
- cfs_atomic_read(&kiblnd_data.kib_nthreads));
+ atomic_read(&kiblnd_data.kib_nthreads));
cfs_pause(cfs_time_seconds(1));
}
cfs_percpt_free(kiblnd_data.kib_scheds);
CDEBUG(D_MALLOC, "after LND base cleanup: kmem %d\n",
- cfs_atomic_read(&libcfs_kmemory));
+ atomic_read(&libcfs_kmemory));
kiblnd_data.kib_init = IBLND_INIT_NOTHING;
module_put(THIS_MODULE);
goto out;
CDEBUG(D_MALLOC, "before LND net cleanup: kmem %d\n",
- cfs_atomic_read(&libcfs_kmemory));
+ atomic_read(&libcfs_kmemory));
write_lock_irqsave(g_lock, flags);
net->ibn_shutdown = 1;
/* Wait for all peer state to clean up */
i = 2;
- while (cfs_atomic_read(&net->ibn_npeers) != 0) {
+ while (atomic_read(&net->ibn_npeers) != 0) {
i++;
CDEBUG(((i & (-i)) == i) ? D_WARNING : D_NET, /* 2**n? */
"%s: waiting for %d peers to disconnect\n",
libcfs_nid2str(ni->ni_nid),
- cfs_atomic_read(&net->ibn_npeers));
+ atomic_read(&net->ibn_npeers));
cfs_pause(cfs_time_seconds(1));
}
/* fall through */
case IBLND_INIT_NOTHING:
- LASSERT (cfs_atomic_read(&net->ibn_nconns) == 0);
+ LASSERT (atomic_read(&net->ibn_nconns) == 0);
if (net->ibn_dev != NULL &&
net->ibn_dev->ibd_nnets == 0)
}
CDEBUG(D_MALLOC, "after LND net cleanup: kmem %d\n",
- cfs_atomic_read(&libcfs_kmemory));
+ atomic_read(&libcfs_kmemory));
net->ibn_init = IBLND_INIT_NOTHING;
ni->ni_data = NULL;