lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cae0b982-99fb-e808-0ff8-2f8d175b2d6d@oracle.com>
Date:   Mon, 6 Dec 2021 08:31:33 -0500
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Joe Perches <joe@...ches.com>, Juergen Gross <jgross@...e.com>,
        sstabellini@...nel.org, roger.pau@...rix.com, axboe@...nel.dk
Cc:     xen-devel@...ts.xenproject.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] xen-blkfront: Use the bitmap API when applicable


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