Example #1
0
void *
nlm_granted_msg_1_svc(nlm_testargs *arg, struct svc_req *rqstp)
{
	static nlm_res result;

	if (debug_level)
		log_from_addr("nlm_granted_msg", rqstp);

	result.cookie = arg->cookie;
	result.stat.stat = nlm_granted;
	transmit_result(NLM_GRANTED_RES, &result, svc_getcaller(rqstp->rq_xprt));
	return NULL;
}
Example #2
0
void *
nlm_granted_msg_1_svc(nlm_testargs *arg, struct svc_req *rqstp)
{
	static nlm_res res;

	if (debug_level)
		log_from_addr("nlm_granted_msg", rqstp);

	res.cookie = arg->cookie;
	res.stat.stat = lock_answer(arg->alock.svid, &arg->cookie,
		nlm_granted, NULL, NLM_VERS) == 0 ?
		nlm_granted : nlm_denied;

	transmit_result(NLM_GRANTED_RES, &res, getrpcaddr(rqstp));
	return (NULL);
}
Example #3
0
void *
nlm_unlock_msg_1_svc(nlm_unlockargs *arg, struct svc_req *rqstp)
{
	static nlm_res result;
	struct nlm4_lock arg4;

	nlmtonlm4(&arg->alock, &arg4);

	if (debug_level)
		log_from_addr("nlm_unlock_msg", rqstp);

	result.stat.stat = unlock(&arg4, 0);
	result.cookie = arg->cookie;

	transmit_result(NLM_UNLOCK_RES, &result, svc_getcaller(rqstp->rq_xprt));
	return NULL;
}
Example #4
0
void *
nlm_unlock_msg_1_svc(nlm_unlockargs *arg, struct svc_req *rqstp)
{
	static nlm_res res;
	struct nlm4_lock arg4;

	nlmtonlm4(&arg->alock, &arg4);

	if (debug_level)
		log_from_addr("nlm_unlock_msg", rqstp);

	res.stat.stat = unlock(&arg4, 0);
	res.cookie = arg->cookie;

	transmit_result(NLM_UNLOCK_RES, &res, getrpcaddr(rqstp));
	return (NULL);
}
Example #5
0
void *
nlm_cancel_msg_1_svc(nlm_cancargs *arg, struct svc_req *rqstp)
{
	static nlm_res result;
	struct nlm4_lock arg4;

	nlmtonlm4(&arg->alock, &arg4);

	if (debug_level)
		log_from_addr("nlm_cancel_msg", rqstp);

	result.cookie = arg->cookie;
	/*
	 * Since at present we never return 'nlm_blocked', there can never be
	 * a lock to cancel, so this call always fails.
	 */
	result.stat.stat = unlock(&arg4, LOCK_CANCEL);
	transmit_result(NLM_CANCEL_RES, &result, svc_getcaller(rqstp->rq_xprt));
	return NULL;
}
Example #6
0
void *
nlm_lock_msg_1_svc(nlm_lockargs *arg, struct svc_req *rqstp)
{
	static nlm_res result;
	struct nlm4_lockargs arg4;

	nlmtonlm4(&arg->alock, &arg4.alock);
	arg4.cookie = arg->cookie;
	arg4.block = arg->block;
	arg4.exclusive = arg->exclusive;
	arg4.reclaim = arg->reclaim;
	arg4.state = arg->state;

	if (debug_level)
		log_from_addr("nlm_lock_msg", rqstp);

	result.cookie = arg->cookie;
	result.stat.stat = getlock(&arg4, rqstp, LOCK_ASYNC | LOCK_MON);
	transmit_result(NLM_LOCK_RES, &result, svc_getcaller(rqstp->rq_xprt));

	return NULL;
}