- 論壇徽章:
- 0
|
本帖最后由 asweisun_shan 于 2011-02-15 15:31 編輯
最新內(nèi)核中,inet_twdr_twcal_tick()中有如下的代碼:- inet_twdr_twcal_tick()
- 446 #ifdef CONFIG_NET_NS
- 447 NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITKILLED);
- 448 #endif
復制代碼 twsk_net()中已經(jīng)針對是否啟用CONFIG_NET_NS,而選擇不同的命名空間。
twsk_net()的定義如下:- 217 static inline
- 218 struct net *twsk_net(const struct inet_timewait_sock *twsk)
- 219 {
- 220 #ifdef CONFIG_NET_NS
- 221 return rcu_dereference_raw(twsk->tw_net); /* protected by locking, */
- 222 /* reference counting, */
- 223 /* initialization, or RCU. */
- 224 #else
- 225 return &init_net;
- 226 #endif
- 227 }
復制代碼 為何CONFIG_NET_NS宏未定義時,不增加LINUX_MIB_TIMEWAITKILLED值。
有人知道這樣實現(xiàn)的目的嗎? |
|