From: Keith Busch <kbusch@meta.com>
To: <linux-block@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Cc: <snitzer@kernel.org>, <axboe@kernel.dk>, <dw@davidwei.uk>,
<brauner@kernel.org>, Keith Busch <kbusch@kernel.org>
Subject: [PATCH 6/7] blk-integrity: use simpler alignment check
Date: Fri, 1 Aug 2025 16:47:35 -0700 [thread overview]
Message-ID: <20250801234736.1913170-7-kbusch@meta.com> (raw)
In-Reply-To: <20250801234736.1913170-1-kbusch@meta.com>
From: Keith Busch <kbusch@kernel.org>
We're checking length and addresses against the same alignment value, so
use the more simple iterator check.
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
block/bio-integrity.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 6b077ca937f6b..6d069a49b4aad 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -262,7 +262,6 @@ static unsigned int bvec_from_pages(struct bio_vec *bvec, struct page **pages,
int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter)
{
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
- unsigned int align = blk_lim_dma_alignment_and_pad(&q->limits);
struct page *stack_pages[UIO_FASTIOV], **pages = stack_pages;
struct bio_vec stack_vec[UIO_FASTIOV], *bvec = stack_vec;
size_t offset, bytes = iter->count;
@@ -285,7 +284,8 @@ int bio_integrity_map_user(struct bio *bio, struct iov_iter *iter)
pages = NULL;
}
- copy = !iov_iter_is_aligned(iter, align, align);
+ copy = iov_iter_alignment(iter) &
+ blk_lim_dma_alignment_and_pad(&q->limits);
ret = iov_iter_extract_pages(iter, &pages, bytes, nr_vecs, 0, &offset);
if (unlikely(ret < 0))
goto free_bvec;
--
2.47.3
next prev parent reply other threads:[~2025-08-01 23:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 23:47 [PATCH 0/7] direct-io: even more flexible io vectors Keith Busch
2025-08-01 23:47 ` [PATCH 1/7] block: check for valid bio while splitting Keith Busch
2025-08-04 6:54 ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 2/7] block: align the bio after building it Keith Busch
2025-08-04 6:54 ` Hannes Reinecke
2025-08-04 14:08 ` Keith Busch
2025-08-04 16:47 ` Keith Busch
2025-08-05 6:54 ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 3/7] block: simplify direct io validity check Keith Busch
2025-08-04 6:55 ` Hannes Reinecke
2025-08-04 17:11 ` Keith Busch
2025-08-05 6:57 ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 4/7] iomap: " Keith Busch
2025-08-04 6:57 ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 5/7] block: remove bdev_iter_is_aligned Keith Busch
2025-08-04 6:57 ` Hannes Reinecke
2025-08-01 23:47 ` Keith Busch [this message]
2025-08-04 6:58 ` [PATCH 6/7] blk-integrity: use simpler alignment check Hannes Reinecke
2025-08-01 23:47 ` [PATCH 7/7] iov_iter: remove iov_iter_is_aligned Keith Busch
2025-08-02 2:02 ` Mike Snitzer
2025-08-04 14:16 ` Keith Busch
2025-08-04 15:25 ` Mike Snitzer
2025-08-04 15:27 ` Mike Snitzer
2025-08-04 22:26 ` Mike Snitzer
2025-08-04 22:57 ` Keith Busch
2025-08-05 0:24 ` Mike Snitzer
2025-08-02 15:37 ` [PATCH 0/7] direct-io: even more flexible io vectors Jens Axboe
2025-08-04 17:06 ` Keith Busch
2025-08-04 23:45 ` Keith Busch
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=20250801234736.1913170-7-kbusch@meta.com \
--to=kbusch@meta.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=dw@davidwei.uk \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=snitzer@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
all inboxes | Powered by JetHome®