Linux block layer
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@meta.com>,
	linux-block@vger.kernel.org, axboe@kernel.dk, dlemoal@kernel.org,
	hans.holmberg@wdc.com
Subject: Re: [PATCHv2 4/4] null_blk: allow byte aligned memory offsets
Date: Thu, 6 Nov 2025 08:24:18 -0700	[thread overview]
Message-ID: <aQy9onvbbLaD_6Gx@kbusch-mbp> (raw)
In-Reply-To: <20251106120131.GD2002@lst.de>

On Thu, Nov 06, 2025 at 01:01:31PM +0100, Christoph Hellwig wrote:
> >  static blk_status_t copy_to_nullb(struct nullb *nullb, void *source,
> > -				  sector_t sector, size_t n, bool is_fua)
> > +				  loff_t pos, size_t n, bool is_fua)
> 
> Is it just me, or is n are way to non-descriptive argument name?  Can
> we fix that if you touch it anyway?
> 
> >  {
> >  	size_t temp, count = 0;
> > -	unsigned int offset;
> >  	struct nullb_page *t_page;
> > +	sector_t sector;
> >  
> >  	while (count < n) {
> 
> And count here should be done of offset.  I really had a bit of a hard
> time following the code due to the naming.
> 
> >  static blk_status_t null_transfer(struct nullb *nullb, struct page *page,
> > -	unsigned int len, unsigned int off, bool is_write, sector_t sector,
> > +	unsigned int len, unsigned int off, bool is_write, loff_t pos,
> >  	bool is_fua)
> 
> .. and the indentation here could use fixing if we touch it anyway.

I actually had an earlier branch with all sorts of little refactors like
what you're mentioning. I don't even like the loops counting upward: we
can remove "count" entirely and loop backwards from "n".

Anyway, it started to look like all those little cleanups were
distracting from the feature, but I can redo the series with more prep
patches to tidy things up.

  reply	other threads:[~2025-11-06 15:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  1:54 [PATCHv2 0/4] null_blk: relaxed memory alignments Keith Busch
2025-11-06  1:54 ` [PATCHv2 1/4] null_blk: simplify copy_from_nullb Keith Busch
2025-11-06  3:51   ` Chaitanya Kulkarni
2025-11-06  4:12   ` Damien Le Moal
2025-11-06 10:48   ` Johannes Thumshirn
2025-11-06 11:51   ` Christoph Hellwig
2025-11-06  1:54 ` [PATCHv2 2/4] null_blk: consistently use blk_status_t Keith Busch
2025-11-06  3:52   ` Chaitanya Kulkarni
2025-11-06  4:13   ` Damien Le Moal
2025-11-06 10:52   ` Johannes Thumshirn
2025-11-06 11:52   ` Christoph Hellwig
2025-11-06  1:54 ` [PATCHv2 3/4] null_blk: single kmap per bio segment Keith Busch
2025-11-06  3:58   ` Chaitanya Kulkarni
2025-11-06  4:26   ` Damien Le Moal
2025-11-06 11:22   ` Johannes Thumshirn
2025-11-06 11:53   ` Christoph Hellwig
2025-11-06  1:54 ` [PATCHv2 4/4] null_blk: allow byte aligned memory offsets Keith Busch
2025-11-06  4:09   ` Chaitanya Kulkarni
2025-11-06  4:31   ` Damien Le Moal
2025-11-06  4:40     ` Keith Busch
2025-11-06 11:23   ` Johannes Thumshirn
2025-11-06 12:01   ` Christoph Hellwig
2025-11-06 15:24     ` Keith Busch [this message]
2025-11-06 15:42       ` Johannes Thumshirn
2025-11-06 15:43         ` hch
2025-11-06  4:11 ` [PATCHv2 0/4] null_blk: relaxed memory alignments Damien Le Moal
2025-11-06  8:35 ` Hans Holmberg
2025-11-06 23:30 ` Jens Axboe

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=aQy9onvbbLaD_6Gx@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=hans.holmberg@wdc.com \
    --cc=hch@lst.de \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox