svn commit: r313739 - head/sys/dev/iscsi

Alexander Motin mav at FreeBSD.org
Tue Feb 14 18:34:26 UTC 2017


Author: mav
Date: Tue Feb 14 18:34:25 2017
New Revision: 313739
URL: https://svnweb.freebsd.org/changeset/base/313739

Log:
  Directly call m_gethdr() instead of m_getm2() for BHS.
  
  All this code is based on assumption that data will be stored in one piece,
  and since buffer size if known and fixed, it is easier to hardcode it.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/iscsi/icl_soft.c

Modified: head/sys/dev/iscsi/icl_soft.c
==============================================================================
--- head/sys/dev/iscsi/icl_soft.c	Tue Feb 14 18:29:07 2017	(r313738)
+++ head/sys/dev/iscsi/icl_soft.c	Tue Feb 14 18:34:25 2017	(r313739)
@@ -260,8 +260,8 @@ icl_soft_conn_new_pdu(struct icl_conn *i
 	if (ip == NULL)
 		return (NULL);
 
-	ip->ip_bhs_mbuf = m_getm2(NULL, sizeof(struct iscsi_bhs),
-	    flags, MT_DATA, M_PKTHDR);
+	CTASSERT(sizeof(struct iscsi_bhs) <= MHLEN);
+	ip->ip_bhs_mbuf = m_gethdr(flags, MT_DATA);
 	if (ip->ip_bhs_mbuf == NULL) {
 		ICL_WARN("failed to allocate BHS mbuf");
 		icl_pdu_free(ip);


More information about the svn-src-all mailing list