Source-Changes-HG archive

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

[src/trunk]: src/sys - Fix a silly bug: remove umap from uobj in ubc_release(...



details:   https://anonhg.NetBSD.org/src/rev/f1361bd91ee1
branches:  trunk
changeset: 766232:f1361bd91ee1
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sun Jun 19 02:42:53 2011 +0000

description:
- Fix a silly bug: remove umap from uobj in ubc_release() UBC_UNMAP case.
- Use UBC_WANT_UNMAP() consistently.

ARM (PMAP_CACHE_VIVT case) works again.

diffstat:

 sys/fs/nilfs/nilfs_vnops.c        |  10 +++-------
 sys/nfs/nfs_bio.c                 |  11 +++++------
 sys/rump/librump/rumpvfs/rumpfs.c |   8 ++++----
 sys/ufs/ufs/ufs_readwrite.c       |  10 ++++------
 sys/uvm/uvm_bio.c                 |   5 +++--
 5 files changed, 19 insertions(+), 25 deletions(-)

diffs (192 lines):

diff -r 99db23f48df9 -r f1361bd91ee1 sys/fs/nilfs/nilfs_vnops.c
--- a/sys/fs/nilfs/nilfs_vnops.c        Sun Jun 19 02:40:38 2011 +0000
+++ b/sys/fs/nilfs/nilfs_vnops.c        Sun Jun 19 02:42:53 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vnops.c,v 1.12 2011/06/12 03:35:53 rmind Exp $ */
+/* $NetBSD: nilfs_vnops.c,v 1.13 2011/06/19 02:42:53 rmind Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.12 2011/06/12 03:35:53 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.13 2011/06/19 02:42:53 rmind Exp $");
 #endif /* not lint */
 
 
@@ -144,7 +144,6 @@
        uint64_t file_size;
        vsize_t len;
        int error;
-       int flags;
 
        DPRINTF(READ, ("nilfs_read called\n"));
 
@@ -168,7 +167,6 @@
 
        /* read contents using buffercache */
        uobj = &vp->v_uobj;
-       flags = UBC_WANT_UNMAP(vp) ? UBC_UNMAP : 0;
        error = 0;
        while (uio->uio_resid > 0) {
                /* reached end? */
@@ -216,8 +214,7 @@
        struct nilfs_node      *nilfs_node = VTOI(vp);
        uint64_t file_size, old_size;
        vsize_t len;
-       int error;
-       int flags, resid, extended;
+       int error, resid, extended;
 
        DPRINTF(WRITE, ("nilfs_write called\n"));
 
@@ -263,7 +260,6 @@
 
        /* write contents using buffercache */
        uobj = &vp->v_uobj;
-       flags = UBC_WANT_UNMAP(vp) ? UBC_UNMAP : 0;
        resid = uio->uio_resid;
        error = 0;
 
diff -r 99db23f48df9 -r f1361bd91ee1 sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Sun Jun 19 02:40:38 2011 +0000
+++ b/sys/nfs/nfs_bio.c Sun Jun 19 02:42:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_bio.c,v 1.186 2011/06/12 03:35:59 rmind Exp $      */
+/*     $NetBSD: nfs_bio.c,v 1.187 2011/06/19 02:42:53 rmind Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.186 2011/06/12 03:35:59 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.187 2011/06/19 02:42:53 rmind Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -157,9 +157,8 @@
                        }
                        bytelen =
                            MIN(np->n_size - uio->uio_offset, uio->uio_resid);
-                       error = ubc_uiomove(&vp->v_uobj, uio, bytelen,
-                           advice, UBC_READ | UBC_PARTIALOK |
-                           (UBC_WANT_UNMAP(vp) ? UBC_UNMAP : 0));
+                       error = ubc_uiomove(&vp->v_uobj, uio, bytelen, advice,
+                           UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp));
                        if (error) {
                                /*
                                 * XXXkludge
@@ -532,7 +531,7 @@
                error = ubc_uiomove(&vp->v_uobj, uio, bytelen,
                    UVM_ADV_RANDOM, UBC_WRITE | UBC_PARTIALOK |
                    (overwrite ? UBC_FAULTBUSY : 0) |
-                   (UBC_WANT_UNMAP(vp) ? UBC_UNMAP : 0));
+                   UBC_UNMAP_FLAG(vp));
                if (error) {
                        uvm_vnp_setwritesize(vp, vp->v_size);
                        if (overwrite && np->n_size != oldsize) {
diff -r 99db23f48df9 -r f1361bd91ee1 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Sun Jun 19 02:40:38 2011 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Sun Jun 19 02:42:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpfs.c,v 1.95 2011/06/12 03:35:59 rmind Exp $        */
+/*     $NetBSD: rumpfs.c,v 1.96 2011/06/19 02:42:53 rmind Exp $        */
 
 /*
  * Copyright (c) 2009, 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.95 2011/06/12 03:35:59 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.96 2011/06/19 02:42:53 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -1260,7 +1260,7 @@
                if (chunk == 0)
                        break;
                error = ubc_uiomove(&vp->v_uobj, uio, chunk, advice,
-                   UBC_READ | UBC_PARTIALOK | UBC_WANT_UNMAP(vp)?UBC_UNMAP:0);
+                   UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp));
                if (error)
                        break;
        }
@@ -1353,7 +1353,7 @@
                if (chunk == 0)
                        break;
                error = ubc_uiomove(&vp->v_uobj, uio, chunk, advice,
-                   UBC_WRITE | UBC_PARTIALOK | UBC_WANT_UNMAP(vp)?UBC_UNMAP:0);
+                   UBC_WRITE | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp));
                if (error)
                        break;
        }
diff -r 99db23f48df9 -r f1361bd91ee1 sys/ufs/ufs/ufs_readwrite.c
--- a/sys/ufs/ufs/ufs_readwrite.c       Sun Jun 19 02:40:38 2011 +0000
+++ b/sys/ufs/ufs/ufs_readwrite.c       Sun Jun 19 02:42:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_readwrite.c,v 1.97 2011/06/12 03:36:02 rmind Exp $ */
+/*     $NetBSD: ufs_readwrite.c,v 1.98 2011/06/19 02:42:53 rmind Exp $ */
 
 /*-
  * Copyright (c) 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.97 2011/06/12 03:36:02 rmind Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ufs_readwrite.c,v 1.98 2011/06/19 02:42:53 rmind Exp $");
 
 #ifdef LFS_READWRITE
 #define        FS                      struct lfs
@@ -132,8 +132,7 @@
                        if (bytelen == 0)
                                break;
                        error = ubc_uiomove(&vp->v_uobj, uio, bytelen, advice,
-                           UBC_READ | UBC_PARTIALOK |
-                           (UBC_WANT_UNMAP(vp) ? UBC_UNMAP : 0));
+                           UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp));
                        if (error)
                                break;
                }
@@ -390,9 +389,8 @@
                 * copy the data.
                 */
 
-               ubc_flags |= UBC_WANT_UNMAP(vp) ? UBC_UNMAP : 0;
                error = ubc_uiomove(&vp->v_uobj, uio, bytelen,
-                   IO_ADV_DECODE(ioflag), ubc_flags);
+                   IO_ADV_DECODE(ioflag), ubc_flags | UBC_UNMAP_FLAG(vp));
 
                /*
                 * update UVM's notion of the size now that we've
diff -r 99db23f48df9 -r f1361bd91ee1 sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Sun Jun 19 02:40:38 2011 +0000
+++ b/sys/uvm/uvm_bio.c Sun Jun 19 02:42:53 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_bio.c,v 1.76 2011/06/18 21:14:43 rmind Exp $       */
+/*     $NetBSD: uvm_bio.c,v 1.77 2011/06/19 02:42:53 rmind Exp $       */
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.76 2011/06/18 21:14:43 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.77 2011/06/19 02:42:53 rmind Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -686,6 +686,7 @@
 
                        umap->flags &= ~UMAP_MAPPING_CACHED;
                        LIST_REMOVE(umap, hash);
+                       LIST_REMOVE(umap, list);
                        umap->uobj = NULL;
                        TAILQ_INSERT_HEAD(UBC_QUEUE(umap->offset), umap,
                            inactive);



Home | Main Index | Thread Index | Old Index