Skip to content

Commit 9c4ce08

Browse files
author
Matthew Wilcox (Oracle)
committed
iomap: Convert iomap_write_end_inline to take a folio
This conversion is only safe because iomap only supports writes to inline data which starts at the beginning of the file. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent bc6123a commit 9c4ce08

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/iomap/buffered-io.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,16 +683,16 @@ static size_t __iomap_write_end(struct inode *inode, loff_t pos, size_t len,
683683
}
684684

685685
static size_t iomap_write_end_inline(const struct iomap_iter *iter,
686-
struct page *page, loff_t pos, size_t copied)
686+
struct folio *folio, loff_t pos, size_t copied)
687687
{
688688
const struct iomap *iomap = &iter->iomap;
689689
void *addr;
690690

691-
WARN_ON_ONCE(!PageUptodate(page));
691+
WARN_ON_ONCE(!folio_test_uptodate(folio));
692692
BUG_ON(!iomap_inline_data_valid(iomap));
693693

694-
flush_dcache_page(page);
695-
addr = kmap_local_page(page) + pos;
694+
flush_dcache_folio(folio);
695+
addr = kmap_local_folio(folio, pos);
696696
memcpy(iomap_inline_data(iomap, pos), addr, copied);
697697
kunmap_local(addr);
698698

@@ -710,7 +710,7 @@ static size_t iomap_write_end(struct iomap_iter *iter, loff_t pos, size_t len,
710710
size_t ret;
711711

712712
if (srcmap->type == IOMAP_INLINE) {
713-
ret = iomap_write_end_inline(iter, &folio->page, pos, copied);
713+
ret = iomap_write_end_inline(iter, folio, pos, copied);
714714
} else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) {
715715
ret = block_write_end(NULL, iter->inode->i_mapping, pos, len,
716716
copied, &folio->page, NULL);

0 commit comments

Comments
 (0)