]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/uuid.h
uuid: hoist helpers uuid_equal() and uuid_copy() from xfs
[mirror_ubuntu-artful-kernel.git] / include / linux / uuid.h
index c2adb80460953219831de73ba3aac069a88a4e81..777f9cb01eb1bdcf0fa8ffaaee2e88fd1ad67edb 100644 (file)
@@ -35,6 +35,26 @@ typedef struct {
  */
 #define        UUID_STRING_LEN         36
 
+static inline bool guid_equal(const guid_t *u1, const guid_t *u2)
+{
+       return memcmp(u1, u2, sizeof(guid_t)) == 0;
+}
+
+static inline void guid_copy(guid_t *dst, const guid_t *src)
+{
+       memcpy(dst, src, sizeof(guid_t));
+}
+
+static inline bool uuid_equal(const uuid_t *u1, const uuid_t *u2)
+{
+       return memcmp(u1, u2, sizeof(uuid_t)) == 0;
+}
+
+static inline void uuid_copy(uuid_t *dst, const uuid_t *src)
+{
+       memcpy(dst, src, sizeof(uuid_t));
+}
+
 void generate_random_uuid(unsigned char uuid[16]);
 
 extern void guid_gen(guid_t *u);