Subject: Re: M_READONLY
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-net
Date: 09/20/2004 11:43:11
--Apple-Mail-3--713009565
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


On Sep 20, 2004, at 7:46 AM, YAMAMOTO Takashi wrote:

> hi,
>
> i'd like to change M_READONLY like the following.
> there's no point to protect external storage if it isn't shared.
> eg. receive buffers for jumbo frame.

How would this work e.g. with a buf loaned to an mbuf ... I don't think 
you want to scribble over that buf, right?

>
> YAMAMOTO Takashi
>
> Index: mbuf.h
> ===================================================================
> --- mbuf.h	(revision 878)
> +++ mbuf.h	(working copy)
> @@ -636,12 +636,11 @@ do {									\
>
>  /*
>   * Determine if an mbuf's data area is read-only.  This is true
> - * for non-cluster external storage and for clusters that are
> - * being referenced by more than one mbuf.
> + * if external storage is read-only mapped or referenced by more than 
> one mbuf.
>   */
>  #define	M_READONLY(m)							\
>  	(((m)->m_flags & M_EXT) != 0 &&					\
> -	  (((m)->m_flags & M_CLUSTER) == 0 || MCLISREFERENCED(m)))
> +	  (((m)->m_flags & M_EXT_ROMAP) != 0 || MCLISREFERENCED(m)))
>
>  /*
>   * Determine if an mbuf's data area is read-only at the MMU.
>
         -- Jason R. Thorpe <thorpej@wasabisystems.com>


--Apple-Mail-3--713009565
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFBTyS+OpVKkaBm8XkRAqgIAKCJmsCg3OSxfPFdXzTFFW6DLQCUaQCeMIAc
CTEk6iSXPImJCfc5HkA7jhw=
=E5Of
-----END PGP SIGNATURE-----

--Apple-Mail-3--713009565--