Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-06 Thread Boris Ostrovsky
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

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-03 Thread Joe Perches
On Sat, 2021-12-04 at 07:57 +0100, 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 d

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-03 Thread Christophe JAILLET
Le 03/12/2021 à 22:04, Boris Ostrovsky a écrit : On 12/3/21 10:54 AM, Christophe JAILLET wrote: Le 03/12/2021 à 04:03, Joe Perches a écrit : I get your point now, and I agree with you. Maybe something as what is done in mc-entity.c? Explicitly require more bits (which will be allocated anyway

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-03 Thread Boris Ostrovsky
On 12/3/21 10:54 AM, Christophe JAILLET wrote: Le 03/12/2021 à 04:03, Joe Perches a écrit : On Thu, 2021-12-02 at 20:07 +0100, Christophe JAILLET wrote: Le 02/12/2021 à 19:16, Joe Perches a écrit : On Thu, 2021-12-02 at 19:12 +0100, Christophe JAILLET wrote: Le 02/12/2021 à 07:12, Juergen G

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-03 Thread Joe Perches
On Fri, 2021-12-03 at 16:54 +0100, Christophe JAILLET wrote: > Le 03/12/2021 à 04:03, Joe Perches a écrit : > > On Thu, 2021-12-02 at 20:07 +0100, Christophe JAILLET wrote: > > > Le 02/12/2021 à 19:16, Joe Perches a écrit : > > > > On Thu, 2021-12-02 at 19:12 +0100, Christophe JAILLET wrote: > > >

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-03 Thread Christophe JAILLET
Le 03/12/2021 à 04:03, Joe Perches a écrit : On Thu, 2021-12-02 at 20:07 +0100, Christophe JAILLET wrote: Le 02/12/2021 à 19:16, Joe Perches a écrit : On Thu, 2021-12-02 at 19:12 +0100, Christophe JAILLET wrote: Le 02/12/2021 à 07:12, Juergen Gross a écrit : On 01.12.21 22:10, Christophe JAIL

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-02 Thread Joe Perches
On Thu, 2021-12-02 at 20:07 +0100, Christophe JAILLET wrote: > Le 02/12/2021 à 19:16, Joe Perches a écrit : > > On Thu, 2021-12-02 at 19:12 +0100, Christophe JAILLET wrote: > > > Le 02/12/2021 à 07:12, Juergen Gross a écrit : > > > > On 01.12.21 22:10, Christophe JAILLET wrote: > > > > > Use 'bitma

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-02 Thread Christophe JAILLET
Le 02/12/2021 à 19:16, Joe Perches a écrit : On Thu, 2021-12-02 at 19:12 +0100, Christophe JAILLET wrote: Le 02/12/2021 à 07:12, Juergen Gross a écrit : On 01.12.21 22:10, Christophe JAILLET wrote: Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmeti

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-02 Thread Joe Perches
On Thu, 2021-12-02 at 19:12 +0100, Christophe JAILLET wrote: > Le 02/12/2021 à 07:12, Juergen Gross a écrit : > > On 01.12.21 22:10, Christophe JAILLET wrote: > > > Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid > > > some open-coded arithmetic in allocator arguments. > > >

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-02 Thread Christophe JAILLET
Le 02/12/2021 à 07:12, Juergen Gross a écrit : On 01.12.21 22:10, Christophe JAILLET wrote: Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency

Re: [PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-01 Thread Juergen Gross
On 01.12.21 22:10, Christophe JAILLET wrote: Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Use 'bitmap_copy()' to avoid an explicit 'memc

[PATCH] xen-blkfront: Use the bitmap API when applicable

2021-12-01 Thread Christophe JAILLET
Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Use 'bitmap_copy()' to avoid an explicit 'memcpy()' Signed-off-by: Christophe JAILLET ---