/* display the MMU context currently a process is currently using (un)pin a process's mm_struct's MMU context ID  */
int cxn_pin_by_pid(pid_t pid)
/* display the MMU context currently a process is currently using (un)pin a process's mm_struct's MMU context ID  */
int cxn_pin_by_pid(pid_t pid)
{
	struct task_struct *tsk;
	struct mm_struct *mm = NULL;
	int ret;
	if (pid == 0) {
		cxn_pinned = -1;
		return 0;
	}
	ret = -ESRCH;
	read_lock(&tasklist_lock);
	tsk = find_task_by_vpid(pid);
	if (tsk) {
		ret = -EINVAL;
		task_lock(tsk);
		if (tsk->mm) {
			mm = tsk->mm;
			atomic_inc(&mm->mm_users);
			ret = 0;
		}
		task_unlock(tsk);
	}
	read_unlock(&tasklist_lock);
	if (ret < 0)
		return ret;
	spin_lock(&cxn_owners_lock);
	cxn_pinned = get_cxn(&mm->context);
	spin_unlock(&cxn_owners_lock);
	mmput(mm);
	return 0;
}