/* Update on-disk file size now that data has been written to disk. The current in-memory file size is i_size. If a write is beyond eof i_new_size will be the intended file size until i_size is updated. If this write does not extend all the way to the valid file size then restrict this update to the end of the write.  */
STATIC void xfs_setfilesize(xfs_ioend_t *ioend)
/* Update on-disk file size now that data has been written to disk. The current in-memory file size is i_size. If a write is beyond eof i_new_size will be the intended file size until i_size is updated. If this write does not extend all the way to the valid file size then restrict this update to the end of the write.  */
STATIC void xfs_setfilesize(xfs_ioend_t *ioend)
{
	xfs_inode_t		*ip = XFS_I(ioend->io_inode);
	xfs_fsize_t		isize;
	ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG);
	ASSERT(ioend->io_type != IOMAP_READ);
	if (unlikely(ioend->io_error))
		return;
	xfs_ilock(ip, XFS_ILOCK_EXCL);
	isize = xfs_ioend_new_eof(ioend);
	if (isize) {
		ip->i_d.di_size = isize;
		xfs_mark_inode_dirty_sync(ip);
	}
	xfs_iunlock(ip, XFS_ILOCK_EXCL);
}