Lines Matching refs:sk
32 static int hash_alloc_result(struct sock *sk, struct hash_ctx *ctx) in hash_alloc_result() argument
41 ctx->result = sock_kmalloc(sk, ds, GFP_KERNEL); in hash_alloc_result()
50 static void hash_free_result(struct sock *sk, struct hash_ctx *ctx) in hash_free_result() argument
59 sock_kzfree_s(sk, ctx->result, ds); in hash_free_result()
67 struct sock *sk = sock->sk; in hash_sendmsg() local
68 struct alg_sock *ask = alg_sk(sk); in hash_sendmsg()
73 if (limit > sk->sk_sndbuf) in hash_sendmsg()
74 limit = sk->sk_sndbuf; in hash_sendmsg()
76 lock_sock(sk); in hash_sendmsg()
79 hash_free_result(sk, ctx); in hash_sendmsg()
116 err = hash_alloc_result(sk, ctx); in hash_sendmsg()
126 release_sock(sk); in hash_sendmsg()
134 struct sock *sk = sock->sk; in hash_sendpage() local
135 struct alg_sock *ask = alg_sk(sk); in hash_sendpage()
142 lock_sock(sk); in hash_sendpage()
147 err = hash_alloc_result(sk, ctx); in hash_sendpage()
151 hash_free_result(sk, ctx); in hash_sendpage()
178 release_sock(sk); in hash_sendpage()
186 struct sock *sk = sock->sk; in hash_recvmsg() local
187 struct alg_sock *ask = alg_sk(sk); in hash_recvmsg()
198 lock_sock(sk); in hash_recvmsg()
200 err = hash_alloc_result(sk, ctx); in hash_recvmsg()
224 hash_free_result(sk, ctx); in hash_recvmsg()
225 release_sock(sk); in hash_recvmsg()
233 struct sock *sk = sock->sk; in hash_accept() local
234 struct alg_sock *ask = alg_sk(sk); in hash_accept()
244 lock_sock(sk); in hash_accept()
247 release_sock(sk); in hash_accept()
256 sk2 = newsock->sk; in hash_accept()
298 struct sock *sk = sock->sk; in hash_check_key() local
299 struct alg_sock *ask = alg_sk(sk); in hash_check_key()
301 lock_sock(sk); in hash_check_key()
322 release_sock(sk); in hash_check_key()
409 static void hash_sock_destruct(struct sock *sk) in hash_sock_destruct() argument
411 struct alg_sock *ask = alg_sk(sk); in hash_sock_destruct()
414 hash_free_result(sk, ctx); in hash_sock_destruct()
415 sock_kfree_s(sk, ctx, ctx->len); in hash_sock_destruct()
416 af_alg_release_parent(sk); in hash_sock_destruct()
419 static int hash_accept_parent_nokey(void *private, struct sock *sk) in hash_accept_parent_nokey() argument
422 struct alg_sock *ask = alg_sk(sk); in hash_accept_parent_nokey()
426 ctx = sock_kmalloc(sk, len, GFP_KERNEL); in hash_accept_parent_nokey()
441 sk->sk_destruct = hash_sock_destruct; in hash_accept_parent_nokey()
446 static int hash_accept_parent(void *private, struct sock *sk) in hash_accept_parent() argument
453 return hash_accept_parent_nokey(private, sk); in hash_accept_parent()