From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>, Yu Kuai <yukuai1@huaweicloud.com>
Cc: linux-block@vger.kernel.org
Subject: [PATCH 3/5] brd: use bvec_kmap_local in brd_do_bvec
Date: Mon, 21 Apr 2025 09:26:07 +0200 [thread overview]
Message-ID: <20250421072641.1311040-4-hch@lst.de> (raw)
In-Reply-To: <20250421072641.1311040-1-hch@lst.de>
Use the proper helper to kmap a bvec in brd_do_bvec instead of directly
accessing the bvec fields and use the deprecated kmap_atomic API.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/brd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 91eb50126355..0c70d29379f1 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -207,15 +207,15 @@ static int brd_rw_bvec(struct brd_device *brd, struct bio_vec *bv,
return err;
}
- mem = kmap_atomic(bv->bv_page);
+ mem = bvec_kmap_local(bv);
if (!op_is_write(opf)) {
- copy_from_brd(mem + bv->bv_offset, brd, sector, bv->bv_len);
+ copy_from_brd(mem, brd, sector, bv->bv_len);
flush_dcache_page(bv->bv_page);
} else {
flush_dcache_page(bv->bv_page);
- copy_to_brd(brd, mem + bv->bv_offset, sector, bv->bv_len);
+ copy_to_brd(brd, mem, sector, bv->bv_len);
}
- kunmap_atomic(mem);
+ kunmap_local(mem);
return 0;
}
--
2.47.2
next prev parent reply other threads:[~2025-04-21 7:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 7:26 brd cleanups Christoph Hellwig
2025-04-21 7:26 ` [PATCH 1/5] brd; pass a bvec pointer to brd_do_bvec Christoph Hellwig
2025-04-22 6:36 ` Yu Kuai
2025-04-22 9:24 ` Hannes Reinecke
2025-04-28 9:21 ` Johannes Thumshirn
2025-04-21 7:26 ` [PATCH 2/5] brd: remove the sector variable in brd_submit_bio Christoph Hellwig
2025-04-22 6:38 ` Yu Kuai
2025-04-22 9:24 ` Hannes Reinecke
2025-04-21 7:26 ` Christoph Hellwig [this message]
2025-04-22 6:42 ` [PATCH 3/5] brd: use bvec_kmap_local in brd_do_bvec Yu Kuai
2025-04-22 9:25 ` Hannes Reinecke
2025-04-21 7:26 ` [PATCH 4/5] brd: split I/O at page boundaries Christoph Hellwig
2025-04-22 9:30 ` Hannes Reinecke
2025-04-22 11:10 ` Yu Kuai
2025-04-21 7:26 ` [PATCH 5/5] brd: use memcpy_{to,from]_page in brd_rw_bvec Christoph Hellwig
2025-04-22 9:30 ` Hannes Reinecke
2025-04-22 11:18 ` Yu Kuai
2025-04-22 13:50 ` Christoph Hellwig
2025-04-23 3:26 ` Yu Kuai
-- strict thread matches above, loose matches on Subject: below --
2025-04-28 14:09 brd cleanups v2 Christoph Hellwig
2025-04-28 14:09 ` [PATCH 3/5] brd: use bvec_kmap_local in brd_do_bvec Christoph Hellwig
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=20250421072641.1311040-4-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=yukuai1@huaweicloud.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