Page MenuHomeFreeBSD

D60688.id189684.diff
No OneTemporary

D60688.id189684.diff

diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -925,7 +925,7 @@
* contiguous region in an attempt to avoid being called next time.
*/
struct mbuf *
-m_pullup(struct mbuf *n, int len)
+__m_pullup(struct mbuf *n, int len)
{
struct mbuf *m;
int count;
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -862,7 +862,7 @@
struct mbuf *m_prepend(struct mbuf *, int, int);
void m_print(const struct mbuf *, int);
struct mbuf *m_pulldown(struct mbuf *, int, int, int *);
-struct mbuf *m_pullup(struct mbuf *, int);
+struct mbuf *__m_pullup(struct mbuf *, int);
int m_sanity(struct mbuf *, int);
struct mbuf *m_split(struct mbuf *, int, int);
struct mbuf *m_uiotombuf(struct uio *, int, int, int, int);
@@ -877,6 +877,15 @@
void m_rcvif_serialize(struct mbuf *);
struct ifnet *m_rcvif_restore(struct mbuf *);
+static __inline struct mbuf *
+m_pullup(struct mbuf *m, int len)
+{
+ if (__predict_false(m->m_len < len))
+ return (__m_pullup(m, len));
+ else
+ return (m);
+}
+
static __inline int
m_gettype(int size)
{

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 14, 1:02 AM (6 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40778754
Default Alt Text
D60688.id189684.diff (1 KB)

Event Timeline