From: Andrew Morton <akpm@linux-foundation.org>
To: Mark Fasheh <mark.fasheh@oracle.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
ocfs2-devel@oss.oracle.com
Subject: Re: [git patches] ocfs2 update
Date: Thu, 7 Feb 2008 12:47:45 -0800 [thread overview]
Message-ID: <20080207124745.4868e108.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080207200944.GQ22671@ca-server1.us.oracle.com>
On Thu, 7 Feb 2008 12:09:44 -0800
Mark Fasheh <mark.fasheh@oracle.com> wrote:
> /*
> - * dlm_register_domain: one-time setup per "domain"
> + * Compare a requested locking protocol version against the current one.
> + *
> + * If the major numbers are different, they are incompatible.
> + * If the current minor is greater than the request, they are incompatible.
> + * If the current minor is less than or equal to the request, they are
> + * compatible, and the requester should run at the current minor version.
> + */
> +static int dlm_protocol_compare(struct dlm_protocol_version *existing,
> + struct dlm_protocol_version *request)
> +{
> + if (existing->pv_major != request->pv_major)
> + return 1;
> +
> + if (existing->pv_minor > request->pv_minor)
> + return 1;
> +
> + if (existing->pv_minor < request->pv_minor)
> + request->pv_minor = existing->pv_minor;
> +
> + return 0;
> +}
> +
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.
Please integrate checkpatch into your processes - this one had a few little
glitches.
next prev parent reply other threads:[~2008-02-07 20:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-07 20:09 [git patches] ocfs2 update Mark Fasheh
2008-02-07 20:47 ` Andrew Morton [this message]
2008-02-07 21:37 ` Mark Fasheh
2008-02-07 22:17 ` Andrew Morton
2008-02-07 22:29 ` Joel Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080207124745.4868e108.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.fasheh@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox