• Home
  • Raw
  • Download

Lines Matching full:other

52  *		other the moment one end closes.
378 static int unix_dgram_peer_wake_connect(struct sock *sk, struct sock *other) in unix_dgram_peer_wake_connect() argument
384 u_other = unix_sk(other); in unix_dgram_peer_wake_connect()
389 u->peer_wake.private = other; in unix_dgram_peer_wake_connect()
400 struct sock *other) in unix_dgram_peer_wake_disconnect() argument
405 u_other = unix_sk(other); in unix_dgram_peer_wake_disconnect()
408 if (u->peer_wake.private == other) { in unix_dgram_peer_wake_disconnect()
417 struct sock *other) in unix_dgram_peer_wake_disconnect_wakeup() argument
419 unix_dgram_peer_wake_disconnect(sk, other); in unix_dgram_peer_wake_disconnect_wakeup()
427 * - unix_peer(sk) == other
430 static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other) in unix_dgram_peer_wake_me() argument
434 connected = unix_dgram_peer_wake_connect(sk, other); in unix_dgram_peer_wake_me()
436 /* If other is SOCK_DEAD, we want to make sure we signal in unix_dgram_peer_wake_me()
439 * to other and its full, we will hang waiting for POLLOUT. in unix_dgram_peer_wake_me()
441 if (unix_recvq_full_lockless(other) && !sock_flag(other, SOCK_DEAD)) in unix_dgram_peer_wake_me()
445 unix_dgram_peer_wake_disconnect(sk, other); in unix_dgram_peer_wake_me()
475 static void unix_dgram_disconnected(struct sock *sk, struct sock *other) in unix_dgram_disconnected() argument
485 if (!sock_flag(other, SOCK_DEAD) && unix_peer(other) == sk) { in unix_dgram_disconnected()
486 other->sk_err = ECONNRESET; in unix_dgram_disconnected()
487 other->sk_error_report(other); in unix_dgram_disconnected()
1154 struct sock *other; in unix_dgram_connect() local
1173 other = unix_find_other(net, sunaddr, alen, sock->type, hash, &err); in unix_dgram_connect()
1174 if (!other) in unix_dgram_connect()
1177 unix_state_double_lock(sk, other); in unix_dgram_connect()
1180 if (sock_flag(other, SOCK_DEAD)) { in unix_dgram_connect()
1181 unix_state_double_unlock(sk, other); in unix_dgram_connect()
1182 sock_put(other); in unix_dgram_connect()
1187 if (!unix_may_send(sk, other)) in unix_dgram_connect()
1190 err = security_unix_may_send(sk->sk_socket, other->sk_socket); in unix_dgram_connect()
1198 other = NULL; in unix_dgram_connect()
1199 unix_state_double_lock(sk, other); in unix_dgram_connect()
1207 unix_peer(sk) = other; in unix_dgram_connect()
1210 unix_state_double_unlock(sk, other); in unix_dgram_connect()
1212 if (other != old_peer) in unix_dgram_connect()
1216 unix_peer(sk) = other; in unix_dgram_connect()
1217 unix_state_double_unlock(sk, other); in unix_dgram_connect()
1222 unix_state_double_unlock(sk, other); in unix_dgram_connect()
1223 sock_put(other); in unix_dgram_connect()
1228 static long unix_wait_for_peer(struct sock *other, long timeo) in unix_wait_for_peer() argument
1229 __releases(&unix_sk(other)->lock) in unix_wait_for_peer()
1231 struct unix_sock *u = unix_sk(other); in unix_wait_for_peer()
1237 sched = !sock_flag(other, SOCK_DEAD) && in unix_wait_for_peer()
1238 !(other->sk_shutdown & RCV_SHUTDOWN) && in unix_wait_for_peer()
1239 unix_recvq_full_lockless(other); in unix_wait_for_peer()
1241 unix_state_unlock(other); in unix_wait_for_peer()
1258 struct sock *other = NULL; in unix_stream_connect() local
1295 other = unix_find_other(net, sunaddr, addr_len, sk->sk_type, hash, &err); in unix_stream_connect()
1296 if (!other) in unix_stream_connect()
1300 unix_state_lock(other); in unix_stream_connect()
1303 if (sock_flag(other, SOCK_DEAD)) { in unix_stream_connect()
1304 unix_state_unlock(other); in unix_stream_connect()
1305 sock_put(other); in unix_stream_connect()
1310 if (other->sk_state != TCP_LISTEN) in unix_stream_connect()
1312 if (other->sk_shutdown & RCV_SHUTDOWN) in unix_stream_connect()
1315 if (unix_recvq_full(other)) { in unix_stream_connect()
1320 timeo = unix_wait_for_peer(other, timeo); in unix_stream_connect()
1325 sock_put(other); in unix_stream_connect()
1335 state. other is TCP_LISTEN, if sk is TCP_LISTEN we in unix_stream_connect()
1359 unix_state_unlock(other); in unix_stream_connect()
1360 sock_put(other); in unix_stream_connect()
1364 err = security_unix_stream_connect(sk, other, newsk); in unix_stream_connect()
1379 otheru = unix_sk(other); in unix_stream_connect()
1406 copy_peercred(sk, other); in unix_stream_connect()
1418 spin_lock(&other->sk_receive_queue.lock); in unix_stream_connect()
1419 __skb_queue_tail(&other->sk_receive_queue, skb); in unix_stream_connect()
1420 spin_unlock(&other->sk_receive_queue.lock); in unix_stream_connect()
1421 unix_state_unlock(other); in unix_stream_connect()
1422 other->sk_data_ready(other); in unix_stream_connect()
1423 sock_put(other); in unix_stream_connect()
1427 if (other) in unix_stream_connect()
1428 unix_state_unlock(other); in unix_stream_connect()
1434 if (other) in unix_stream_connect()
1435 sock_put(other); in unix_stream_connect()
1610 const struct sock *other) in unix_passcred_enabled() argument
1613 !other->sk_socket || in unix_passcred_enabled()
1614 test_bit(SOCK_PASSCRED, &other->sk_socket->flags); in unix_passcred_enabled()
1623 const struct sock *other) in maybe_add_creds() argument
1627 if (unix_passcred_enabled(sock, other)) { in maybe_add_creds()
1635 const struct sock *other) in maybe_init_creds() argument
1644 if (unix_passcred_enabled(socket, other)) { in maybe_init_creds()
1691 struct sock *other = NULL; in unix_dgram_sendmsg() local
1718 other = unix_peer_get(sk); in unix_dgram_sendmsg()
1719 if (!other) in unix_dgram_sendmsg()
1760 if (!other) { in unix_dgram_sendmsg()
1765 other = unix_find_other(net, sunaddr, namelen, sk->sk_type, in unix_dgram_sendmsg()
1767 if (other == NULL) in unix_dgram_sendmsg()
1771 if (sk_filter(other, skb) < 0) { in unix_dgram_sendmsg()
1778 unix_state_lock(other); in unix_dgram_sendmsg()
1781 if (!unix_may_send(sk, other)) in unix_dgram_sendmsg()
1784 if (unlikely(sock_flag(other, SOCK_DEAD))) { in unix_dgram_sendmsg()
1789 unix_state_unlock(other); in unix_dgram_sendmsg()
1790 sock_put(other); in unix_dgram_sendmsg()
1796 if (unix_peer(sk) == other) { in unix_dgram_sendmsg()
1798 unix_dgram_peer_wake_disconnect_wakeup(sk, other); in unix_dgram_sendmsg()
1802 unix_dgram_disconnected(sk, other); in unix_dgram_sendmsg()
1803 sock_put(other); in unix_dgram_sendmsg()
1809 other = NULL; in unix_dgram_sendmsg()
1816 if (other->sk_shutdown & RCV_SHUTDOWN) in unix_dgram_sendmsg()
1820 err = security_unix_may_send(sk->sk_socket, other->sk_socket); in unix_dgram_sendmsg()
1825 /* other == sk && unix_peer(other) != sk if in unix_dgram_sendmsg()
1829 if (other != sk && in unix_dgram_sendmsg()
1830 unlikely(unix_peer(other) != sk && in unix_dgram_sendmsg()
1831 unix_recvq_full_lockless(other))) { in unix_dgram_sendmsg()
1833 timeo = unix_wait_for_peer(other, timeo); in unix_dgram_sendmsg()
1843 unix_state_unlock(other); in unix_dgram_sendmsg()
1844 unix_state_double_lock(sk, other); in unix_dgram_sendmsg()
1847 if (unix_peer(sk) != other || in unix_dgram_sendmsg()
1848 unix_dgram_peer_wake_me(sk, other)) { in unix_dgram_sendmsg()
1863 if (sock_flag(other, SOCK_RCVTSTAMP)) in unix_dgram_sendmsg()
1865 maybe_add_creds(skb, sock, other); in unix_dgram_sendmsg()
1866 scm_stat_add(other, skb); in unix_dgram_sendmsg()
1867 skb_queue_tail(&other->sk_receive_queue, skb); in unix_dgram_sendmsg()
1868 unix_state_unlock(other); in unix_dgram_sendmsg()
1869 other->sk_data_ready(other); in unix_dgram_sendmsg()
1870 sock_put(other); in unix_dgram_sendmsg()
1877 unix_state_unlock(other); in unix_dgram_sendmsg()
1881 if (other) in unix_dgram_sendmsg()
1882 sock_put(other); in unix_dgram_sendmsg()
1896 struct sock *other = NULL; in unix_stream_sendmsg() local
1918 other = unix_peer(sk); in unix_stream_sendmsg()
1919 if (!other) in unix_stream_sendmsg()
1962 unix_state_lock(other); in unix_stream_sendmsg()
1964 if (sock_flag(other, SOCK_DEAD) || in unix_stream_sendmsg()
1965 (other->sk_shutdown & RCV_SHUTDOWN)) in unix_stream_sendmsg()
1968 maybe_add_creds(skb, sock, other); in unix_stream_sendmsg()
1969 scm_stat_add(other, skb); in unix_stream_sendmsg()
1970 skb_queue_tail(&other->sk_receive_queue, skb); in unix_stream_sendmsg()
1971 unix_state_unlock(other); in unix_stream_sendmsg()
1972 other->sk_data_ready(other); in unix_stream_sendmsg()
1981 unix_state_unlock(other); in unix_stream_sendmsg()
1999 struct sock *other, *sk = socket->sk; in unix_stream_sendpage() local
2005 other = unix_peer(sk); in unix_stream_sendpage()
2006 if (!other || sk->sk_state != TCP_ESTABLISHED) in unix_stream_sendpage()
2011 spin_unlock(&other->sk_receive_queue.lock); in unix_stream_sendpage()
2012 unix_state_unlock(other); in unix_stream_sendpage()
2013 mutex_unlock(&unix_sk(other)->iolock); in unix_stream_sendpage()
2023 err = mutex_lock_interruptible(&unix_sk(other)->iolock); in unix_stream_sendpage()
2035 unix_state_lock(other); in unix_stream_sendpage()
2037 if (sock_flag(other, SOCK_DEAD) || in unix_stream_sendpage()
2038 other->sk_shutdown & RCV_SHUTDOWN) { in unix_stream_sendpage()
2045 err = maybe_init_creds(&scm, socket, other); in unix_stream_sendpage()
2051 spin_lock(&other->sk_receive_queue.lock); in unix_stream_sendpage()
2052 skb = skb_peek_tail(&other->sk_receive_queue); in unix_stream_sendpage()
2083 __skb_queue_tail(&other->sk_receive_queue, newskb); in unix_stream_sendpage()
2086 spin_unlock(&other->sk_receive_queue.lock); in unix_stream_sendpage()
2087 unix_state_unlock(other); in unix_stream_sendpage()
2088 mutex_unlock(&unix_sk(other)->iolock); in unix_stream_sendpage()
2090 other->sk_data_ready(other); in unix_stream_sendpage()
2095 unix_state_unlock(other); in unix_stream_sendpage()
2097 mutex_unlock(&unix_sk(other)->iolock); in unix_stream_sendpage()
2571 struct sock *other; in unix_shutdown() local
2584 other = unix_peer(sk); in unix_shutdown()
2585 if (other) in unix_shutdown()
2586 sock_hold(other); in unix_shutdown()
2590 if (other && in unix_shutdown()
2599 unix_state_lock(other); in unix_shutdown()
2600 WRITE_ONCE(other->sk_shutdown, other->sk_shutdown | peer_mode); in unix_shutdown()
2601 unix_state_unlock(other); in unix_shutdown()
2602 other->sk_state_change(other); in unix_shutdown()
2604 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP); in unix_shutdown()
2606 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN); in unix_shutdown()
2608 if (other) in unix_shutdown()
2609 sock_put(other); in unix_shutdown()
2743 * we set writable also when the other side has shut down the in unix_poll()
2755 struct sock *sk = sock->sk, *other; in unix_dgram_poll() local
2795 other = unix_peer(sk); in unix_dgram_poll()
2796 if (other && unix_peer(other) != sk && in unix_dgram_poll()
2797 unix_recvq_full_lockless(other) && in unix_dgram_poll()
2798 unix_dgram_peer_wake_me(sk, other)) in unix_dgram_poll()
3006 /* Earlier than device_initcall() so that other drivers invoking