Lines Matching defs:smc
18 #include "smc.h"
24 void smc_clcsock_release(struct smc_sock *smc)
28 if (smc->listen_smc && current_work() != &smc->smc_listen_work)
29 cancel_work_sync(&smc->smc_listen_work);
30 mutex_lock(&smc->clcsock_release_lock);
31 if (smc->clcsock) {
32 tcp = smc->clcsock;
33 smc->clcsock = NULL;
36 mutex_unlock(&smc->clcsock_release_lock);
49 static void smc_close_stream_wait(struct smc_sock *smc, long timeout)
52 struct sock *sk = &smc->sk;
57 if (!smc_tx_prepared_sends(&smc->conn))
60 smc->wait_close_tx_prepared = 1;
66 !smc_tx_prepared_sends(&smc->conn) ||
69 smc->conn.killed,
75 smc->wait_close_tx_prepared = 0;
78 void smc_close_wake_tx_prepared(struct smc_sock *smc)
80 if (smc->wait_close_tx_prepared)
82 smc->sk.sk_state_change(&smc->sk);
111 static void smc_close_cancel_work(struct smc_sock *smc)
113 struct sock *sk = &smc->sk;
116 if (cancel_work_sync(&smc->conn.close_work))
118 cancel_delayed_work_sync(&smc->conn.tx_work);
122 /* terminate smc socket abnormally - active abort
125 void smc_close_active_abort(struct smc_sock *smc)
127 struct sock *sk = &smc->sk;
130 if (sk->sk_state != SMC_INIT && smc->clcsock && smc->clcsock->sk) {
132 if (smc->clcsock && smc->clcsock->sk)
133 tcp_abort(smc->clcsock->sk, ECONNABORTED);
140 smc_close_cancel_work(smc);
150 smc_close_cancel_work(smc);
154 smc_conn_free(&smc->conn);
161 smc_close_cancel_work(smc);
165 smc_conn_free(&smc->conn);
179 smc_clcsock_release(smc);
190 int smc_close_active(struct smc_sock *smc)
193 &smc->conn.local_tx_ctrl.conn_state_flags;
194 struct smc_connection *conn = &smc->conn;
195 struct sock *sk = &smc->sk;
214 if (smc->clcsock && smc->clcsock->sk) {
215 smc->clcsock->sk->sk_data_ready = smc->clcsk_data_ready;
216 smc->clcsock->sk->sk_user_data = NULL;
217 rc = kernel_sock_shutdown(smc->clcsock, SHUT_RDWR);
221 flush_work(&smc->tcp_listen_work);
225 smc_close_stream_wait(smc, timeout);
237 if (smc->clcsock && smc->clcsock->sk) {
238 rc1 = kernel_sock_shutdown(smc->clcsock,
259 smc_close_stream_wait(smc, timeout);
306 static void smc_close_passive_abort_received(struct smc_sock *smc)
309 &smc->conn.local_tx_ctrl.conn_state_flags;
310 struct sock *sk = &smc->sk;
325 !smc_close_sent_any_close(&smc->conn))
355 struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
358 struct sock *sk = &smc->sk;
367 smc_close_passive_abort_received(smc);
368 release_sock(&smc->sk);
370 lock_sock(&smc->sk);
431 if (smc->clcsock)
437 smc_clcsock_release(smc);
441 int smc_close_shutdown_write(struct smc_sock *smc)
443 struct smc_connection *conn = &smc->conn;
444 struct sock *sk = &smc->sk;
457 smc_close_stream_wait(smc, timeout);
470 smc_close_stream_wait(smc, timeout);
497 void smc_close_init(struct smc_sock *smc)
499 INIT_WORK(&smc->conn.close_work, smc_close_passive_work);