Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Fix unit mismatch in debugging code in lfs_segcl...



details:   https://anonhg.NetBSD.org/src/rev/eecdcb068efd
branches:  trunk
changeset: 467822:eecdcb068efd
user:      perseant <perseant%NetBSD.org@localhost>
date:      Mon Mar 29 22:13:07 1999 +0000

description:
Fix unit mismatch in debugging code in lfs_segclean; also put it properly
within `#ifdef DEBUG_LFS'.

diffstat:

 sys/ufs/lfs/lfs_syscalls.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r f0eb2309e11c -r eecdcb068efd sys/ufs/lfs/lfs_syscalls.c
--- a/sys/ufs/lfs/lfs_syscalls.c        Mon Mar 29 21:54:26 1999 +0000
+++ b/sys/ufs/lfs/lfs_syscalls.c        Mon Mar 29 22:13:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_syscalls.c,v 1.25 1999/03/25 22:26:52 perseant Exp $       */
+/*     $NetBSD: lfs_syscalls.c,v 1.26 1999/03/29 22:13:07 perseant Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -765,21 +765,27 @@
        fs->lfs_bfree += (sup->su_nsums * LFS_SUMMARY_SIZE / DEV_BSIZE) +
                sup->su_ninos * btodb(fs->lfs_bsize);
        sup->su_flags &= ~SEGUSE_DIRTY;
-#if 1
+#ifdef DEBUG_LFS
        /* XXX KS - before we return, really empty the segment (i.e., fill
           it with zeroes).  This is only for debugging purposes. */
        {
                daddr_t start;
                int offset, sizeleft, bufsize;
                struct buf *zbp;
+               int s;
 
                start = sntoda(fs, SCARG(uap, segment));
                offset = (sup->su_flags & SEGUSE_SUPERBLOCK) ? LFS_SBPAD : 0;
-               sizeleft = fs->lfs_ssize / DEV_BSIZE - offset;
+               sizeleft = fs->lfs_ssize * fs->lfs_bsize - offset;
                while(sizeleft > 0) {
                        bufsize = (sizeleft < MAXPHYS) ? sizeleft : MAXPHYS;
-                       zbp = lfs_newbuf(VTOI(fs->lfs_ivnode)->i_devvp, start+offset, bufsize);
+                       zbp = lfs_newbuf(VTOI(fs->lfs_ivnode)->i_devvp, start+(offset/DEV_BSIZE), bufsize);
                        memset(zbp->b_data, 'Z', bufsize);
+                       zbp->b_saveaddr = (caddr_t)fs;
+                       s = splbio();
+                       ++zbp->b_vp->v_numoutput;
+                       ++fs->lfs_iocount;
+                       splx(s);
                        VOP_STRATEGY(zbp);
                        offset += bufsize;
                        sizeleft -= bufsize;



Home | Main Index | Thread Index | Old Index