Commit ab069d5f authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Darrick J. Wong

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: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent f1f264b4
...@@ -223,10 +223,10 @@ static int iomap_read_inline_data(struct inode *inode, struct page *page, ...@@ -223,10 +223,10 @@ static int iomap_read_inline_data(struct inode *inode, struct page *page,
if (poff > 0) if (poff > 0)
iomap_page_create(inode, page); iomap_page_create(inode, page);
addr = kmap_atomic(page) + poff; addr = kmap_local_page(page) + poff;
memcpy(addr, iomap->inline_data, size); memcpy(addr, iomap->inline_data, size);
memset(addr + size, 0, PAGE_SIZE - poff - size); memset(addr + size, 0, PAGE_SIZE - poff - size);
kunmap_atomic(addr); kunmap_local(addr);
iomap_set_range_uptodate(page, poff, PAGE_SIZE - poff); iomap_set_range_uptodate(page, poff, PAGE_SIZE - poff);
return PAGE_SIZE - poff; return PAGE_SIZE - poff;
} }
...@@ -682,9 +682,9 @@ static size_t iomap_write_end_inline(struct inode *inode, struct page *page, ...@@ -682,9 +682,9 @@ static size_t iomap_write_end_inline(struct inode *inode, struct page *page,
BUG_ON(!iomap_inline_data_valid(iomap)); BUG_ON(!iomap_inline_data_valid(iomap));
flush_dcache_page(page); flush_dcache_page(page);
addr = kmap_atomic(page); addr = kmap_local_page(page) + pos;
memcpy(iomap_inline_data(iomap, pos), addr + pos, copied); memcpy(iomap_inline_data(iomap, pos), addr, copied);
kunmap_atomic(addr); kunmap_local(addr);
mark_inode_dirty(inode); mark_inode_dirty(inode);
return copied; return copied;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment