Lines Matching refs:clp
829 static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, st… in get_backchannel_cred() argument
831 if (clp->cl_minorversion == 0) { in get_backchannel_cred()
832 client->cl_principal = clp->cl_cred.cr_targ_princ ? in get_backchannel_cred()
833 clp->cl_cred.cr_targ_princ : "nfs"; in get_backchannel_cred()
849 static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_s… in setup_callback_client() argument
851 int maxtime = max_cb_time(clp->net); in setup_callback_client()
858 .net = clp->net, in setup_callback_client()
871 if (clp->cl_minorversion == 0) { in setup_callback_client()
872 if (!clp->cl_cred.cr_principal && in setup_callback_client()
873 (clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5)) in setup_callback_client()
875 args.client_name = clp->cl_cred.cr_principal; in setup_callback_client()
878 args.authflavor = clp->cl_cred.cr_flavor; in setup_callback_client()
879 clp->cl_cb_ident = conn->cb_ident; in setup_callback_client()
883 clp->cl_cb_conn.cb_xprt = conn->cb_xprt; in setup_callback_client()
884 clp->cl_cb_session = ses; in setup_callback_client()
886 args.prognumber = clp->cl_cb_session->se_cb_prog; in setup_callback_client()
898 cred = get_backchannel_cred(clp, client, ses); in setup_callback_client()
903 clp->cl_cb_client = client; in setup_callback_client()
904 clp->cl_cb_cred = cred; in setup_callback_client()
908 static void warn_no_callback_path(struct nfs4_client *clp, int reason) in warn_no_callback_path() argument
911 (int)clp->cl_name.len, clp->cl_name.data, reason); in warn_no_callback_path()
914 static void nfsd4_mark_cb_down(struct nfs4_client *clp, int reason) in nfsd4_mark_cb_down() argument
916 if (test_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags)) in nfsd4_mark_cb_down()
918 clp->cl_cb_state = NFSD4_CB_DOWN; in nfsd4_mark_cb_down()
919 warn_no_callback_path(clp, reason); in nfsd4_mark_cb_down()
922 static void nfsd4_mark_cb_fault(struct nfs4_client *clp, int reason) in nfsd4_mark_cb_fault() argument
924 if (test_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags)) in nfsd4_mark_cb_fault()
926 clp->cl_cb_state = NFSD4_CB_FAULT; in nfsd4_mark_cb_fault()
927 warn_no_callback_path(clp, reason); in nfsd4_mark_cb_fault()
932 struct nfs4_client *clp = container_of(calldata, struct nfs4_client, cl_cb_null); in nfsd4_cb_probe_done() local
935 nfsd4_mark_cb_down(clp, task->tk_status); in nfsd4_cb_probe_done()
937 clp->cl_cb_state = NFSD4_CB_UP; in nfsd4_cb_probe_done()
952 void nfsd4_probe_callback(struct nfs4_client *clp) in nfsd4_probe_callback() argument
954 clp->cl_cb_state = NFSD4_CB_UNKNOWN; in nfsd4_probe_callback()
955 set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); in nfsd4_probe_callback()
956 nfsd4_run_cb(&clp->cl_cb_null); in nfsd4_probe_callback()
959 void nfsd4_probe_callback_sync(struct nfs4_client *clp) in nfsd4_probe_callback_sync() argument
961 nfsd4_probe_callback(clp); in nfsd4_probe_callback_sync()
965 void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn) in nfsd4_change_callback() argument
967 clp->cl_cb_state = NFSD4_CB_UNKNOWN; in nfsd4_change_callback()
968 spin_lock(&clp->cl_lock); in nfsd4_change_callback()
969 memcpy(&clp->cl_cb_conn, conn, sizeof(struct nfs4_cb_conn)); in nfsd4_change_callback()
970 spin_unlock(&clp->cl_lock); in nfsd4_change_callback()
978 static bool nfsd41_cb_get_slot(struct nfs4_client *clp, struct rpc_task *task) in nfsd41_cb_get_slot() argument
980 if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) { in nfsd41_cb_get_slot()
981 rpc_sleep_on(&clp->cl_cb_waitq, task, NULL); in nfsd41_cb_get_slot()
983 if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) { in nfsd41_cb_get_slot()
987 rpc_wake_up_queued_task(&clp->cl_cb_waitq, task); in nfsd41_cb_get_slot()
999 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_prepare() local
1000 u32 minorversion = clp->cl_minorversion; in nfsd4_cb_prepare()
1009 if (!cb->cb_holds_slot && !nfsd41_cb_get_slot(clp, task)) in nfsd4_cb_prepare()
1018 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_sequence_done() local
1019 struct nfsd4_session *session = clp->cl_cb_session; in nfsd4_cb_sequence_done()
1022 if (!clp->cl_minorversion) { in nfsd4_cb_sequence_done()
1080 clear_bit(0, &clp->cl_cb_slot_busy); in nfsd4_cb_sequence_done()
1081 rpc_wake_up_next(&clp->cl_cb_waitq); in nfsd4_cb_sequence_done()
1083 clp->cl_cb_session->se_cb_seq_nr); in nfsd4_cb_sequence_done()
1102 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_done() local
1105 clp->cl_minorversion); in nfsd4_cb_done()
1124 nfsd4_mark_cb_down(clp, task->tk_status); in nfsd4_cb_done()
1163 void nfsd4_shutdown_callback(struct nfs4_client *clp) in nfsd4_shutdown_callback() argument
1165 set_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags); in nfsd4_shutdown_callback()
1171 nfsd4_run_cb(&clp->cl_cb_null); in nfsd4_shutdown_callback()
1176 static struct nfsd4_conn * __nfsd4_find_backchannel(struct nfs4_client *clp) in __nfsd4_find_backchannel() argument
1181 list_for_each_entry(s, &clp->cl_sessions, se_perclnt) { in __nfsd4_find_backchannel()
1193 struct nfs4_client *clp = cb->cb_clp; in nfsd4_process_cb_update() local
1202 if (clp->cl_cb_client) { in nfsd4_process_cb_update()
1203 rpc_shutdown_client(clp->cl_cb_client); in nfsd4_process_cb_update()
1204 clp->cl_cb_client = NULL; in nfsd4_process_cb_update()
1205 put_cred(clp->cl_cb_cred); in nfsd4_process_cb_update()
1206 clp->cl_cb_cred = NULL; in nfsd4_process_cb_update()
1208 if (clp->cl_cb_conn.cb_xprt) { in nfsd4_process_cb_update()
1209 svc_xprt_put(clp->cl_cb_conn.cb_xprt); in nfsd4_process_cb_update()
1210 clp->cl_cb_conn.cb_xprt = NULL; in nfsd4_process_cb_update()
1212 if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) in nfsd4_process_cb_update()
1214 spin_lock(&clp->cl_lock); in nfsd4_process_cb_update()
1219 BUG_ON(!(clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK)); in nfsd4_process_cb_update()
1220 clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); in nfsd4_process_cb_update()
1222 c = __nfsd4_find_backchannel(clp); in nfsd4_process_cb_update()
1228 spin_unlock(&clp->cl_lock); in nfsd4_process_cb_update()
1230 err = setup_callback_client(clp, &conn, ses); in nfsd4_process_cb_update()
1232 nfsd4_mark_cb_down(clp, err); in nfsd4_process_cb_update()
1242 struct nfs4_client *clp = cb->cb_clp; in nfsd4_run_cb_work() local
1252 if (clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK) in nfsd4_run_cb_work()
1255 clnt = clp->cl_cb_client; in nfsd4_run_cb_work()
1266 if (!cb->cb_ops && clp->cl_minorversion) { in nfsd4_run_cb_work()
1267 clp->cl_cb_state = NFSD4_CB_UP; in nfsd4_run_cb_work()
1271 cb->cb_msg.rpc_cred = clp->cl_cb_cred; in nfsd4_run_cb_work()
1276 void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, in nfsd4_init_cb() argument
1279 cb->cb_clp = clp; in nfsd4_init_cb()