Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Mar 2014 05:09:47 +0000 (UTC)
From:      "George V. Neville-Neil" <gnn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262727 - head/sys/net
Message-ID:  <201403040509.s2459lou017310@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gnn
Date: Tue Mar  4 05:09:46 2014
New Revision: 262727
URL: http://svnweb.freebsd.org/changeset/base/262727

Log:
  Naming consistency fix. The routing code defines
  RADIX_NODE_HEAD_LOCK as grabbing the write lock,
  but RADIX_NODE_HEAD_LOCK_ASSERT as checking the read lock.
  
  Submitted by:	Vijay Singh <vijju.singh at gmail.com>
  MFC after:	1 month

Modified:
  head/sys/net/radix.h
  head/sys/net/route.c

Modified: head/sys/net/radix.h
==============================================================================
--- head/sys/net/radix.h	Tue Mar  4 03:19:36 2014	(r262726)
+++ head/sys/net/radix.h	Tue Mar  4 05:09:46 2014	(r262727)
@@ -149,7 +149,8 @@ struct radix_node_head {
 
 
 #define	RADIX_NODE_HEAD_DESTROY(rnh)	rw_destroy(&(rnh)->rnh_lock)
-#define	RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED)
+#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED)
+#define RADIX_NODE_HEAD_RLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_RLOCKED)
 #define	RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED)
 #endif /* _KERNEL */
 

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Tue Mar  4 03:19:36 2014	(r262726)
+++ head/sys/net/route.c	Tue Mar  4 05:09:46 2014	(r262727)
@@ -381,7 +381,7 @@ rtalloc1_fib(struct sockaddr *dst, int r
 		RADIX_NODE_HEAD_RLOCK(rnh);
 #ifdef INVARIANTS	
 	else
-		RADIX_NODE_HEAD_LOCK_ASSERT(rnh);
+		RADIX_NODE_HEAD_RLOCK_ASSERT(rnh);
 #endif
 	rn = rnh->rnh_matchaddr(dst, rnh);
 	if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
@@ -1000,9 +1000,10 @@ rn_mpath_update(int req, struct rt_addri
 	 * a matching RTAX_GATEWAY.
 	 */
 	struct rtentry *rt, *rto = NULL;
-	register struct radix_node *rn;
+	struct radix_node *rn;
 	int error = 0;
 
+	RADIX_NODE_HEAD_LOCK_ASSERT(rnh);
 	rn = rnh->rnh_lookup(dst, netmask, rnh);
 	if (rn == NULL)
 		return (ESRCH);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403040509.s2459lou017310>