Date: Thu, 13 Sep 2007 01:36:03 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 126351 for review Message-ID: <200709130136.l8D1a3oR014753@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126351 Change 126351 by kmacy@kmacy_home:ethng on 2007/09/13 01:35:09 add shared locking macros declare rtalloc2 which returns with route referenced but unlocked Affected files ... .. //depot/projects/ethng/src/sys/net/route.h#3 edit Differences ... ==== //depot/projects/ethng/src/sys/net/route.h#3 (text+ko) ==== @@ -287,9 +287,12 @@ #ifdef _KERNEL #define RT_LOCK_INIT(_rt) \ - rw_init(&(_rt)->rt_lock, "rtentry") + rw_init_flags(&(_rt)->rt_lock, "rtentry", RW_DUPOK) #define RT_LOCK(_rt) rw_wlock(&(_rt)->rt_lock) #define RT_UNLOCK(_rt) rw_wunlock(&(_rt)->rt_lock) +#define RT_LOCK_SHARED(_rt) rw_rlock(&(_rt)->rt_lock) +#define RT_UNLOCK_SHARED(_rt) rw_runlock(&(_rt)->rt_lock) +#define RT_LOCK_DOWNGRADE(_rt) rw_downgrade(&(_rt)->rt_lock) #define RT_LOCK_DESTROY(_rt) rw_destroy(&(_rt)->rt_lock) #define RT_LOCK_ASSERT(_rt) rw_assert(&(_rt)->rt_lock, RA_LOCKED) @@ -349,6 +352,7 @@ void rtalloc_ign(struct route *ro, u_long ignflags); void rtalloc(struct route *ro); /* XXX deprecated, use rtalloc_ign(ro, 0) */ struct rtentry *rtalloc1(struct sockaddr *, int, u_long); +struct rtentry *rtalloc2(struct sockaddr *, int, u_long); int rtexpunge(struct rtentry *); void rtfree(struct rtentry *); int rtinit(struct ifaddr *, int, int);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709130136.l8D1a3oR014753>