All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types
@ 2017-05-10 15:56 Andy Shevchenko
  2017-05-10 15:56 ` [PATCH v1 2/3] (to be folded into): uuid: hoist uuid_is_null() helper from libnvdimm Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andy Shevchenko @ 2017-05-10 15:56 UTC (permalink / raw)
  To: Christoph Hellwig, Amir Goldstein, linux-xfs, Dan Williams,
	linux-fsdevel
  Cc: Andy Shevchenko

TBD:
	NTFS ?
	other conflicts?

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 fs/jfs/jfs_logmgr.h       |  4 ++--
 include/linux/efi.h       |  3 +--
 include/uapi/linux/uuid.h | 16 ++++++++--------
 lib/test_uuid.c           | 12 ++++++------
 4 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/fs/jfs/jfs_logmgr.h b/fs/jfs/jfs_logmgr.h
index e38c21598850..0b9efddeb9f5 100644
--- a/fs/jfs/jfs_logmgr.h
+++ b/fs/jfs/jfs_logmgr.h
@@ -19,6 +19,8 @@
 #ifndef	_H_JFS_LOGMGR
 #define _H_JFS_LOGMGR
 
+#include <linux/uuid.h>
+
 #include "jfs_filsys.h"
 #include "jfs_lock.h"
 
@@ -80,8 +82,6 @@ struct logsuper {
 	} active[MAX_ACTIVE];	/* 2048: active file systems list */
 };
 
-#define NULL_UUID "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-
 /* log flag: commit option (see jfs_filsys.h) */
 
 /* log state */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index ec36f42a2add..cbd4d00e62c5 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -50,7 +50,7 @@ typedef void *efi_handle_t;
 typedef uuid_le efi_guid_t;
 
 #define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
-	UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
+	GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
 
 /*
  * Generic EFI table header
@@ -584,7 +584,6 @@ void efi_native_runtime_setup(void);
  * Note that the 'extra space' separates the values at the same place
  * where the UEFI SPEC breaks the line.
  */
-#define NULL_GUID				EFI_GUID(0x00000000, 0x0000, 0x0000,  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
 #define MPS_TABLE_GUID				EFI_GUID(0xeb9d2d2f, 0x2d88, 0x11d3,  0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
 #define ACPI_TABLE_GUID				EFI_GUID(0xeb9d2d30, 0x2d88, 0x11d3,  0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
 #define ACPI_20_TABLE_GUID			EFI_GUID(0x8868e871, 0xe4f1, 0x11d3,  0xbc, 0x22, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81)
diff --git a/include/uapi/linux/uuid.h b/include/uapi/linux/uuid.h
index 1fcf119e9726..1039d2f3e114 100644
--- a/include/uapi/linux/uuid.h
+++ b/include/uapi/linux/uuid.h
@@ -55,27 +55,27 @@ typedef struct {
 	};
 } uuid_t;
 
-#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)		\
+#define GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)			\
 ((guid_t)								\
 {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
    (b) & 0xff, ((b) >> 8) & 0xff,					\
    (c) & 0xff, ((c) >> 8) & 0xff,					\
    (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
 
-#define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)		\
+#define UUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)			\
 ((uuid_t)								\
 {{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
    ((b) >> 8) & 0xff, (b) & 0xff,					\
    ((c) >> 8) & 0xff, (c) & 0xff,					\
    (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
 
-#define NULL_UUID_LE							\
-	UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,	\
-		0x00, 0x00, 0x00, 0x00)
+#define NULL_GUID							\
+	GUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,	\
+	     0x00, 0x00, 0x00, 0x00)
 
-#define NULL_UUID_BE							\
-	UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,	\
-		0x00, 0x00, 0x00, 0x00)
+#define NULL_UUID							\
+	UUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,	\
+	     0x00, 0x00, 0x00, 0x00)
 
 /* backwards compatibility, don't use in new code */
 typedef guid_t uuid_le;
diff --git a/lib/test_uuid.c b/lib/test_uuid.c
index 547d3127a3cf..7e05c1565dcc 100644
--- a/lib/test_uuid.c
+++ b/lib/test_uuid.c
@@ -18,18 +18,18 @@ struct test_uuid_data {
 static const struct test_uuid_data test_uuid_test_data[] = {
 	{
 		.uuid = "c33f4995-3701-450e-9fbf-206a2e98e576",
-		.le = UUID_LE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
-		.be = UUID_BE(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
+		.le = GUID(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
+		.be = UUID(0xc33f4995, 0x3701, 0x450e, 0x9f, 0xbf, 0x20, 0x6a, 0x2e, 0x98, 0xe5, 0x76),
 	},
 	{
 		.uuid = "64b4371c-77c1-48f9-8221-29f054fc023b",
-		.le = UUID_LE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
-		.be = UUID_BE(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
+		.le = GUID(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
+		.be = UUID(0x64b4371c, 0x77c1, 0x48f9, 0x82, 0x21, 0x29, 0xf0, 0x54, 0xfc, 0x02, 0x3b),
 	},
 	{
 		.uuid = "0cb4ddff-a545-4401-9d06-688af53e7f84",
-		.le = UUID_LE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
-		.be = UUID_BE(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
+		.le = GUID(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
+		.be = UUID(0x0cb4ddff, 0xa545, 0x4401, 0x9d, 0x06, 0x68, 0x8a, 0xf5, 0x3e, 0x7f, 0x84),
 	},
 };
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 2/3] (to be folded into): uuid: hoist uuid_is_null() helper from libnvdimm
  2017-05-10 15:56 [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Andy Shevchenko
@ 2017-05-10 15:56 ` Andy Shevchenko
  2017-05-10 17:29   ` Christoph Hellwig
  2017-05-10 15:56 ` [PATCH v1 3/3] (to be folded into): block: remove blk_part_pack_uuid Andy Shevchenko
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2017-05-10 15:56 UTC (permalink / raw)
  To: Christoph Hellwig, Amir Goldstein, linux-xfs, Dan Williams,
	linux-fsdevel
  Cc: Andy Shevchenko

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/uuid.h | 7 ++-----
 lib/uuid.c           | 5 -----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/include/linux/uuid.h b/include/linux/uuid.h
