Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2014 14:34:29 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268530 - in head/sys: dev/hatm dev/iscsi_initiator dev/netmap kern netinet netipsec sys
Message-ID:  <201407111434.s6BEYTOe009790@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Jul 11 14:34:29 2014
New Revision: 268530
URL: http://svnweb.freebsd.org/changeset/base/268530

Log:
  Fix style bug: rename the refcount field of m_ext to ext_cnt, to match
  other members.
  
  Sponsored by:	Nginx, Inc.

Modified:
  head/sys/dev/hatm/if_hatm_intr.c
  head/sys/dev/iscsi_initiator/isc_soc.c
  head/sys/dev/netmap/netmap_freebsd.c
  head/sys/dev/netmap/netmap_generic.c
  head/sys/kern/kern_mbuf.c
  head/sys/kern/uipc_mbuf.c
  head/sys/netinet/sctp_os_bsd.h
  head/sys/netipsec/key_debug.c
  head/sys/sys/mbuf.h

Modified: head/sys/dev/hatm/if_hatm_intr.c
==============================================================================
--- head/sys/dev/hatm/if_hatm_intr.c	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/dev/hatm/if_hatm_intr.c	Fri Jul 11 14:34:29 2014	(r268530)
@@ -457,7 +457,7 @@ hatm_rx_buffer(struct hatm_softc *sc, u_
 		c0->hdr.flags &= ~MBUF_CARD;
 
 		if (m != NULL) {
-			m->m_ext.ref_cnt = &c0->hdr.ref_cnt;
+			m->m_ext.ext_cnt = &c0->hdr.ref_cnt;
 			MEXTADD(m, (void *)c0, MBUF0_SIZE,
 			    hatm_mbuf0_free, c0, sc, M_PKTHDR, EXT_EXTREF);
 			m->m_data += MBUF0_OFFSET;
@@ -481,7 +481,7 @@ hatm_rx_buffer(struct hatm_softc *sc, u_
 		c1->hdr.flags &= ~MBUF_CARD;
 
 		if (m != NULL) {
-			m->m_ext.ref_cnt = &c1->hdr.ref_cnt;
+			m->m_ext.ext_cnt = &c1->hdr.ref_cnt;
 			MEXTADD(m, (void *)c1, MBUF1_SIZE,
 			    hatm_mbuf1_free, c1, sc, M_PKTHDR, EXT_EXTREF);
 			m->m_data += MBUF1_OFFSET;

Modified: head/sys/dev/iscsi_initiator/isc_soc.c
==============================================================================
--- head/sys/dev/iscsi_initiator/isc_soc.c	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/dev/iscsi_initiator/isc_soc.c	Fri Jul 11 14:34:29 2014	(r268530)
@@ -133,7 +133,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *p
 	       int l;
 
 	       MGET(md, M_WAITOK, MT_DATA);
-	       md->m_ext.ref_cnt = &ou_refcnt;
+	       md->m_ext.ext_cnt = &ou_refcnt;
 	       l = min(MCLBYTES, len);
 	       debug(4, "setting ext_free(arg=%p len/l=%d/%d)", pq->buf, len, l);
 	       MEXTADD(md, pp->ds_addr + off, l, ext_free, 

Modified: head/sys/dev/netmap/netmap_freebsd.c
==============================================================================
--- head/sys/dev/netmap/netmap_freebsd.c	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/dev/netmap/netmap_freebsd.c	Fri Jul 11 14:34:29 2014	(r268530)
@@ -221,9 +221,9 @@ generic_xmit_frame(struct ifnet *ifp, st
 	 * (and eventually, just reference the netmap buffer)
 	 */
 
-	if (*m->m_ext.ref_cnt != 1) {
+	if (*m->m_ext.ext_cnt != 1) {
 		D("invalid refcnt %d for %p",
-			*m->m_ext.ref_cnt, m);
+			*m->m_ext.ext_cnt, m);
 		panic("in generic_xmit_frame");
 	}
 	// XXX the ext_size check is unnecessary if we link the netmap buf
@@ -238,7 +238,7 @@ generic_xmit_frame(struct ifnet *ifp, st
 	}
 	m->m_len = m->m_pkthdr.len = len;
 	// inc refcount. All ours, we could skip the atomic
-	atomic_fetchadd_int(m->m_ext.ref_cnt, 1);
+	atomic_fetchadd_int(m->m_ext.ext_cnt, 1);
 	m->m_flags |= M_FLOWID;
 	m->m_pkthdr.flowid = ring_nr;
 	m->m_pkthdr.rcvif = ifp; /* used for tx notification */

Modified: head/sys/dev/netmap/netmap_generic.c
==============================================================================
--- head/sys/dev/netmap/netmap_generic.c	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/dev/netmap/netmap_generic.c	Fri Jul 11 14:34:29 2014	(r268530)
@@ -126,8 +126,8 @@ netmap_default_mbuf_destructor(struct mb
 	m->m_ext.ext_type = EXT_PACKET;
 	m->m_ext.ext_free = NULL;
 	m->m_ext.ext_arg1 = m->m_ext.ext_arg2 = NULL;
-	if (*(m->m_ext.ref_cnt) == 0)
-		*(m->m_ext.ref_cnt) = 1;
+	if (*(m->m_ext.ext_cnt) == 0)
+		*(m->m_ext.ext_cnt) = 1;
 	uma_zfree(zone_pack, m);
 } 
 
@@ -141,12 +141,12 @@ netmap_get_mbuf(int len) 
 		m->m_ext.ext_arg2 = m->m_ext.ext_buf; /* save original */
 		m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor;
 		m->m_ext.ext_type = EXT_EXTREF;
-		ND(5, "create m %p refcnt %d", m, *m->m_ext.ref_cnt);
+		ND(5, "create m %p refcnt %d", m, *m->m_ext.ext_cnt);
 	}
 	return m;
 } 
 
-#define GET_MBUF_REFCNT(m)	((m)->m_ext.ref_cnt ? *(m)->m_ext.ref_cnt : -1)
+#define GET_MBUF_REFCNT(m)	((m)->m_ext.ext_cnt ? *(m)->m_ext.ext_cnt : -1)
 
 
 

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/kern/kern_mbuf.c	Fri Jul 11 14:34:29 2014	(r268530)
@@ -476,7 +476,7 @@ mb_dtor_pack(void *mem, int size, void *
 	KASSERT(m->m_ext.ext_arg2 == NULL, ("%s: ext_arg2 != NULL", __func__));
 	KASSERT(m->m_ext.ext_size == MCLBYTES, ("%s: ext_size != MCLBYTES", __func__));
 	KASSERT(m->m_ext.ext_type == EXT_PACKET, ("%s: ext_type != EXT_PACKET", __func__));
-	KASSERT(*m->m_ext.ref_cnt == 1, ("%s: ref_cnt != 1", __func__));
+	KASSERT(*m->m_ext.ext_cnt == 1, ("%s: ext_cnt != 1", __func__));
 #ifdef INVARIANTS
 	trash_dtor(m->m_ext.ext_buf, MCLBYTES, arg);
 #endif
@@ -548,7 +548,7 @@ mb_ctor_clust(void *mem, int size, void 
 		m->m_ext.ext_size = size;
 		m->m_ext.ext_type = type;
 		m->m_ext.ext_flags = 0;
-		m->m_ext.ref_cnt = refcnt;
+		m->m_ext.ext_cnt = refcnt;
 	}
 
 	return (0);

Modified: head/sys/kern/uipc_mbuf.c
==============================================================================
--- head/sys/kern/uipc_mbuf.c	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/kern/uipc_mbuf.c	Fri Jul 11 14:34:29 2014	(r268530)
@@ -261,12 +261,12 @@ m_extadd(struct mbuf *mb, caddr_t buf, u
 	KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__));
 
 	if (type != EXT_EXTREF)
-		mb->m_ext.ref_cnt = uma_zalloc(zone_ext_refcnt, wait);
+		mb->m_ext.ext_cnt = uma_zalloc(zone_ext_refcnt, wait);
 
-	if (mb->m_ext.ref_cnt == NULL)
+	if (mb->m_ext.ext_cnt == NULL)
 		return (ENOMEM);
 
-	*(mb->m_ext.ref_cnt) = 1;
+	*(mb->m_ext.ext_cnt) = 1;
 	mb->m_flags |= (M_EXT | flags);
 	mb->m_ext.ext_buf = buf;
 	mb->m_data = mb->m_ext.ext_buf;
@@ -290,7 +290,7 @@ mb_free_ext(struct mbuf *m)
 	int skipmbuf;
 
 	KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__));
-	KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__));
+	KASSERT(m->m_ext.ext_cnt != NULL, ("%s: ext_cnt not set", __func__));
 
 	/*
 	 * check if the header is embedded in the cluster
@@ -298,12 +298,12 @@ mb_free_ext(struct mbuf *m)
 	skipmbuf = (m->m_flags & M_NOFREE);
 
 	/* Free attached storage if this mbuf is the only reference to it. */
