Lines Matching refs:clp

699 static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, stru…  in get_backchannel_cred()  argument
701 if (clp->cl_minorversion == 0) { in get_backchannel_cred()
729 static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_s… in setup_callback_client() argument
731 int maxtime = max_cb_time(clp->net); in setup_callback_client()
738 .net = clp->net, in setup_callback_client()
750 if (clp->cl_minorversion == 0) { in setup_callback_client()
751 if (!clp->cl_cred.cr_principal && in setup_callback_client()
752 (clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5)) in setup_callback_client()
754 args.client_name = clp->cl_cred.cr_principal; in setup_callback_client()
757 args.authflavor = clp->cl_cred.cr_flavor; in setup_callback_client()
758 clp->cl_cb_ident = conn->cb_ident; in setup_callback_client()
762 clp->cl_cb_conn.cb_xprt = conn->cb_xprt; in setup_callback_client()
763 clp->cl_cb_session = ses; in setup_callback_client()
765 args.prognumber = clp->cl_cb_session->se_cb_prog; in setup_callback_client()
777 cred = get_backchannel_cred(clp, client, ses); in setup_callback_client()
782 clp->cl_cb_client = client; in setup_callback_client()
783 clp->cl_cb_cred = cred; in setup_callback_client()
787 static void warn_no_callback_path(struct nfs4_client *clp, int reason) in warn_no_callback_path() argument
790 (int)clp->cl_name.len, clp->cl_name.data, reason); in warn_no_callback_path()
793 static void nfsd4_mark_cb_down(struct nfs4_client *clp, int reason) in nfsd4_mark_cb_down() argument
795 clp->cl_cb_state = NFSD4_CB_DOWN; in nfsd4_mark_cb_down()
796 warn_no_callback_path(clp, reason); in nfsd4_mark_cb_down()
799 static void nfsd4_mark_cb_fault(struct nfs4_client *clp, int reason) in nfsd4_mark_cb_fault() argument
801 clp->cl_cb_state = NFSD4_CB_FAULT; in nfsd4_mark_cb_fault()
802 warn_no_callback_path(clp, reason); in nfsd4_mark_cb_fault()
807 struct nfs4_client *clp = container_of(calldata, struct nfs4_client, cl_cb_null); in nfsd4_cb_probe_done() local
810 nfsd4_mark_cb_down(clp, task->tk_status); in nfsd4_cb_probe_done()
812 clp->cl_cb_state = NFSD4_CB_UP; in nfsd4_cb_probe_done()
827 void nfsd4_probe_callback(struct nfs4_client *clp) in nfsd4_probe_callback() argument
829 clp->cl_cb_state = NFSD4_CB_UNKNOWN; in nfsd4_probe_callback()
830 set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); in nfsd4_probe_callback()
831 nfsd4_run_cb(&clp->cl_cb_null); in nfsd4_probe_callback()
834 void nfsd4_probe_callback_sync(struct nfs4_client *clp) in nfsd4_probe_callback_sync() argument
836 nfsd4_probe_callback(clp); in nfsd4_probe_callback_sync()
840 void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn) in nfsd4_change_callback() argument
842 clp->cl_cb_state = NFSD4_CB_UNKNOWN; in nfsd4_change_callback()
843 spin_lock(&clp->cl_lock); in nfsd4_change_callback()
844 memcpy(&clp->cl_cb_conn, conn, sizeof(struct nfs4_cb_conn)); in nfsd4_change_callback()
845 spin_unlock(&clp->cl_lock); in nfsd4_change_callback()
853 static bool nfsd41_cb_get_slot(struct nfs4_client *clp, struct rpc_task *task) in nfsd41_cb_get_slot() argument
855 if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) { in nfsd41_cb_get_slot()
856 rpc_sleep_on(&clp->cl_cb_waitq, task, NULL); in nfsd41_cb_get_slot()
858 if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) { in nfsd41_cb_get_slot()
862 rpc_wake_up_queued_task(&clp->cl_cb_waitq, task); in nfsd41_cb_get_slot()
874 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_prepare() local
875 u32 minorversion = clp->cl_minorversion; in nfsd4_cb_prepare()
879 if (!nfsd41_cb_get_slot(clp, task)) in nfsd4_cb_prepare()
888 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_done() local
891 clp->cl_minorversion); in nfsd4_cb_done()
893 if (clp->cl_minorversion) { in nfsd4_cb_done()
896 ++clp->cl_cb_session->se_cb_seq_nr; in nfsd4_cb_done()
897 clear_bit(0, &clp->cl_cb_slot_busy); in nfsd4_cb_done()
898 rpc_wake_up_next(&clp->cl_cb_waitq); in nfsd4_cb_done()
900 clp->cl_cb_session->se_cb_seq_nr); in nfsd4_cb_done()
932 nfsd4_mark_cb_down(clp, task->tk_status); in nfsd4_cb_done()
970 void nfsd4_shutdown_callback(struct nfs4_client *clp) in nfsd4_shutdown_callback() argument
972 set_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags); in nfsd4_shutdown_callback()
978 nfsd4_run_cb(&clp->cl_cb_null); in nfsd4_shutdown_callback()
983 static struct nfsd4_conn * __nfsd4_find_backchannel(struct nfs4_client *clp) in __nfsd4_find_backchannel() argument
988 list_for_each_entry(s, &clp->cl_sessions, se_perclnt) { in __nfsd4_find_backchannel()
1000 struct nfs4_client *clp = cb->cb_clp; in nfsd4_process_cb_update() local
1009 if (clp->cl_cb_client) { in nfsd4_process_cb_update()
1010 rpc_shutdown_client(clp->cl_cb_client); in nfsd4_process_cb_update()
1011 clp->cl_cb_client = NULL; in nfsd4_process_cb_update()
1012 put_rpccred(clp->cl_cb_cred); in nfsd4_process_cb_update()
1013 clp->cl_cb_cred = NULL; in nfsd4_process_cb_update()
1015 if (clp->cl_cb_conn.cb_xprt) { in nfsd4_process_cb_update()
1016 svc_xprt_put(clp->cl_cb_conn.cb_xprt); in nfsd4_process_cb_update()
1017 clp->cl_cb_conn.cb_xprt = NULL; in nfsd4_process_cb_update()
1019 if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) in nfsd4_process_cb_update()
1021 spin_lock(&clp->cl_lock); in nfsd4_process_cb_update()
1026 BUG_ON(!(clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK)); in nfsd4_process_cb_update()
1027 clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); in nfsd4_process_cb_update()
1029 c = __nfsd4_find_backchannel(clp); in nfsd4_process_cb_update()
1035 spin_unlock(&clp->cl_lock); in nfsd4_process_cb_update()
1037 err = setup_callback_client(clp, &conn, ses); in nfsd4_process_cb_update()
1039 nfsd4_mark_cb_down(clp, err); in nfsd4_process_cb_update()
1049 struct nfs4_client *clp = cb->cb_clp; in nfsd4_run_cb_work() local
1059 if (clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK) in nfsd4_run_cb_work()
1062 clnt = clp->cl_cb_client; in nfsd4_run_cb_work()
1073 if (!cb->cb_ops && clp->cl_minorversion) { in nfsd4_run_cb_work()
1074 clp->cl_cb_state = NFSD4_CB_UP; in nfsd4_run_cb_work()
1078 cb->cb_msg.rpc_cred = clp->cl_cb_cred; in nfsd4_run_cb_work()
1083 void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, in nfsd4_init_cb() argument
1086 cb->cb_clp = clp; in nfsd4_init_cb()