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 Fix a bug (offset calculation) in th...



details:   https://anonhg.NetBSD.org/src/rev/62d7077f7f17
branches:  uebayasi-xip
changeset: 751880:62d7077f7f17
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sat Nov 20 04:26:12 2010 +0000

description:
Fix a bug (offset calculation) in the previous.

diffstat:

 sys/miscfs/genfs/genfs_io.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 1288965f4927 -r 62d7077f7f17 sys/miscfs/genfs/genfs_io.c
--- a/sys/miscfs/genfs/genfs_io.c       Sat Nov 20 03:00:42 2010 +0000
+++ b/sys/miscfs/genfs/genfs_io.c       Sat Nov 20 04:26:12 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfs_io.c,v 1.36.2.48 2010/11/20 03:00:42 uebayasi Exp $      */
+/*     $NetBSD: genfs_io.c,v 1.36.2.49 2010/11/20 04:26:12 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.48 2010/11/20 03:00:42 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.49 2010/11/20 04:26:12 uebayasi Exp $");
 
 #include "opt_xip.h"
 
@@ -749,8 +749,9 @@
                    bp, offset, bp->b_bcount, bp->b_blkno);
 
                VOP_STRATEGY(devvp, bp);
+           }
 #ifdef XIP
-           } else {
+           else {
                /*
                 * XIP page metadata assignment
                 * - Unallocated block is redirected to the dedicated zero'ed
@@ -760,10 +761,10 @@
                        iobytes >> PAGE_SHIFT,
                        ((1 + run) << fs_bshift) >> PAGE_SHIFT);
                const daddr_t blk_off = blkno << dev_bshift;
-               const daddr_t fs_off = ap->a_offset - (lbn << fs_bshift);
+               const daddr_t fs_off = ap->a_offset - startoffset;
 
                UVMHIST_LOG(ubchist,
-                       "xip npgs=%d _blk_off=0x%lx _fs_off=0x%lx",
+                       "xip npgs=%d blk_off=0x%lx fs_off=0x%lx",
                        npgs, (long)blk_off, (long)fs_off, 0);
 
                for (i = 0; i < npgs; i++) {



Home | Main Index | Thread Index | Old Index