/* The generic ->writepage function for buffer-backed address_spaces this form passes in the end_io handler used to finish the IO.  */
int block_write_full_page_endio(struct page *page, get_block_t *get_block, struct writeback_control *wbc, bh_end_io_t *handler)
/* The generic ->writepage function for buffer-backed address_spaces this form passes in the end_io handler used to finish the IO.  */
int block_write_full_page_endio(struct page *page, get_block_t *get_block, struct writeback_control *wbc, bh_end_io_t *handler)
{
	struct inode * const inode = page->mapping->host;
	loff_t i_size = i_size_read(inode);
	const pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT;
	unsigned offset;
	if (page->index < end_index)
		return __block_write_full_page(inode, page, get_block, wbc,
					       handler);
	offset = i_size & (PAGE_CACHE_SIZE-1);
	if (page->index >= end_index+1 || !offset) {
		do_invalidatepage(page, 0);
		unlock_page(page);
		return 0;
	}
	zero_user_segment(page, offset, PAGE_CACHE_SIZE);
	return __block_write_full_page(inode, page, get_block, wbc, handler);
}