• Home
  • Raw
  • Download

Lines Matching refs:ctx

114 gss_get_ctx(struct gss_cl_ctx *ctx)  in gss_get_ctx()  argument
116 refcount_inc(&ctx->count); in gss_get_ctx()
117 return ctx; in gss_get_ctx()
121 gss_put_ctx(struct gss_cl_ctx *ctx) in gss_put_ctx() argument
123 if (refcount_dec_and_test(&ctx->count)) in gss_put_ctx()
124 gss_free_ctx(ctx); in gss_put_ctx()
133 gss_cred_set_ctx(struct rpc_cred *cred, struct gss_cl_ctx *ctx) in gss_cred_set_ctx() argument
139 gss_get_ctx(ctx); in gss_cred_set_ctx()
140 rcu_assign_pointer(gss_cred->gc_ctx, ctx); in gss_cred_set_ctx()
150 struct gss_cl_ctx *ctx = NULL; in gss_cred_get_ctx() local
153 ctx = rcu_dereference(gss_cred->gc_ctx); in gss_cred_get_ctx()
154 if (ctx) in gss_cred_get_ctx()
155 gss_get_ctx(ctx); in gss_cred_get_ctx()
157 return ctx; in gss_cred_get_ctx()
163 struct gss_cl_ctx *ctx; in gss_alloc_context() local
165 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); in gss_alloc_context()
166 if (ctx != NULL) { in gss_alloc_context()
167 ctx->gc_proc = RPC_GSS_PROC_DATA; in gss_alloc_context()
168 ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */ in gss_alloc_context()
169 spin_lock_init(&ctx->gc_seq_lock); in gss_alloc_context()
170 refcount_set(&ctx->count,1); in gss_alloc_context()
172 return ctx; in gss_alloc_context()
177 gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct gss_api_mech *gm) in gss_fill_context() argument
195 ctx->gc_expiry = now + ((unsigned long)timeout * HZ); in gss_fill_context()
202 ctx->gc_win = window_size; in gss_fill_context()
204 if (ctx->gc_win == 0) { in gss_fill_context()
216 p = simple_get_netobj(p, end, &ctx->gc_wire_ctx); in gss_fill_context()
228 ret = gss_import_sec_context(p, seclen, gm, &ctx->gc_gss_ctx, NULL, GFP_KERNEL); in gss_fill_context()
242 p = simple_get_netobj(q, end, &ctx->gc_acceptor); in gss_fill_context()
246 trace_rpcgss_context(window_size, ctx->gc_expiry, now, timeout, in gss_fill_context()
247 ctx->gc_acceptor.len, ctx->gc_acceptor.data); in gss_fill_context()
269 struct gss_cl_ctx *ctx; member
306 if (gss_msg->ctx != NULL) in gss_release_msg()
307 gss_put_ctx(gss_msg->ctx); in gss_release_msg()
377 if (gss_msg->ctx == NULL) in gss_handle_downcall_result()
380 gss_cred_set_ctx(&gss_cred->gc_base, gss_msg->ctx); in gss_handle_downcall_result()
623 else if (gss_msg->ctx == NULL && gss_msg->msg.errno >= 0) { in gss_refresh_upcall()
679 if (gss_msg->ctx != NULL || gss_msg->msg.errno < 0) { in gss_create_upcall()
689 if (gss_msg->ctx) { in gss_create_upcall()
691 gss_cred_set_ctx(cred, gss_msg->ctx); in gss_create_upcall()
729 struct gss_cl_ctx *ctx; in gss_pipe_downcall() local
759 ctx = gss_alloc_context(); in gss_pipe_downcall()
760 if (ctx == NULL) in gss_pipe_downcall()
774 p = gss_fill_context(p, end, ctx, gss_msg->auth->mech); in gss_pipe_downcall()
796 gss_msg->ctx = gss_get_ctx(ctx); in gss_pipe_downcall()
805 gss_put_ctx(ctx); in gss_pipe_downcall()
1260 struct gss_cl_ctx *ctx = in gss_dup_cred() local
1270 rcu_assign_pointer(new->gc_ctx, ctx); in gss_dup_cred()
1271 gss_get_ctx(ctx); in gss_dup_cred()
1287 struct gss_cl_ctx *ctx = rcu_dereference_protected(gss_cred->gc_ctx, 1); in gss_send_destroy_context() local
1293 ctx->gc_proc = RPC_GSS_PROC_DESTROY; in gss_send_destroy_context()
1309 gss_do_free_ctx(struct gss_cl_ctx *ctx) in gss_do_free_ctx() argument
1311 gss_delete_sec_context(&ctx->gc_gss_ctx); in gss_do_free_ctx()
1312 kfree(ctx->gc_wire_ctx.data); in gss_do_free_ctx()
1313 kfree(ctx->gc_acceptor.data); in gss_do_free_ctx()
1314 kfree(ctx); in gss_do_free_ctx()
1320 struct gss_cl_ctx *ctx = container_of(head, struct gss_cl_ctx, gc_rcu); in gss_free_ctx_callback() local
1321 gss_do_free_ctx(ctx); in gss_free_ctx_callback()
1325 gss_free_ctx(struct gss_cl_ctx *ctx) in gss_free_ctx() argument
1327 call_rcu(&ctx->gc_rcu, gss_free_ctx_callback); in gss_free_ctx()
1348 struct gss_cl_ctx *ctx = rcu_dereference_protected(gss_cred->gc_ctx, 1); in gss_destroy_nullcred() local
1353 if (ctx) in gss_destroy_nullcred()
1354 gss_put_ctx(ctx); in gss_destroy_nullcred()
1425 struct gss_cl_ctx *ctx; in gss_stringify_acceptor() local
1430 ctx = rcu_dereference(gss_cred->gc_ctx); in gss_stringify_acceptor()
1431 if (!ctx) in gss_stringify_acceptor()
1434 len = ctx->gc_acceptor.len; in gss_stringify_acceptor()
1446 ctx = rcu_dereference(gss_cred->gc_ctx); in gss_stringify_acceptor()
1449 if (!ctx || !ctx->gc_acceptor.len) { in gss_stringify_acceptor()
1455 acceptor = &ctx->gc_acceptor; in gss_stringify_acceptor()
1483 struct gss_cl_ctx *ctx; in gss_key_timeout() local
1488 ctx = rcu_dereference(gss_cred->gc_ctx); in gss_key_timeout()
1489 if (!ctx || time_after(timeout, ctx->gc_expiry)) in gss_key_timeout()
1500 struct gss_cl_ctx *ctx; in gss_match() local
1507 ctx = rcu_dereference(gss_cred->gc_ctx); in gss_match()
1508 if (!ctx || time_after(jiffies, ctx->gc_expiry)) { in gss_match()
1541 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); in gss_marshal() local
1552 ctx->gc_wire_ctx.len); in gss_marshal()
1558 spin_lock(&ctx->gc_seq_lock); in gss_marshal()
1559 req->rq_seqno = (ctx->gc_seq < MAXSEQ) ? ctx->gc_seq++ : MAXSEQ; in gss_marshal()
1560 spin_unlock(&ctx->gc_seq_lock); in gss_marshal()
1566 *p++ = cpu_to_be32(ctx->gc_proc); in gss_marshal()
1569 p = xdr_encode_netobj(p, &ctx->gc_wire_ctx); in gss_marshal()
1585 maj_stat = gss_get_mic(ctx->gc_gss_ctx, &verf_buf, &mic); in gss_marshal()
1594 gss_put_ctx(ctx); in gss_marshal()
1685 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); in gss_validate() local
1714 maj_stat = gss_verify_mic(ctx->gc_gss_ctx, &verf_buf, &mic); in gss_validate()
1726 gss_put_ctx(ctx); in gss_validate()
1740 gss_wrap_req_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx, in gss_wrap_req_integ() argument
1768 maj_stat = gss_get_mic(ctx->gc_gss_ctx, &integ_buf, &mic); in gss_wrap_req_integ()
1833 gss_wrap_req_priv(struct rpc_cred *cred, struct gss_cl_ctx *ctx, in gss_wrap_req_priv() argument
1876 maj_stat = gss_wrap(ctx->gc_gss_ctx, offset, snd_buf, inpages); in gss_wrap_req_priv()
1914 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); in gss_wrap_req() local
1918 if (ctx->gc_proc != RPC_GSS_PROC_DATA) { in gss_wrap_req()
1930 status = gss_wrap_req_integ(cred, ctx, task, xdr); in gss_wrap_req()
1933 status = gss_wrap_req_priv(cred, ctx, task, xdr); in gss_wrap_req()
1939 gss_put_ctx(ctx); in gss_wrap_req()
1985 struct gss_cl_ctx *ctx, struct rpc_rqst *rqstp, in gss_unwrap_resp_integ() argument
2031 maj_stat = gss_verify_mic(ctx->gc_gss_ctx, &gss_data, &mic); in gss_unwrap_resp_integ()
2057 struct gss_cl_ctx *ctx, struct rpc_rqst *rqstp, in gss_unwrap_resp_priv() argument
2073 maj_stat = gss_unwrap(ctx->gc_gss_ctx, offset, in gss_unwrap_resp_priv()
2088 gss_update_rslack(task, cred, 2 + ctx->gc_gss_ctx->align, in gss_unwrap_resp_priv()
2089 2 + ctx->gc_gss_ctx->slack); in gss_unwrap_resp_priv()
2114 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); in gss_xmit_need_reencode() local
2118 if (!ctx) in gss_xmit_need_reencode()
2121 if (gss_seq_is_newer(req->rq_seqno, READ_ONCE(ctx->gc_seq))) in gss_xmit_need_reencode()
2124 seq_xmit = READ_ONCE(ctx->gc_seq_xmit); in gss_xmit_need_reencode()
2128 seq_xmit = cmpxchg(&ctx->gc_seq_xmit, tmp, req->rq_seqno); in gss_xmit_need_reencode()
2135 win = ctx->gc_win; in gss_xmit_need_reencode()
2140 gss_put_ctx(ctx); in gss_xmit_need_reencode()
2153 struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred); in gss_unwrap_resp() local
2156 if (ctx->gc_proc != RPC_GSS_PROC_DATA) in gss_unwrap_resp()
2163 status = gss_unwrap_resp_integ(task, cred, ctx, rqstp, xdr); in gss_unwrap_resp()
2166 status = gss_unwrap_resp_priv(task, cred, ctx, rqstp, xdr); in gss_unwrap_resp()
2175 gss_put_ctx(ctx); in gss_unwrap_resp()