From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@meta.com>
Cc: linux-block@vger.kernel.org, hch@lst.de, axboe@kernel.dk,
dlemoal@kernel.org, hans.holmberg@wdc.com,
Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCHv2 4/4] null_blk: allow byte aligned memory offsets
Date: Thu, 6 Nov 2025 13:01:31 +0100 [thread overview]
Message-ID: <20251106120131.GD2002@lst.de> (raw)
In-Reply-To: <20251106015447.1372926-5-kbusch@meta.com>
On Wed, Nov 05, 2025 at 05:54:47PM -0800, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> Allowing byte aligned memory provides a nice testing ground for
> direct-io.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/block/null_blk/main.c | 46 ++++++++++++++++++----------------
> drivers/block/null_blk/zoned.c | 2 +-
> 2 files changed, 25 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index 34346590d4eee..f1e67962ecaeb 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -1130,25 +1130,27 @@ static int null_make_cache_space(struct nullb *nullb, unsigned long n)
> }
>
> 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.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2025-11-06 12:01 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 [this message]
2025-11-06 15:24 ` Keith Busch
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=20251106120131.GD2002@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hans.holmberg@wdc.com \
--cc=kbusch@kernel.org \
--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 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.