mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Replace rw_init/rw_destroy with corresponding macros.
Obtained from: Yandex LLC
This commit is contained in:
parent
fd3d8ea51a
commit
abe95d87ee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306760
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user