Date: Thu, 6 Oct 2016 14:42:07 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306760 - head/sys/net Message-ID: <201610061442.u96Eg7WD025328@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Thu Oct 6 14:42:06 2016 New Revision: 306760 URL: https://svnweb.freebsd.org/changeset/base/306760 Log: Replace rw_init/rw_destroy with corresponding macros. Obtained from: Yandex LLC Modified: head/sys/net/route.c head/sys/net/route_var.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Oct 6 13:53:17 2016 (r306759) +++ head/sys/net/route.c Thu Oct 6 14:42:06 2016 (r306760) @@ -352,7 +352,7 @@ rt_table_init(int offset) rh->head.rnh_masks = &rh->rmhead; /* Init locks */ - rw_init(&rh->rib_lock, "rib head lock"); + RIB_LOCK_INIT(rh); /* Finally, set base callbacks */ rh->rnh_addaddr = rn_addroute; @@ -384,7 +384,7 @@ rt_table_destroy(struct rib_head *rh) rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); /* Assume table is already empty */ - rw_destroy(&rh->rib_lock); + RIB_LOCK_DESTROY(rh); free(rh, M_RTABLE); } Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Thu Oct 6 13:53:17 2016 (r306759) +++ head/sys/net/route_var.h Thu Oct 6 14:42:06 2016 (r306760) @@ -48,6 +48,8 @@ struct rib_head { struct radix_mask_head rmhead; /* masks radix head */ }; +#define RIB_LOCK_INIT(rh) rw_init(&(rh)->rib_lock, "rib head lock") +#define RIB_LOCK_DESTROY(rh) rw_destroy(&(rh)->rib_lock) #define RIB_RLOCK(rh) rw_rlock(&(rh)->rib_lock) #define RIB_RUNLOCK(rh) rw_runlock(&(rh)->rib_lock) #define RIB_WLOCK(rh) rw_wlock(&(rh)->rib_lock)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610061442.u96Eg7WD025328>