Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys/miscfs/genfs Comment out XIP hole page redirectio...



details:   https://anonhg.NetBSD.org/src/rev/d4a2e4486572
branches:  uebayasi-xip
changeset: 751868:d4a2e4486572
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Fri Nov 19 04:13:21 2010 +0000

description:
Comment out XIP hole page redirection code.  Since makefs(8) doesn't
support hole, and these code paths can be never tested.

(The current XIP is read-only, so hole pages are pointless in
practice.)

diffstat:

 sys/miscfs/genfs/genfs_io.c |  21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diffs (107 lines):

diff -r 32dc2d66dd10 -r d4a2e4486572 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Fri Nov 19 02:30:41 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Fri Nov 19 04:13:21 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.36.2.36 2010/11/19 02:30:41 uebayasi Exp $      */
+/*     $NetBSD: genfs_io.c,v 1.36.2.37 2010/11/19 04:13:21 uebayasi Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.36 2010/11/19 02:30:41 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.37 2010/11/19 04:13:21 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -286,7 +286,6 @@
                goto out_err;
        }
        mutex_exit(&uobj->vmobjlock);
-
        /*
         * find the requested pages and make some simple checks.
         * leave space in the page array for a whole block.
@@ -859,7 +858,9 @@
        int npages;
        int fs_bshift, fs_bsize, dev_bshift, dev_bsize;
        int i;
+#ifdef XIP_HOLE
        struct vm_page *zero_page;
+#endif
 
        UVMHIST_FUNC("genfs_do_getpages_xip_io"); UVMHIST_CALLED(ubchist);
 
@@ -875,7 +876,9 @@
        ebkoff = ((offset + PAGE_SIZE * npages) + (fs_bsize - 1)) &
            ~(fs_bsize - 1);
 
+#ifdef XIP_HOLE
        zero_page = NULL;
+#endif
 
        UVMHIST_LOG(ubchist, "xip npages=%d sbkoff=%lx ebkoff=%lx",
            npages, (long)sbkoff, (long)ebkoff, 0);
@@ -902,9 +905,13 @@
                 *   page.
                 */
                if (blkno < 0) {
+#ifdef XIP_HOLE
                        zero_page = uvm_page_zeropage_alloc();
                        KASSERT(zero_page != NULL);
                        pps[i] = zero_page;
+#else
+                       panic("XIP hole is not supported yet!");
+#endif
                } else {
                        daddr_t blk_off, fs_off;
 
@@ -931,8 +938,10 @@
                struct vm_page *pg = pps[i];
 
                KASSERT((pg->flags & PG_RDONLY) != 0);
+#ifdef XIP_HOLE
                if (pg == zero_page)
                        continue;
+#endif
                KASSERT((pg->flags & PG_BUSY) == 0);
                KASSERT((pg->flags & PG_CLEAN) != 0);
                KASSERT((pg->flags & PG_DEVICE) != 0);
@@ -1521,8 +1530,10 @@
         */
 
        off_t off, eof;
+#ifdef XIP_HOLE
        struct vm_page *zero_page;
        bool put_zero_page;
+#endif
 
        off = trunc_page(startoff);
        if (endoff == 0 || (flags & PGO_ALLPAGES))
@@ -1530,10 +1541,12 @@
        else
                eof = endoff;
 
+#ifdef XIP_HOLE
        zero_page = uvm_pagelookup(uobj, 0);
        KASSERT(zero_page != NULL || uobj->uo_npages == 0);
        KASSERT(zero_page == NULL || uobj->uo_npages == 1);
        put_zero_page = false;
+#endif
 
        while (off < eof) {
                int npages, orignpages, error, i;
@@ -1554,9 +1567,11 @@
                        pg = pgs[i];
                        if (pg == NULL || pg == PGO_DONTCARE)
                                continue;
+#ifdef XIP_HOLE
                        if (pg == uvm_page_zeropage)
                                /* Do nothing for holes. */
                                continue;
+#endif
                        /*
                         * Freeing normal XIP pages; nothing to do.
                         */



Home | Main Index | Thread Index | Old Index