@@ -664,18 +664,18 @@ static size_t __iomap_write_end(struct inode *inode, loff_t pos, size_t len,
return copied;
}
-static size_t iomap_write_end_inline(struct inode *inode, struct page *page,
+static size_t iomap_write_end_inline(struct inode *inode, struct folio *folio,
struct iomap *iomap, loff_t pos, size_t copied)
{
void *addr;
- WARN_ON_ONCE(!PageUptodate(page));
+ WARN_ON_ONCE(!folio_test_uptodate(folio));
BUG_ON(pos + copied > PAGE_SIZE - offset_in_page(iomap->inline_data));
- flush_dcache_page(page);
- addr = kmap_atomic(page);
+ flush_dcache_folio(folio);
+ addr = kmap_local_folio(folio, 0);
memcpy(iomap->inline_data + pos, addr + pos, copied);
- kunmap_atomic(addr);
+ kunmap_local(addr);
mark_inode_dirty(inode);
return copied;
@@ -692,7 +692,7 @@ static size_t iomap_write_end(struct inode *inode, loff_t pos, size_t len,
size_t ret;
if (srcmap->type == IOMAP_INLINE) {
- ret = iomap_write_end_inline(inode, page, iomap, pos, copied);
+ ret = iomap_write_end_inline(inode, folio, iomap, pos, copied);
} else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) {
ret = block_write_end(NULL, inode->i_mapping, pos, len, copied,
page, NULL);