Subject: CVS commit: syssrc/sys/sys
To: None <source-changes@netbsd.org>
From: Jason R Thorpe <thorpej@netbsd.org>
List: source-changes
Date: 07/26/2001 20:25:00
Module Name:	syssrc
Committed By:	thorpej
Date:		Thu Jul 26 17:24:59 UTC 2001

Modified Files:
	syssrc/sys/sys: mbuf.h

Log Message:
Add an M_READONLY() macro, which evaluates to true if the mbuf's
data area is not to be written to.  This is the case for mbufs with
external storage which is either a non-cluster or a cluster referenced
by multiple mbufs.

Change M_LEADINGSPACE() and M_TRAILINGSPACE() to use M_READONLY(),
rather than their own testing for M_EXT.  Previously, M_LEADINGSPACE()
treated all M_EXT mbufs as read-only (which causes an extra mbuf to
be needlessly allocated when sending large TCP packets), and
M_TRAILINGSPACE() previously did not treat any external storage as
read-only (could lead to data corruption of external storage buffers!).


To generate a diff of this commit:
cvs rdiff -r1.58 -r1.59 syssrc/sys/sys/mbuf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.