Subject: Re: m_defrag() addition
To: Bill Studenmund <wrstuden@NetBSD.org>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 03/02/2005 22:41:28
On Wed, Mar 02, 2005 at 01:05:40PM -0800, Bill Studenmund wrote:
> I can't.

Cool.

> But that's partly the point. You have a routine which does a 
> rather useful manipulation yet you're assuming how it will be used and 
> thus are limiting its use to only that area. You're also assuming that 
> there is no other error cleanup that needs to happen between noticing the 
> error and freeing the chain.

The purpose of subroutine is to encapsulate common behaviour. This
improves code consistency and maintainability. For these reasons,
IMO it's good to make m_defrag() do _exactly_ what we need it to
do at this time.

We can always add more complex interface to the functionality later
if needed, and change m_defrag() to be a macro/inline around it.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We can walk our road together if our goals are all the same;     -=-
-=- We can run alone and free if we pursue a different aim.          -=-