- lp->lp_notifying = 0;
-}
-
-
-static void
-lnet_rtr_addref_locked(lnet_peer_t *lp)
-{
- LASSERT(lp->lp_refcount > 0);
- LASSERT(lp->lp_rtr_refcount >= 0);
-
- /* lnet_net_lock must be exclusively locked */
- lp->lp_rtr_refcount++;
- if (lp->lp_rtr_refcount == 1) {
- cfs_list_t *pos;
-
- /* a simple insertion sort */
- cfs_list_for_each_prev(pos, &the_lnet.ln_routers) {
- lnet_peer_t *rtr = cfs_list_entry(pos, lnet_peer_t,
- lp_rtr_list);
-
- if (rtr->lp_nid < lp->lp_nid)
- break;
- }
-
- cfs_list_add(&lp->lp_rtr_list, pos);
- /* addref for the_lnet.ln_routers */
- lnet_peer_addref_locked(lp);
- the_lnet.ln_routers_version++;
- }
-}
-
-static void
-lnet_rtr_decref_locked(lnet_peer_t *lp)
-{
- LASSERT(lp->lp_refcount > 0);
- LASSERT(lp->lp_rtr_refcount > 0);
-
- /* lnet_net_lock must be exclusively locked */
- lp->lp_rtr_refcount--;
- if (lp->lp_rtr_refcount == 0) {
- LASSERT(cfs_list_empty(&lp->lp_routes));
-
- if (lp->lp_rcd != NULL) {
- cfs_list_add(&lp->lp_rcd->rcd_list,
- &the_lnet.ln_rcd_deathrow);
- lp->lp_rcd = NULL;
- }
-
- cfs_list_del(&lp->lp_rtr_list);
- /* decref for the_lnet.ln_routers */
- lnet_peer_decref_locked(lp);
- the_lnet.ln_routers_version++;
- }
-}
-
-lnet_remotenet_t *
-lnet_find_net_locked (__u32 net)
-{
- lnet_remotenet_t *rnet;
- cfs_list_t *tmp;
- cfs_list_t *rn_list;
-
- LASSERT(!the_lnet.ln_shutdown);
-
- rn_list = lnet_net2rnethash(net);
- cfs_list_for_each(tmp, rn_list) {
- rnet = cfs_list_entry(tmp, lnet_remotenet_t, lrn_list);
-
- if (rnet->lrn_net == net)
- return rnet;