Lines Matching refs:clp

846 static void nfsd41_cb_inflight_begin(struct nfs4_client *clp)  in nfsd41_cb_inflight_begin()  argument
848 atomic_inc(&clp->cl_cb_inflight); in nfsd41_cb_inflight_begin()
851 static void nfsd41_cb_inflight_end(struct nfs4_client *clp) in nfsd41_cb_inflight_end() argument
854 if (atomic_dec_and_test(&clp->cl_cb_inflight)) in nfsd41_cb_inflight_end()
855 wake_up_var(&clp->cl_cb_inflight); in nfsd41_cb_inflight_end()
858 static void nfsd41_cb_inflight_wait_complete(struct nfs4_client *clp) in nfsd41_cb_inflight_wait_complete() argument
860 wait_var_event(&clp->cl_cb_inflight, in nfsd41_cb_inflight_wait_complete()
861 !atomic_read(&clp->cl_cb_inflight)); in nfsd41_cb_inflight_wait_complete()
864 static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, st… in get_backchannel_cred() argument
866 if (clp->cl_minorversion == 0) { in get_backchannel_cred()
867 client->cl_principal = clp->cl_cred.cr_targ_princ ? in get_backchannel_cred()
868 clp->cl_cred.cr_targ_princ : "nfs"; in get_backchannel_cred()
884 static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_s… in setup_callback_client() argument
886 int maxtime = max_cb_time(clp->net); in setup_callback_client()
893 .net = clp->net, in setup_callback_client()
906 if (clp->cl_minorversion == 0) { in setup_callback_client()
907 if (!clp->cl_cred.cr_principal && in setup_callback_client()
908 (clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5)) { in setup_callback_client()
909 trace_nfsd_cb_setup_err(clp, -EINVAL); in setup_callback_client()
912 args.client_name = clp->cl_cred.cr_principal; in setup_callback_client()
915 args.authflavor = clp->cl_cred.cr_flavor; in setup_callback_client()
916 clp->cl_cb_ident = conn->cb_ident; in setup_callback_client()
920 clp->cl_cb_conn.cb_xprt = conn->cb_xprt; in setup_callback_client()
921 clp->cl_cb_session = ses; in setup_callback_client()
923 args.prognumber = clp->cl_cb_session->se_cb_prog; in setup_callback_client()
931 trace_nfsd_cb_setup_err(clp, PTR_ERR(client)); in setup_callback_client()
934 cred = get_backchannel_cred(clp, client, ses); in setup_callback_client()
936 trace_nfsd_cb_setup_err(clp, -ENOMEM); in setup_callback_client()
940 clp->cl_cb_client = client; in setup_callback_client()
941 clp->cl_cb_cred = cred; in setup_callback_client()
943 trace_nfsd_cb_setup(clp, rpc_peeraddr2str(client, RPC_DISPLAY_NETID), in setup_callback_client()
949 static void nfsd4_mark_cb_state(struct nfs4_client *clp, int newstate) in nfsd4_mark_cb_state() argument
951 if (clp->cl_cb_state != newstate) { in nfsd4_mark_cb_state()
952 clp->cl_cb_state = newstate; in nfsd4_mark_cb_state()
953 trace_nfsd_cb_state(clp); in nfsd4_mark_cb_state()
957 static void nfsd4_mark_cb_down(struct nfs4_client *clp, int reason) in nfsd4_mark_cb_down() argument
959 if (test_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags)) in nfsd4_mark_cb_down()
961 nfsd4_mark_cb_state(clp, NFSD4_CB_DOWN); in nfsd4_mark_cb_down()
964 static void nfsd4_mark_cb_fault(struct nfs4_client *clp, int reason) in nfsd4_mark_cb_fault() argument
966 if (test_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags)) in nfsd4_mark_cb_fault()
968 nfsd4_mark_cb_state(clp, NFSD4_CB_FAULT); in nfsd4_mark_cb_fault()
973 struct nfs4_client *clp = container_of(calldata, struct nfs4_client, cl_cb_null); in nfsd4_cb_probe_done() local
976 nfsd4_mark_cb_down(clp, task->tk_status); in nfsd4_cb_probe_done()
978 nfsd4_mark_cb_state(clp, NFSD4_CB_UP); in nfsd4_cb_probe_done()
983 struct nfs4_client *clp = container_of(calldata, struct nfs4_client, cl_cb_null); in nfsd4_cb_probe_release() local
985 nfsd41_cb_inflight_end(clp); in nfsd4_cb_probe_release()
1000 void nfsd4_probe_callback(struct nfs4_client *clp) in nfsd4_probe_callback() argument
1002 trace_nfsd_cb_probe(clp); in nfsd4_probe_callback()
1003 nfsd4_mark_cb_state(clp, NFSD4_CB_UNKNOWN); in nfsd4_probe_callback()
1004 set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); in nfsd4_probe_callback()
1005 nfsd4_run_cb(&clp->cl_cb_null); in nfsd4_probe_callback()
1008 void nfsd4_probe_callback_sync(struct nfs4_client *clp) in nfsd4_probe_callback_sync() argument
1010 nfsd4_probe_callback(clp); in nfsd4_probe_callback_sync()
1014 void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn) in nfsd4_change_callback() argument
1016 nfsd4_mark_cb_state(clp, NFSD4_CB_UNKNOWN); in nfsd4_change_callback()
1017 spin_lock(&clp->cl_lock); in nfsd4_change_callback()
1018 memcpy(&clp->cl_cb_conn, conn, sizeof(struct nfs4_cb_conn)); in nfsd4_change_callback()
1019 spin_unlock(&clp->cl_lock); in nfsd4_change_callback()
1029 struct nfs4_client *clp = cb->cb_clp; in nfsd41_cb_get_slot() local
1032 test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) { in nfsd41_cb_get_slot()
1033 rpc_sleep_on(&clp->cl_cb_waitq, task, NULL); in nfsd41_cb_get_slot()
1035 if (test_and_set_bit(0, &clp->cl_cb_slot_busy) != 0) { in nfsd41_cb_get_slot()
1039 rpc_wake_up_queued_task(&clp->cl_cb_waitq, task); in nfsd41_cb_get_slot()
1047 struct nfs4_client *clp = cb->cb_clp; in nfsd41_cb_release_slot() local
1051 clear_bit(0, &clp->cl_cb_slot_busy); in nfsd41_cb_release_slot()
1052 rpc_wake_up_next(&clp->cl_cb_waitq); in nfsd41_cb_release_slot()
1058 struct nfs4_client *clp = cb->cb_clp; in nfsd41_destroy_cb() local
1063 nfsd41_cb_inflight_end(clp); in nfsd41_destroy_cb()
1073 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_prepare() local
1074 u32 minorversion = clp->cl_minorversion; in nfsd4_cb_prepare()
1089 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_sequence_done() local
1090 struct nfsd4_session *session = clp->cl_cb_session; in nfsd4_cb_sequence_done()
1093 if (!clp->cl_minorversion) { in nfsd4_cb_sequence_done()
1153 clp->cl_cb_session->se_cb_seq_nr); in nfsd4_cb_sequence_done()
1164 if (!test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) { in nfsd4_cb_sequence_done()
1174 struct nfs4_client *clp = cb->cb_clp; in nfsd4_cb_done() local
1194 nfsd4_mark_cb_down(clp, task->tk_status); in nfsd4_cb_done()
1233 void nfsd4_shutdown_callback(struct nfs4_client *clp) in nfsd4_shutdown_callback() argument
1235 if (clp->cl_cb_state != NFSD4_CB_UNKNOWN) in nfsd4_shutdown_callback()
1236 trace_nfsd_cb_shutdown(clp); in nfsd4_shutdown_callback()
1238 set_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags); in nfsd4_shutdown_callback()
1244 nfsd4_run_cb(&clp->cl_cb_null); in nfsd4_shutdown_callback()
1246 nfsd41_cb_inflight_wait_complete(clp); in nfsd4_shutdown_callback()
1250 static struct nfsd4_conn * __nfsd4_find_backchannel(struct nfs4_client *clp) in __nfsd4_find_backchannel() argument
1255 list_for_each_entry(s, &clp->cl_sessions, se_perclnt) { in __nfsd4_find_backchannel()
1273 struct nfs4_client *clp = cb->cb_clp; in nfsd4_process_cb_update() local
1282 if (clp->cl_cb_client) { in nfsd4_process_cb_update()
1283 rpc_shutdown_client(clp->cl_cb_client); in nfsd4_process_cb_update()
1284 clp->cl_cb_client = NULL; in nfsd4_process_cb_update()
1285 put_cred(clp->cl_cb_cred); in nfsd4_process_cb_update()
1286 clp->cl_cb_cred = NULL; in nfsd4_process_cb_update()
1288 if (clp->cl_cb_conn.cb_xprt) { in nfsd4_process_cb_update()
1289 svc_xprt_put(clp->cl_cb_conn.cb_xprt); in nfsd4_process_cb_update()
1290 clp->cl_cb_conn.cb_xprt = NULL; in nfsd4_process_cb_update()
1292 if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) in nfsd4_process_cb_update()
1294 spin_lock(&clp->cl_lock); in nfsd4_process_cb_update()
1299 BUG_ON(!(clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK)); in nfsd4_process_cb_update()
1300 clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); in nfsd4_process_cb_update()
1302 c = __nfsd4_find_backchannel(clp); in nfsd4_process_cb_update()
1308 spin_unlock(&clp->cl_lock); in nfsd4_process_cb_update()
1310 err = setup_callback_client(clp, &conn, ses); in nfsd4_process_cb_update()
1312 nfsd4_mark_cb_down(clp, err); in nfsd4_process_cb_update()
1324 struct nfs4_client *clp = cb->cb_clp; in nfsd4_run_cb_work() local
1335 if (clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK) in nfsd4_run_cb_work()
1338 clnt = clp->cl_cb_client; in nfsd4_run_cb_work()
1348 if (!cb->cb_ops && clp->cl_minorversion) { in nfsd4_run_cb_work()
1349 nfsd4_mark_cb_state(clp, NFSD4_CB_UP); in nfsd4_run_cb_work()
1354 cb->cb_msg.rpc_cred = clp->cl_cb_cred; in nfsd4_run_cb_work()
1355 flags = clp->cl_minorversion ? RPC_TASK_NOCONNECT : RPC_TASK_SOFTCONN; in nfsd4_run_cb_work()
1360 void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, in nfsd4_init_cb() argument
1363 cb->cb_clp = clp; in nfsd4_init_cb()
1377 struct nfs4_client *clp = cb->cb_clp; in nfsd4_run_cb() local
1379 nfsd41_cb_inflight_begin(clp); in nfsd4_run_cb()
1381 nfsd41_cb_inflight_end(clp); in nfsd4_run_cb()