/* If we are going to release inode from memory, we truncate last inode extent to proper length. We could use drop_inode() but it's called under inode_lock and thus we cannot mark inode dirty there. We use clear_inode() but we have to make sure to write inode as it's not written automatically.  */
void udf_clear_inode(struct inode *inode)
/* If we are going to release inode from memory, we truncate last inode extent to proper length. We could use drop_inode() but it's called under inode_lock and thus we cannot mark inode dirty there. We use clear_inode() but we have to make sure to write inode as it's not written automatically.  */
void udf_clear_inode(struct inode *inode)
{
	struct udf_inode_info *iinfo = UDF_I(inode);
	if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB &&
	    inode->i_size != iinfo->i_lenExtents) {
		printk(KERN_WARNING "UDF-fs (%s): Inode %lu (mode %o) has "
			"inode size %llu different from extent lenght %llu. "
			"Filesystem need not be standards compliant.\n",
			inode->i_sb->s_id, inode->i_ino, inode->i_mode,
			(unsigned long long)inode->i_size,
			(unsigned long long)iinfo->i_lenExtents);
	}
	kfree(iinfo->i_ext.i_data);
	iinfo->i_ext.i_data = NULL;
}