Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2017 06:30:42 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r314378 - stable/11/sys/dev/iscsi
Message-ID:  <201702280630.v1S6UgLH088778@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Feb 28 06:30:42 2017
New Revision: 314378
URL: https://svnweb.freebsd.org/changeset/base/314378

Log:
  MFC r313739: 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.

Modified:
  stable/11/sys/dev/iscsi/icl_soft.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iscsi/icl_soft.c
==============================================================================
--- stable/11/sys/dev/iscsi/icl_soft.c	Tue Feb 28 06:29:44 2017	(r314377)
+++ stable/11/sys/dev/iscsi/icl_soft.c	Tue Feb 28 06:30:42 2017	(r314378)
@@ -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);



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