Lines Matching refs:sock
97 mlog(ML_SOCKET, "[sc %p refs %d sock %p node %u page %p " \
114 * quorum work is queued as sock containers are shutdown.. stop_listening
115 * tears down all the node's sock containers, preventing future shutdowns
138 static void o2net_listen_data_ready(struct sock *sk, int bytes);
540 static void o2net_data_ready(struct sock *sk, int bytes)
542 void (*ready)(struct sock *sk, int bytes);
560 static void o2net_state_change(struct sock *sk)
562 void (*state_change)(struct sock *sk);
601 static void o2net_register_callbacks(struct sock *sk,
626 static int o2net_unregister_callbacks(struct sock *sk,
857 static int o2net_recv_tcp_msg(struct socket *sock, void *data, size_t len)
873 ret = sock_recvmsg(sock, &msg, len, msg.msg_flags);
879 static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec,
889 if (sock == NULL) {
896 ret = sock_sendmsg(sock, &msg, total);
1106 static int o2net_send_status_magic(struct socket *sock, struct o2net_msg *hdr,
1125 return o2net_send_tcp_msg(sock, &vec, 1, sizeof(struct o2net_msg));
1404 static int o2net_set_nodelay(struct socket *sock)
1422 ret = sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY,
1442 /* called when a connect completes and after a sock is accepted. the
1536 struct socket *sock = NULL;
1583 ret = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
1588 sc->sc_sock = sock; /* freed by sc_kref_release */
1590 sock->sk->sk_allocation = GFP_ATOMIC;
1596 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
1755 static int o2net_accept_one(struct socket *sock)
1765 BUG_ON(sock == NULL);
1766 ret = sock_create_lite(sock->sk->sk_family, sock->sk->sk_type,
1767 sock->sk->sk_protocol, &new_sock);
1771 new_sock->type = sock->type;
1772 new_sock->ops = sock->ops;
1773 ret = sock->ops->accept(sock, new_sock, O_NONBLOCK);
1873 struct socket *sock = o2net_listen_sock;
1874 while (o2net_accept_one(sock) == 0)
1878 static void o2net_listen_data_ready(struct sock *sk, int bytes)
1880 void (*ready)(struct sock *sk, int bytes);
1905 struct socket *sock = NULL;
1913 ret = sock_create(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock);
1919 sock->sk->sk_allocation = GFP_ATOMIC;
1921 write_lock_bh(&sock->sk->sk_callback_lock);
1922 sock->sk->sk_user_data = sock->sk->sk_data_ready;
1923 sock->sk->sk_data_ready = o2net_listen_data_ready;
1924 write_unlock_bh(&sock->sk->sk_callback_lock);
1926 o2net_listen_sock = sock;
1929 sock->sk->sk_reuse = 1;
1930 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin));
1937 ret = sock->ops->listen(sock, 64);
1946 if (sock)
1947 sock_release(sock);
1988 struct socket *sock = o2net_listen_sock;
1995 write_lock_bh(&sock->sk->sk_callback_lock);
1996 sock->sk->sk_data_ready = sock->sk->sk_user_data;
1997 sock->sk->sk_user_data = NULL;
1998 write_unlock_bh(&sock->sk->sk_callback_lock);