hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/uuid.h
....@@ -1,17 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * UUID/GUID definition
34 *
45 * Copyright (C) 2010, 2016 Intel Corp.
56 * Huang Ying <ying.huang@intel.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License version
9
- * 2 as published by the Free Software Foundation;
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
157 */
168 #ifndef _LINUX_UUID_H_
179 #define _LINUX_UUID_H_
....@@ -51,6 +43,16 @@
5143 memcpy(dst, src, sizeof(guid_t));
5244 }
5345
46
+static inline void import_guid(guid_t *dst, const __u8 *src)
47
+{
48
+ memcpy(dst, src, sizeof(guid_t));
49
+}
50
+
51
+static inline void export_guid(__u8 *dst, const guid_t *src)
52
+{
53
+ memcpy(dst, src, sizeof(guid_t));
54
+}
55
+
5456 static inline bool guid_is_null(const guid_t *guid)
5557 {
5658 return guid_equal(guid, &guid_null);
....@@ -66,12 +68,23 @@
6668 memcpy(dst, src, sizeof(uuid_t));
6769 }
6870
71
+static inline void import_uuid(uuid_t *dst, const __u8 *src)
72
+{
73
+ memcpy(dst, src, sizeof(uuid_t));
74
+}
75
+
76
+static inline void export_uuid(__u8 *dst, const uuid_t *src)
77
+{
78
+ memcpy(dst, src, sizeof(uuid_t));
79
+}
80
+
6981 static inline bool uuid_is_null(const uuid_t *uuid)
7082 {
7183 return uuid_equal(uuid, &uuid_null);
7284 }
7385
7486 void generate_random_uuid(unsigned char uuid[16]);
87
+void generate_random_guid(unsigned char guid[16]);
7588
7689 extern void guid_gen(guid_t *u);
7790 extern void uuid_gen(uuid_t *u);
....@@ -85,9 +98,6 @@
8598 int uuid_parse(const char *uuid, uuid_t *u);
8699
87100 /* backwards compatibility, don't use in new code */
88
-#define uuid_le_gen(u) guid_gen(u)
89
-#define uuid_le_to_bin(guid, u) guid_parse(guid, u)
90
-
91101 static inline int uuid_le_cmp(const guid_t u1, const guid_t u2)
92102 {
93103 return memcmp(&u1, &u2, sizeof(guid_t));