Subject: Re: m_defrag() addition
To: Jason Thorpe <thorpej@shagadelic.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/02/2005 08:58:05
--V0207lvV8h4k8FAm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 02, 2005 at 08:50:07AM -0800, Jason Thorpe wrote:
>=20
> On Mar 1, 2005, at 7:12 PM, Bill Studenmund wrote:
>=20
> Rather than "return the chain", you do want it to return NULL, but=20
> simply not modify the chain.  If you do:

Point taken. I like this idea.

[snip]

> So, I think the way it needs to be done is:
>=20
> 	error =3D m_defrag(&m, ...);
> 	if (error !=3D 0) {
> 		/* m_defrag() failed, m still points to old chain. */
> 	} else {
> 		/* m_defrag() succeeded, m now points to new chain, old=20
> 		chain freed. */
> 	}
>=20
> Sound reasonable?

That would work too. The main thing I had in my head (which is why my=20
terminology got a little sloppy) was that if there's an error, let's just=
=20
leave the original alone.

Take care,

Bill

--V0207lvV8h4k8FAm
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFCJfCdWz+3JHUci9cRAlOBAJ9B1X8WRQK8XLL+UUSmEFghPZ8brgCfV6jB
1w51ZKYEOVlNyPKqs6AQvE0=
=RQ9V
-----END PGP SIGNATURE-----

--V0207lvV8h4k8FAm--