From ab069d5fdcd14530d4223746c8d01f421d4c4057 Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Wed, 4 Aug 2021 20:07:33 -0700 Subject: iomap: Use kmap_local_page instead of kmap_atomic kmap_atomic() has the side-effect of disabling pagefaults and preemption. kmap_local_page() does not do this and is preferred. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/iomap/buffered-io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fs/iomap') diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index c1c8cd41ea81..8ee0211bea86 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -223,10 +223,10 @@ static int iomap_read_inline_data(struct inode *inode, struct page *page, if (poff > 0) iomap_page_create(inode, page); - addr = kmap_atomic(page) + poff; + addr = kmap_local_page(page) + poff; memcpy(addr, iomap->inline_data, size); memset(addr + size, 0, PAGE_SIZE - poff - size); - kunmap_atomic(addr); + kunmap_local(addr); iomap_set_range_uptodate(page, poff, PAGE_SIZE - poff); return PAGE_SIZE - poff; } @@ -682,9 +682,9 @@ static size_t iomap_write_end_inline(struct inode *inode, struct page *page, BUG_ON(!iomap_inline_data_valid(iomap)); flush_dcache_page(page); - addr = kmap_atomic(page); - memcpy(iomap_inline_data(iomap, pos), addr + pos, copied); - kunmap_atomic(addr); + addr = kmap_local_page(page) + pos; + memcpy(iomap_inline_data(iomap, pos), addr, copied); + kunmap_local(addr); mark_inode_dirty(inode); return copied; -- cgit v1.2.3