Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: mbuf.9
- ===================================================================
- --- mbuf.9 (revision 260701)
- +++ mbuf.9 (working copy)
- @@ -72,8 +72,10 @@
- .Ft struct mbuf *
- .Fn m_get "int how" "int type"
- .Ft struct mbuf *
- -.Fn m_getm "struct mbuf *orig" "int len" "int how" "int type"
- +.Fn m_getm "struct mbuf *m" "int len" "int how" "short type"
- .Ft struct mbuf *
- +.Fn m_getm2 "struct mbuf *m" "int len" "int how" "short type" "int flags"
- +.Ft struct mbuf *
- .Fn m_getcl "int how" "short type" "int flags"
- .Ft struct mbuf *
- .Fn m_getclr "int how" "int type"
- @@ -136,6 +138,8 @@
- .Ft struct mbuf *
- .Fn m_defrag "struct mbuf *m0" "int how"
- .Ft struct mbuf *
- +.Fn m_collapse "struct mbuf *m0" "int how" "int maxfrags"
- +.Ft struct mbuf *
- .Fn m_unshare "struct mbuf *m0" "int how"
- .\"
- .Sh DESCRIPTION
- @@ -538,7 +542,15 @@
- A function version of
- .Fn MGET
- for non-critical paths.
- -.It Fn m_getm orig len how type
- +.It Fn m_getm m len how type
- +A wrapper macro for
- +.Fn m_getm2
- +specifying
- +.Dv M_PKTHDR
- +as the
- +.Fa flags
- +parameter.
- +.It Fn m_getm2 m len how type flags
- Allocate
- .Fa len
- bytes worth of
- @@ -549,7 +561,7 @@
- .Vt mbuf chain
- to the
- .Vt mbuf chain
- -.Fa orig ,
- +.Fa m ,
- if it is
- .No non- Ns Dv NULL .
- If the allocation fails at any point,
- @@ -556,12 +568,12 @@
- free whatever was allocated and return
- .Dv NULL .
- If
- -.Fa orig
- +.Fa m
- is
- .No non- Ns Dv NULL ,
- it will not be freed.
- It is possible to use
- -.Fn m_getm
- +.Fn m_getm2
- to either append
- .Fa len
- bytes to an existing
- @@ -573,7 +585,19 @@
- .Vt mbuf
- and
- .Vt mbuf cluster
- -allocation.
- +allocation. Valid
- +.Fa flags
- +are
- +.Dv M_PKTHDR
- +and
- +.Dv M_EOR
- +but if
- +.Fa m
- +is
- +.No non- Ns Dv NULL
- +then
- +.Dv M_PKTHDR
- +will be ignored.
- .It Fn m_gethdr how type
- A function version of
- .Fn MGETHDR
- @@ -973,8 +997,19 @@
- depending on the caller's preference.
- .Pp
- This function is especially useful in network drivers, where
- -certain long mbuf chains must be shortened before being added
- -to TX descriptor lists.
- +certain long
- +.Vt mbuf chains
- +must be shortened before being added to TX descriptor lists.
- +.It Fn m_collapse m0 how maxfrags
- +Collapse an mbuf chain, returning at most
- +.Fa maxfrags
- +separate
- +.Vt mbufs+clusters .
- +If this is not possible
- +.Dv NULL
- +is returned and the original
- +.Vt mbuf chain
- +is left in its present (potentially modified) state.
- .It Fn m_unshare m0 how
- Create a version of the specified mbuf chain whose
- contents can be safely modified without affecting other users.
Advertisement
Add Comment
Please, Sign In to add comment