/* Check if we should update i_disksize when write to the end of file but not require block allocation  */
static int ext4_da_should_update_i_disksize(struct page *page, unsigned long offset)
/* Check if we should update i_disksize when write to the end of file but not require block allocation  */
static int ext4_da_should_update_i_disksize(struct page *page, unsigned long offset)
{
	struct buffer_head *bh;
	struct inode *inode = page->mapping->host;
	unsigned int idx;
	int i;
	bh = page_buffers(page);
	idx = offset >> inode->i_blkbits;
	for (i = 0; i < idx; i++)
		bh = bh->b_this_page;
	if (!buffer_mapped(bh) || (buffer_delay(bh)) || buffer_unwritten(bh))
		return 0;
	return 1;
}