[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

m_collapse Kernel Service

Purpose

Guarantees that an mbuf chain contains no more than a given number of mbuf structures.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/mbuf.h>


struct mbuf *m_collapse ( m, size)
struct mbuf *m;
int size;

Parameters

m Specifies the mbuf chain to be collapsed.
size Denotes the maximum number of mbuf structures allowed in the chain.

Description

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.)

Execution Environment

The m_collapse kernel service can be called from either the process or interrupt environment.

Return Values

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.

Related Information

I/O Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]