NetBSD/sys
ozaki-r 9eae87d0c8 Reform use of rt_refcnt
rt_refcnt of rtentry was used in bad manners, for example, direct rt_refcnt++
and rt_refcnt-- outside route.c, "rt->rt_refcnt++; rtfree(rt);" idiom, and
touching rt after rt->rt_refcnt--.

These abuses seem to be needed because rt_refcnt manages only references
between rtentry and doesn't take care of references during packet processing
(IOW references from local variables). In order to reduce the above abuses,
the latter cases should be counted by rt_refcnt as well as the former cases.

This change improves consistency of use of rt_refcnt:
- rtentry is always accessed with rt_refcnt incremented
- rtentry's rt_refcnt is decremented after use (rtfree is always used instead
  of rt_refcnt--)
- functions returning rtentry increment its rt_refcnt (and caller rtfree it)

Note that rt_refcnt prevents rtentry from being freed but doesn't prevent
rtentry from being updated. Toward MP-safe, we need to provide another
protection for rtentry, e.g., locks. (Or introduce a better data structure
allowing concurrent readers during updates.)
2015-07-17 02:21:08 +00:00
..
altq
arch Uncoment options IPSEC, as requested by Gary Duzan in PR port-amd64/50052 2015-07-16 15:43:10 +00:00
coda Remove miscfs/syncfs and 2015-05-06 15:57:07 +00:00
compat Use the right type in sizeof() for copyin() in adjtime 2015-07-12 14:06:52 +00:00
conf Create a new sysv_ipc module to contain the SYSVSHM, SYSVSEM, and 2015-05-13 02:06:25 +00:00
crypto More rnd.h user cleanup. 2015-04-13 22:43:41 +00:00
ddb Add support for 'q' qualifier for 64-bit values on examine and write. 2015-06-06 22:06:05 +00:00
dev Disambiguate debug message. 2015-07-16 15:01:04 +00:00
dist/pf <sys/rnd.h> not needed for pf_norm.c. 2015-04-13 16:35:33 +00:00
external fix Xorg coredumps that have started happening recently. 2015-06-25 16:01:20 +00:00
fs This enum is likely to be made unsigned by the compiler, so the assertion 2015-07-07 09:30:24 +00:00
gdbscripts
ipkdb
kern Operations getnewvnode() and ungetnewvnode() have been replaced with vcache. 2015-07-12 08:11:27 +00:00
lib If the platform support popcount as a __builtin, use that in preference 2015-05-29 19:38:59 +00:00
miscfs Unfortunately MFS uses v_data of its anonymous device vnode so 2015-07-01 08:13:52 +00:00
modules Don't build compat_netbsd32 if mips64 && building mips-n32 2015-07-09 14:41:30 +00:00
net Reform use of rt_refcnt 2015-07-17 02:21:08 +00:00
net80211
netatalk make connect syscall use sockaddr_big and modify pr_{send,connect} 2015-05-02 17:18:03 +00:00
netbt make connect syscall use sockaddr_big and modify pr_{send,connect} 2015-05-02 17:18:03 +00:00
netinet Reform use of rt_refcnt 2015-07-17 02:21:08 +00:00
netinet6 Reform use of rt_refcnt 2015-07-17 02:21:08 +00:00
netipsec make connect syscall use sockaddr_big and modify pr_{send,connect} 2015-05-02 17:18:03 +00:00
netisdn
netkey
netmpls make connect syscall use sockaddr_big and modify pr_{send,connect} 2015-05-02 17:18:03 +00:00
netnatm make connect syscall use sockaddr_big and modify pr_{send,connect} 2015-05-02 17:18:03 +00:00
netsmb Remove leftover IPX-related stuffs 2015-05-25 08:29:01 +00:00
nfs Fix soft NFS force unmount 2015-07-15 03:28:55 +00:00
opencrypto
rump Add uname to rump sources 2015-07-07 12:40:13 +00:00
secmodel
stand
sys Operations getnewvnode() and ungetnewvnode() have been replaced with vcache. 2015-07-12 08:11:27 +00:00
ufs Don't cast the return value of malloc. 2015-07-16 08:31:45 +00:00
uvm Use %p, %#xl etc. for pointers and addresses. 2015-06-22 06:24:17 +00:00
Makefile