diff options
| author | pooka <pooka@NetBSD.org> | 2009-09-08 21:14:33 +0000 |
|---|---|---|
| committer | pooka <pooka@NetBSD.org> | 2009-09-08 21:14:33 +0000 |
| commit | 3446f432fa67c088fbea586ea7c95d0c73f426dd (patch) | |
| tree | a4c26c64d25bf63b8d1e6cb21feb0cca904ca601 /sys/dev | |
| parent | 3c5c932b98a24fd2a662a15fc3d1b2bafb8cef10 (diff) | |
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)
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/dkwedge/dk.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c index e0bc6b770ca..ef0a7731cf5 100644 --- a/sys/dev/dkwedge/dk.c +++ b/sys/dev/dkwedge/dk.c @@ -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 @@ dkwedge_list(struct disk *pdk, struct dkwedge_list *dkwl, struct lwp *l) 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 @@ dkwedge_list(struct disk *pdk, struct dkwedge_list *dkwl, struct lwp *l) 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 @@ dkwedge_list(struct disk *pdk, struct dkwedge_list *dkwl, struct lwp *l) dkwl->dkwl_nwedges = pdk->dk_nwedges; mutex_exit(&pdk->dk_openlock); - if (l != NULL) { - uvmspace_free(vm); - } - return (error); } |
