Skip to contentSkip to conversation

ceph: move max constant definitions

PATCH In review Alex Elder 2 participants 2 messages Mar 29, 2013 – Apr 3, 2013

Subsystems (3)
lore
Share & tools
lore

Alex Elder

author
#0 lore raw

PATCH 1/1 ceph: move max constant definitions

Move some definitions for max integer values out of the rbd code and into the more central "decode.h" header file. These really belong in a Linux (or libc) header somewhere, but I haven't gotten around to proposing that yet.

This is in preparation for moving some code out of rbd.c and into the osd client.

---
 drivers/block/rbd.c         |    7 -------
 include/linux/ceph/decode.h |    7 +++++++
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/block/rbd.c +0 -7
index d54a045..9c97204 100644
@@ -52,13 +52,6 @@
 #define	SECTOR_SHIFT	9
 #define	SECTOR_SIZE	(1ULL << SECTOR_SHIFT)
 
-/* It might be useful to have these defined elsewhere */
-
-#define	U8_MAX	((u8)	(~0U))
-#define	U16_MAX	((u16)	(~0U))
-#define	U32_MAX	((u32)	(~0U))
-#define	U64_MAX	((u64)	(~0ULL))
-
 #define RBD_DRV_NAME "rbd"
 #define RBD_DRV_NAME_LONG "rbd (rados block device)"
 
include/linux/ceph/decode.h +7 -0
index 360d9d0..689f1df 100644
@@ -8,6 +8,13 @@
 
 #include <linux/ceph/types.h>
 
+/* This seemed to be the easiest place to define these */
+
+#define	U8_MAX	((u8)  (~0U))
+#define	U16_MAX	((u16) (~0U))
+#define	U32_MAX	((u32) (~0U))
+#define	U64_MAX	((u64) (~0ULL))
+
 /*
  * in all cases,
  *   void **p     pointer to position pointer
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 51 lines · Alex Elder

Move some definitions for max integer values out of the rbd code and into the more central "decode.h" header file. These really belong in a Linux (or libc) header somewhere, but I haven't gotten around to proposing that yet.

This is in preparation for moving some code out of rbd.c and into the osd client.

---
  drivers/block/rbd.c         |    7 -------
  include/linux/ceph/decode.h |    7 +++++++
  2 files changed, 7 insertions(+), 7 deletions(-)
drivers/block/rbd.c +0 -7
index d54a045..9c97204 100644
@@ -52,13 +52,6 @@
  #define	SECTOR_SHIFT	9
  #define	SECTOR_SIZE	(1ULL << SECTOR_SHIFT)
 
-/* It might be useful to have these defined elsewhere */
-
-#define	U8_MAX	((u8)	(~0U))
-#define	U16_MAX	((u16)	(~0U))
-#define	U32_MAX	((u32)	(~0U))
-#define	U64_MAX	((u64)	(~0ULL))
-
  #define RBD_DRV_NAME "rbd"
  #define RBD_DRV_NAME_LONG "rbd (rados block device)"
 
include/linux/ceph/decode.h +7 -0
index 360d9d0..689f1df 100644
@@ -8,6 +8,13 @@
 
  #include <linux/ceph/types.h>
 
+/* This seemed to be the easiest place to define these */
+
+#define	U8_MAX	((u8)  (~0U))
+#define	U16_MAX	((u16) (~0U))
+#define	U32_MAX	((u32) (~0U))
+#define	U64_MAX	((u64) (~0ULL))
+
  /*
   * in all cases,
   *   void **p     pointer to position pointer