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)
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to