ceph: move max constant definitions
authorAlex Elder <elder@inktank.com>
Thu, 14 Mar 2013 01:50:00 +0000 (20:50 -0500)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:17:42 +0000 (21:17 -0700)
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.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c
include/linux/ceph/decode.h

index dea4401..6ed508b 100644 (file)
 #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)"
 
index 360d9d0..689f1df 100644 (file)
@@ -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