/* Force has 4 possible values: 0 - don't destroy locksapce if it has any LKBs 1 - destroy lockspace if it has remote LKBs but not if it has local LKBs 2 - destroy lockspace regardless of LKBs 3 - destroy lockspace as part of a forced shutdown  */
int dlm_release_lockspace(void *lockspace, int force)
/* Force has 4 possible values: 0 - don't destroy locksapce if it has any LKBs 1 - destroy lockspace if it has remote LKBs but not if it has local LKBs 2 - destroy lockspace regardless of LKBs 3 - destroy lockspace as part of a forced shutdown  */
int dlm_release_lockspace(void *lockspace, int force)
{
	struct dlm_ls *ls;
	int error;
	ls = dlm_find_lockspace_local(lockspace);
	if (!ls)
		return -EINVAL;
	dlm_put_lockspace(ls);
	mutex_lock(&ls_lock);
	error = release_lockspace(ls, force);
	if (!error)
		ls_count--;
	if (!ls_count)
		threads_stop();
	mutex_unlock(&ls_lock);
	return error;
}