Module Name: src
Committed By: pooka
Date: Tue Sep 8 21:14:33 UTC 2009
Modified Files:
src/sys/dev/dkwedge: dk.c
Log Message:
dkwedge_list() is currently called only from ioctl routines where
l == curlwp. Since there is no perceived case where we'd ever want
to copy the list to non-curlwp, simplify the code a bit.
(the struct lwp * argument could probably be dropped too, but
that's another commit)
To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/dkwedge/dk.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/dkwedge/dk.c
diff -u src/sys/dev/dkwedge/dk.c:1.50 src/sys/dev/dkwedge/dk.c:1.51
--- src/sys/dev/dkwedge/dk.c:1.50 Mon Sep 7 13:59:38 2009
+++ src/sys/dev/dkwedge/dk.c Tue Sep 8 21:14:33 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dk.c,v 1.50 2009/09/07 13:59:38 pooka Exp $ */
+/* $NetBSD: dk.c,v 1.51 2009/09/08 21:14:33 pooka Exp $ */
/*-
* Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.50 2009/09/07 13:59:38 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.51 2009/09/08 21:14:33 pooka Exp $");
#ifdef _KERNEL_OPT
#include "opt_dkwedge.h"
@@ -658,7 +658,6 @@
struct iovec iov;
struct dkwedge_softc *sc;
struct dkwedge_info dkw;
- struct vmspace *vm;
int error = 0;
iov.iov_base = dkwl->dkwl_buf;
@@ -669,15 +668,8 @@
uio.uio_offset = 0;
uio.uio_resid = dkwl->dkwl_bufsize;
uio.uio_rw = UIO_READ;
- if (l == NULL) {
- UIO_SETUP_SYSSPACE(&uio);
- } else {
- error = proc_vmspace_getref(l->l_proc, &vm);
- if (error) {
- return error;
- }
- uio.uio_vmspace = vm;
- }
+ KASSERT(l == curlwp);
+ uio.uio_vmspace = l->l_proc->p_vmspace;
dkwl->dkwl_ncopied = 0;
@@ -706,10 +698,6 @@
dkwl->dkwl_nwedges = pdk->dk_nwedges;
mutex_exit(&pdk->dk_openlock);
- if (l != NULL) {
- uvmspace_free(vm);
- }
-
return (error);
}