From 1037184c102af79016506f2004fedcdb9eb71954 Mon Sep 17 00:00:00 2001 From: ae Date: Thu, 6 Oct 2016 14:42:06 +0000 Subject: [PATCH] Replace rw_init/rw_destroy with corresponding macros. Obtained from: Yandex LLC --- sys/net/route.c | 4 ++-- sys/net/route_var.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/net/route.c b/sys/net/route.c index d7b3b9613ffe..40227741115f 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -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); } diff --git a/sys/net/route_var.h b/sys/net/route_var.h index a8ef56a51d7e..914bcfe2710f 100644 --- a/sys/net/route_var.h +++ b/sys/net/route_var.h @@ -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)