Re: [PATCH] null_blk: Use bitmap_zalloc() when applicable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 30, 2021 at 11:28:28AM +0900, Damien Le Moal wrote:
> >  
> > -	tag_size = ALIGN(nq->queue_depth, BITS_PER_LONG) / BITS_PER_LONG;
> > -	nq->tag_map = kcalloc(tag_size, sizeof(unsigned long), GFP_KERNEL);
> > +	nq->tag_map = bitmap_zalloc(nq->queue_depth, GFP_KERNEL);
> >  	if (!nq->tag_map) {
> >  		kfree(nq->cmds);
> >  		return -ENOMEM;
> 
> Before this patch, tag_size would always be a multiple of BITS_PER_LONG.
> Using bitmap_zalloc(), that alignment goes away, but I think this is OK.
> 

It's still going to be a multiple of long.  Bitmaps are always stored
in longs.

regards,
dan carpenter




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux