Lines Matching refs:ioend
1320 iomap_finish_ioend(struct iomap_ioend *ioend, int error) in iomap_finish_ioend() argument
1322 struct inode *inode = ioend->io_inode; in iomap_finish_ioend()
1323 struct bio *bio = &ioend->io_inline_bio; in iomap_finish_ioend()
1324 struct bio *last = ioend->io_bio, *next; in iomap_finish_ioend()
1326 loff_t offset = ioend->io_offset; in iomap_finish_ioend()
1330 for (bio = &ioend->io_inline_bio; bio; bio = next) { in iomap_finish_ioend()
1369 iomap_finish_ioends(struct iomap_ioend *ioend, int error) in iomap_finish_ioends() argument
1376 list_replace_init(&ioend->io_list, &tmp); in iomap_finish_ioends()
1377 completions = iomap_finish_ioend(ioend, error); in iomap_finish_ioends()
1384 ioend = list_first_entry(&tmp, struct iomap_ioend, io_list); in iomap_finish_ioends()
1385 list_del_init(&ioend->io_list); in iomap_finish_ioends()
1386 completions += iomap_finish_ioend(ioend, error); in iomap_finish_ioends()
1395 iomap_ioend_can_merge(struct iomap_ioend *ioend, struct iomap_ioend *next) in iomap_ioend_can_merge() argument
1397 if (ioend->io_bio->bi_status != next->io_bio->bi_status) in iomap_ioend_can_merge()
1399 if ((ioend->io_flags & IOMAP_F_SHARED) ^ in iomap_ioend_can_merge()
1402 if ((ioend->io_type == IOMAP_UNWRITTEN) ^ in iomap_ioend_can_merge()
1405 if (ioend->io_offset + ioend->io_size != next->io_offset) in iomap_ioend_can_merge()
1417 if (ioend->io_sector + (ioend->io_size >> 9) != next->io_sector) in iomap_ioend_can_merge()
1423 iomap_ioend_try_merge(struct iomap_ioend *ioend, struct list_head *more_ioends) in iomap_ioend_try_merge() argument
1427 INIT_LIST_HEAD(&ioend->io_list); in iomap_ioend_try_merge()
1431 if (!iomap_ioend_can_merge(ioend, next)) in iomap_ioend_try_merge()
1433 list_move_tail(&next->io_list, &ioend->io_list); in iomap_ioend_try_merge()
1434 ioend->io_size += next->io_size; in iomap_ioend_try_merge()
1462 struct iomap_ioend *ioend = bio->bi_private; in iomap_writepage_end_bio() local
1464 iomap_finish_ioend(ioend, blk_status_to_errno(bio->bi_status)); in iomap_writepage_end_bio()
1476 iomap_submit_ioend(struct iomap_writepage_ctx *wpc, struct iomap_ioend *ioend, in iomap_submit_ioend() argument
1479 ioend->io_bio->bi_private = ioend; in iomap_submit_ioend()
1480 ioend->io_bio->bi_end_io = iomap_writepage_end_bio; in iomap_submit_ioend()
1483 error = wpc->ops->prepare_ioend(ioend, error); in iomap_submit_ioend()
1491 ioend->io_bio->bi_status = errno_to_blk_status(error); in iomap_submit_ioend()
1492 bio_endio(ioend->io_bio); in iomap_submit_ioend()
1496 submit_bio(ioend->io_bio); in iomap_submit_ioend()
1504 struct iomap_ioend *ioend; in iomap_alloc_ioend() local
1513 ioend = container_of(bio, struct iomap_ioend, io_inline_bio); in iomap_alloc_ioend()
1514 INIT_LIST_HEAD(&ioend->io_list); in iomap_alloc_ioend()
1515 ioend->io_type = wpc->iomap.type; in iomap_alloc_ioend()
1516 ioend->io_flags = wpc->iomap.flags; in iomap_alloc_ioend()
1517 ioend->io_inode = inode; in iomap_alloc_ioend()
1518 ioend->io_size = 0; in iomap_alloc_ioend()
1519 ioend->io_folios = 0; in iomap_alloc_ioend()
1520 ioend->io_offset = offset; in iomap_alloc_ioend()
1521 ioend->io_bio = bio; in iomap_alloc_ioend()
1522 ioend->io_sector = sector; in iomap_alloc_ioend()
1523 return ioend; in iomap_alloc_ioend()
1553 (wpc->ioend->io_flags & IOMAP_F_SHARED)) in iomap_can_add_to_ioend()
1555 if (wpc->iomap.type != wpc->ioend->io_type) in iomap_can_add_to_ioend()
1557 if (offset != wpc->ioend->io_offset + wpc->ioend->io_size) in iomap_can_add_to_ioend()
1559 if (sector != bio_end_sector(wpc->ioend->io_bio)) in iomap_can_add_to_ioend()
1566 if (wpc->ioend->io_folios >= IOEND_BATCH_SIZE) in iomap_can_add_to_ioend()
1584 if (!wpc->ioend || !iomap_can_add_to_ioend(wpc, pos, sector)) { in iomap_add_to_ioend()
1585 if (wpc->ioend) in iomap_add_to_ioend()
1586 list_add(&wpc->ioend->io_list, iolist); in iomap_add_to_ioend()
1587 wpc->ioend = iomap_alloc_ioend(inode, wpc, pos, sector, wbc); in iomap_add_to_ioend()
1590 if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) { in iomap_add_to_ioend()
1591 wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio); in iomap_add_to_ioend()
1592 bio_add_folio(wpc->ioend->io_bio, folio, len, poff); in iomap_add_to_ioend()
1597 wpc->ioend->io_size += len; in iomap_add_to_ioend()
1623 struct iomap_ioend *ioend, *next; in iomap_writepage_map() local
1654 wpc->ioend->io_folios++; in iomap_writepage_map()
1656 WARN_ON_ONCE(!wpc->ioend && !list_empty(&submit_list)); in iomap_writepage_map()
1690 list_for_each_entry_safe(ioend, next, &submit_list, io_list) { in iomap_writepage_map()
1693 list_del_init(&ioend->io_list); in iomap_writepage_map()
1694 error2 = iomap_submit_ioend(wpc, ioend, error); in iomap_writepage_map()
1821 if (!wpc->ioend) in iomap_writepages()
1823 return iomap_submit_ioend(wpc, wpc->ioend, ret); in iomap_writepages()