[PATCH RFC PKS/PMEM 20/58] fs/jffs2: Utilize new kmap_thread()

From: ira . weiny
Date: Fri Oct 09 2020 - 16:07:04 EST


From: Ira Weiny <ira.weiny@xxxxxxxxx>

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

Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Richard Weinberger <richard@xxxxxx>
Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
---
fs/jffs2/file.c | 4 ++--
fs/jffs2/gc.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index f8fb89b10227..3e6d54f9b011 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -88,7 +88,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)

BUG_ON(!PageLocked(pg));

- pg_buf = kmap(pg);
+ pg_buf = kmap_thread(pg);
/* FIXME: Can kmap fail? */

ret = jffs2_read_inode_range(c, f, pg_buf, pg->index << PAGE_SHIFT,
@@ -103,7 +103,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
}

flush_dcache_page(pg);
- kunmap(pg);
+ kunmap_thread(pg);

jffs2_dbg(2, "readpage finished\n");
return ret;
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
index 373b3b7c9f44..a7259783ab84 100644
--- a/fs/jffs2/gc.c
+++ b/fs/jffs2/gc.c
@@ -1335,7 +1335,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
return PTR_ERR(page);
}

- pg_ptr = kmap(page);
+ pg_ptr = kmap_thread(page);
mutex_lock(&f->sem);

offset = start;
@@ -1400,7 +1400,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
}
}

- kunmap(page);
+ kunmap_thread(page);
put_page(page);
return ret;
}
--
2.28.0.rc0.12.gb6a658bd00c9