Lines Matching refs:t
45 #define KSMBD_TRANS(t) (&(t)->transport) argument
46 #define TCP_TRANS(t) ((struct tcp_transport *)container_of(t, \ argument
76 struct tcp_transport *t; in alloc_transport() local
79 t = kzalloc(sizeof(*t), GFP_KERNEL); in alloc_transport()
80 if (!t) in alloc_transport()
82 t->sock = client_sk; in alloc_transport()
86 kfree(t); in alloc_transport()
90 conn->transport = KSMBD_TRANS(t); in alloc_transport()
91 KSMBD_TRANS(t)->conn = conn; in alloc_transport()
92 KSMBD_TRANS(t)->ops = &ksmbd_tcp_transport_ops; in alloc_transport()
93 return t; in alloc_transport()
96 static void free_transport(struct tcp_transport *t) in free_transport() argument
98 kernel_sock_shutdown(t->sock, SHUT_RDWR); in free_transport()
99 sock_release(t->sock); in free_transport()
100 t->sock = NULL; in free_transport()
102 ksmbd_conn_free(KSMBD_TRANS(t)->conn); in free_transport()
103 kfree(t->iov); in free_transport()
104 kfree(t); in free_transport()
146 static struct kvec *get_conn_iovec(struct tcp_transport *t, unsigned int nr_segs) in get_conn_iovec() argument
150 if (t->iov && nr_segs <= t->nr_iov) in get_conn_iovec()
151 return t->iov; in get_conn_iovec()
156 kfree(t->iov); in get_conn_iovec()
157 t->iov = new_iov; in get_conn_iovec()
158 t->nr_iov = nr_segs; in get_conn_iovec()
187 struct tcp_transport *t; in ksmbd_tcp_new_connection() local
190 t = alloc_transport(client_sk); in ksmbd_tcp_new_connection()
191 if (!t) { in ksmbd_tcp_new_connection()
196 csin = KSMBD_TCP_PEER_SOCKADDR(KSMBD_TRANS(t)->conn); in ksmbd_tcp_new_connection()
204 KSMBD_TRANS(t)->conn, in ksmbd_tcp_new_connection()
210 free_transport(t); in ksmbd_tcp_new_connection()
215 free_transport(t); in ksmbd_tcp_new_connection()
304 static int ksmbd_tcp_readv(struct tcp_transport *t, struct kvec *iov_orig, in ksmbd_tcp_readv() argument
313 struct ksmbd_conn *conn = KSMBD_TRANS(t)->conn; in ksmbd_tcp_readv()
315 iov = get_conn_iovec(t, nr_segs); in ksmbd_tcp_readv()
331 length = kernel_recvmsg(t->sock, &ksmbd_msg, in ksmbd_tcp_readv()
373 static int ksmbd_tcp_read(struct ksmbd_transport *t, char *buf, in ksmbd_tcp_read() argument
381 return ksmbd_tcp_readv(TCP_TRANS(t), &iov, 1, to_read, max_retries); in ksmbd_tcp_read()
384 static int ksmbd_tcp_writev(struct ksmbd_transport *t, struct kvec *iov, in ksmbd_tcp_writev() argument
391 return kernel_sendmsg(TCP_TRANS(t)->sock, &smb_msg, iov, nvecs, size); in ksmbd_tcp_writev()
394 static void ksmbd_tcp_disconnect(struct ksmbd_transport *t) in ksmbd_tcp_disconnect() argument
396 free_transport(TCP_TRANS(t)); in ksmbd_tcp_disconnect()