Source-Changes-HG archive

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

[src/trunk]: src Bump daddr_t to 64 bits. Replace it with int32_t in all plac...



details:   https://anonhg.NetBSD.org/src/rev/b2d570f9c6b2
branches:  trunk
changeset: 542263:b2d570f9c6b2
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Fri Jan 24 21:55:02 2003 +0000

description:
Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.

diffstat:

 include/protocols/dumprestore.h                  |    4 +-
 include/util.h                                   |    4 +-
 lib/libutil/getlabelsector.c                     |    8 +-
 libexec/lfs_cleanerd/clean.h                     |    7 +-
 libexec/lfs_cleanerd/cleanerd.c                  |   19 +-
 libexec/lfs_cleanerd/coalesce.c                  |    7 +-
 libexec/lfs_cleanerd/library.c                   |   23 +-
 libexec/lfs_cleanerd/print.c                     |   13 +-
 sbin/badsect/badsect.c                           |   23 +-
 sbin/dump/dump.h                                 |    8 +-
 sbin/dump/ffs_inode.c                            |    6 +-
 sbin/dump/rcache.c                               |   22 +-
 sbin/dump/traverse.c                             |   19 +-
 sbin/dump_lfs/lfs_inode.c                        |   16 +-
 sbin/fsck_ext2fs/fsck.h                          |    8 +-
 sbin/fsck_ext2fs/inode.c                         |   37 +++--
 sbin/fsck_ext2fs/main.c                          |   14 +-
 sbin/fsck_ext2fs/utilities.c                     |   21 +-
 sbin/fsck_ffs/dir.c                              |    8 +-
 sbin/fsck_ffs/extern.h                           |   18 +-
 sbin/fsck_ffs/fsck.h                             |   22 +-
 sbin/fsck_ffs/inode.c                            |   47 ++++--
 sbin/fsck_ffs/main.c                             |   23 +-
 sbin/fsck_ffs/pass1.c                            |   18 +-
 sbin/fsck_ffs/pass1b.c                           |    6 +-
 sbin/fsck_ffs/pass4.c                            |    6 +-
 sbin/fsck_ffs/pass5.c                            |    8 +-
 sbin/fsck_ffs/setup.c                            |    8 +-
 sbin/fsck_ffs/utilities.c                        |   39 ++--
 sbin/fsck_lfs/fsck.h                             |    8 +-
 sbin/fsck_lfs/fsck_vars.h                        |    4 +-
 sbin/fsck_lfs/inode.c                            |   31 ++-
 sbin/fsck_lfs/main.c                             |    9 +-
 sbin/fsck_lfs/pass0.c                            |   32 ++--
 sbin/fsck_lfs/pass1.c                            |   10 +-
 sbin/fsck_lfs/setup.c                            |    7 +-
 sbin/fsck_lfs/utilities.c                        |   19 +-
 sbin/fsck_lfs/vars.c                             |    4 +-
 sbin/fsdb/fsdb.c                                 |   24 ++-
 sbin/newfs/mkfs.c                                |   45 +++---
 sbin/newfs/newfs.c                               |    7 +-
 sbin/newfs_lfs/extern.h                          |    4 +-
 sbin/newfs_lfs/lfs.c                             |   43 +++--
 sys/arch/i386/stand/installboot/installboot.c    |   12 +-
 sys/arch/mipsco/stand/common/saio.c              |    5 +-
 sys/arch/mvme68k/stand/bootxx/bootxx.c           |    5 +-
 sys/arch/mvme68k/stand/installboot/installboot.c |   11 +-
 sys/arch/sparc/dev/fd.c                          |   15 +-
 sys/arch/sparc64/sparc64/machdep.c               |    4 +-
 sys/arch/x68k/stand/boot_ufs/readufs.c           |   15 +-
 sys/arch/x68k/stand/boot_ufs/readufs.h           |    6 +-
 sys/arch/x68k/stand/boot_ufs/readufs_lfs.c       |    8 +-
 sys/compat/netbsd32/netbsd32_ioctl.c             |   15 +-
 sys/compat/netbsd32/netbsd32_ioctl.h             |    4 +-
 sys/compat/sunos/sunos.h                         |    4 +-
 sys/fs/adosfs/advnops.c                          |    6 +-
 sys/kern/vfs_vnops.c                             |   12 +-
 sys/lib/libsa/lfs.c                              |   16 +-
 sys/lib/libsa/ufs.c                              |    8 +-
 sys/sys/disklabel.h                              |    4 +-
 sys/sys/filio.h                                  |    3 +-
 sys/sys/mtio.h                                   |   16 +-
 sys/sys/types.h                                  |    4 +-
 sys/ufs/ext2fs/ext2fs.h                          |   10 +-
 sys/ufs/ext2fs/ext2fs_alloc.c                    |   60 ++++----
 sys/ufs/ext2fs/ext2fs_balloc.c                   |   36 +++--
 sys/ufs/ext2fs/ext2fs_bmap.c                     |   31 ++-
 sys/ufs/ext2fs/ext2fs_extern.h                   |   15 +-
 sys/ufs/ext2fs/ext2fs_inode.c                    |   34 ++--
 sys/ufs/ext2fs/ext2fs_readwrite.c                |    8 +-
 sys/ufs/ext2fs/ext2fs_subr.c                     |   10 +-
 sys/ufs/ext2fs/ext2fs_vfsops.c                   |    6 +-
 sys/ufs/ffs/ffs_alloc.c                          |  154 ++++++++++++----------
 sys/ufs/ffs/ffs_balloc.c                         |   38 +++--
 sys/ufs/ffs/ffs_extern.h                         |   37 ++--
 sys/ufs/ffs/ffs_inode.c                          |   32 ++--
 sys/ufs/ffs/ffs_softdep.c                        |  110 ++++++++-------
 sys/ufs/ffs/ffs_softdep.stub.c                   |   20 +-
 sys/ufs/ffs/ffs_subr.c                           |   16 +-
 sys/ufs/ffs/ffs_vfsops.c                         |   12 +-
 sys/ufs/ffs/ffs_vnops.c                          |    8 +-
 sys/ufs/ffs/fs.h                                 |   20 +-
 sys/ufs/ffs/softdep.h                            |   22 +-
 sys/ufs/lfs/lfs.h                                |   47 +++---
 sys/ufs/lfs/lfs_alloc.c                          |    8 +-
 sys/ufs/lfs/lfs_balloc.c                         |   24 ++-
 sys/ufs/lfs/lfs_bio.c                            |   10 +-
 sys/ufs/lfs/lfs_debug.c                          |   10 +-
 sys/ufs/lfs/lfs_extern.h                         |   13 +-
 sys/ufs/lfs/lfs_inode.c                          |   37 ++--
 sys/ufs/lfs/lfs_segment.c                        |   80 ++++++-----
 sys/ufs/lfs/lfs_subr.c                           |    8 +-
 sys/ufs/lfs/lfs_syscalls.c                       |   30 ++-
 sys/ufs/lfs/lfs_vfsops.c                         |   41 +++--
 sys/ufs/ufs/dinode.h                             |   11 +-
 sys/ufs/ufs/inode.h                              |    8 +-
 sys/ufs/ufs/ufs_bmap.c                           |   28 ++-
 sys/ufs/ufs/ufs_extern.h                         |    6 +-
 sys/ufs/ufs/ufs_readwrite.c                      |    8 +-
 usr.sbin/bad144/bad144.c                         |   45 +++---
 usr.sbin/dumplfs/dumplfs.c                       |   37 ++--
 usr.sbin/installboot/ffs.c                       |   12 +-
 usr.sbin/makefs/ffs.c                            |    7 +-
 usr.sbin/makefs/ffs/buf.c                        |   25 ++-
 usr.sbin/makefs/ffs/ffs_alloc.c                  |   83 ++++++-----
 usr.sbin/makefs/ffs/ffs_balloc.c                 |   31 ++-
 usr.sbin/makefs/ffs/ffs_extern.h                 |   23 +-
 usr.sbin/makefs/ffs/mkfs.c                       |   43 +++--
 usr.sbin/makefs/ffs/ufs_bmap.c                   |    8 +-
 usr.sbin/quotacheck/quotacheck.c                 |    6 +-
 110 files changed, 1234 insertions(+), 1016 deletions(-)