index 2f9bdc88079e..5dcaabc1e28b 100644
--- a/include/linux/uuid.h
+++ b/include/linux/uuid.h
@@ -24,9 +24,6 @@
  */
 #define	UUID_STRING_LEN		36
 
-extern const guid_t guid_null;
-extern const uuid_t uuid_null;
-
 static inline int guid_cmp(const guid_t u1, const guid_t u2)
 {
 	return memcmp(&u1, &u2, sizeof(guid_t));
@@ -44,7 +41,7 @@ static inline void guid_copy(guid_t *dst, const guid_t *src)
 
 static inline bool guid_is_null(guid_t *guid)
 {
-	return guid_equal(guid, &guid_null);
+	return guid_equal(guid, &NULL_GUID);
 }
 
 static inline int uuid_cmp(const uuid_t u1, const uuid_t u2)
@@ -64,7 +61,7 @@ static inline void uuid_copy(uuid_t *dst, const uuid_t *src)
 
 static inline bool uuid_is_null(uuid_t *uuid)
 {
-	return uuid_equal(uuid, &uuid_null);
+	return uuid_equal(uuid, &NULL_UUID);
 }
 
 void generate_random_uuid(unsigned char uuid[16]);
diff --git a/lib/uuid.c b/lib/uuid.c
index 25145bfb0eaa..003bf6823003 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -21,11 +21,6 @@
 #include <linux/uuid.h>
 #include <linux/random.h>
 
-const guid_t guid_null;
-EXPORT_SYMBOL(guid_null);
-const uuid_t uuid_null;
-EXPORT_SYMBOL(uuid_null);
-
 const u8 guid_index[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15};
 const u8 uuid_index[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 3/3] (to be folded into): block: remove blk_part_pack_uuid
  2017-05-10 15:56 [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Andy Shevchenko
  2017-05-10 15:56 ` [PATCH v1 2/3] (to be folded into): uuid: hoist uuid_is_null() helper from libnvdimm Andy Shevchenko
@ 2017-05-10 15:56 ` Andy Shevchenko
  2017-05-10 17:31   ` Christoph Hellwig
  2017-05-10 17:34 ` [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Christoph Hellwig
  2017-05-11  7:56 ` Christoph Hellwig
  3 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2017-05-10 15:56 UTC (permalink / raw)
  To: Christoph Hellwig, Amir Goldstein, linux-xfs, Dan Williams,
	linux-fsdevel
  Cc: Andy Shevchenko

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 security/integrity/ima/ima_policy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index 626a26d98ffd..659dbcc83d2f 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -716,8 +716,9 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
 				break;
 			}
 
-			uuid_to_bin(args[0].from, &entry->fsuuid);
-			entry->flags |= IMA_FSUUID;
+			result = uuid_to_bin(args[0].from, &entry->fsuuid);
+			if (!result)
+				entry->flags |= IMA_FSUUID;
 			break;
 		case Opt_uid_gt:
 		case Opt_euid_gt:
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 2/3] (to be folded into): uuid: hoist uuid_is_null() helper from libnvdimm
  2017-05-10 15:56 ` [PATCH v1 2/3] (to be folded into): uuid: hoist uuid_is_null() helper from libnvdimm Andy Shevchenko
@ 2017-05-10 17:29   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2017-05-10 17:29 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Christoph Hellwig, Amir Goldstein, linux-xfs, Dan Williams,
	linux-fsdevel

>  static inline bool guid_is_null(guid_t *guid)
>  {
> -	return guid_equal(guid, &guid_null);
> +	return guid_equal(guid, &NULL_GUID);

Given that NULL_UUID/GUID are macros I wouldn't expect this to work,
and in fact the compiler throws pages of warnings at me with this
change..

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 3/3] (to be folded into): block: remove blk_part_pack_uuid
  2017-05-10 15:56 ` [PATCH v1 3/3] (to be folded into): block: remove blk_part_pack_uuid Andy Shevchenko
@ 2017-05-10 17:31   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2017-05-10 17:31 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Christoph Hellwig, Amir Goldstein, linux-xfs, Dan Williams,
	linux-fsdevel

Thanks, folded in.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types
  2017-05-10 15:56 [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Andy Shevchenko
  2017-05-10 15:56 ` [PATCH v1 2/3] (to be folded into): uuid: hoist uuid_is_null() helper from libnvdimm Andy Shevchenko
  2017-05-10 15:56 ` [PATCH v1 3/3] (to be folded into): block: remove blk_part_pack_uuid Andy Shevchenko
@ 2017-05-10 17:34 ` Christoph Hellwig
  2017-05-11  7:56 ` Christoph Hellwig
  3 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2017-05-10 17:34 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Christoph Hellwig, Amir Goldstein, linux-xfs, Dan Williams,
	linux-fsdevel

Thanks, folded.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types
  2017-05-10 15:56 [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Andy Shevchenko
                   ` (2 preceding siblings ...)
  2017-05-10 17:34 ` [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Christoph Hellwig
@ 2017-05-11  7:56 ` Christoph Hellwig
  3 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2017-05-11  7:56 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Christoph Hellwig, Amir Goldstein, linux-xfs, Dan Williams,
	linux-fsdevel

I had to revert adding the NULL_UUID/GID defines due to too many
conflicts.  But in the end we shouldn't need them - we get uuid/guid_null
a little later so we should be just fine.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-11  7:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 15:56 [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Andy Shevchenko
2017-05-10 15:56 ` [PATCH v1 2/3] (to be folded into): uuid: hoist uuid_is_null() helper from libnvdimm Andy Shevchenko
2017-05-10 17:29   ` Christoph Hellwig
2017-05-10 15:56 ` [PATCH v1 3/3] (to be folded into): block: remove blk_part_pack_uuid Andy Shevchenko
2017-05-10 17:31   ` Christoph Hellwig
2017-05-10 17:34 ` [PATCH v1 1/3] (to be split and folded into): uuid: rename uuid types Christoph Hellwig
2017-05-11  7:56 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.