/* What we want to do here is fill in any hole between the current end of allocation and the end of our write. That way the rest of the write path can treat it as an non-allocating write, which has no special case code for sparse/nonsparse files.  */
static int ocfs2_expand_nonsparse_inode(struct inode *inode, loff_t pos, unsigned len, struct ocfs2_write_ctxt *wc)
/* What we want to do here is fill in any hole between the current end of allocation and the end of our write. That way the rest of the write path can treat it as an non-allocating write, which has no special case code for sparse/nonsparse files.  */
static int ocfs2_expand_nonsparse_inode(struct inode *inode, loff_t pos, unsigned len, struct ocfs2_write_ctxt *wc)
{
	int ret;
	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
	loff_t newsize = pos + len;
	if (ocfs2_sparse_alloc(osb))
		return 0;
	if (newsize <= i_size_read(inode))
		return 0;
	ret = ocfs2_extend_no_holes(inode, newsize, pos);
	if (ret)
		mlog_errno(ret);
	wc->w_first_new_cpos =
		ocfs2_clusters_for_bytes(inode->i_sb, i_size_read(inode));
	return ret;
}