]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Move portions of data structure initialization from if_attach() to
authorRobert Watson <rwatson@FreeBSD.org>
Thu, 23 Apr 2009 10:59:40 +0000 (10:59 +0000)
committerRobert Watson <rwatson@FreeBSD.org>
Thu, 23 Apr 2009 10:59:40 +0000 (10:59 +0000)
commitd6f157ea9a4f2578eb57a9ac1194985f5ba02bbb
treeadd4802821083cfeb421bf310a555a943e1a5c29
parent242a8e72ebef3b1925f92504c0b9bdda013f0fe9
Move portions of data structure initialization from if_attach() to
if_alloc(), and portions of data structure destruction from if_detach()
to if_free().  These changes leave more of the struct ifnet in a
safe-to-access condition between alloc and attach, and between detach
and free, and focus on attach/detach as stack usage events rather than
data structure initialization.

Affected fields include the linkstate task queue, if_afdata lock,
address lists, kqueue state, and MAC labels.  ifq_attach() ifq_detach()
are not moved as ifq_attach() may use a queue length set by the device
driver between if_alloc() and if_attach().

MFC after: 3 weeks
sys/net/if.c