diffs (truncated from 7374 to 300 lines):

diff -r 8d6a2f0fb309 -r b2d570f9c6b2 include/protocols/dumprestore.h
--- a/include/protocols/dumprestore.h   Fri Jan 24 21:37:01 2003 +0000
+++ b/include/protocols/dumprestore.h   Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dumprestore.h,v 1.9 2001/12/23 14:38:03 lukem Exp $    */
+/*     $NetBSD: dumprestore.h,v 1.10 2003/01/24 21:55:03 fvdl Exp $    */
 
 /*
  * Copyright (c) 1980, 1993
@@ -73,7 +73,7 @@
                int32_t c_date;             /* date of this dump */
                int32_t c_ddate;            /* date of previous dump */
                int32_t c_volume;           /* dump volume number */
-               daddr_t c_tapea;            /* logical block of this record */
+               int32_t c_tapea;            /* logical block of this record */
                ino_t   c_inumber;          /* number of inode */
                int32_t c_magic;            /* magic number (see above) */
                int32_t c_checksum;         /* record checksum */
diff -r 8d6a2f0fb309 -r b2d570f9c6b2 include/util.h
--- a/include/util.h    Fri Jan 24 21:37:01 2003 +0000
+++ b/include/util.h    Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.h,v 1.29 2002/12/12 09:45:32 scw Exp $    */
+/*     $NetBSD: util.h,v 1.30 2003/01/24 21:55:02 fvdl Exp $   */
 
 /*-
  * Copyright (c) 1995
@@ -67,7 +67,7 @@
 pid_t          forkpty(int *, char *, struct termios *, struct winsize *);
 const char     *getbootfile(void);
 off_t          getlabeloffset(void);
-daddr_t                getlabelsector(void);
+int            getlabelsector(void);
 int            getmaxpartitions(void);
 int            getrawpartition(void);
 int            humanize_number(char *, size_t, int64_t, const char *, int,
diff -r 8d6a2f0fb309 -r b2d570f9c6b2 lib/libutil/getlabelsector.c
--- a/lib/libutil/getlabelsector.c      Fri Jan 24 21:37:01 2003 +0000
+++ b/lib/libutil/getlabelsector.c      Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getlabelsector.c,v 1.1 2002/12/12 09:45:33 scw Exp $   */
+/*     $NetBSD: getlabelsector.c,v 1.2 2003/01/24 21:55:03 fvdl Exp $  */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -37,14 +37,14 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getlabelsector.c,v 1.1 2002/12/12 09:45:33 scw Exp $");
+__RCSID("$NetBSD: getlabelsector.c,v 1.2 2003/01/24 21:55:03 fvdl Exp $");
 #endif
 
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #include <util.h>
 
