On Thu, 7 Feb 2008 12:09:44 -0800
Mark Fasheh <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to