Source-Changes-HG archive

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

[src/yamt-uio_vmspace]: src/sys/fs/cd9660 adapt cd9660.



details:   https://anonhg.NetBSD.org/src/rev/cf6749397183
branches:  yamt-uio_vmspace
changeset: 586710:cf6749397183
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sun Feb 05 12:06:20 2006 +0000

description:
adapt cd9660.

diffstat:

 sys/fs/cd9660/cd9660_vnops.c |  25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diffs (75 lines):

diff -r 32607f80d0b2 -r cf6749397183 sys/fs/cd9660/cd9660_vnops.c
--- a/sys/fs/cd9660/cd9660_vnops.c      Sun Feb 05 11:35:07 2006 +0000
+++ b/sys/fs/cd9660/cd9660_vnops.c      Sun Feb 05 12:06:20 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd9660_vnops.c,v 1.19 2005/12/11 12:24:25 christos Exp $       */
+/*     $NetBSD: cd9660_vnops.c,v 1.19.2.1 2006/02/05 12:06:20 yamt Exp $       */
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.19 2005/12/11 12:24:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.19.2.1 2006/02/05 12:06:20 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -218,9 +218,8 @@
                auio.uio_iovcnt = 1;
                auio.uio_offset = 0;
                auio.uio_rw = UIO_READ;
-               auio.uio_segflg = UIO_SYSSPACE;
-               auio.uio_lwp = NULL;
                auio.uio_resid = MAXPATHLEN;
+               UIO_SETUP_SYSSPACE(&auio);
                rdlnk.a_uio = &auio;
                rdlnk.a_vp = ap->a_vp;
                rdlnk.a_cred = ap->a_cred;
@@ -633,6 +632,7 @@
        u_short symlen;
        int     error;
        char    *symname;
+       boolean_t use_pnbuf;
 
        ip  = VTOI(ap->a_vp);
        imp = ip->i_mnt;
@@ -672,19 +672,21 @@
         * Now get a buffer
         * Abuse a namei buffer for now.
         */
-       if (uio->uio_segflg == UIO_SYSSPACE &&
-           uio->uio_iov->iov_len >= MAXPATHLEN)
+       use_pnbuf = !VMSPACE_IS_KERNEL_P(uio->uio_vmspace) ||
+           uio->uio_iov->iov_len < MAXPATHLEN;
+       if (use_pnbuf) {
+               symname = PNBUF_GET();
+       } else {
                symname = uio->uio_iov->iov_base;
-       else
-               symname = PNBUF_GET();
+       }
 
        /*
         * Ok, we just gathering a symbolic name in SL record.
         */
        if (cd9660_rrip_getsymname(dirp, symname, &symlen, imp) == 0) {
-               if (uio->uio_segflg != UIO_SYSSPACE ||
-                   uio->uio_iov->iov_len < MAXPATHLEN)
+               if (use_pnbuf) {
                        PNBUF_PUT(symname);
+               }
                brelse(bp);
                return (EINVAL);
        }
@@ -696,8 +698,7 @@
        /*
         * return with the symbolic name to caller's.
         */
-       if (uio->uio_segflg != UIO_SYSSPACE ||
-           uio->uio_iov->iov_len < MAXPATHLEN) {
+       if (use_pnbuf) {
                error = uiomove(symname, symlen, uio);
                PNBUF_PUT(symname);
                return (error);



Home | Main Index | Thread Index | Old Index