/* RETURN VALUES: 0 - success -ENOMEM - insufficient free virtual memory. -EIO - i/o error.  */
int diUnmount(struct inode *ipimap, int mounterror)
/* RETURN VALUES: 0 - success -ENOMEM - insufficient free virtual memory. -EIO - i/o error.  */
int diUnmount(struct inode *ipimap, int mounterror)
{
	struct inomap *imap = JFS_IP(ipimap)->i_imap;
	if (!(mounterror || isReadOnly(ipimap)))
		diSync(ipimap);
	truncate_inode_pages(ipimap->i_mapping, 0);
	kfree(imap);
	return (0);
}