lkml.org 
[lkml]   [2020]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC PKS/PMEM 47/58] drivers/mtd: Utilize new kmap_thread()
Date
From: Ira Weiny <ira.weiny@intel.com>

These kmap() calls are localized to a single thread. To avoid the over
head of global PKRS updates use the new kmap_thread() call.

Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
drivers/mtd/mtd_blkdevs.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 0c05f77f9b21..4b18998273fa 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -88,14 +88,14 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr,
return BLK_STS_IOERR;
return BLK_STS_OK;
case REQ_OP_READ:
- buf = kmap(bio_page(req->bio)) + bio_offset(req->bio);
+ buf = kmap_thread(bio_page(req->bio)) + bio_offset(req->bio);
for (; nsect > 0; nsect--, block++, buf += tr->blksize) {
if (tr->readsect(dev, block, buf)) {
- kunmap(bio_page(req->bio));
+ kunmap_thread(bio_page(req->bio));
return BLK_STS_IOERR;
}
}
- kunmap(bio_page(req->bio));
+ kunmap_thread(bio_page(req->bio));
rq_flush_dcache_pages(req);
return BLK_STS_OK;
case REQ_OP_WRITE:
@@ -103,14 +103,14 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr,
return BLK_STS_IOERR;

rq_flush_dcache_pages(req);
- buf = kmap(bio_page(req->bio)) + bio_offset(req->bio);
+ buf = kmap_thread(bio_page(req->bio)) + bio_offset(req->bio);
for (; nsect > 0; nsect--, block++, buf += tr->blksize) {
if (tr->writesect(dev, block, buf)) {
- kunmap(bio_page(req->bio));
+ kunmap_thread(bio_page(req->bio));
return BLK_STS_IOERR;
}
}
- kunmap(bio_page(req->bio));
+ kunmap_thread(bio_page(req->bio));
return BLK_STS_OK;
default:
return BLK_STS_IOERR;
--
2.28.0.rc0.12.gb6a658bd00c9
\
 
 \ /
  Last update: 2020-10-09 21:58    [W:0.463 / U:3.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site