Author: bz
Date: Sat Apr  9 14:27:27 2011
New Revision: 220501
URL: http://svn.freebsd.org/changeset/base/220501

Log:
  MFC r218567:
  
    Mfp4 CH=177255:
  
      Resort the CURVNET_SET* macros in the non-VNET_DEBUG case to match
      the call order of the VNET_DEBUG case.
  
      Add the VNET_ASSERT() to the non-VNET_DEBUG case as well so that
      INVARIANTS will still catch problems.
  
      Sponsored by: The FreeBSD Foundation
      Sponsored by: CK Software GmbH
      Reviewed by:  jhb

Modified:
  stable/8/sys/net/vnet.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/vnet.h
==============================================================================
--- stable/8/sys/net/vnet.h     Sat Apr  9 14:25:58 2011        (r220500)
+++ stable/8/sys/net/vnet.h     Sat Apr  9 14:27:27 2011        (r220501)
@@ -154,14 +154,23 @@ void vnet_log_recursion(struct vnet *, c
        curthread->td_vnet_lpush = saved_vnet_lpush;
 #else /* !VNET_DEBUG */
 
-#define        CURVNET_SET(arg)                                                
\
+#define        CURVNET_SET_QUIET(arg)                                          
\
+       VNET_ASSERT((arg) != NULL && (arg)->vnet_magic_n == VNET_MAGIC_N, \
+           ("CURVNET_SET at %s:%d %s() curvnet=%p vnet=%p",            \
+           __FILE__, __LINE__, __func__, curvnet, (arg)));             \
        struct vnet *saved_vnet = curvnet;                              \
        curvnet = arg;  
  
-#define        CURVNET_SET_VERBOSE(arg)        CURVNET_SET(arg)
-#define        CURVNET_SET_QUIET(arg)          CURVNET_SET(arg)
+#define        CURVNET_SET_VERBOSE(arg)                                        
\
+       CURVNET_SET_QUIET(arg)
+
+#define        CURVNET_SET(arg)        CURVNET_SET_VERBOSE(arg)
  
 #define        CURVNET_RESTORE()                                               
\
+       VNET_ASSERT(curvnet != NULL && (saved_vnet == NULL ||           \
+           saved_vnet->vnet_magic_n == VNET_MAGIC_N),                  \
+           ("CURVNET_RESTORE at %s:%d %s() curvnet=%p saved_vnet=%p",  \
+           __FILE__, __LINE__, __func__, curvnet, saved_vnet));        \
        curvnet = saved_vnet;
 #endif /* VNET_DEBUG */
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to