/* Return zero on success. Non-zero means the caller needs to start a new BIO.  */
static int dio_bio_add_page(struct dio *dio)
/* Return zero on success. Non-zero means the caller needs to start a new BIO.  */
static int dio_bio_add_page(struct dio *dio)
{
	int ret;
	ret = bio_add_page(dio->bio, dio->cur_page,
			dio->cur_page_len, dio->cur_page_offset);
	if (ret == dio->cur_page_len) {
		if ((dio->cur_page_len + dio->cur_page_offset) == PAGE_SIZE)
			dio->pages_in_io--;
		page_cache_get(dio->cur_page);
		dio->final_block_in_bio = dio->cur_page_block +
			(dio->cur_page_len >> dio->blkbits);
		ret = 0;
	} else {
		ret = 1;
	}
	return ret;
}