summaryrefslogtreecommitdiff
path: root/fs/iomap
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-08-04 20:07:33 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-08-05 10:30:33 -0700
commitab069d5fdcd14530d4223746c8d01f421d4c4057 (patch)
tree1b86a2ef451f3d4a0ea834c8aa55309b74a18eff /fs/iomap
parentf1f264b4c134ee65cdadece7a20f3c0643602a4a (diff)
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) <willy@infradead.org> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/iomap')
-rw-r--r--fs/iomap/buffered-io.c10
1 files changed, 5 insertions, 5 deletions
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;