Date: Tue, 14 Feb 2017 18:34:25 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313739 - head/sys/dev/iscsi Message-ID: <201702141834.v1EIYP4q085100@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702141834.v1EIYP4q085100>