* [PATCH] rbd: remove RBD_DEBUG
@ 2013-06-17 10:15 Paul Bolle
2013-06-18 15:11 ` Sage Weil
0 siblings, 1 reply; 2+ messages in thread
From: Paul Bolle @ 2013-06-17 10:15 UTC (permalink / raw)
To: Yehuda Sadeh, Sage Weil, Alex Elder; +Cc: ceph-devel, linux-kernel
The RBD_DEBUG macro is always defined, so it serves no purpose.
Removing it has the benefit that readers of the code won't be tricked
into thinking that rbd_assert() will compile away because they didn't
define RBD_DEBUG themselves.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
Compile tested only.
drivers/block/rbd.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b8a58178..d3869b4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -44,8 +44,6 @@
#include "rbd_types.h"
-#define RBD_DEBUG /* Activate rbd_assert() calls */
-
/*
* The basic unit of block I/O is a sector. It is interpreted in a
* number of contexts in Linux (blk, bio, genhd), but the default is
@@ -444,7 +442,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
va_end(args);
}
-#ifdef RBD_DEBUG
#define rbd_assert(expr) \
if (unlikely(!(expr))) { \
printk(KERN_ERR "\nAssertion failure in %s() " \
@@ -453,9 +450,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
__func__, __LINE__, #expr); \
BUG(); \
}
-#else /* !RBD_DEBUG */
-# define rbd_assert(expr) ((void) 0)
-#endif /* !RBD_DEBUG */
static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request);
static void rbd_img_parent_read(struct rbd_obj_request *obj_request);
--
1.8.1.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] rbd: remove RBD_DEBUG
2013-06-17 10:15 [PATCH] rbd: remove RBD_DEBUG Paul Bolle
@ 2013-06-18 15:11 ` Sage Weil
0 siblings, 0 replies; 2+ messages in thread
From: Sage Weil @ 2013-06-18 15:11 UTC (permalink / raw)
To: Paul Bolle; +Cc: Yehuda Sadeh, Alex Elder, ceph-devel, linux-kernel
On Mon, 17 Jun 2013, Paul Bolle wrote:
> The RBD_DEBUG macro is always defined, so it serves no purpose.
> Removing it has the benefit that readers of the code won't be tricked
> into thinking that rbd_assert() will compile away because they didn't
> define RBD_DEBUG themselves.
In the future we likely will disable the #define. We may as well leave it
there for now...
>
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> ---
> Compile tested only.
>
> drivers/block/rbd.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index b8a58178..d3869b4 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -44,8 +44,6 @@
>
> #include "rbd_types.h"
>
> -#define RBD_DEBUG /* Activate rbd_assert() calls */
> -
> /*
> * The basic unit of block I/O is a sector. It is interpreted in a
> * number of contexts in Linux (blk, bio, genhd), but the default is
> @@ -444,7 +442,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
> va_end(args);
> }
>
> -#ifdef RBD_DEBUG
> #define rbd_assert(expr) \
> if (unlikely(!(expr))) { \
> printk(KERN_ERR "\nAssertion failure in %s() " \
> @@ -453,9 +450,6 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...)
> __func__, __LINE__, #expr); \
> BUG(); \
> }
> -#else /* !RBD_DEBUG */
> -# define rbd_assert(expr) ((void) 0)
> -#endif /* !RBD_DEBUG */
>
> static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request);
> static void rbd_img_parent_read(struct rbd_obj_request *obj_request);
> --
> 1.8.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-18 15:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-17 10:15 [PATCH] rbd: remove RBD_DEBUG Paul Bolle
2013-06-18 15:11 ` Sage Weil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®