From 530dbb378225a5c8203c3472e88b0500384cc144 Mon Sep 17 00:00:00 2001 From: mlelstv Date: Sun, 5 Jun 2016 05:31:43 +0000 Subject: [PATCH] No need to acquire KERNEL_LOCK when entering network code. Also use the socket callbacks. --- sys/dev/iscsi/iscsi_rcv.c | 6 ++---- sys/dev/iscsi/iscsi_send.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/dev/iscsi/iscsi_rcv.c b/sys/dev/iscsi/iscsi_rcv.c index 7e53a3d42ec6..79291ebef0dd 100644 --- a/sys/dev/iscsi/iscsi_rcv.c +++ b/sys/dev/iscsi/iscsi_rcv.c @@ -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. @@ -59,9 +59,7 @@ my_soo_read(connection_t *conn, struct uio *u, int flags) DEBC(conn, 99, ("soo_read req: %zu\n", resid)); - KERNEL_LOCK(1, curlwp); - ret = soreceive(so, NULL, u, NULL, NULL, &flags); - KERNEL_UNLOCK_ONE(curlwp); + ret = (*so->so_receive)(so, NULL, u, NULL, NULL, &flags); if (ret || (flags != MSG_DONTWAIT && u->uio_resid)) { DEBC(conn, 1, ("Read failed (ret: %d, req: %zu, out: %zu)\n", diff --git a/sys/dev/iscsi/iscsi_send.c b/sys/dev/iscsi/iscsi_send.c index cb8baf77a3d8..5e1162802cb0 100644 --- a/sys/dev/iscsi/iscsi_send.c +++ b/sys/dev/iscsi/iscsi_send.c @@ -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. @@ -62,9 +62,7 @@ my_soo_write(connection_t *conn, struct uio *u) KASSERT(u->uio_resid != 0); - KERNEL_LOCK(1, curlwp); - ret = sosend(so, NULL, u, NULL, NULL, 0, conn->threadobj); - KERNEL_UNLOCK_ONE(curlwp); + ret = (*so->so_send)(so, NULL, u, NULL, NULL, 0, conn->threadobj); DEB(99, ("soo_write done: len = %zu\n", u->uio_resid));