/* Called at the last iput() if i_nlink is zero.  */
void ext2_delete_inode(struct inode *inode)
/* Called at the last iput() if i_nlink is zero.  */
void ext2_delete_inode(struct inode *inode)
{
	truncate_inode_pages(&inode->i_data, 0);
	if (is_bad_inode(inode))
		goto no_delete;
	EXT2_I(inode)->i_dtime	= get_seconds();
	mark_inode_dirty(inode);
	ext2_write_inode(inode, inode_needs_sync(inode));
	inode->i_size = 0;
	if (inode->i_blocks)
		ext2_truncate (inode);
	ext2_free_inode (inode);
	return;
no_delete:
	clear_inode(inode);
}