/* Modified for 680x0 by Andreas Schwab Updated to filesystem version 3 by Daniel Aragones  */
static int minix_write_inode(struct inode *inode, int wait)
/* Modified for 680x0 by Andreas Schwab Updated to filesystem version 3 by Daniel Aragones  */
static int minix_write_inode(struct inode *inode, int wait)
{
	int err = 0;
	struct buffer_head *bh;
	if (INODE_VERSION(inode) == MINIX_V1)
		bh = V1_minix_update_inode(inode);
	else
		bh = V2_minix_update_inode(inode);
	if (!bh)
		return -EIO;
	if (wait && buffer_dirty(bh)) {
		sync_dirty_buffer(bh);
		if (buffer_req(bh) && !buffer_uptodate(bh)) {
			printk("IO error syncing minix inode [%s:%08lx]\n",
				inode->i_sb->s_id, inode->i_ino);
			err = -EIO;
		}
	}
	brelse (bh);
	return err;
}