Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dkwedge dkwedge_list() is currently called only from...



details:   https://anonhg.NetBSD.org/src/rev/382cb80ba83d
branches:  trunk
changeset: 747300:382cb80ba83d
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Sep 08 21:14:33 2009 +0000

description:
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:

 sys/dev/dkwedge/dk.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (55 lines):

diff -r 30519c428f7c -r 382cb80ba83d sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Tue Sep 08 20:57:59 2009 +0000
+++ b/sys/dev/dkwedge/dk.c      Tue Sep 08 21:14:33 2009 +0000
@@ -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);
 }
 



Home | Main Index | Thread Index | Old Index