Lines Matching refs:sk
382 static void iscsi_target_sk_data_ready(struct sock *sk) in iscsi_target_sk_data_ready() argument
384 struct iscsit_conn *conn = sk->sk_user_data; in iscsi_target_sk_data_ready()
389 write_lock_bh(&sk->sk_callback_lock); in iscsi_target_sk_data_ready()
390 if (!sk->sk_user_data) { in iscsi_target_sk_data_ready()
391 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_data_ready()
395 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_data_ready()
400 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_data_ready()
405 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_data_ready()
409 conn->orig_data_ready(sk); in iscsi_target_sk_data_ready()
418 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_data_ready()
425 struct sock *sk; in iscsi_target_set_sock_callbacks() local
430 sk = conn->sock->sk; in iscsi_target_set_sock_callbacks()
433 write_lock_bh(&sk->sk_callback_lock); in iscsi_target_set_sock_callbacks()
434 sk->sk_user_data = conn; in iscsi_target_set_sock_callbacks()
435 conn->orig_data_ready = sk->sk_data_ready; in iscsi_target_set_sock_callbacks()
436 conn->orig_state_change = sk->sk_state_change; in iscsi_target_set_sock_callbacks()
437 sk->sk_data_ready = iscsi_target_sk_data_ready; in iscsi_target_set_sock_callbacks()
438 sk->sk_state_change = iscsi_target_sk_state_change; in iscsi_target_set_sock_callbacks()
439 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_set_sock_callbacks()
441 sk->sk_sndtimeo = TA_LOGIN_TIMEOUT * HZ; in iscsi_target_set_sock_callbacks()
442 sk->sk_rcvtimeo = TA_LOGIN_TIMEOUT * HZ; in iscsi_target_set_sock_callbacks()
447 struct sock *sk; in iscsi_target_restore_sock_callbacks() local
452 sk = conn->sock->sk; in iscsi_target_restore_sock_callbacks()
455 write_lock_bh(&sk->sk_callback_lock); in iscsi_target_restore_sock_callbacks()
456 if (!sk->sk_user_data) { in iscsi_target_restore_sock_callbacks()
457 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_restore_sock_callbacks()
460 sk->sk_user_data = NULL; in iscsi_target_restore_sock_callbacks()
461 sk->sk_data_ready = conn->orig_data_ready; in iscsi_target_restore_sock_callbacks()
462 sk->sk_state_change = conn->orig_state_change; in iscsi_target_restore_sock_callbacks()
463 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_restore_sock_callbacks()
465 sk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; in iscsi_target_restore_sock_callbacks()
466 sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT; in iscsi_target_restore_sock_callbacks()
471 static bool __iscsi_target_sk_check_close(struct sock *sk) in __iscsi_target_sk_check_close() argument
473 if (sk->sk_state == TCP_CLOSE_WAIT || sk->sk_state == TCP_CLOSE) { in __iscsi_target_sk_check_close()
486 struct sock *sk = conn->sock->sk; in iscsi_target_sk_check_close() local
488 read_lock_bh(&sk->sk_callback_lock); in iscsi_target_sk_check_close()
489 state = (__iscsi_target_sk_check_close(sk) || in iscsi_target_sk_check_close()
491 read_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_check_close()
501 struct sock *sk = conn->sock->sk; in iscsi_target_sk_check_flag() local
503 read_lock_bh(&sk->sk_callback_lock); in iscsi_target_sk_check_flag()
505 read_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_check_flag()
515 struct sock *sk = conn->sock->sk; in iscsi_target_sk_check_and_clear() local
517 write_lock_bh(&sk->sk_callback_lock); in iscsi_target_sk_check_and_clear()
518 state = (__iscsi_target_sk_check_close(sk) || in iscsi_target_sk_check_and_clear()
522 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_check_and_clear()
630 struct sock *sk = conn->sock->sk; in iscsi_target_do_login_rx() local
632 write_lock_bh(&sk->sk_callback_lock); in iscsi_target_do_login_rx()
637 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_do_login_rx()
662 static void iscsi_target_sk_state_change(struct sock *sk) in iscsi_target_sk_state_change() argument
670 write_lock_bh(&sk->sk_callback_lock); in iscsi_target_sk_state_change()
671 conn = sk->sk_user_data; in iscsi_target_sk_state_change()
673 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_state_change()
681 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_state_change()
682 orig_state_change(sk); in iscsi_target_sk_state_change()
685 state = __iscsi_target_sk_check_close(sk); in iscsi_target_sk_state_change()
694 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_state_change()
695 orig_state_change(sk); in iscsi_target_sk_state_change()
701 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_state_change()
702 orig_state_change(sk); in iscsi_target_sk_state_change()
724 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_state_change()
726 orig_state_change(sk); in iscsi_target_sk_state_change()
732 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_sk_state_change()
734 orig_state_change(sk); in iscsi_target_sk_state_change()
1354 struct sock *sk = conn->sock->sk; in iscsi_target_start_negotiation() local
1356 write_lock_bh(&sk->sk_callback_lock); in iscsi_target_start_negotiation()
1359 write_unlock_bh(&sk->sk_callback_lock); in iscsi_target_start_negotiation()