Source-Changes-HG archive

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

[src/yamt-uio_vmspace]: src/sys/nfs - adapt nfs.



details:   https://anonhg.NetBSD.org/src/rev/a36ea28d490b
branches:  yamt-uio_vmspace
changeset: 586698:a36ea28d490b
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Dec 31 16:29:01 2005 +0000

description:
- adapt nfs.
- nfs_doio_read: #if 0 out "killproc if text is modified" part of
  the code as it's broken.  (a process reading the modified text is not
  necessarily a process which is using the file as a text.)

diffstat:

 sys/nfs/nfs_bio.c    |  13 +++++++------
 sys/nfs/nfs_boot.c   |   5 ++---
 sys/nfs/nfs_serv.c   |  24 +++++++++---------------
 sys/nfs/nfs_socket.c |  17 ++++++++---------
 sys/nfs/nfs_subs.c   |  46 +++++++++++++++-------------------------------
 sys/nfs/nfs_vnops.c  |  17 +++++++++--------
 6 files changed, 50 insertions(+), 72 deletions(-)

diffs (truncated from 443 to 300 lines):

diff -r 9b485c8d733e -r a36ea28d490b sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Sat Dec 31 16:08:22 2005 +0000
+++ b/sys/nfs/nfs_bio.c Sat Dec 31 16:29:01 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_bio.c,v 1.140 2005/12/13 13:12:18 reinoud Exp $    */
+/*     $NetBSD: nfs_bio.c,v 1.140.2.1 2005/12/31 16:29:01 yamt Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.140 2005/12/13 13:12:18 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.140.2.1 2005/12/31 16:29:01 yamt Exp $");
 
 #include "opt_nfs.h"
 #include "opt_ddb.h"
@@ -85,7 +85,6 @@
 {
        struct nfsnode *np = VTONFS(vp);
        struct buf *bp = NULL, *rabp;
-       struct lwp *l = uio->uio_lwp;
        struct nfsmount *nmp = VFSTONFS(vp->v_mount);
        struct nfsdircache *ndp = NULL, *nndp = NULL;
        caddr_t baddr;
@@ -94,6 +93,7 @@
        struct dirent *dp, *pdp, *edp, *ep;
        off_t curoff = 0;
        int advice;
+       struct lwp *l = curlwp;
 
 #ifdef DIAGNOSTIC
        if (uio->uio_rw != UIO_READ)
@@ -498,7 +498,7 @@
                struct ucred *a_cred;
        } */ *ap = v;
        struct uio *uio = ap->a_uio;
-       struct lwp *l = uio->uio_lwp;
+       struct lwp *l = curlwp;
        struct vnode *vp = ap->a_vp;
        struct nfsnode *np = VTONFS(vp);
        struct ucred *cred = ap->a_cred;
@@ -956,6 +956,7 @@
                        len = uiop->uio_resid;
                        memset((char *)bp->b_data + diff, 0, len);
                }
