From: Nikanth K <nikanth@gmail.com>
To: Philipp Reisner <philipp.reisner@linbit.com>
Cc: linux-kernel@vger.kernel.org, gregkh@suse.de,
Nikanth Karthikesan <knikanth@suse.de>
Subject: Re: [PATCH 03/12] DRBD: bitmap
Date: Wed, 8 Apr 2009 15:46:11 +0530 [thread overview]
Message-ID: <807b3a220904080316s587ce988qdb47f231c8e90fbc@mail.gmail.com> (raw)
In-Reply-To: <1237823287-12734-4-git-send-email-philipp.reisner@linbit.com>
On Mon, Mar 23, 2009 at 9:17 PM, Philipp Reisner
<philipp.reisner@linbit.com> wrote:
> +/* definition of bits in bm_flags */
> +#define BM_LOCKED 0
> +#define BM_MD_IO_ERROR (BITS_PER_LONG-1) /* 31? 63? */
Wonder whether this should be made same for 32-bit as well as 64-bit?
Especially for x86_64 as the machine can become 32-bit to 64-bit or
vice-versa after reboot.
<snip>
> +#if 0
> +#define catch_oob_access_start() do { \
> + do { \
> + if ((bm-p_addr) >= PAGE_SIZE/sizeof(long)) { \
> + printk(KERN_ALERT "drbd_bitmap.c:%u %s: p_addr:%p bm:%p %d\n", \
> + __LINE__ , __func__ , p_addr, bm, (bm-p_addr)); \
> + break; \
> + }
> +#define catch_oob_access_end() \
> + } while (0); } while (0)
> +#else
> +#define catch_oob_access_start() do {
> +#define catch_oob_access_end() } while (0)
> +#endif
> +
Probably should be changed to be based on a config debug option?
<snip>
> +/*
> + * since (b->bm_bits % BITS_PER_LONG) != 0,
> + * this masks out the remaining bits.
> + * Rerturns the number of bits cleared.
> + */
> +STATIC int bm_clear_surplus(struct drbd_bitmap *b)
> +{
> + const unsigned long mask = (1UL << (b->bm_bits & (BITS_PER_LONG-1))) - 1;
Should BM_MD_IO_ERROR be used instead of (BITS_PER_LONG-1)?
Or at least this deserves a macro as it is used in many places.
Thanks
Nikanth
next prev parent reply other threads:[~2009-04-08 10:16 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 15:47 [PATCH 00/12] DRBD: a block device for HA clusters Philipp Reisner
2009-03-23 15:47 ` [PATCH 01/12] DRBD: lru_cache Philipp Reisner
2009-03-23 15:47 ` [PATCH 02/12] DRBD: activity_log Philipp Reisner
2009-03-23 15:47 ` [PATCH 03/12] DRBD: bitmap Philipp Reisner
2009-03-23 15:47 ` [PATCH 04/12] DRBD: request Philipp Reisner
2009-03-23 15:48 ` [PATCH 05/12] DRBD: userspace_interface Philipp Reisner
2009-03-23 15:48 ` [PATCH 06/12] DRBD: internal_data_structures Philipp Reisner
2009-03-23 15:48 ` [PATCH 07/12] DRBD: main Philipp Reisner
2009-03-23 15:48 ` [PATCH 08/12] DRBD: receiver Philipp Reisner
2009-03-23 15:48 ` [PATCH 09/12] DRBD: proc Philipp Reisner
2009-03-23 15:48 ` [PATCH 10/12] DRBD: worker Philipp Reisner
2009-03-23 15:48 ` [PATCH 11/12] DRBD: misc Philipp Reisner
2009-03-23 15:48 ` [PATCH 12/12] DRBD: final Philipp Reisner
2009-04-08 10:17 ` [PATCH 08/12] DRBD: receiver Nikanth K
2009-04-08 15:10 ` Philipp Reisner
2009-03-23 16:51 ` [PATCH 07/12] DRBD: main Alexey Dobriyan
2009-03-23 22:26 ` Philipp Reisner
2009-04-08 10:16 ` [PATCH 04/12] DRBD: request Nikanth K
2009-04-08 10:16 ` Nikanth K [this message]
2009-04-08 15:09 ` [PATCH 03/12] DRBD: bitmap Philipp Reisner
2009-03-24 12:27 ` [PATCH 02/12] DRBD: activity_log Andi Kleen
2009-03-25 10:27 ` Philipp Reisner
2009-03-25 10:46 ` Andi Kleen
2009-03-25 10:57 ` Philipp Reisner
2009-03-23 15:58 ` [PATCH 01/12] DRBD: lru_cache Greg KH
2009-04-08 10:15 ` Nikanth K
2009-04-08 15:09 ` Philipp Reisner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=807b3a220904080316s587ce988qdb47f231c8e90fbc@mail.gmail.com \
--to=nikanth@gmail.com \
--cc=gregkh@suse.de \
--cc=knikanth@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=philipp.reisner@linbit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).