No need to acquire KERNEL_LOCK when entering network code.

Also use the socket callbacks.
This commit is contained in:
mlelstv 2016-06-05 05:31:43 +00:00
parent 36dadbea16
commit 530dbb3782
2 changed files with 4 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: iscsi_rcv.c,v 1.16 2016/06/05 05:11:57 mlelstv Exp $ */ /* $NetBSD: iscsi_rcv.c,v 1.17 2016/06/05 05:31:43 mlelstv Exp $ */
/*- /*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc. * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@ -59,9 +59,7 @@ my_soo_read(connection_t *conn, struct uio *u, int flags)
DEBC(conn, 99, ("soo_read req: %zu\n", resid)); DEBC(conn, 99, ("soo_read req: %zu\n", resid));
KERNEL_LOCK(1, curlwp); ret = (*so->so_receive)(so, NULL, u, NULL, NULL, &flags);
ret = soreceive(so, NULL, u, NULL, NULL, &flags);
KERNEL_UNLOCK_ONE(curlwp);
if (ret || (flags != MSG_DONTWAIT && u->uio_resid)) { if (ret || (flags != MSG_DONTWAIT && u->uio_resid)) {
DEBC(conn, 1, ("Read failed (ret: %d, req: %zu, out: %zu)\n", DEBC(conn, 1, ("Read failed (ret: %d, req: %zu, out: %zu)\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: iscsi_send.c,v 1.23 2016/06/05 05:25:59 mlelstv Exp $ */ /* $NetBSD: iscsi_send.c,v 1.24 2016/06/05 05:31:43 mlelstv Exp $ */
/*- /*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc. * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@ -62,9 +62,7 @@ my_soo_write(connection_t *conn, struct uio *u)
KASSERT(u->uio_resid != 0); KASSERT(u->uio_resid != 0);
KERNEL_LOCK(1, curlwp); ret = (*so->so_send)(so, NULL, u, NULL, NULL, 0, conn->threadobj);
ret = sosend(so, NULL, u, NULL, NULL, 0, conn->threadobj);
KERNEL_UNLOCK_ONE(curlwp);
DEB(99, ("soo_write done: len = %zu\n", u->uio_resid)); DEB(99, ("soo_write done: len = %zu\n", u->uio_resid));