All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>,
	Josef Bacik <josef@toxicpanda.com>, Jens Axboe <axboe@kernel.dk>,
	"open list:NETWORK BLOCK DEVICE (NBD)"
	<linux-block@vger.kernel.org>,
	"open list:NETWORK BLOCK DEVICE (NBD)" <nbd@other.debian.org>,
	marcos.souza.org@gmail.com
Subject: Re: [PATCH] driver: block: nbd: Replace magic number 9 with SECTOR_SHIFT
Date: Tue, 2 Jul 2019 19:55:21 -0300	[thread overview]
Message-ID: <20190702225521.GA16741@continental> (raw)
In-Reply-To: <20190624160933.23148-1-marcos.souza.org@gmail.com>

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@suse.com>
> ---
>  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
> 

  reply	other threads:[~2019-07-03  0:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 16:09 [PATCH] driver: block: nbd: Replace magic number 9 with SECTOR_SHIFT Marcos Paulo de Souza
2019-07-02 22:55 ` Marcos Paulo de Souza [this message]
2019-07-14  4:09   ` Marcos Paulo de Souza

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=20190702225521.GA16741@continental \
    --to=marcos.souza.org@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpdesouza@suse.com \
    --cc=nbd@other.debian.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.