[Drbd-dev] [DRBD-user] [PATCH] drbd: drbd_bitmap: Avoid name collision

Fabio Estevam festevam at gmail.com
Tue Mar 10 17:06:59 CET 2015


On Tue, Mar 10, 2015 at 7:54 AM, Lars Ellenberg
<lars.ellenberg at linbit.com> wrote:

> Apparently there are more than one consumer of "BITS_PER_PAGE".
> The commit that moved the now conflicting definition to pid_namespace.h
> itself already refered to a similar "redefined" warning.
>
> Would it not make more sense to have one such definition next to PAGE_SIZE?
> Or somewhere central, anyways?

What about this instead?

--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
@@ -29,6 +29,7 @@
 #include <linux/string.h>
 #include <linux/drbd.h>
 #include <linux/slab.h>
+#include <linux/pid_namespace.h>
 #include <asm/kmap_types.h>

 #include "drbd_int.h"
@@ -479,8 +480,6 @@ void drbd_bm_cleanup(struct drbd_device *device)
  * this masks out the remaining bits.
  * Returns the number of bits cleared.
  */
-#define BITS_PER_PAGE          (1UL << (PAGE_SHIFT + 3))
-#define BITS_PER_PAGE_MASK     (BITS_PER_PAGE - 1)
 #define BITS_PER_LONG_MASK     (BITS_PER_LONG - 1)
 static int bm_clear_surplus(struct drbd_bitmap *b)
 {


More information about the drbd-dev mailing list