+#if 0
                if (uiop->uio_lwp && (vp->v_flag & VTEXT) &&
                    (((nmp->nm_flag & NFSMNT_NQNFS) &&
                      NQNFS_CKINVALID(vp, np, ND_READ) &&
@@ -967,6 +968,7 @@
                        uiop->uio_lwp->l_proc->p_holdcnt++;
 #endif
                }
+#endif
                break;
        case VLNK:
                KASSERT(uiop->uio_offset == (off_t)0);
@@ -1270,9 +1272,8 @@
 
        uiop->uio_iov = &io;
        uiop->uio_iovcnt = 1;
-       uiop->uio_segflg = UIO_SYSSPACE;
-       uiop->uio_lwp = NULL;
        uiop->uio_offset = (((off_t)bp->b_blkno) << DEV_BSHIFT);
+       UIO_SETUP_SYSSPACE(uiop);
        io.iov_base = bp->b_data;
        io.iov_len = uiop->uio_resid = bp->b_bcount;
 
diff -r 9b485c8d733e -r a36ea28d490b sys/nfs/nfs_boot.c
--- a/sys/nfs/nfs_boot.c        Sat Dec 31 16:08:22 2005 +0000
+++ b/sys/nfs/nfs_boot.c        Sat Dec 31 16:29:01 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_boot.c,v 1.62 2005/12/11 12:25:16 christos Exp $   */
+/*     $NetBSD: nfs_boot.c,v 1.62.2.1 2005/12/31 16:29:01 yamt Exp $   */
 
 /*-
  * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.62 2005/12/11 12:25:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_boot.c,v 1.62.2.1 2005/12/31 16:29:01 yamt Exp $");
 
 #include "opt_nfs.h"
 #include "opt_nfs_boot.h"
@@ -459,7 +459,6 @@
                        m = NULL;
                }
                uio.uio_resid = 1 << 16; /* ??? */
-               uio.uio_lwp = lwp;
                rcvflg = 0;
                error = (*so->so_receive)(so, &from, &uio, &m, NULL, &rcvflg);
                if (error == EWOULDBLOCK) {
diff -r 9b485c8d733e -r a36ea28d490b sys/nfs/nfs_serv.c
--- a/sys/nfs/nfs_serv.c        Sat Dec 31 16:08:22 2005 +0000
+++ b/sys/nfs/nfs_serv.c        Sat Dec 31 16:29:01 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_serv.c,v 1.99 2005/12/11 12:25:16 christos Exp $   */
+/*     $NetBSD: nfs_serv.c,v 1.99.2.1 2005/12/31 16:29:01 yamt Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.99 2005/12/11 12:25:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.99.2.1 2005/12/31 16:29:01 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -527,8 +527,7 @@
        uiop->uio_offset = 0;
        uiop->uio_resid = len;
        uiop->uio_rw = UIO_READ;
-       uiop->uio_segflg = UIO_SYSSPACE;
-       uiop->uio_lwp = NULL;
+       UIO_SETUP_SYSSPACE(uiop);
        error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam,
                 &rdonly, (nfsd->nd_flag & ND_KERBAUTH), FALSE);
        if (error) {
@@ -760,7 +759,7 @@
                        uiop->uio_offset = off;
                        uiop->uio_resid = cnt;
                        uiop->uio_rw = UIO_READ;
-                       uiop->uio_segflg = UIO_SYSSPACE;
+                       UIO_SETUP_SYSSPACE(uiop);
                        error = VOP_READ(vp, uiop, IO_NODELOCKED, cred);
                        free((caddr_t)iv2, M_TEMP);
                }
@@ -949,9 +948,8 @@
                        ioflags = (IO_METASYNC | IO_SYNC | IO_NODELOCKED);
                uiop->uio_resid = len;
                uiop->uio_rw = UIO_WRITE;
-               uiop->uio_segflg = UIO_SYSSPACE;
-               uiop->uio_lwp = NULL;
                uiop->uio_offset = off;
+               UIO_SETUP_SYSSPACE(uiop);
                error = VOP_WRITE(vp, uiop, ioflags, cred);
                nfsstats.srvvop_writes++;
                free(iv, M_TEMP);
@@ -1188,10 +1186,9 @@
                else
                    ioflags = (IO_METASYNC | IO_SYNC | IO_NODELOCKED);
                uiop->uio_rw = UIO_WRITE;
-               uiop->uio_segflg = UIO_SYSSPACE;
-               uiop->uio_lwp = NULL;
                uiop->uio_offset = nfsd->nd_off;
                uiop->uio_resid = nfsd->nd_eoff - nfsd->nd_off;
+               UIO_SETUP_SYSSPACE(uiop);
                if (uiop->uio_resid > 0) {
                    mp = mrep;
                    i = 0;
@@ -2227,9 +2224,8 @@
        io.uio_offset = 0;
        io.uio_iov = &iv;
        io.uio_iovcnt = 1;
-       io.uio_segflg = UIO_SYSSPACE;
        io.uio_rw = UIO_READ;
-       io.uio_lwp = NULL;
+       UIO_SETUP_SYSSPACE(&io);
        nfsm_mtouio(&io, len2);
        if (!v3) {
                nfsm_dissect(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
@@ -2651,9 +2647,8 @@
        io.uio_iovcnt = 1;
        io.uio_offset = (off_t)off;
        io.uio_resid = fullsiz;
-       io.uio_segflg = UIO_SYSSPACE;
        io.uio_rw = UIO_READ;
-       io.uio_lwp = NULL;
+       UIO_SETUP_SYSSPACE(&io);
        eofflag = 0;
        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 
@@ -2910,9 +2905,8 @@
        io.uio_iovcnt = 1;
        io.uio_offset = (off_t)off;
        io.uio_resid = fullsiz;
-       io.uio_segflg = UIO_SYSSPACE;
        io.uio_rw = UIO_READ;
-       io.uio_lwp = NULL;
+       UIO_SETUP_SYSSPACE(&io);
        eofflag = 0;
 
        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
diff -r 9b485c8d733e -r a36ea28d490b sys/nfs/nfs_socket.c
--- a/sys/nfs/nfs_socket.c      Sat Dec 31 16:08:22 2005 +0000
+++ b/sys/nfs/nfs_socket.c      Sat Dec 31 16:29:01 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_socket.c,v 1.120 2005/12/30 10:35:44 jmmv Exp $    */
+/*     $NetBSD: nfs_socket.c,v 1.120.2.1 2005/12/31 16:29:01 yamt Exp $        */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.120 2005/12/30 10:35:44 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.120.2.1 2005/12/31 16:29:01 yamt Exp $");
 
 #include "fs_nfs.h"
 #include "opt_nfs.h"
@@ -630,11 +630,10 @@
                        aio.iov_len = sizeof(u_int32_t);
                        auio.uio_iov = &aio;
                        auio.uio_iovcnt = 1;
-                       auio.uio_segflg = UIO_SYSSPACE;
                        auio.uio_rw = UIO_READ;
                        auio.uio_offset = 0;
                        auio.uio_resid = sizeof(u_int32_t);
-                       auio.uio_lwp = NULL;
+                       UIO_SETUP_SYSSPACE(&auio);
                        do {
                           rcvflg = MSG_WAITALL;
                           error = (*so->so_receive)(so, (struct mbuf **)0, &auio,
@@ -708,7 +707,7 @@
                         * on.
                         */
                        auio.uio_resid = len = 100000000; /* Anything Big */
-                       auio.uio_lwp = l;
+                       /* not need to setup uio_vmspace */
                        do {
                            rcvflg = 0;
                            error =  (*so->so_receive)(so, (struct mbuf **)0,
@@ -752,7 +751,7 @@
                else
                        getnam = aname;
                auio.uio_resid = len = 1000000;
-               auio.uio_lwp = l;
+               /* not need to setup uio_vmspace */
                do {
                        rcvflg = 0;
                        error =  (*so->so_receive)(so, getnam, &auio, mp,
@@ -2042,7 +2041,7 @@
                        uio.uio_offset = 0;
                        uio.uio_iov = &iov;
                        uio.uio_iovcnt = 1;
-                       uio.uio_segflg = UIO_SYSSPACE;
+                       UIO_SETUP_SYSSPACE(&uio);
                        iov.iov_base = (caddr_t)&nfsd->nfsd_authstr[4];
                        iov.iov_len = RPCAUTH_MAXSIZ - 4;
                        nfsm_mtouio(&uio, uio.uio_resid);
@@ -2228,8 +2227,6 @@
                slp->ns_flag |= SLP_NEEDQ; goto dorecs;
        }
 #endif
-       /* XXX: was NULL, soreceive() requires non-NULL uio->uio_lwp */
-       auio.uio_lwp = curlwp;  /* XXX curlwp */
        if (so->so_type == SOCK_STREAM) {
                /*
                 * If there are already records on the queue, defer soreceive()
@@ -2245,6 +2242,7 @@
                 * Do soreceive().
                 */
                auio.uio_resid = 1000000000;
+               /* not need to setup uio_vmspace */
                flags = MSG_DONTWAIT;
                error = (*so->so_receive)(so, &nam, &auio, &mp, (struct mbuf **)0, &flags);
                if (error || mp == (struct mbuf *)0) {
@@ -2279,6 +2277,7 @@
        } else {
                do {
                        auio.uio_resid = 1000000000;
+                       /* not need to setup uio_vmspace */
                        flags = MSG_DONTWAIT;
                        error = (*so->so_receive)(so, &nam, &auio, &mp,
                                                (struct mbuf **)0, &flags);
diff -r 9b485c8d733e -r a36ea28d490b sys/nfs/nfs_subs.c
--- a/sys/nfs/nfs_subs.c        Sat Dec 31 16:08:22 2005 +0000
+++ b/sys/nfs/nfs_subs.c        Sat Dec 31 16:29:01 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_subs.c,v 1.156 2005/12/11 12:25:16 christos Exp $  */
+/*     $NetBSD: nfs_subs.c,v 1.156.2.1 2005/12/31 16:29:01 yamt Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.156 2005/12/11 12:25:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.156.2.1 2005/12/31 16:29:01 yamt Exp $");
 
 #include "fs_nfs.h"
 #include "opt_nfs.h"
@@ -825,19 +825,11 @@
                                len = mp->m_len;
                        }
                        xfer = (left > len) ? len : left;
-#ifdef notdef
-                       /* Not Yet.. */
-                       if (uiop->uio_iov->iov_op != NULL)
-                               (*(uiop->uio_iov->iov_op))
-                               (mbufcp, uiocp, xfer);
-                       else



Home | Main Index | Thread Index | Old Index