Re: [git patches] ocfs2 update

From: Andrew Morton
Date: Thu Feb 07 2008 - 15:48:31 EST


On Thu, 7 Feb 2008 12:09:44 -0800
Mark Fasheh <mark.fasheh@xxxxxxxxxx> 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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/