Source-Changes-HG archive

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

[src/trunk]: src fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()



details:   https://anonhg.NetBSD.org/src/rev/6633c5db1f9d
branches:  trunk
changeset: 787543:6633c5db1f9d
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Jun 23 02:06:04 2013 +0000

description:
fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB()

(Christos already did the lfs ones a few days back)

diffstat:

 sbin/badsect/badsect.c                           |  12 ++--
 sbin/clri/clri.c                                 |   6 +-
 sbin/dump/ffs_inode.c                            |  10 ++--
 sbin/fsck_ext2fs/inode.c                         |  14 ++--
 sbin/fsck_ext2fs/setup.c                         |  10 ++--
 sbin/fsck_ext2fs/utilities.c                     |  10 ++--
 sbin/fsck_ffs/inode.c                            |   6 +-
 sbin/fsck_ffs/pass1.c                            |   6 +-
 sbin/fsck_ffs/pass5.c                            |   8 +-
 sbin/fsck_ffs/setup.c                            |  14 ++--
 sbin/fsck_ffs/utilities.c                        |  10 ++--
 sbin/fsdb/fsdb.c                                 |  20 ++++----
 sbin/fsirand/fsirand.c                           |   6 +-
 sbin/newfs/mkfs.c                                |  44 ++++++++--------
 sbin/newfs_ext2fs/mke2fs.c                       |  48 +++++++++---------
 sbin/resize_ffs/resize_ffs.c                     |  60 ++++++++++++------------
 sbin/scan_ffs/scan_ffs.c                         |  10 +---
 sbin/tunefs/tunefs.c                             |   8 +-
 sys/arch/hp700/stand/xxboot/readufs_ffs.c        |   4 +-
 sys/arch/mvme68k/stand/installboot/installboot.c |  10 ++--
 sys/arch/x68k/stand/boot_ufs/readufs_ffs.c       |   4 +-
 sys/lib/libsa/ext2fs.c                           |   4 +-
 sys/lib/libsa/minixfs3.c                         |   4 +-
 sys/lib/libsa/minixfs3.h                         |   4 +-
 sys/lib/libsa/ufs.c                              |   4 +-
 sys/ufs/ext2fs/ext2fs.h                          |   6 +-
 sys/ufs/ext2fs/ext2fs_alloc.c                    |  12 ++--
 sys/ufs/ext2fs/ext2fs_balloc.c                   |  14 ++--
 sys/ufs/ext2fs/ext2fs_inode.c                    |  20 ++++----
 sys/ufs/ext2fs/ext2fs_vfsops.c                   |  14 ++--
 sys/ufs/ffs/ffs_alloc.c                          |  32 ++++++------
 sys/ufs/ffs/ffs_balloc.c                         |  42 ++++++++--------
 sys/ufs/ffs/ffs_inode.c                          |  20 ++++----
 sys/ufs/ffs/ffs_snapshot.c                       |  18 +++---
 sys/ufs/ffs/ffs_vfsops.c                         |  18 +++---
 sys/ufs/ffs/ffs_wapbl.c                          |  14 ++--
 sys/ufs/ffs/fs.h                                 |  16 +++---
 usr.sbin/dumpfs/dumpfs.c                         |  12 ++--
 usr.sbin/installboot/ext2fs.c                    |  14 ++--
 usr.sbin/installboot/ffs.c                       |  20 ++++----
 usr.sbin/makefs/ffs.c                            |  12 ++--
 usr.sbin/makefs/ffs/ffs_alloc.c                  |   8 +-
 usr.sbin/makefs/ffs/ffs_balloc.c                 |  20 ++++----
 usr.sbin/makefs/ffs/mkfs.c                       |  20 ++++----
 usr.sbin/quotacheck/quotacheck.c                 |  10 ++--
 45 files changed, 336 insertions(+), 342 deletions(-)

diffs (truncated from 2878 to 300 lines):