-daddr_t
+int
 getlabelsector(void)
 {
        int sector, mib[2];
@@ -56,7 +56,7 @@
        if (sysctl(mib, 2, &sector, &varlen, NULL, 0) < 0)
                return (-1);
 
-       return ((daddr_t)sector);
+       return sector;
 }
 
 off_t
diff -r 8d6a2f0fb309 -r b2d570f9c6b2 libexec/lfs_cleanerd/clean.h
--- a/libexec/lfs_cleanerd/clean.h      Fri Jan 24 21:37:01 2003 +0000
+++ b/libexec/lfs_cleanerd/clean.h      Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clean.h,v 1.14 2002/06/14 00:58:39 perseant Exp $      */
+/*     $NetBSD: clean.h,v 1.15 2003/01/24 21:55:03 fvdl Exp $  */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -152,11 +152,12 @@
 int             lfs_bmapv(fsid_t *, BLOCK_INFO_15 *, int); 
 int             lfs_markv(fsid_t *, BLOCK_INFO_15 *, int);
 
-int             dump_summary(struct lfs *, SEGSUM *, u_long, daddr_t **, daddr_t);
+/* XXX ondisk32 */
+int             dump_summary(struct lfs *, SEGSUM *, u_long, int32_t **, daddr_t);
 int             fs_getmntinfo(struct statfs **, char *, const char *);
 void            get(int, off_t, void *, size_t);
 struct dinode  *get_dinode (FS_INFO *, ino_t);
-int             get_rawblock(FS_INFO *, char *, size_t, ufs_daddr_t);
+int             get_rawblock(FS_INFO *, char *, size_t, daddr_t);
 FS_INFO                *get_fs_info(struct statfs *, int);
 int             lfs_segmapv(FS_INFO *, int, caddr_t, BLOCK_INFO_15 **, int *);
 int             mmap_segment(FS_INFO *, int, caddr_t *, int);
diff -r 8d6a2f0fb309 -r b2d570f9c6b2 libexec/lfs_cleanerd/cleanerd.c
--- a/libexec/lfs_cleanerd/cleanerd.c   Fri Jan 24 21:37:01 2003 +0000
+++ b/libexec/lfs_cleanerd/cleanerd.c   Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cleanerd.c,v 1.40 2002/12/15 07:25:37 yamt Exp $       */
+/*     $NetBSD: cleanerd.c,v 1.41 2003/01/24 21:55:04 fvdl Exp $       */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)cleanerd.c 8.5 (Berkeley) 6/10/95";
 #else
-__RCSID("$NetBSD: cleanerd.c,v 1.40 2002/12/15 07:25:37 yamt Exp $");
+__RCSID("$NetBSD: cleanerd.c,v 1.41 2003/01/24 21:55:04 fvdl Exp $");
 #endif
 #endif /* not lint */
 
