diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2015-03-20 15:47:22 +0100 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2017-06-13 09:29:19 -0400 |
commit | b9e4b97eb9a0e6e2747166a66a99c4d34b1fd9e8 (patch) | |
tree | c46712e14802c520972ab830cd4d1b587f86510d | |
parent | 1de253cbd35be16b6b0f7d8ef6ed360159f33a1e (diff) |
drbd: avoid redefinition of BITS_PER_PAGE
[ Upstream commit 2630628b2dbc3fc320aafaf84836119e4e3d62f1 ]
Apparently we now implicitly get definitions for BITS_PER_PAGE and
BITS_PER_PAGE_MASK from the pid_namespace.h
Instead of renaming our defines, I chose to define only if not yet
defined, but to double check the value if already defined.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | drivers/block/drbd/drbd_bitmap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 434c77dcc99e..227deb03c52d 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -479,8 +479,14 @@ void drbd_bm_cleanup(struct drbd_device *device) * this masks out the remaining bits. * Returns the number of bits cleared. */ +#ifndef BITS_PER_PAGE #define BITS_PER_PAGE (1UL << (PAGE_SHIFT + 3)) #define BITS_PER_PAGE_MASK (BITS_PER_PAGE - 1) +#else +# if BITS_PER_PAGE != (1UL << (PAGE_SHIFT + 3)) +# error "ambiguous BITS_PER_PAGE" +# endif +#endif #define BITS_PER_LONG_MASK (BITS_PER_LONG - 1) static int bm_clear_surplus(struct drbd_bitmap *b) { |