/* Decrement the link count on an inode & log the change. If this causes the link count to go to zero, initiate the logging activity required to truncate a file.  */
int xfs_droplink(xfs_trans_t *tp, xfs_inode_t *ip)
/* Decrement the link count on an inode & log the change. If this causes the link count to go to zero, initiate the logging activity required to truncate a file.  */
int xfs_droplink(xfs_trans_t *tp, xfs_inode_t *ip)
{
	int	error;
	xfs_ichgtime(ip, XFS_ICHGTIME_CHG);
	ASSERT (ip->i_d.di_nlink > 0);
	ip->i_d.di_nlink--;
	drop_nlink(VFS_I(ip));
	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
	error = 0;
	if (ip->i_d.di_nlink == 0) {
		error = xfs_iunlink(tp, ip);
	}
	return error;
}