From 2a6c7f5717f6c64605784466b8d335f496b0979e Mon Sep 17 00:00:00 2001 From: markj Date: Thu, 19 Mar 2015 23:06:45 +0000 Subject: [PATCH] MFC r279896: Document m_collapse(). git-svn-id: svn://svn.freebsd.org/base/stable/9@280269 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- share/man/man9/mbuf.9 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9 index b60107a7a..c1f124abc 100644 --- a/share/man/man9/mbuf.9 +++ b/share/man/man9/mbuf.9 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2012 +.Dd March 11, 2015 .Dt MBUF 9 .Os .\" @@ -136,6 +136,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 @@ -975,6 +977,20 @@ depending on the caller's preference. This function is especially useful in network drivers, where certain long mbuf chains must be shortened before being added to TX descriptor lists. +.It Fn m_collapse m0 how maxfrags +Defragment an mbuf chain, returning a chain of at most +.Fa maxfrags +mbufs and clusters. +If allocation fails or the chain cannot be collapsed as requested, +.Dv NULL +will be returned, with the original chain possibly modified. +As with +.Fn m_defrag , +.Fa how +should be one of +.Dv M_WAITOK +or +.Dv M_NOWAIT . .It Fn m_unshare m0 how Create a version of the specified mbuf chain whose contents can be safely modified without affecting other users. -- 2.45.0