Guarantees that an mbuf chain contains no more than a given number of mbuf structures.
#include <sys/types.h> #include <sys/errno.h> #include <sys/mbuf.h>
struct mbuf *m_collapse (m, size) struct mbuf *m; int size;
m | Specifies the mbuf chain to be collapsed. |
size | Denotes the maximum number of mbuf structures allowed in the chain. |
The m_collapse kernel service reduces the number of mbuf structures in an mbuf chain to the number of mbuf structures specified by the size parameter. The m_collapse service accomplishes this by copying data into page-sized mbuf structures until the chain is of the desired length. (If required, more than one page-sized mbuf structure is used.)
The m_collapse kernel service can be called from either the process or interrupt environment.
If the chain cannot be collapsed into the number of mbuf structures specified by the size parameter, a value of null is returned and the original chain is deallocated. Upon successful completion, the head of the altered mbuf chain is returned.
The m_collapse kernel service is part of Base Operating System (BOS) Runtime.
I/O Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts.