/* Using fops->write is slower than using aops->{prepare,commit}_write in the transforming case because we need to double buffer the data as we cannot do the transformations in place as we do not have direct access to the destination pages of the backing file.  */
static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec, loff_t pos, struct page *page)
/* Using fops->write is slower than using aops->{prepare,commit}_write in the transforming case because we need to double buffer the data as we cannot do the transformations in place as we do not have direct access to the destination pages of the backing file.  */
static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec, loff_t pos, struct page *page)
{
	int ret = lo_do_transfer(lo, WRITE, page, 0, bvec->bv_page,
			bvec->bv_offset, bvec->bv_len, pos >> 9);
	if (likely(!ret))
		return __do_lo_send_write(lo->lo_backing_file,
				page_address(page), bvec->bv_len,
				pos);
	printk(KERN_ERR "loop: Transfer error at byte offset %llu, "
			"length %i.\n", (unsigned long long)pos, bvec->bv_len);
	if (ret > 0)
		ret = -EIO;
	return ret;
}