@@ -737,23 +737,24 @@
                        syslog(LOG_DEBUG,"segment %d is empty, as claimed", id);
        }
        /* XXX KS - check for misplaced blocks */
+       /* XXX ondisk32 */
        for(i=0; i<num_blocks; i++) {
                if(tba[i].bi_daddr
-                  && tba[i].bi_daddr != (long)seg_addr +
+                  && tba[i].bi_daddr != seg_addr +
                                btofsb(lfsp, (char *)(tba[i].bi_bp) - seg_buf)
                   && dtosn(&(fsp->fi_lfs), tba[i].bi_daddr) == id)
                {
-                       syslog(LOG_ERR, "bi_daddr = 0x%x = %db; %p - %p = %ld",
+                       syslog(LOG_ERR, "bi_daddr = 0x%x = %lldb; %p - %p = %ld",
                                tba[i].bi_daddr,
-                               fsbtob(lfsp, tba[i].bi_daddr - seg_addr),
+                               (long long)fsbtob(lfsp, tba[i].bi_daddr - seg_addr),
                                tba[i].bi_bp, seg_buf,
                                (long)(((char *)(tba[i].bi_bp) - seg_buf)));
-                       syslog(LOG_ERR, "seg %d (0x%x), ino %d lbn %d, 0x%x != 0x%lx",
-                              id, seg_addr,
+                       syslog(LOG_ERR, "seg %d (0x%llx), ino %d lbn %d, 0x%x != 0x%llx",
+                              id, (long long)seg_addr,
                               tba[i].bi_inode,
                               tba[i].bi_lbn,
                               tba[i].bi_daddr,
-                              (long)seg_addr + btofsb(lfsp, (char *)(tba[i].bi_bp) - seg_buf));
+                              seg_addr + btofsb(lfsp, (char *)(tba[i].bi_bp) - seg_buf));
                        error = EFAULT;
                        goto out;
 
@@ -763,6 +764,7 @@
                         * segment from where we thought, we need to reload
                         * the *right* inode, not the first one in the block.
                         */
+                       /* XXX ondisk32 */
                        if(tba[i].bi_lbn == LFS_UNUSED_LBN) {
                                dip = (struct dinode *)(seg_buf + fsbtob(lfsp, tba[i].bi_daddr - seg_addr));
                                for(j=INOPB(lfsp)-1;j>=0;j--) {
@@ -809,6 +811,7 @@
                        syslog(LOG_DEBUG, "BLOCK INFOS");
                for (_bip = tba, i=0; i < num_blocks; ++_bip, ++i) {
                        PRINT_BINFO(_bip);
+                       /* XXX ondisk32? */
                        lp = (u_long *)_bip->bi_bp;
                }
        }
diff -r 8d6a2f0fb309 -r b2d570f9c6b2 libexec/lfs_cleanerd/coalesce.c
--- a/libexec/lfs_cleanerd/coalesce.c   Fri Jan 24 21:37:01 2003 +0000
+++ b/libexec/lfs_cleanerd/coalesce.c   Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: coalesce.c,v 1.5 2002/12/15 08:38:17 yamt Exp $  */
+/*      $NetBSD: coalesce.c,v 1.6 2003/01/24 21:55:04 fvdl Exp $  */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
        BLOCK_INFO_15 *bip = NULL, *tbip;
        struct dinode *dip;
        int nb, onb, noff;
-       ufs_daddr_t toff;
+       daddr_t toff;
        struct lfs *lfsp;
        int bps;
        SEGUSE *sup;
@@ -204,7 +204,8 @@
                goto out;
        } else if (debug)
                syslog(LOG_DEBUG, "ino %d total discontinuity "
-                       "%d (%d) for %d blocks", ino, noff, toff, nb);
+                       "%d (%lld) for %d blocks", ino, noff,
+                       (long long)toff, nb);
 
        /* Search for blocks in active segments; don't move them. */
        for (i = 0; i < nb; i++) {
diff -r 8d6a2f0fb309 -r b2d570f9c6b2 libexec/lfs_cleanerd/library.c
--- a/libexec/lfs_cleanerd/library.c    Fri Jan 24 21:37:01 2003 +0000
+++ b/libexec/lfs_cleanerd/library.c    Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: library.c,v 1.31 2002/12/05 02:03:56 yamt Exp $        */
+/*     $NetBSD: library.c,v 1.32 2003/01/24 21:55:04 fvdl Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)library.c  8.3 (Berkeley) 5/24/95";
 #else
-__RCSID("$NetBSD: library.c,v 1.31 2002/12/05 02:03:56 yamt Exp $");
+__RCSID("$NetBSD: library.c,v 1.32 2003/01/24 21:55:04 fvdl Exp $");
 #endif
 #endif /* not lint */
 
@@ -175,7 +175,7 @@
  * Read a block from disk.
  */
 int
-get_rawblock(FS_INFO *fsp, char *buf, size_t size, ufs_daddr_t daddr)
+get_rawblock(FS_INFO *fsp, char *buf, size_t size, daddr_t daddr)
 {
        return pread(getdevfd(fsp), buf, size, fsbtob(&fsp->fi_lfs,
            (off_t)daddr));
@@ -433,13 +433,14 @@
                if (fsbtob(lfsp, pseg_addr) < LFS_LABELPAD + LFS_SBPAD) {
                        pseg_addr = btofsb(lfsp, LFS_LABELPAD + LFS_SBPAD);
                        s = seg_buf + LFS_LABELPAD + LFS_SBPAD;
-                       syslog(LOG_DEBUG, "adj segment 0 offset to 0x%x\n",
-                              pseg_addr);
+                       syslog(LOG_DEBUG, "adj segment 0 offset to 0x%llx\n",
+                              (long long)pseg_addr);
                }
        }
 
         if(debug > 1)
-            syslog(LOG_DEBUG, "\tsegment buffer at: %p\tseg_addr 0x%x", s, seg_addr);
+            syslog(LOG_DEBUG, "\tsegment buffer at: %p\tseg_addr 0x%llx", s,
+               (long long)seg_addr);
 
 
        *bcount = 0;
@@ -448,8 +449,8 @@
 
                nblocks = pseg_valid(fsp, sp, pseg_addr);
                if (nblocks <= 0) {
-                        syslog(LOG_DEBUG, "Warning: invalid segment summary at 0x%x",
-                           pseg_addr);
+                        syslog(LOG_DEBUG, "Warning: invalid segment summary at 0x%llx",
+                           (long long)pseg_addr);
                        goto err0;
                }
 
@@ -525,7 +526,8 @@
        IFILE   *ifp;
        FINFO   *fip;
        caddr_t bp;
-       daddr_t *dp, *iaddrp;
+       /* XXX ondisk32 */
+       int32_t *dp, *iaddrp;
        int fsb_per_block, fsb_per_iblock, i, j;
        int fsb_frag, iblks_seen;
        u_long iblk_size, blk_size;
@@ -542,7 +544,8 @@
        bp = seg_buf + fsbtob(lfsp, psegaddr - segaddr) + lfsp->lfs_sumsize;
        bip += *countp;
        psegaddr += btofsb(lfsp, lfsp->lfs_sumsize);
-       iaddrp = (daddr_t *)((caddr_t)sp + lfsp->lfs_sumsize);
+       /* XXX ondisk32 */
+       iaddrp = (int32_t *)((caddr_t)sp + lfsp->lfs_sumsize);
        --iaddrp;
        if (lfsp->lfs_version == 1)
                fip = (FINFO *)(((char *)sp) + sizeof(SEGSUM_V1));
diff -r 8d6a2f0fb309 -r b2d570f9c6b2 libexec/lfs_cleanerd/print.c
--- a/libexec/lfs_cleanerd/print.c      Fri Jan 24 21:37:01 2003 +0000
+++ b/libexec/lfs_cleanerd/print.c      Fri Jan 24 21:55:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: print.c,v 1.12 2002/04/30 00:28:58 perseant Exp $      */
+/*     $NetBSD: print.c,v 1.13 2003/01/24 21:55:05 fvdl Exp $  */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)print.c      8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: print.c,v 1.12 2002/04/30 00:28:58 perseant Exp $");
+__RCSID("$NetBSD: print.c,v 1.13 2003/01/24 21:55:05 fvdl Exp $");
 #endif
 #endif /* not lint */
 
@@ -66,11 +66,13 @@
  * Returns a pointer to the array of inode addresses.
  */
 
+/* XXX ondisk32 */
 int
-dump_summary(struct lfs *lfsp, SEGSUM *sp, u_long flags, daddr_t **iaddrp, daddr_t addr)
+dump_summary(struct lfs *lfsp, SEGSUM *sp, u_long flags, int32_t **iaddrp, daddr_t addr)
 {
        int i, j, blk, numblocks, accino=0;
-       daddr_t *dp, ddp, *idp;
+       /* XXX ondisk32 */
+       int32_t *dp, ddp, *idp;
        u_int32_t *datap;
        int size;
        FINFO *fp;
@@ -110,7 +112,8 @@
        if (flags & DUMP_INODE_ADDRS)



Home | Main Index | Thread Index | Old Index