Re: [PATCH] driver: block: nbd: Replace magic number 9 with SECTOR_SHIFT

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

 



ping?

On Tue, Jul 02, 2019 at 07:55:21PM -0300, Marcos Paulo de Souza wrote:
> ping?
> 
> On Mon, Jun 24, 2019 at 01:09:33PM -0300, Marcos Paulo de Souza wrote:
> > set_capacity expects the disk size in sectors of 512 bytes, and changing
> > the magic number 9 to SECTOR_SHIFT clarifies this intent.
> > 
> > Signed-off-by: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>
> > ---
> >  drivers/block/nbd.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> > index 3a9bca3aa093..fd3bc061c600 100644
> > --- a/drivers/block/nbd.c
> > +++ b/drivers/block/nbd.c
> > @@ -288,7 +288,7 @@ static void nbd_size_update(struct nbd_device *nbd)
> >  	}
> >  	blk_queue_logical_block_size(nbd->disk->queue, config->blksize);
> >  	blk_queue_physical_block_size(nbd->disk->queue, config->blksize);
> > -	set_capacity(nbd->disk, config->bytesize >> 9);
> > +	set_capacity(nbd->disk, config->bytesize >> SECTOR_SHIFT);
> >  	if (bdev) {
> >  		if (bdev->bd_disk) {
> >  			bd_set_size(bdev, config->bytesize);
> > -- 
> > 2.21.0
> > 



[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