Lines Matching refs:wpc

1632 iomap_submit_ioend(struct iomap_writepage_ctx *wpc, struct iomap_ioend *ioend,
1638 if (wpc->ops->prepare_ioend)
1639 error = wpc->ops->prepare_ioend(ioend, error);
1657 iomap_alloc_ioend(struct inode *inode, struct iomap_writepage_ctx *wpc,
1663 bio = bio_alloc_bioset(wpc->iomap.bdev, BIO_MAX_VECS,
1671 ioend->io_type = wpc->iomap.type;
1672 ioend->io_flags = wpc->iomap.flags;
1705 iomap_can_add_to_ioend(struct iomap_writepage_ctx *wpc, loff_t offset,
1708 if ((wpc->iomap.flags & IOMAP_F_SHARED) !=
1709 (wpc->ioend->io_flags & IOMAP_F_SHARED))
1711 if (wpc->iomap.type != wpc->ioend->io_type)
1713 if (offset != wpc->ioend->io_offset + wpc->ioend->io_size)
1715 if (sector != bio_end_sector(wpc->ioend->io_bio))
1722 if (wpc->ioend->io_folios >= IOEND_BATCH_SIZE)
1733 struct iomap_folio_state *ifs, struct iomap_writepage_ctx *wpc,
1736 sector_t sector = iomap_sector(&wpc->iomap, pos);
1740 if (!wpc->ioend || !iomap_can_add_to_ioend(wpc, pos, sector)) {
1741 if (wpc->ioend)
1742 list_add(&wpc->ioend->io_list, iolist);
1743 wpc->ioend = iomap_alloc_ioend(inode, wpc, pos, sector, wbc);
1746 if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) {
1747 wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio);
1748 bio_add_folio_nofail(wpc->ioend->io_bio, folio, len, poff);
1753 wpc->ioend->io_size += len;
1774 iomap_writepage_map(struct iomap_writepage_ctx *wpc,
1804 error = wpc->ops->map_blocks(wpc, inode, pos);
1807 trace_iomap_writepage_map(inode, &wpc->iomap);
1808 if (WARN_ON_ONCE(wpc->iomap.type == IOMAP_INLINE))
1810 if (wpc->iomap.type == IOMAP_HOLE)
1812 iomap_add_to_ioend(inode, pos, folio, ifs, wpc, wbc,
1817 wpc->ioend->io_folios++;
1819 WARN_ON_ONCE(!wpc->ioend && !list_empty(&submit_list));
1835 if (wpc->ops->discard_folio)
1836 wpc->ops->discard_folio(folio, pos);
1867 error2 = iomap_submit_ioend(wpc, ioend, error);
1893 struct iomap_writepage_ctx *wpc = data;
1976 return iomap_writepage_map(wpc, wbc, inode, folio, end_pos);
1987 struct iomap_writepage_ctx *wpc,
1992 wpc->ops = ops;
1993 ret = write_cache_pages(mapping, wbc, iomap_do_writepage, wpc);
1994 if (!wpc->ioend)
1996 return iomap_submit_ioend(wpc, wpc->ioend, ret);