summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/bluetooth
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2015-01-06 12:59:37 +0000
committerrwatson <rwatson@FreeBSD.org>2015-01-06 12:59:37 +0000
commit60909669f00c3675bab15d82d9d63aaff61dfafa (patch)
tree8da641e0473d723ab1cc2e5a5772cb1eed6e4d6f /sys/netgraph/bluetooth
parentff9d81bf5b98e98550d75c454cbd7b6d5002e628 (diff)
downloadFreeBSD-src-60909669f00c3675bab15d82d9d63aaff61dfafa.zip
FreeBSD-src-60909669f00c3675bab15d82d9d63aaff61dfafa.tar.gz
In order to reduce use of M_EXT outside of the mbuf allocator and
socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/netgraph/bluetooth')
-rw-r--r--sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c3
-rw-r--r--sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c9
2 files changed, 4 insertions, 8 deletions
diff --git a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
index 9b174bb..d7cff74 100644
--- a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
+++ b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
@@ -814,8 +814,7 @@ bt3c_receive(bt3c_softc_p sc)
break; /* XXX lost of sync */
}
- MCLGET(sc->m, M_NOWAIT);
- if (!(sc->m->m_flags & M_EXT)) {
+ if (!(MCLGET(sc->m, M_NOWAIT))) {
NG_FREE_M(sc->m);
NG_BT3C_ERR(sc->dev, "Could not get cluster\n");
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
index 2488d06..f34c708 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
@@ -816,8 +816,7 @@ ubt_intr_read_callback(struct usb_xfer *xfer, usb_error_t error)
goto submit_next;
}
- MCLGET(m, M_NOWAIT);
- if (!(m->m_flags & M_EXT)) {
+ if (!(MCLGET(m, M_NOWAIT))) {
UBT_STAT_IERROR(sc);
goto submit_next;
}
@@ -916,8 +915,7 @@ ubt_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
goto submit_next;
}
- MCLGET(m, M_NOWAIT);
- if (!(m->m_flags & M_EXT)) {
+ if (!(MCLGET(m, M_NOWAIT))) {
UBT_STAT_IERROR(sc);
goto submit_next;
}
@@ -1126,8 +1124,7 @@ ubt_isoc_read_one_frame(struct usb_xfer *xfer, int frame_no)
return (-1); /* XXX out of sync! */
}
- MCLGET(m, M_NOWAIT);
- if (!(m->m_flags & M_EXT)) {
+ if (!(MCLGET(m, M_NOWAIT))) {
UBT_STAT_IERROR(sc);
NG_FREE_M(m);
return (-1); /* XXX out of sync! */
OpenPOWER on IntegriCloud