Source-Changes-HG archive

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

[src/trunk]: src/sbin/fsck_ext2fs e2di_nblock is (assuming the huge_file feat...



details:   https://anonhg.NetBSD.org/src/rev/f914248f8dc0
branches:  trunk
changeset: 782893:f914248f8dc0
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Nov 25 19:36:23 2012 +0000

description:
e2di_nblock is (assuming the huge_file feature is not active) stored in
DEV_BSIZE units, not fs block size units.

diffstat:

 sbin/fsck_ext2fs/dir.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r ace59eee1041 -r f914248f8dc0 sbin/fsck_ext2fs/dir.c
--- a/sbin/fsck_ext2fs/dir.c    Sun Nov 25 19:15:43 2012 +0000
+++ b/sbin/fsck_ext2fs/dir.c    Sun Nov 25 19:36:23 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.23 2009/10/19 18:41:07 bouyer Exp $  */
+/*     $NetBSD: dir.c,v 1.24 2012/11/25 19:36:23 jakllsch Exp $        */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
 #if 0
 static char sccsid[] = "@(#)dir.c      8.5 (Berkeley) 12/8/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.23 2009/10/19 18:41:07 bouyer Exp $");
+__RCSID("$NetBSD: dir.c,v 1.24 2012/11/25 19:36:23 jakllsch Exp $");
 #endif
 #endif /* not lint */
 
@@ -569,7 +569,8 @@
        dp->e2di_blocks[lastbn + 1] = dp->e2di_blocks[lastbn];
        dp->e2di_blocks[lastbn] = h2fs32(newblk);
        inossize(dp, inosize(dp) + sblock.e2fs_bsize);
-       dp->e2di_nblock = h2fs32(fs2h32(dp->e2di_nblock) + 1);
+       dp->e2di_nblock = h2fs32(fs2h32(dp->e2di_nblock) +
+               btodb(sblock.e2fs_bsize));
        bp = getdirblk(fs2h32(dp->e2di_blocks[lastbn + 1]),
                sblock.e2fs_bsize);
        if (bp->b_errs)
@@ -603,7 +604,8 @@
        dp->e2di_blocks[lastbn] = dp->e2di_blocks[lastbn + 1];
        dp->e2di_blocks[lastbn + 1] = 0;
        inossize(dp, inosize(dp) - sblock.e2fs_bsize);
-       dp->e2di_nblock = h2fs32(fs2h32(dp->e2di_nblock) - 1);
+       dp->e2di_nblock = h2fs32(fs2h32(dp->e2di_nblock) -
+               btodb(sblock.e2fs_bsize));
        freeblk(newblk);
        return (0);
 }



Home | Main Index | Thread Index | Old Index