Lines Matching refs:req
124 static void nlmclnt_setlockargs(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_setlockargs() argument
126 struct nlm_args *argp = &req->a_args; in nlmclnt_setlockargs()
128 char *nodename = req->a_host->h_rpcclnt->cl_nodename; in nlmclnt_setlockargs()
133 lock->oh.data = req->a_owner; in nlmclnt_setlockargs()
134 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s", in nlmclnt_setlockargs()
143 static void nlmclnt_release_lockargs(struct nlm_rqst *req) in nlmclnt_release_lockargs() argument
145 WARN_ON_ONCE(req->a_args.lock.fl.fl_ops != NULL); in nlmclnt_release_lockargs()
249 nlmclnt_call(struct rpc_cred *cred, struct nlm_rqst *req, u32 proc) in nlmclnt_call() argument
251 struct nlm_host *host = req->a_host; in nlmclnt_call()
253 struct nlm_args *argp = &req->a_args; in nlmclnt_call()
254 struct nlm_res *resp = &req->a_res; in nlmclnt_call()
327 static struct rpc_task *__nlm_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, c… in __nlm_async_call() argument
329 struct nlm_host *host = req->a_host; in __nlm_async_call()
334 .callback_data = req, in __nlm_async_call()
351 tk_ops->rpc_release(req); in __nlm_async_call()
355 static int nlm_do_async_call(struct nlm_rqst *req, u32 proc, struct rpc_message *msg, const struct … in nlm_do_async_call() argument
359 task = __nlm_async_call(req, proc, msg, tk_ops); in nlm_do_async_call()
369 int nlm_async_call(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops) in nlm_async_call() argument
372 .rpc_argp = &req->a_args, in nlm_async_call()
373 .rpc_resp = &req->a_res, in nlm_async_call()
375 return nlm_do_async_call(req, proc, &msg, tk_ops); in nlm_async_call()
378 int nlm_async_reply(struct nlm_rqst *req, u32 proc, const struct rpc_call_ops *tk_ops) in nlm_async_reply() argument
381 .rpc_argp = &req->a_res, in nlm_async_reply()
383 return nlm_do_async_call(req, proc, &msg, tk_ops); in nlm_async_reply()
394 static int nlmclnt_async_call(struct rpc_cred *cred, struct nlm_rqst *req, u32 proc, const struct r… in nlmclnt_async_call() argument
397 .rpc_argp = &req->a_args, in nlmclnt_async_call()
398 .rpc_resp = &req->a_res, in nlmclnt_async_call()
404 task = __nlm_async_call(req, proc, &msg, tk_ops); in nlmclnt_async_call()
416 nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_test() argument
420 status = nlmclnt_call(nfs_file_cred(fl->fl_file), req, NLMPROC_TEST); in nlmclnt_test()
424 switch (req->a_res.status) { in nlmclnt_test()
432 fl->fl_start = req->a_res.lock.fl.fl_start; in nlmclnt_test()
433 fl->fl_end = req->a_res.lock.fl.fl_end; in nlmclnt_test()
434 fl->fl_type = req->a_res.lock.fl.fl_type; in nlmclnt_test()
438 status = nlm_stat_to_errno(req->a_res.status); in nlmclnt_test()
441 nlmclnt_release_call(req); in nlmclnt_test()
501 nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_lock() argument
504 struct nlm_host *host = req->a_host; in nlmclnt_lock()
505 struct nlm_res *resp = &req->a_res; in nlmclnt_lock()
513 req->a_args.state = nsm_local_state; in nlmclnt_lock()
531 status = nlmclnt_call(cred, req, NLMPROC_LOCK); in nlmclnt_lock()
540 status = nlmclnt_block(block, req, NLMCLNT_POLL_TIMEOUT); in nlmclnt_lock()
551 if (!req->a_args.block) in nlmclnt_lock()
553 if (nlmclnt_cancel(host, req->a_args.block, fl) == 0) in nlmclnt_lock()
586 nlmclnt_release_call(req); in nlmclnt_lock()
600 nlmclnt_async_call(cred, req, NLMPROC_UNLOCK, &nlmclnt_unlock_ops); in nlmclnt_lock()
609 struct nlm_rqst *req) in nlmclnt_reclaim() argument
613 memset(req, 0, sizeof(*req)); in nlmclnt_reclaim()
614 locks_init_lock(&req->a_args.lock.fl); in nlmclnt_reclaim()
615 locks_init_lock(&req->a_res.lock.fl); in nlmclnt_reclaim()
616 req->a_host = host; in nlmclnt_reclaim()
619 nlmclnt_setlockargs(req, fl); in nlmclnt_reclaim()
620 req->a_args.reclaim = 1; in nlmclnt_reclaim()
622 status = nlmclnt_call(nfs_file_cred(fl->fl_file), req, NLMPROC_LOCK); in nlmclnt_reclaim()
623 if (status >= 0 && req->a_res.status == nlm_granted) in nlmclnt_reclaim()
628 status, ntohl(req->a_res.status)); in nlmclnt_reclaim()
649 nlmclnt_unlock(struct nlm_rqst *req, struct file_lock *fl) in nlmclnt_unlock() argument
651 struct nlm_host *host = req->a_host; in nlmclnt_unlock()
652 struct nlm_res *resp = &req->a_res; in nlmclnt_unlock()
671 atomic_inc(&req->a_count); in nlmclnt_unlock()
672 status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req, in nlmclnt_unlock()
686 nlmclnt_release_call(req); in nlmclnt_unlock()
692 struct nlm_rqst *req = data; in nlmclnt_unlock_callback() local
693 u32 status = ntohl(req->a_res.status); in nlmclnt_unlock_callback()
717 nlm_rebind_host(req->a_host); in nlmclnt_unlock_callback()
734 struct nlm_rqst *req; in nlmclnt_cancel() local
740 req = nlm_alloc_call(host); in nlmclnt_cancel()
741 if (!req) in nlmclnt_cancel()
743 req->a_flags = RPC_TASK_ASYNC; in nlmclnt_cancel()
745 nlmclnt_setlockargs(req, fl); in nlmclnt_cancel()
746 req->a_args.block = block; in nlmclnt_cancel()
748 atomic_inc(&req->a_count); in nlmclnt_cancel()
749 status = nlmclnt_async_call(nfs_file_cred(fl->fl_file), req, in nlmclnt_cancel()
751 if (status == 0 && req->a_res.status == nlm_lck_denied) in nlmclnt_cancel()
753 nlmclnt_release_call(req); in nlmclnt_cancel()
759 struct nlm_rqst *req = data; in nlmclnt_cancel_callback() local
760 u32 status = ntohl(req->a_res.status); in nlmclnt_cancel_callback()
793 if (req->a_retries++ >= NLMCLNT_MAX_RETRIES) in nlmclnt_cancel_callback()
795 nlm_rebind_host(req->a_host); in nlmclnt_cancel_callback()