aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iscsi_initiator
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2015-01-05 09:58:32 +0000
committerRobert Watson <rwatson@FreeBSD.org>2015-01-05 09:58:32 +0000
commited6a66ca6c2065bc1fed93e00805676a5d3b981e (patch)
tree6f98bf414ddd5e9772757ca1f6016f218ead95f8 /sys/dev/iscsi_initiator
parentcd470fead8828603c75aaa68a28a90df541c13c2 (diff)
downloadsrc-ed6a66ca6c2065bc1fed93e00805676a5d3b981e.tar.gz
src-ed6a66ca6c2065bc1fed93e00805676a5d3b981e.zip
To ease changes to underlying mbuf structure and the mbuf allocator, reduce
the knowledge of mbuf layout, and in particular constants such as M_EXT, MLEN, MHLEN, and so on, in mbuf consumers by unifying various alignment utility functions (M_ALIGN(), MH_ALIGN(), MEXT_ALIGN() in a single M_ALIGN() macro, implemented by a now-inlined m_align() function: - Move m_align() from uipc_mbuf.c to mbuf.h; mark as __inline. - Reimplement M_ALIGN(), MH_ALIGN(), and MEXT_ALIGN() using m_align(). - Update consumers around the tree to simply use M_ALIGN(). This change eliminates a number of cases where mbuf consumers must be aware of whether or not mbufs returned by the allocator use external storage, but also assumptions about the size of the returned mbuf. This will make it easier to introduce changes in how we use external storage, as well as features such as variable-size mbufs. Differential Revision: https://reviews.freebsd.org/D1436 Reviewed by: glebius, trasz, gnn, bz Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=276692
Diffstat (limited to 'sys/dev/iscsi_initiator')
-rw-r--r--sys/dev/iscsi_initiator/isc_soc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/iscsi_initiator/isc_soc.c b/sys/dev/iscsi_initiator/isc_soc.c
index 625e74b3b981..e77f0700c69e 100644
--- a/sys/dev/iscsi_initiator/isc_soc.c
+++ b/sys/dev/iscsi_initiator/isc_soc.c
@@ -110,7 +110,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq)
| Add any AHS to the iSCSI hdr mbuf
*/
if((mh->m_len + pp->ahs_len) < MHLEN) {
- MH_ALIGN(mh, mh->m_len + pp->ahs_len);
+ M_ALIGN(mh, mh->m_len + pp->ahs_len);
bcopy(&pp->ipdu, mh->m_data, mh->m_len);
bcopy(pp->ahs_addr, mh->m_data + mh->m_len, pp->ahs_len);
mh->m_len += pp->ahs_len;
@@ -119,7 +119,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq)
panic("len AHS=%d too big, not impleneted yet", pp->ahs_len);
}
else {
- MH_ALIGN(mh, mh->m_len);
+ M_ALIGN(mh, mh->m_len);
bcopy(&pp->ipdu, mh->m_data, mh->m_len);
}
mh->m_pkthdr.len = mh->m_len;