diff -r b779ca527ec3 -r 6633c5db1f9d sbin/badsect/badsect.c
--- a/sbin/badsect/badsect.c    Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/badsect/badsect.c    Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: badsect.c,v 1.32 2009/03/16 12:53:30 lukem Exp $       */
+/*     $NetBSD: badsect.c,v 1.33 2013/06/23 02:06:04 dholland Exp $    */
 
 /*
  * Copyright (c) 1981, 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)badsect.c  8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: badsect.c,v 1.32 2009/03/16 12:53:30 lukem Exp $");
+__RCSID("$NetBSD: badsect.c,v 1.33 2013/06/23 02:06:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -179,13 +179,13 @@
                break;
        }
 
-       dev_bsize = fs->fs_fsize / fsbtodb(fs, 1);
+       dev_bsize = fs->fs_fsize / FFS_FSBTODB(fs, 1);
        for (argc -= 2, argv += 2; argc > 0; argc--, argv++) {
                number = atoi(*argv);
                if (chkuse(number, 1))
                        continue;
                if (mknod(*argv, S_IFMT|S_IRUSR|S_IWUSR,
-                   (dev_t)dbtofsb(fs, number)) == -1) {
+                   (dev_t)FFS_DBTOFSB(fs, number)) == -1) {
                        warn("Cannot mknod `%s'", *argv);
                        errs++;
                        continue;
@@ -206,7 +206,7 @@
        int cg;
        off_t fsbn, bn, fsbe;
 
-       fsbn = dbtofsb(fs, blkno);
+       fsbn = FFS_DBTOFSB(fs, blkno);
        fsbe = fsbn + cnt;
        if (fsbe > fs->fs_size) {
                warnx("block %lld out of range of file system",
@@ -229,7 +229,7 @@
                }
        }
 
-       rdfs(fsbtodb(fs, cgtod(fs, cg)), (int)sblock.fs_cgsize, &acg);
+       rdfs(FFS_FSBTODB(fs, cgtod(fs, cg)), (int)sblock.fs_cgsize, &acg);
 
        if (!cg_chkmagic(&acg, needswap)) {
                warnx("cg %d: bad magic number", cg);
diff -r b779ca527ec3 -r 6633c5db1f9d sbin/clri/clri.c
--- a/sbin/clri/clri.c  Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/clri/clri.c  Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clri.c,v 1.22 2009/07/26 03:22:01 dholland Exp $       */
+/*     $NetBSD: clri.c,v 1.23 2013/06/23 02:06:04 dholland Exp $       */
 
 /*
  * Copyright (c) 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)clri.c     8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: clri.c,v 1.22 2009/07/26 03:22:01 dholland Exp $");
+__RCSID("$NetBSD: clri.c,v 1.23 2013/06/23 02:06:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -165,7 +165,7 @@
 
                /* read in the appropriate block. */
                offset = ino_to_fsba(sbp, inonum);      /* inode to fs blk */
-               offset = fsbtodb(sbp, offset);          /* fs blk disk blk */
+               offset = FFS_FSBTODB(sbp, offset);      /* fs blk disk blk */
                offset *= DEV_BSIZE;                    /* disk blk to bytes */
 
                /* seek and read the block */
diff -r b779ca527ec3 -r 6633c5db1f9d sbin/dump/ffs_inode.c
--- a/sbin/dump/ffs_inode.c     Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/dump/ffs_inode.c     Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_inode.c,v 1.21 2013/06/19 17:51:25 dholland Exp $ */
+/*     $NetBSD: ffs_inode.c,v 1.22 2013/06/23 02:06:04 dholland Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -36,7 +36,7 @@
 #endif /* not lint */
 
 #ifndef lint
-__RCSID("$NetBSD: ffs_inode.c,v 1.21 2013/06/19 17:51:25 dholland Exp $");
+__RCSID("$NetBSD: ffs_inode.c,v 1.22 2013/06/23 02:06:04 dholland Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -134,7 +134,7 @@
 #endif
 
        /* Fill out ufsi struct */
-       ufsi.ufs_dsize = fsbtodb(sblock,sblock->fs_size);
+       ufsi.ufs_dsize = FFS_FSBTODB(sblock,sblock->fs_size);
        ufsi.ufs_bsize = sblock->fs_bsize;
        ufsi.ufs_bshift = sblock->fs_bshift;
        ufsi.ufs_fsize = sblock->fs_fsize;
@@ -148,7 +148,7 @@
        ufsi.ufs_qbmask = sblock->fs_qbmask;
        ufsi.ufs_qfmask = sblock->fs_qfmask;
 
-       dev_bsize = sblock->fs_fsize / fsbtodb(sblock, 1);
+       dev_bsize = sblock->fs_fsize / FFS_FSBTODB(sblock, 1);
 
        return &ufsi;
 }
