Lines Matching refs:req
129 static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_setlockargs() argument
131 struct nlm_args *argp = &req->a_args; in nlmclnt_setlockargs()
133 char *nodename = req->a_host->h_rpcclnt->cl_nodename; in nlmclnt_setlockargs()
139 lock->oh.data = req->a_owner; in nlmclnt_setlockargs()
140 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s", in nlmclnt_setlockargs()
149 static void nlmclnt_release_lockargs(struct nlm_rqst *req) in nlmclnt_release_lockargs() argument
151 WARN_ON_ONCE(req->a_args.lock.fl.fl_ops != NULL); in nlmclnt_release_lockargs()
265 nlmclnt_call(const struct cred *cred, struct nlm_rqst *req, u32 proc) in nlmclnt_call() argument
267 struct nlm_host *host = req->a_host; in nlmclnt_call()
269 struct nlm_args *argp = &req->a_args; in nlmclnt_call()
270 struct nlm_res *resp = &req->a_res; in nlmclnt_call()
343 static struct rpc_task *__nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, c… in __nlm_async_call() argument
345 struct nlm_host *host = req->a_host; in __nlm_async_call()
350 .callback_data = req, in __nlm_async_call()
367 tk_ops->rpc_release(req); in __nlm_async_call()
371 static int nlm_do_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct … in nlm_do_async_call() argument
375 task = __nlm_async_call(req, proc, msg, tk_ops); in nlm_do_async_call()
385 int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops) in nlm_async_call() argument
388 .rpc_argp = &req->a_args, in nlm_async_call()
389 .rpc_resp = &req->a_res, in nlm_async_call()
391 return nlm_do_async_call(req, proc, &msg, tk_ops); in nlm_async_call()
394 int nlm_async_reply(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops) in nlm_async_reply() argument
397 .rpc_argp = &req->a_res, in nlm_async_reply()
399 return nlm_do_async_call(req, proc, &msg, tk_ops); in nlm_async_reply()
410 static int nlmclnt_async_call(const struct cred *cred, struct nlm_rqst *req, u32 proc, const struct… in nlmclnt_async_call() argument
413 .rpc_argp = &req->a_args, in nlmclnt_async_call()
414 .rpc_resp = &req->a_res, in nlmclnt_async_call()
420 task = __nlm_async_call(req, proc, &msg, tk_ops); in nlmclnt_async_call()
432 nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_test() argument
436 status = nlmclnt_call(nfs_file_cred(fl->c.flc_file), req, in nlmclnt_test()
441 switch (req->a_res.status) { in nlmclnt_test()
449 fl->fl_start = req->a_res.lock.fl.fl_start; in nlmclnt_test()
450 fl->fl_end = req->a_res.lock.fl.fl_end; in nlmclnt_test()
451 fl->c.flc_type = req->a_res.lock.fl.c.flc_type; in nlmclnt_test()
452 fl->c.flc_pid = -req->a_res.lock.fl.c.flc_pid; in nlmclnt_test()
455 status = nlm_stat_to_errno(req->a_res.status); in nlmclnt_test()
458 trace_nlmclnt_test(&req->a_args.lock, in nlmclnt_test()
459 (const struct sockaddr *)&req->a_host->h_addr, in nlmclnt_test()
460 req->a_host->h_addrlen, req->a_res.status); in nlmclnt_test()
461 nlmclnt_release_call(req); in nlmclnt_test()
522 nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_lock() argument
525 struct nlm_host *host = req->a_host; in nlmclnt_lock()
526 struct nlm_res *resp = &req->a_res; in nlmclnt_lock()
535 req->a_args.state = nsm_local_state; in nlmclnt_lock()
560 status = nlmclnt_call(cred, req, NLMPROC_LOCK); in nlmclnt_lock()
569 status = nlmclnt_wait(&block, req, NLMCLNT_POLL_TIMEOUT); in nlmclnt_lock()
583 if (!req->a_args.block) in nlmclnt_lock()
585 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0) in nlmclnt_lock()
616 trace_nlmclnt_lock(&req->a_args.lock, in nlmclnt_lock()
617 (const struct sockaddr *)&req->a_host->h_addr, in nlmclnt_lock()
618 req->a_host->h_addrlen, req->a_res.status); in nlmclnt_lock()
619 nlmclnt_release_call(req); in nlmclnt_lock()
623 trace_nlmclnt_lock(&req->a_args.lock, in nlmclnt_lock()
624 (const struct sockaddr *)&req->a_host->h_addr, in nlmclnt_lock()
625 req->a_host->h_addrlen, req->a_res.status); in nlmclnt_lock()
635 nlmclnt_async_call(cred, req, NLMPROC_UNLOCK, &nlmclnt_unlock_ops); in nlmclnt_lock()
644 struct nlm_rqst *req) in nlmclnt_reclaim() argument
648 memset(req, 0, sizeof(*req)); in nlmclnt_reclaim()
649 locks_init_lock(&req->a_args.lock.fl); in nlmclnt_reclaim()
650 locks_init_lock(&req->a_res.lock.fl); in nlmclnt_reclaim()
651 req->a_host = host; in nlmclnt_reclaim()
654 nlmclnt_setlockargs(req, fl); in nlmclnt_reclaim()
655 req->a_args.reclaim = 1; in nlmclnt_reclaim()
657 status = nlmclnt_call(nfs_file_cred(fl->c.flc_file), req, in nlmclnt_reclaim()
659 if (status >= 0 && req->a_res.status == nlm_granted) in nlmclnt_reclaim()
665 status, ntohl(req->a_res.status)); in nlmclnt_reclaim()
686 nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_unlock() argument
688 struct nlm_host *host = req->a_host; in nlmclnt_unlock()
689 struct nlm_res *resp = &req->a_res; in nlmclnt_unlock()
708 refcount_inc(&req->a_count); in nlmclnt_unlock()
709 status = nlmclnt_async_call(nfs_file_cred(fl->c.flc_file), req, in nlmclnt_unlock()
723 trace_nlmclnt_unlock(&req->a_args.lock, in nlmclnt_unlock()
724 (const struct sockaddr *)&req->a_host->h_addr, in nlmclnt_unlock()
725 req->a_host->h_addrlen, req->a_res.status); in nlmclnt_unlock()
726 nlmclnt_release_call(req); in nlmclnt_unlock()
732 struct nlm_rqst *req = data; in nlmclnt_unlock_prepare() local
733 const struct nlmclnt_operations *nlmclnt_ops = req->a_host->h_nlmclnt_ops; in nlmclnt_unlock_prepare()
737 defer_call = nlmclnt_ops->nlmclnt_unlock_prepare(task, req->a_callback_data); in nlmclnt_unlock_prepare()
745 struct nlm_rqst *req = data; in nlmclnt_unlock_callback() local
746 u32 status = ntohl(req->a_res.status); in nlmclnt_unlock_callback()
770 nlm_rebind_host(req->a_host); in nlmclnt_unlock_callback()
788 struct nlm_rqst *req; in nlmclnt_cancel() local
794 req = nlm_alloc_call(host); in nlmclnt_cancel()
795 if (!req) in nlmclnt_cancel()
797 req->a_flags = RPC_TASK_ASYNC; in nlmclnt_cancel()
799 nlmclnt_setlockargs(req, fl); in nlmclnt_cancel()
800 req->a_args.block = block; in nlmclnt_cancel()
802 refcount_inc(&req->a_count); in nlmclnt_cancel()
803 status = nlmclnt_async_call(nfs_file_cred(fl->c.flc_file), req, in nlmclnt_cancel()
805 if (status == 0 && req->a_res.status == nlm_lck_denied) in nlmclnt_cancel()
807 nlmclnt_release_call(req); in nlmclnt_cancel()
813 struct nlm_rqst *req = data; in nlmclnt_cancel_callback() local
814 u32 status = ntohl(req->a_res.status); in nlmclnt_cancel_callback()
844 if (req->a_retries++ >= NLMCLNT_MAX_RETRIES) in nlmclnt_cancel_callback()
846 nlm_rebind_host(req->a_host); in nlmclnt_cancel_callback()