-	if (*(m->m_ext.ref_cnt) == 1 ||
-	    atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) {
+	if (*(m->m_ext.ext_cnt) == 1 ||
+	    atomic_fetchadd_int(m->m_ext.ext_cnt, -1) == 1) {
 		switch (m->m_ext.ext_type) {
 		case EXT_PACKET:	/* The packet zone is special. */
-			if (*(m->m_ext.ref_cnt) == 0)
-				*(m->m_ext.ref_cnt) = 1;
+			if (*(m->m_ext.ext_cnt) == 0)
+				*(m->m_ext.ext_cnt) = 1;
 			uma_zfree(zone_pack, m);
 			return;		/* Job done. */
 		case EXT_CLUSTER:
@@ -322,9 +322,9 @@ mb_free_ext(struct mbuf *m)
 		case EXT_NET_DRV:
 		case EXT_MOD_TYPE:
 		case EXT_DISPOSABLE:
-			*(m->m_ext.ref_cnt) = 0;
+			*(m->m_ext.ext_cnt) = 0;
 			uma_zfree(zone_ext_refcnt, __DEVOLATILE(u_int *,
-				m->m_ext.ref_cnt));
+				m->m_ext.ext_cnt));
 			/* FALLTHROUGH */
 		case EXT_EXTREF:
 			KASSERT(m->m_ext.ext_free != NULL,
@@ -348,7 +348,7 @@ mb_free_ext(struct mbuf *m)
 	m->m_ext.ext_free = NULL;
 	m->m_ext.ext_arg1 = NULL;
 	m->m_ext.ext_arg2 = NULL;
-	m->m_ext.ref_cnt = NULL;
+	m->m_ext.ext_cnt = NULL;
 	m->m_ext.ext_size = 0;
 	m->m_ext.ext_type = 0;
 	m->m_ext.ext_flags = 0;
@@ -364,19 +364,19 @@ static void
 mb_dupcl(struct mbuf *n, struct mbuf *m)
 {
 	KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__));
-	KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__));
+	KASSERT(m->m_ext.ext_cnt != NULL, ("%s: ext_cnt not set", __func__));
 	KASSERT((n->m_flags & M_EXT) == 0, ("%s: M_EXT set", __func__));
 
