Lines Matching refs:ioend

33 	struct xfs_ioend	*ioend;  member
89 struct xfs_ioend *ioend, in xfs_destroy_ioend() argument
92 struct inode *inode = ioend->io_inode; in xfs_destroy_ioend()
93 struct bio *bio = &ioend->io_inline_bio; in xfs_destroy_ioend()
94 struct bio *last = ioend->io_bio, *next; in xfs_destroy_ioend()
98 for (bio = &ioend->io_inline_bio; bio; bio = next) { in xfs_destroy_ioend()
126 static inline bool xfs_ioend_is_append(struct xfs_ioend *ioend) in xfs_ioend_is_append() argument
128 return ioend->io_offset + ioend->io_size > in xfs_ioend_is_append()
129 XFS_I(ioend->io_inode)->i_d.di_size; in xfs_ioend_is_append()
134 struct xfs_ioend *ioend) in xfs_setfilesize_trans_alloc() argument
136 struct xfs_mount *mp = XFS_I(ioend->io_inode)->i_mount; in xfs_setfilesize_trans_alloc()
145 ioend->io_append_trans = tp; in xfs_setfilesize_trans_alloc()
151 __sb_writers_release(ioend->io_inode->i_sb, SB_FREEZE_FS); in xfs_setfilesize_trans_alloc()
208 struct xfs_ioend *ioend, in xfs_setfilesize_ioend() argument
211 struct xfs_inode *ip = XFS_I(ioend->io_inode); in xfs_setfilesize_ioend()
212 struct xfs_trans *tp = ioend->io_append_trans; in xfs_setfilesize_ioend()
228 return __xfs_setfilesize(ip, tp, ioend->io_offset, ioend->io_size); in xfs_setfilesize_ioend()
238 struct xfs_ioend *ioend = in xfs_end_io() local
240 struct xfs_inode *ip = XFS_I(ioend->io_inode); in xfs_end_io()
241 xfs_off_t offset = ioend->io_offset; in xfs_end_io()
242 size_t size = ioend->io_size; in xfs_end_io()
256 error = blk_status_to_errno(ioend->io_bio->bi_status); in xfs_end_io()
258 switch (ioend->io_type) { in xfs_end_io()
270 switch (ioend->io_type) { in xfs_end_io()
279 ASSERT(!xfs_ioend_is_append(ioend) || ioend->io_append_trans); in xfs_end_io()
284 if (ioend->io_append_trans) in xfs_end_io()
285 error = xfs_setfilesize_ioend(ioend, error); in xfs_end_io()
286 xfs_destroy_ioend(ioend, error); in xfs_end_io()
293 struct xfs_ioend *ioend = bio->bi_private; in xfs_end_bio() local
294 struct xfs_mount *mp = XFS_I(ioend->io_inode)->i_mount; in xfs_end_bio()
296 if (ioend->io_type == XFS_IO_UNWRITTEN || ioend->io_type == XFS_IO_COW) in xfs_end_bio()
297 queue_work(mp->m_unwritten_workqueue, &ioend->io_work); in xfs_end_bio()
298 else if (ioend->io_append_trans) in xfs_end_bio()
299 queue_work(mp->m_data_workqueue, &ioend->io_work); in xfs_end_bio()
301 xfs_destroy_ioend(ioend, blk_status_to_errno(bio->bi_status)); in xfs_end_bio()
485 struct xfs_ioend *ioend, in xfs_submit_ioend() argument
489 if (!status && ioend->io_type == XFS_IO_COW) { in xfs_submit_ioend()
500 status = xfs_reflink_convert_cow(XFS_I(ioend->io_inode), in xfs_submit_ioend()
501 ioend->io_offset, ioend->io_size); in xfs_submit_ioend()
507 ioend->io_type != XFS_IO_UNWRITTEN && in xfs_submit_ioend()
508 xfs_ioend_is_append(ioend) && in xfs_submit_ioend()
509 !ioend->io_append_trans) in xfs_submit_ioend()
510 status = xfs_setfilesize_trans_alloc(ioend); in xfs_submit_ioend()
512 ioend->io_bio->bi_private = ioend; in xfs_submit_ioend()
513 ioend->io_bio->bi_end_io = xfs_end_bio; in xfs_submit_ioend()
514 ioend->io_bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc); in xfs_submit_ioend()
523 ioend->io_bio->bi_status = errno_to_blk_status(status); in xfs_submit_ioend()
524 bio_endio(ioend->io_bio); in xfs_submit_ioend()
528 ioend->io_bio->bi_write_hint = ioend->io_inode->i_write_hint; in xfs_submit_ioend()
529 submit_bio(ioend->io_bio); in xfs_submit_ioend()
541 struct xfs_ioend *ioend; in xfs_alloc_ioend() local
548 ioend = container_of(bio, struct xfs_ioend, io_inline_bio); in xfs_alloc_ioend()
549 INIT_LIST_HEAD(&ioend->io_list); in xfs_alloc_ioend()
550 ioend->io_type = type; in xfs_alloc_ioend()
551 ioend->io_inode = inode; in xfs_alloc_ioend()
552 ioend->io_size = 0; in xfs_alloc_ioend()
553 ioend->io_offset = offset; in xfs_alloc_ioend()
554 INIT_WORK(&ioend->io_work, xfs_end_io); in xfs_alloc_ioend()
555 ioend->io_append_trans = NULL; in xfs_alloc_ioend()
556 ioend->io_bio = bio; in xfs_alloc_ioend()
557 return ioend; in xfs_alloc_ioend()
569 struct xfs_ioend *ioend, in xfs_chain_bio() argument
579 bio_chain(ioend->io_bio, new); in xfs_chain_bio()
580 bio_get(ioend->io_bio); /* for xfs_destroy_ioend */ in xfs_chain_bio()
581 ioend->io_bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc); in xfs_chain_bio()
582 ioend->io_bio->bi_write_hint = ioend->io_inode->i_write_hint; in xfs_chain_bio()
583 submit_bio(ioend->io_bio); in xfs_chain_bio()
584 ioend->io_bio = new; in xfs_chain_bio()
611 if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type || in xfs_add_to_ioend()
612 sector != bio_end_sector(wpc->ioend->io_bio) || in xfs_add_to_ioend()
613 offset != wpc->ioend->io_offset + wpc->ioend->io_size) { in xfs_add_to_ioend()
614 if (wpc->ioend) in xfs_add_to_ioend()
615 list_add(&wpc->ioend->io_list, iolist); in xfs_add_to_ioend()
616 wpc->ioend = xfs_alloc_ioend(inode, wpc->io_type, offset, in xfs_add_to_ioend()
620 if (!__bio_try_merge_page(wpc->ioend->io_bio, page, len, poff)) { in xfs_add_to_ioend()
623 if (bio_full(wpc->ioend->io_bio)) in xfs_add_to_ioend()
624 xfs_chain_bio(wpc->ioend, wbc, bdev, sector); in xfs_add_to_ioend()
625 __bio_add_page(wpc->ioend->io_bio, page, len, poff); in xfs_add_to_ioend()
628 wpc->ioend->io_size += len; in xfs_add_to_ioend()
705 struct xfs_ioend *ioend, *next; in xfs_writepage_map() local
733 ASSERT(wpc->ioend || list_empty(&submit_list)); in xfs_writepage_map()
780 list_for_each_entry_safe(ioend, next, &submit_list, io_list) { in xfs_writepage_map()
783 list_del_init(&ioend->io_list); in xfs_writepage_map()
784 error2 = xfs_submit_ioend(wbc, ioend, error); in xfs_writepage_map()
927 if (wpc.ioend) in xfs_vm_writepage()
928 ret = xfs_submit_ioend(wbc, wpc.ioend, ret); in xfs_vm_writepage()
944 if (wpc.ioend) in xfs_vm_writepages()
945 ret = xfs_submit_ioend(wbc, wpc.ioend, ret); in xfs_vm_writepages()