Whamcloud - gitweb
b=21156,i=liang:
authorisaac <isaac>
Wed, 2 Dec 2009 23:31:16 +0000 (23:31 +0000)
committerisaac <isaac>
Wed, 2 Dec 2009 23:31:16 +0000 (23:31 +0000)
- simple code cleanup.

lnet/klnds/socklnd/socklnd_cb.c

index 2eb32b4..cd30882 100644 (file)
@@ -2273,7 +2273,6 @@ void
 ksocknal_check_peer_timeouts (int idx)
 {
         struct list_head *peers = &ksocknal_data.ksnd_peers[idx];
-        struct list_head *ptmp;
         ksock_peer_t     *peer;
         ksock_conn_t     *conn;
 
@@ -2283,8 +2282,7 @@ ksocknal_check_peer_timeouts (int idx)
          * take a look... */
         cfs_read_lock (&ksocknal_data.ksnd_global_lock);
 
-        list_for_each (ptmp, peers) {
-                peer = list_entry (ptmp, ksock_peer_t, ksnp_list);
+        cfs_list_for_each_entry_typed(peer, peers, ksock_peer_t, ksnp_list) {
                 if (ksocknal_send_keepalive_locked(peer) != 0) {
                         read_unlock (&ksocknal_data.ksnd_global_lock);
                         goto again;
@@ -2315,7 +2313,7 @@ ksocknal_check_peer_timeouts (int idx)
 
                                 ksocknal_peer_addref(peer);
                                 cfs_read_unlock (&ksocknal_data.ksnd_global_lock);
-                                
+
                                 ksocknal_flush_stale_txs(peer);
 
                                 ksocknal_peer_decref(peer);
@@ -2328,7 +2326,7 @@ ksocknal_check_peer_timeouts (int idx)
         cfs_list_for_each_entry_typed(peer, peers, ksock_peer_t, ksnp_list) {
                 ksock_tx_t *tx;
                 int         n = 0;
-                
+
                 cfs_list_for_each_entry_typed(tx, &peer->ksnp_zc_req_list,
                                               ksock_tx_t, tx_zc_list) {
                         if (!cfs_time_aftereq(cfs_time_current(),
@@ -2347,7 +2345,7 @@ ksocknal_check_peer_timeouts (int idx)
                                                tx->tx_deadline));
                 }
         }
-        
+
         cfs_read_unlock (&ksocknal_data.ksnd_global_lock);
 }