-	if (*(m->m_ext.ref_cnt) == 1)
-		*(m->m_ext.ref_cnt) += 1;
+	if (*(m->m_ext.ext_cnt) == 1)
+		*(m->m_ext.ext_cnt) += 1;
 	else
-		atomic_add_int(m->m_ext.ref_cnt, 1);
+		atomic_add_int(m->m_ext.ext_cnt, 1);
 	n->m_ext.ext_buf = m->m_ext.ext_buf;
 	n->m_ext.ext_free = m->m_ext.ext_free;
 	n->m_ext.ext_arg1 = m->m_ext.ext_arg1;
 	n->m_ext.ext_arg2 = m->m_ext.ext_arg2;
 	n->m_ext.ext_size = m->m_ext.ext_size;
-	n->m_ext.ref_cnt = m->m_ext.ref_cnt;
+	n->m_ext.ext_cnt = m->m_ext.ext_cnt;
 	n->m_ext.ext_type = m->m_ext.ext_type;
 	n->m_ext.ext_flags = m->m_ext.ext_flags;
 	n->m_flags |= M_EXT;

Modified: head/sys/netinet/sctp_os_bsd.h
==============================================================================
--- head/sys/netinet/sctp_os_bsd.h	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/netinet/sctp_os_bsd.h	Fri Jul 11 14:34:29 2014	(r268530)
@@ -346,7 +346,7 @@ typedef struct callout sctp_os_timer_t;
 /* return the base ext data pointer */
 #define SCTP_BUF_EXTEND_BASE(m) (m->m_ext.ext_buf)
  /* return the refcnt of the data pointer */
