public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Hindborg (Samsung)" <nmi@metaspace.dk>
To: Niklas Cassel <Niklas.Cassel@wdc.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"Hans Holmberg" <Hans.Holmberg@wdc.com>,
	"Matias Bjørling" <Matias.Bjorling@wdc.com>,
	"Minwoo Im" <minwoo.im.dev@gmail.com>,
	"Damien Le Moal" <damien.lemoal@opensource.wdc.com>,
	"Jens Axboe" <axboe@kernel.dk>, "Ming Lei" <ming.lei@redhat.com>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] block: ublk: enable zoned storage support
Date: Wed, 28 Jun 2023 13:51:50 +0200	[thread overview]
Message-ID: <87edlvhkfe.fsf@metaspace.dk> (raw)
In-Reply-To: <ZBQ3sgoN8oX5HXOJ@x1-carbon>


Niklas Cassel <Niklas.Cassel@wdc.com> writes:

> On Thu, Mar 16, 2023 at 03:55:38PM +0100, Andreas Hindborg wrote:
>> From: Andreas Hindborg <a.hindborg@samsung.com>
>
> Hello Andreas,
>
>
> I think that this patch is starting to look very nice!

Thanks!

>
>
<snip>
>> +
>> +int ublk_report_zones(struct gendisk *disk, sector_t sector,
>> +		      unsigned int nr_zones, report_zones_cb cb, void *data)
>> +{
>> +	unsigned int done_zones = 0;
>> +	struct ublk_device *ub = disk->private_data;
>> +	unsigned int zone_size_sectors = disk->queue->limits.chunk_sectors;
>> +	unsigned int first_zone = sector >> ilog2(zone_size_sectors);
>> +	struct blk_zone *buffer;
>> +	size_t buffer_length;
>> +	unsigned int max_zones_per_request;
>
> Nit: I would sort the variables differently.
>
> Perhaps:
>> +	struct ublk_device *ub = disk->private_data;
>> +	unsigned int zone_size_sectors = disk->queue->limits.chunk_sectors;
>> +	unsigned int first_zone = sector >> ilog2(zone_size_sectors);
>> +	unsigned int done_zones = 0;
>> +	unsigned int max_zones_per_request;
>> +	struct blk_zone *buffer;
>> +	size_t buffer_length;
>

Can I ask what is the reasoning behind this? I think they way you
propose looks better, but are there any rules one can follow for this?

Best regards
Andreas

  reply	other threads:[~2023-06-28 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 14:55 [PATCH v3] block: ublk: enable zoned storage support Andreas Hindborg
2023-03-16 15:01 ` Christoph Hellwig
2023-03-17  0:20 ` kernel test robot
2023-03-17  0:51 ` kernel test robot
2023-03-17  9:49 ` Niklas Cassel
2023-06-28 11:51   ` Andreas Hindborg (Samsung) [this message]
2023-06-28 12:06     ` Matias Bjørling

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=87edlvhkfe.fsf@metaspace.dk \
    --to=nmi@metaspace.dk \
    --cc=Hans.Holmberg@wdc.com \
    --cc=Matias.Bjorling@wdc.com \
    --cc=Niklas.Cassel@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=minwoo.im.dev@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox