/* This is the inode flushing I/O completion routine. It is called from interrupt level when the buffer containing the inode is flushed to disk. It is responsible for removing the inode item from the AIL if it has not been re-logged, and unlocking the inode's flush lock.  */
void xfs_iflush_done(xfs_buf_t *bp, xfs_inode_log_item_t *iip)
/* This is the inode flushing I/O completion routine. It is called from interrupt level when the buffer containing the inode is flushed to disk. It is responsible for removing the inode item from the AIL if it has not been re-logged, and unlocking the inode's flush lock.  */
void xfs_iflush_done(xfs_buf_t *bp, xfs_inode_log_item_t *iip)
{
	xfs_inode_t		*ip = iip->ili_inode;
	struct xfs_ail		*ailp = iip->ili_item.li_ailp;
	if (iip->ili_logged &&
	    (iip->ili_item.li_lsn == iip->ili_flush_lsn)) {
		spin_lock(&ailp->xa_lock);
		if (iip->ili_item.li_lsn == iip->ili_flush_lsn) {
			xfs_trans_ail_delete(ailp, (xfs_log_item_t*)iip);
		} else {
			spin_unlock(&ailp->xa_lock);
		}
	}
	iip->ili_logged = 0;
	iip->ili_last_fields = 0;
	xfs_ifunlock(ip);
	return;
}