Re: [git patches] ocfs2 update

From: Joel Becker
Date: Thu Feb 07 2008 - 17:31:03 EST


On Thu, Feb 07, 2008 at 01:37:15PM -0800, Mark Fasheh wrote:
> On Thu, Feb 07, 2008 at 12:47:45PM -0800, Andrew Morton wrote:
> > On Thu, 7 Feb 2008 12:09:44 -0800
> > Mark Fasheh <mark.fasheh@xxxxxxxxxx> wrote:
> >
> > > +static int dlm_protocol_compare(struct dlm_protocol_version *existing,
> > > + struct dlm_protocol_version *request)
> >
> > It's somewhat obnoxious that what appears to be a straightforward
> > compare-two-things-and-return-result function will actually modify one of
> > the things which it is allegedly comparing.
>
> Yeah, a better name would probably help with readability. Joel, how about
> dlm_protocol_compare_and_set()?

Even better is to move the update outside the function. What do
we think of the following?