mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Joe Perches <joe@perches.com>, Juergen Gross <jgross@suse.com>,
	sstabellini@kernel.org, roger.pau@citrix.com, axboe@kernel.dk
Cc: xen-devel@lists.xenproject.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] xen-blkfront: Use the bitmap API when applicable
Date: Mon, 6 Dec 2021 08:31:33 -0500	[thread overview]
Message-ID: <cae0b982-99fb-e808-0ff8-2f8d175b2d6d@oracle.com> (raw)
In-Reply-To: <f9a5bc6c-347b-8243-2784-04199ef879c2@wanadoo.fr>


On 12/4/21 1:57 AM, Christophe JAILLET wrote:
>
> So, maybe adding an "official" 'bitmap_size()' (which is already existing and duplicated in a few places) would ease things.
>
> It would replace the 'nr_minors = BITS_TO_LONGS(end) * BITS_PER_LONG;' and hide the implementation details of the bitmap API.
>
> Something like:
> static __always_inline size_t bitmap_size(unsigned long nr_bits)
> {
>     return BITS_TO_LONGS(nr_bits) * sizeof(long);
> }
>

Yes, I think this would be a useful helper. Should be sizeof(unsigned long) though to keep things consistent.


-boris


      parent reply	other threads:[~2021-12-06 13:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 21:10 Christophe JAILLET
2021-12-02  6:12 ` Juergen Gross
2021-12-02 18:12   ` Christophe JAILLET
2021-12-02 18:16     ` Joe Perches
2021-12-02 19:07       ` Christophe JAILLET
2021-12-03  3:03         ` Joe Perches
2021-12-03 15:54           ` Christophe JAILLET
2021-12-03 16:10             ` Joe Perches
2021-12-03 21:04             ` Boris Ostrovsky
2021-12-04  6:57               ` Christophe JAILLET
2021-12-04  7:05                 ` Joe Perches
2021-12-06 13:31                 ` Boris Ostrovsky [this message]

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=cae0b982-99fb-e808-0ff8-2f8d175b2d6d@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=jgross@suse.com \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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

all inboxes | Powered by JetHome®