lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOQ4uxjSpCgM=RK5jXkuY5HmseQT2EKh_huntvK2ADKBuNqi4A@mail.gmail.com>
Date:   Wed, 10 May 2017 22:15:51 +0300
From:   Amir Goldstein <amir73il@...il.com>
To:     Christoph Hellwig <hch@....de>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Shaohua Li <shli@...nel.org>,
        Dan Williams <dan.j.williams@...el.com>,
        David Howells <dhowells@...hat.com>,
        Steven Whitehouse <swhiteho@...hat.com>,
        Mimi Zohar <zohar@...ux.vnet.ibm.com>,
        linux-xfs <linux-xfs@...r.kernel.org>,
        linux-raid@...r.kernel.org, linux-nvdimm@...ts.01.org,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 03/16] uuid: rename uuid types

On Wed, May 10, 2017 at 9:02 PM, Christoph Hellwig <hch@....de> wrote:
> Our "little endian" UUID really is a Wintel GUID, so rename it and its
> helpers such (guid_t).  The big endian UUID is the only true one, so
> give it the name uuid_t.  The uuid_le and uuid_be names are retained for,
> but will hopefully go away soon.
>
> Also remove the existing typedef in XFS that's now been superceeded by
> the generic type name.
>
> Signed-off-by: Christoph Hellwig <hch@....de>
> [andy: also updated the UUID_LE/UUID_BE macros including fallout]
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
[...]

>
> -static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
> +static inline int guid_cmp(const guid_t u1, const guid_t u2)
>  {
> -       return memcmp(&u1, &u2, sizeof(uuid_le));
> +       return memcmp(&u1, &u2, sizeof(guid_t));
>  }
>
> -static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
> +static inline int uuid_cmp(const uuid_t u1, const uuid_t u2)
>  {
> -       return memcmp(&u1, &u2, sizeof(uuid_be));
> +       return memcmp(&u1, &u2, sizeof(uuid_t));
>  }
>


I think we should use this opportunity to change these to (uuid_t *, uuid_t *)
which is more in line with the rest of the helpers including the new helpers
hoisted from xfs.

[...]

> +/* backwards compatibility, don't use in new code */
> +#define uuid_le_cmp(u1, u2)    guid_cmp(u1, u2)
> +#define uuid_be_cmp(u1, u2)    uuid_cmp(u1, u2)

Therefore:
#define uuid_le_cmp(u1, u2)    guid_cmp(&(u1), &(u2))
#define uuid_be_cmp(u1, u2)    uuid_cmp(&(u1), &(u2))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