-#define SCTP_BUF_EXTEND_REFCNT(m) (*m->m_ext.ref_cnt)
+#define SCTP_BUF_EXTEND_REFCNT(m) (*m->m_ext.ext_cnt)
 /* return any buffer related flags, this is
  * used beyond logging for apple only.
  */

Modified: head/sys/netipsec/key_debug.c
==============================================================================
--- head/sys/netipsec/key_debug.c	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/netipsec/key_debug.c	Fri Jul 11 14:34:29 2014	(r268530)
@@ -663,9 +663,9 @@ kdebug_mbufhdr(m)
 
 	if (m->m_flags & M_EXT) {
 		printf("  m_ext{ ext_buf:%p ext_free:%p "
-		       "ext_size:%u ref_cnt:%p }\n",
+		       "ext_size:%u ext_cnt:%p }\n",
 			m->m_ext.ext_buf, m->m_ext.ext_free,
-			m->m_ext.ext_size, m->m_ext.ref_cnt);
+			m->m_ext.ext_size, m->m_ext.ext_cnt);
 	}
 
 	return;

Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h	Fri Jul 11 13:58:48 2014	(r268529)
+++ head/sys/sys/mbuf.h	Fri Jul 11 14:34:29 2014	(r268530)
@@ -168,7 +168,7 @@ struct pkthdr {
  *	 LP64: 48
  */
 struct m_ext {
-	volatile u_int	*ref_cnt;	/* pointer to ref count info */
+	volatile u_int	*ext_cnt;	/* pointer to ref count info */
 	caddr_t		 ext_buf;	/* start of buffer */
 	uint32_t	 ext_size;	/* size of buffer, for ext_free */
 	uint32_t	 ext_type:8,	/* type of external storage */
@@ -344,14 +344,14 @@ struct mbuf {
 #define	EXT_NET_DRV	252	/* custom ext_buf provided by net driver(s) */
 #define	EXT_MOD_TYPE	253	/* custom module's ext_buf type */
 #define	EXT_DISPOSABLE	254	/* can throw this buffer away w/page flipping */
-#define	EXT_EXTREF	255	/* has externally maintained ref_cnt ptr */
+#define	EXT_EXTREF	255	/* has externally maintained ext_cnt ptr */
 
 /*
  * Flags for external mbuf buffer types.
  * NB: limited to the lower 24 bits.
  */
-#define	EXT_FLAG_EMBREF		0x000001	/* embedded ref_cnt, notyet */
-#define	EXT_FLAG_EXTREF		0x000002	/* external ref_cnt, notyet */
+#define	EXT_FLAG_EMBREF		0x000001	/* embedded ext_cnt, notyet */
+#define	EXT_FLAG_EXTREF		0x000002	/* external ext_cnt, notyet */
 #define	EXT_FLAG_NOFREE		0x000010	/* don't free mbuf to pool, notyet */
 
 #define	EXT_FLAG_VENDOR1	0x010000	/* for vendor-internal use */
@@ -546,7 +546,7 @@ m_extaddref(struct mbuf *m, caddr_t buf,
 	atomic_add_int(ref_cnt, 1);
 	m->m_flags |= M_EXT;
 	m->m_ext.ext_buf = buf;
-	m->m_ext.ref_cnt = ref_cnt;
+	m->m_ext.ext_cnt = ref_cnt;
 	m->m_data = m->m_ext.ext_buf;
 	m->m_ext.ext_size = size;
 	m->m_ext.ext_free = freef;
@@ -730,7 +730,7 @@ m_cljset(struct mbuf *m, void *cl, int t
 	m->m_ext.ext_size = size;
 	m->m_ext.ext_type = type;
 	m->m_ext.ext_flags = 0;
-	m->m_ext.ref_cnt = uma_find_refcnt(zone, cl);
+	m->m_ext.ext_cnt = uma_find_refcnt(zone, cl);
 	m->m_flags |= M_EXT;
 
 }
@@ -779,7 +779,7 @@ m_last(struct mbuf *m)
  */
 #define	M_WRITABLE(m)	(!((m)->m_flags & M_RDONLY) &&			\
 			 (!(((m)->m_flags & M_EXT)) ||			\
-			 (*((m)->m_ext.ref_cnt) == 1)) )		\
+			 (*((m)->m_ext.ext_cnt) == 1)) )		\
 
 /* Check if the supplied mbuf has a packet header, or else panic. */
 #define	M_ASSERTPKTHDR(m)						\



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