Lines Matching refs:req
129 static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl)
131 struct nlm_args *argp = &req->a_args;
133 char *nodename = req->a_host->h_rpcclnt->cl_nodename;
138 lock->oh.data = req->a_owner;
139 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
148 static void nlmclnt_release_lockargs(struct nlm_rqst *req)
150 WARN_ON_ONCE(req->a_args.lock.fl.fl_ops != NULL);
264 nlmclnt_call(const struct cred *cred, struct nlm_rqst *req, u32 proc)
266 struct nlm_host *host = req->a_host;
268 struct nlm_args *argp = &req->a_args;
269 struct nlm_res *resp = &req->a_res;
342 static struct rpc_task *__nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct rpc_call_ops *tk_ops)
344 struct nlm_host *host = req->a_host;
349 .callback_data = req,
366 tk_ops->rpc_release(req);
370 static int nlm_do_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct rpc_call_ops *tk_ops)
374 task = __nlm_async_call(req, proc, msg, tk_ops);
384 int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
387 .rpc_argp = &req->a_args,
388 .rpc_resp = &req->a_res,
390 return nlm_do_async_call(req, proc, &msg, tk_ops);
393 int nlm_async_reply(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
396 .rpc_argp = &req->a_res,
398 return nlm_do_async_call(req, proc, &msg, tk_ops);
409 static int nlmclnt_async_call(const struct cred *cred, struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops)
412 .rpc_argp = &req->a_args,
413 .rpc_resp = &req->a_res,
419 task = __nlm_async_call(req, proc, &msg, tk_ops);
431 nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl)
435 status = nlmclnt_call(nfs_file_cred(fl->fl_file), req, NLMPROC_TEST);
439 switch (req->a_res.status) {
447 fl->fl_start = req->a_res.lock.fl.fl_start;
448 fl->fl_end = req->a_res.lock.fl.fl_end;
449 fl->fl_type = req->a_res.lock.fl.fl_type;
450 fl->fl_pid = -req->a_res.lock.fl.fl_pid;
453 status = nlm_stat_to_errno(req->a_res.status);
456 trace_nlmclnt_test(&req->a_args.lock,
457 (const struct sockaddr *)&req->a_host->h_addr,
458 req->a_host->h_addrlen, req->a_res.status);
459 nlmclnt_release_call(req);
519 nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
522 struct nlm_host *host = req->a_host;
523 struct nlm_res *resp = &req->a_res;
532 req->a_args.state = nsm_local_state;
557 status = nlmclnt_call(cred, req, NLMPROC_LOCK);
566 status = nlmclnt_wait(&block, req, NLMCLNT_POLL_TIMEOUT);
580 if (!req->a_args.block)
582 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0)
613 trace_nlmclnt_lock(&req->a_args.lock,
614 (const struct sockaddr *)&req->a_host->h_addr,
615 req->a_host->h_addrlen, req->a_res.status);
616 nlmclnt_release_call(req);
620 trace_nlmclnt_lock(&req->a_args.lock,
621 (const struct sockaddr *)&req->a_host->h_addr,
622 req->a_host->h_addrlen, req->a_res.status);
632 nlmclnt_async_call(cred, req, NLMPROC_UNLOCK, &nlmclnt_unlock_ops);
641 struct nlm_rqst *req)
645 memset(req, 0, sizeof(*req));
646 locks_init_lock(&req->a_args.lock.fl);
647 locks_init_lock(&req->a_res.lock.fl);
648 req->a_host = host;
651 nlmclnt_setlockargs(req, fl);
652 req->a_args.reclaim = 1;
654 status = nlmclnt_call(nfs_file_cred(fl->fl_file), req, NLMPROC_LOCK);
655 if (status >= 0 && req->a_res.status == nlm_granted)
660 status, ntohl(req->a_res.status));
681 nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl)
683 struct nlm_host *host = req->a_host;
684 struct nlm_res *resp = &req->a_res;
703 refcount_inc(&req->a_count);
704 status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req,
718 trace_nlmclnt_unlock(&req->a_args.lock,
719 (const struct sockaddr *)&req->a_host->h_addr,
720 req->a_host->h_addrlen, req->a_res.status);
721 nlmclnt_release_call(req);
727 struct nlm_rqst *req = data;
728 const struct nlmclnt_operations *nlmclnt_ops = req->a_host->h_nlmclnt_ops;
732 defer_call = nlmclnt_ops->nlmclnt_unlock_prepare(task, req->a_callback_data);
740 struct nlm_rqst *req = data;
741 u32 status = ntohl(req->a_res.status);
765 nlm_rebind_host(req->a_host);
783 struct nlm_rqst *req;
789 req = nlm_alloc_call(host);
790 if (!req)
792 req->a_flags = RPC_TASK_ASYNC;
794 nlmclnt_setlockargs(req, fl);
795 req->a_args.block = block;
797 refcount_inc(&req->a_count);
798 status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req,
800 if (status == 0 && req->a_res.status == nlm_lck_denied)
802 nlmclnt_release_call(req);
808 struct nlm_rqst *req = data;
809 u32 status = ntohl(req->a_res.status);
839 if (req->a_retries++ >= NLMCLNT_MAX_RETRIES)
841 nlm_rebind_host(req->a_host);