/* Increment the link count on an inode & log the change.  */
int xfs_bumplink(xfs_trans_t *tp, xfs_inode_t *ip)
/* Increment the link count on an inode & log the change.  */
int xfs_bumplink(xfs_trans_t *tp, xfs_inode_t *ip)
{
	if (ip->i_d.di_nlink >= XFS_MAXLINK)
		return XFS_ERROR(EMLINK);
	xfs_ichgtime(ip, XFS_ICHGTIME_CHG);
	ASSERT(ip->i_d.di_nlink > 0);
	ip->i_d.di_nlink++;
	inc_nlink(VFS_I(ip));
	if ((ip->i_d.di_version == 1) &&
	    (ip->i_d.di_nlink > XFS_MAXLINK_1)) {
		xfs_bump_ino_vers2(tp, ip);
	}
	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
	return 0;
}