@@ -173,7 +173,7 @@
 
        for (cg = 0; cg < sblock->fs_ncg; cg++) {
                ino = cg * sblock->fs_ipg;
-               bread(fsbtodb(sblock, cgtod(sblock, cg)), (char *)cgp,
+               bread(FFS_FSBTODB(sblock, cgtod(sblock, cg)), (char *)cgp,
                    sblock->fs_cgsize);
                if (needswap)
                        ffs_cg_swap(cgp, cgp, sblock);
diff -r b779ca527ec3 -r 6633c5db1f9d sbin/fsck_ext2fs/inode.c
--- a/sbin/fsck_ext2fs/inode.c  Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/fsck_ext2fs/inode.c  Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inode.c,v 1.34 2013/06/19 17:51:25 dholland Exp $      */
+/*     $NetBSD: inode.c,v 1.35 2013/06/23 02:06:04 dholland Exp $      */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
 #if 0
 static char sccsid[] = "@(#)inode.c    8.5 (Berkeley) 2/8/95";
 #else
-__RCSID("$NetBSD: inode.c,v 1.34 2013/06/19 17:51:25 dholland Exp $");
+__RCSID("$NetBSD: inode.c,v 1.35 2013/06/23 02:06:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -432,7 +432,7 @@
                    (unsigned long long)inumber);
        if (inumber >= lastinum) {
                readcnt++;
-               dblk = fsbtodb(&sblock, fsck_ino_to_fsba(&sblock, lastinum));
+               dblk = EXT2_FSBTODB(&sblock, fsck_ino_to_fsba(&sblock, lastinum));
                if (readcnt % readpercg == 0) {
                        size = partialsize;
                        lastinum += partialcnt;
@@ -767,7 +767,7 @@
        if ((sblock.e2fs.e2fs_features_rocompat & EXT2F_ROCOMPAT_HUGE_FILE)) {
                nblock |= (uint64_t)fs2h16(dp->e2di_nblock_high) << 32;
                if (fs2h32(dp->e2di_flags) & EXT2_HUGE_FILE) {
-                       nblock = fsbtodb(&sblock, nblock);
+                       nblock = EXT2_FSBTODB(&sblock, nblock);
                }
        }
 
@@ -798,11 +798,11 @@
                return;
        }
 
-       if (dbtofsb(&sblock, nblock) <= 0xffffffffffffULL) {
+       if (EXT2_DBTOFSB(&sblock, nblock) <= 0xffffffffffffULL) {
                flags |= EXT2_HUGE_FILE;
                dp->e2di_flags = h2fs32(flags);
-               dp->e2di_nblock = h2fs32(dbtofsb(&sblock, nblock));
-               dp->e2di_nblock_high = h2fs16((dbtofsb(&sblock, nblock) >> 32));
+               dp->e2di_nblock = h2fs32(EXT2_DBTOFSB(&sblock, nblock));
+               dp->e2di_nblock_high = h2fs16((EXT2_DBTOFSB(&sblock, nblock) >> 32));
                return;
        }
 
diff -r b779ca527ec3 -r 6633c5db1f9d sbin/fsck_ext2fs/setup.c
--- a/sbin/fsck_ext2fs/setup.c  Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/fsck_ext2fs/setup.c  Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setup.c,v 1.30 2013/06/19 17:51:25 dholland Exp $      */
+/*     $NetBSD: setup.c,v 1.31 2013/06/23 02:06:04 dholland Exp $      */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
 #if 0
 static char sccsid[] = "@(#)setup.c    8.5 (Berkeley) 11/23/94";
 #else
-__RCSID("$NetBSD: setup.c,v 1.30 2013/06/19 17:51:25 dholland Exp $");
+__RCSID("$NetBSD: setup.c,v 1.31 2013/06/23 02:06:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -147,7 +147,7 @@
                if (reply("LOOK FOR ALTERNATE SUPERBLOCKS") == 0)
                        return 0;
                for (cg = 1; cg < proto.e2fs_ncg; cg++) {
-                       bflag = fsbtodb(&proto,
+                       bflag = EXT2_FSBTODB(&proto,
                            cg * proto.e2fs.e2fs_bpg +
                            proto.e2fs.e2fs_first_dblock);
                        if (readsb(0) != 0)
@@ -220,7 +220,7 @@
                if (bread(fsreadfd,
                    (char *)&sblock.e2fs_gd[i * sblock.e2fs_bsize /
                    sizeof(struct ext2_gd)],
-                   fsbtodb(&sblock, ((sblock.e2fs_bsize > 1024) ? 0 : 1) +
+                   EXT2_FSBTODB(&sblock, ((sblock.e2fs_bsize > 1024) ? 0 : 1) +
                    i + 1),
                    sblock.e2fs_bsize) != 0 && !asked) {
                        pfatal("BAD SUMMARY INFORMATION");
@@ -335,7 +335,7 @@
         * so we can tell if this is an alternate later.
         */
        super *= dev_bsize;
-       dev_bsize = sblock.e2fs_bsize / fsbtodb(&sblock, 1);
+       dev_bsize = sblock.e2fs_bsize / EXT2_FSBTODB(&sblock, 1);
        sblk.b_bno = super / dev_bsize;
 
        if (sblock.e2fs_ncg == 1) {
diff -r b779ca527ec3 -r 6633c5db1f9d sbin/fsck_ext2fs/utilities.c
--- a/sbin/fsck_ext2fs/utilities.c      Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/fsck_ext2fs/utilities.c      Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: utilities.c,v 1.22 2011/06/09 19:57:51 christos Exp $  */
+/*     $NetBSD: utilities.c,v 1.23 2013/06/23 02:06:04 dholland Exp $  */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
 #if 0
 static char sccsid[] = "@(#)utilities.c        8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: utilities.c,v 1.22 2011/06/09 19:57:51 christos Exp $");
+__RCSID("$NetBSD: utilities.c,v 1.23 2013/06/23 02:06:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -183,7 +183,7 @@
        struct bufarea *bp;
 
        for (bp = bufhead.b_next; bp != &bufhead; bp = bp->b_next)
-               if (bp->b_bno == fsbtodb(&sblock, blkno))
+               if (bp->b_bno == EXT2_FSBTODB(&sblock, blkno))
                        goto foundit;
        for (bp = bufhead.b_prev; bp != &bufhead; bp = bp->b_prev)
                if ((bp->b_flags & B_INUSE) == 0)
@@ -210,7 +210,7 @@
 {
        daddr_t dblk;
 
-       dblk = fsbtodb(&sblock, blk);
+       dblk = EXT2_FSBTODB(&sblock, blk);
        if (bp->b_bno != dblk) {
                flush(fswritefd, bp);
                bp->b_errs = bread(fsreadfd, bp->b_un.b_buf, dblk, size);
@@ -238,7 +238,7 @@
        for (i = 0; i < sblock.e2fs_ngdb; i++) {
                bwrite(fswritefd, (char *)
                        &sblock.e2fs_gd[i* sblock.e2fs_bsize / sizeof(struct ext2_gd)],
-                   fsbtodb(&sblock, ((sblock.e2fs_bsize>1024)?0:1)+i+1),
+                   EXT2_FSBTODB(&sblock, ((sblock.e2fs_bsize>1024)?0:1)+i+1),
                    sblock.e2fs_bsize);
        }
 }
diff -r b779ca527ec3 -r 6633c5db1f9d sbin/fsck_ffs/inode.c
--- a/sbin/fsck_ffs/inode.c     Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/fsck_ffs/inode.c     Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inode.c,v 1.66 2013/06/19 17:51:25 dholland Exp $      */
+/*     $NetBSD: inode.c,v 1.67 2013/06/23 02:06:04 dholland Exp $      */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)inode.c    8.8 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: inode.c,v 1.66 2013/06/19 17:51:25 dholland Exp $");
+__RCSID("$NetBSD: inode.c,v 1.67 2013/06/23 02:06:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -402,7 +402,7 @@
 
        if (inumber >= lastinum) {
                readcnt++;
-               dblk = fsbtodb(sblock, ino_to_fsba(sblock, lastinum));
+               dblk = FFS_FSBTODB(sblock, ino_to_fsba(sblock, lastinum));
                if (readcnt % readpercg == 0) {
                        size = partialsize;
                        lastinum += partialcnt;
diff -r b779ca527ec3 -r 6633c5db1f9d sbin/fsck_ffs/pass1.c
--- a/sbin/fsck_ffs/pass1.c     Sun Jun 23 01:44:22 2013 +0000
+++ b/sbin/fsck_ffs/pass1.c     Sun Jun 23 02:06:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pass1.c,v 1.53 2013/06/19 18:02:21 dholland Exp $      */
+/*     $NetBSD: pass1.c,v 1.54 2013/06/23 02:06:04 dholland Exp $      */
 
 /*



Home | Main Index | Thread Index | Old Index