Return-Path: Received: from mout.kundenserver.de ([212.227.126.133]:53636 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295AbdEIKFQ (ORCPT ); Tue, 9 May 2017 06:05:16 -0400 From: Arnd Bergmann To: Ben Hutchings Cc: stable@vger.kernel.org, Lars Ellenberg , Philipp Reisner , Jens Axboe , Arnd Bergmann Subject: [PATCH 3.16-stable 03/14] drbd: avoid redefinition of BITS_PER_PAGE Date: Tue, 9 May 2017 12:04:51 +0200 Message-Id: <20170509100502.1358298-4-arnd@arndb.de> In-Reply-To: <20170509100502.1358298-1-arnd@arndb.de> References: <20170509100502.1358298-1-arnd@arndb.de> Sender: stable-owner@vger.kernel.org List-ID: From: Lars Ellenberg Commit 2630628b2dbc3fc320aafaf84836119e4e3d62f1 upstream. 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 Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe Signed-off-by: Arnd Bergmann --- drivers/block/drbd/drbd_bitmap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c index 1aa29f8fdfe1..7c76f7270bec 100644 --- a/drivers/block/drbd/drbd_bitmap.c +++ b/drivers/block/drbd/drbd_bitmap.c @@ -478,8 +478,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) { -- 2.9.0