Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ext2fs Migrate from u_intNN_t to uintNN_t.



details:   https://anonhg.NetBSD.org/src/rev/02a9d2ede108
branches:  trunk
changeset: 747363:02a9d2ede108
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Sep 12 11:27:39 2009 +0000

description:
Migrate from u_intNN_t to uintNN_t.

diffstat:

 sys/ufs/ext2fs/ext2fs.h           |  98 +++++++++++++++++++-------------------
 sys/ufs/ext2fs/ext2fs_dinode.h    |  52 ++++++++++----------
 sys/ufs/ext2fs/ext2fs_dir.h       |  28 +++++-----
 sys/ufs/ext2fs/ext2fs_inode.c     |  14 ++--
 sys/ufs/ext2fs/ext2fs_lookup.c    |   6 +-
 sys/ufs/ext2fs/ext2fs_readwrite.c |   8 +-
 6 files changed, 103 insertions(+), 103 deletions(-)

diffs (truncated from 370 to 300 lines):

diff -r 38355dc735aa -r 02a9d2ede108 sys/ufs/ext2fs/ext2fs.h
--- a/sys/ufs/ext2fs/ext2fs.h   Sat Sep 12 11:01:55 2009 +0000
+++ b/sys/ufs/ext2fs/ext2fs.h   Sat Sep 12 11:27:39 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs.h,v 1.26 2007/12/25 18:33:49 perry Exp $        */
+/*     $NetBSD: ext2fs.h,v 1.27 2009/09/12 11:27:39 tsutsui Exp $      */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -131,46 +131,46 @@
  * Super block for an ext2fs file system.
  */
 struct ext2fs {
-       u_int32_t  e2fs_icount;         /* Inode count */
-       u_int32_t  e2fs_bcount;         /* blocks count */
-       u_int32_t  e2fs_rbcount;        /* reserved blocks count */
-       u_int32_t  e2fs_fbcount;        /* free blocks count */
-       u_int32_t  e2fs_ficount;        /* free inodes count */
-       u_int32_t  e2fs_first_dblock;   /* first data block */
-       u_int32_t  e2fs_log_bsize;      /* block size = 1024*(2^e2fs_log_bsize) */
-       u_int32_t  e2fs_fsize;          /* fragment size */
-       u_int32_t  e2fs_bpg;            /* blocks per group */
-       u_int32_t  e2fs_fpg;            /* frags per group */
-       u_int32_t  e2fs_ipg;            /* inodes per group */
-       u_int32_t  e2fs_mtime;          /* mount time */
-       u_int32_t  e2fs_wtime;          /* write time */
-       u_int16_t  e2fs_mnt_count;      /* mount count */
-       u_int16_t  e2fs_max_mnt_count;  /* max mount count */
-       u_int16_t  e2fs_magic;          /* magic number */
-       u_int16_t  e2fs_state;          /* file system state */
-       u_int16_t  e2fs_beh;            /* behavior on errors */
-       u_int16_t  e2fs_minrev;         /* minor revision level */
-       u_int32_t  e2fs_lastfsck;       /* time of last fsck */
-       u_int32_t  e2fs_fsckintv;       /* max time between fscks */
-       u_int32_t  e2fs_creator;        /* creator OS */
-       u_int32_t  e2fs_rev;            /* revision level */
-       u_int16_t  e2fs_ruid;           /* default uid for reserved blocks */
-       u_int16_t  e2fs_rgid;           /* default gid for reserved blocks */
+       uint32_t  e2fs_icount;          /* Inode count */
+       uint32_t  e2fs_bcount;          /* blocks count */
+       uint32_t  e2fs_rbcount;         /* reserved blocks count */
+       uint32_t  e2fs_fbcount;         /* free blocks count */
+       uint32_t  e2fs_ficount;         /* free inodes count */
+       uint32_t  e2fs_first_dblock;    /* first data block */
+       uint32_t  e2fs_log_bsize;       /* block size = 1024*(2^e2fs_log_bsize) */
+       uint32_t  e2fs_fsize;           /* fragment size */
+       uint32_t  e2fs_bpg;             /* blocks per group */
+       uint32_t  e2fs_fpg;             /* frags per group */
+       uint32_t  e2fs_ipg;             /* inodes per group */
+       uint32_t  e2fs_mtime;           /* mount time */
+       uint32_t  e2fs_wtime;           /* write time */
+       uint16_t  e2fs_mnt_count;       /* mount count */
+       uint16_t  e2fs_max_mnt_count;   /* max mount count */
+       uint16_t  e2fs_magic;           /* magic number */
+       uint16_t  e2fs_state;           /* file system state */
+       uint16_t  e2fs_beh;             /* behavior on errors */
+       uint16_t  e2fs_minrev;          /* minor revision level */
+       uint32_t  e2fs_lastfsck;        /* time of last fsck */
+       uint32_t  e2fs_fsckintv;        /* max time between fscks */
+       uint32_t  e2fs_creator;         /* creator OS */
+       uint32_t  e2fs_rev;             /* revision level */
+       uint16_t  e2fs_ruid;            /* default uid for reserved blocks */
+       uint16_t  e2fs_rgid;            /* default gid for reserved blocks */
        /* EXT2_DYNAMIC_REV superblocks */
-       u_int32_t  e2fs_first_ino;      /* first non-reserved inode */
-       u_int16_t  e2fs_inode_size;     /* size of inode structure */
-       u_int16_t  e2fs_block_group_nr; /* block grp number of this sblk*/
-       u_int32_t  e2fs_features_compat; /*  compatible feature set */
-       u_int32_t  e2fs_features_incompat; /* incompatible feature set */
-       u_int32_t  e2fs_features_rocompat; /* RO-compatible feature set */
-       u_int8_t   e2fs_uuid[16];       /* 128-bit uuid for volume */
-       char       e2fs_vname[16];      /* volume name */
-       char       e2fs_fsmnt[64];      /* name mounted on */
-       u_int32_t  e2fs_algo;           /* For compression */
-       u_int8_t   e2fs_prealloc;       /* # of blocks to preallocate */
-       u_int8_t   e2fs_dir_prealloc;   /* # of blocks to preallocate for dir */
-       u_int16_t  e2fs_reserved_ngdb; /* # of reserved gd blocks for resize */
-       u_int32_t  reserved2[204];
+       uint32_t  e2fs_first_ino;       /* first non-reserved inode */
+       uint16_t  e2fs_inode_size;      /* size of inode structure */
+       uint16_t  e2fs_block_group_nr;  /* block grp number of this sblk*/
+       uint32_t  e2fs_features_compat; /*  compatible feature set */
+       uint32_t  e2fs_features_incompat; /* incompatible feature set */
+       uint32_t  e2fs_features_rocompat; /* RO-compatible feature set */
+       uint8_t   e2fs_uuid[16];        /* 128-bit uuid for volume */
+       char      e2fs_vname[16];       /* volume name */
+       char      e2fs_fsmnt[64];       /* name mounted on */
+       uint32_t  e2fs_algo;            /* For compression */
+       uint8_t   e2fs_prealloc;        /* # of blocks to preallocate */
+       uint8_t   e2fs_dir_prealloc;    /* # of blocks to preallocate for dir */
+       uint16_t  e2fs_reserved_ngdb;   /* # of reserved gd blocks for resize */
+       uint32_t  reserved2[204];
 };
 
 
@@ -256,14 +256,14 @@
 /* ext2 file system block group descriptor */
 
 struct ext2_gd {
-       u_int32_t ext2bgd_b_bitmap;     /* blocks bitmap block */
-       u_int32_t ext2bgd_i_bitmap;     /* inodes bitmap block */
-       u_int32_t ext2bgd_i_tables;     /* inodes table block  */
-       u_int16_t ext2bgd_nbfree;       /* number of free blocks */
-       u_int16_t ext2bgd_nifree;       /* number of free inodes */
-       u_int16_t ext2bgd_ndirs;        /* number of directories */
-       u_int16_t reserved;
-       u_int32_t reserved2[3];
+       uint32_t ext2bgd_b_bitmap;      /* blocks bitmap block */
+       uint32_t ext2bgd_i_bitmap;      /* inodes bitmap block */
+       uint32_t ext2bgd_i_tables;      /* inodes table block  */
+       uint16_t ext2bgd_nbfree;        /* number of free blocks */
+       uint16_t ext2bgd_nifree;        /* number of free inodes */
+       uint16_t ext2bgd_ndirs;         /* number of directories */
+       uint16_t reserved;
+       uint32_t reserved2[3];
 };
 
 
@@ -371,6 +371,6 @@
 /*
  * Number of indirects in a file system block.
  */
-#define        NINDIR(fs)      ((fs)->e2fs_bsize / sizeof(u_int32_t))
+#define        NINDIR(fs)      ((fs)->e2fs_bsize / sizeof(uint32_t))
 
 #endif /* !_UFS_EXT2FS_EXT2FS_H_ */
diff -r 38355dc735aa -r 02a9d2ede108 sys/ufs/ext2fs/ext2fs_dinode.h
--- a/sys/ufs/ext2fs/ext2fs_dinode.h    Sat Sep 12 11:01:55 2009 +0000
+++ b/sys/ufs/ext2fs/ext2fs_dinode.h    Sat Sep 12 11:27:39 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_dinode.h,v 1.19 2009/03/02 09:54:49 tsutsui Exp $       */
+/*     $NetBSD: ext2fs_dinode.h,v 1.20 2009/09/12 11:27:39 tsutsui Exp $       */
 
 /*
  * Copyright (c) 1982, 1989, 1993
@@ -94,37 +94,37 @@
 #define        NDADDR  12                      /* Direct addresses in inode. */
 #define        NIADDR  3                       /* Indirect addresses in inode. */
 
-#define EXT2_MAXSYMLINKLEN ((NDADDR+NIADDR) * sizeof (u_int32_t))
+#define EXT2_MAXSYMLINKLEN ((NDADDR+NIADDR) * sizeof (uint32_t))
 
 struct ext2fs_dinode {
-       u_int16_t       e2di_mode;      /*   0: IFMT, permissions; see below. */
-       u_int16_t       e2di_uid;       /*   2: Owner UID */
-       u_int32_t       e2di_size;      /*       4: Size (in bytes) */
-       u_int32_t       e2di_atime;     /*       8: Acces time */
-       u_int32_t       e2di_ctime;     /*      12: Create time */
-       u_int32_t       e2di_mtime;     /*      16: Modification time */
-       u_int32_t       e2di_dtime;     /*      20: Deletion time */
-       u_int16_t       e2di_gid;       /*  24: Owner GID */
-       u_int16_t       e2di_nlink;     /*  26: File link count */
-       u_int32_t       e2di_nblock;    /*  28: Blocks count */
-       u_int32_t       e2di_flags;     /*  32: Status flags (chflags) */
-       u_int32_t       e2di_linux_reserved1; /* 36 */
-       u_int32_t       e2di_blocks[NDADDR+NIADDR]; /* 40: disk blocks */
-       u_int32_t       e2di_gen;       /* 100: generation number */
-       u_int32_t       e2di_facl;      /* 104: file ACL (not implemented) */
-       u_int32_t       e2di_dacl;      /* 108: dir ACL (not implemented) */
-       u_int32_t       e2di_faddr;     /* 112: fragment address */
-       u_int8_t        e2di_nfrag;     /* 116: fragment number */
-       u_int8_t        e2di_fsize;     /* 117: fragment size */
-       u_int16_t       e2di_linux_reserved2; /* 118 */
-       u_int16_t       e2di_uid_high;  /* 120: Owner UID top 16 bits */
-       u_int16_t       e2di_gid_high;  /* 122: Owner GID top 16 bits */
-       u_int32_t       e2di_linux_reserved3; /* 124 */
+       uint16_t        e2di_mode;      /*   0: IFMT, permissions; see below. */
+       uint16_t        e2di_uid;       /*   2: Owner UID */
+       uint32_t        e2di_size;      /*       4: Size (in bytes) */
+       uint32_t        e2di_atime;     /*       8: Acces time */
+       uint32_t        e2di_ctime;     /*      12: Create time */
+       uint32_t        e2di_mtime;     /*      16: Modification time */
+       uint32_t        e2di_dtime;     /*      20: Deletion time */
+       uint16_t        e2di_gid;       /*  24: Owner GID */
+       uint16_t        e2di_nlink;     /*  26: File link count */
+       uint32_t        e2di_nblock;    /*  28: Blocks count */
+       uint32_t        e2di_flags;     /*  32: Status flags (chflags) */
+       uint32_t        e2di_linux_reserved1; /* 36 */
+       uint32_t        e2di_blocks[NDADDR+NIADDR]; /* 40: disk blocks */
+       uint32_t        e2di_gen;       /* 100: generation number */
+       uint32_t        e2di_facl;      /* 104: file ACL (not implemented) */
+       uint32_t        e2di_dacl;      /* 108: dir ACL (not implemented) */
+       uint32_t        e2di_faddr;     /* 112: fragment address */
+       uint8_t         e2di_nfrag;     /* 116: fragment number */
+       uint8_t         e2di_fsize;     /* 117: fragment size */
+       uint16_t        e2di_linux_reserved2; /* 118 */
+       uint16_t        e2di_uid_high;  /* 120: Owner UID top 16 bits */
+       uint16_t        e2di_gid_high;  /* 122: Owner GID top 16 bits */
+       uint32_t        e2di_linux_reserved3; /* 124 */
 };
 
 
 
-#define        E2MAXSYMLINKLEN ((NDADDR + NIADDR) * sizeof(u_int32_t))
+#define        E2MAXSYMLINKLEN ((NDADDR + NIADDR) * sizeof(uint32_t))
 
 /* File permissions. */
 #define        EXT2_IEXEC              0000100         /* Executable. */
diff -r 38355dc735aa -r 02a9d2ede108 sys/ufs/ext2fs/ext2fs_dir.h
--- a/sys/ufs/ext2fs/ext2fs_dir.h       Sat Sep 12 11:01:55 2009 +0000
+++ b/sys/ufs/ext2fs/ext2fs_dir.h       Sat Sep 12 11:27:39 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_dir.h,v 1.15 2007/12/25 18:33:49 perry Exp $    */
+/*     $NetBSD: ext2fs_dir.h,v 1.16 2009/09/12 11:27:39 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -110,10 +110,10 @@
 #define        EXT2FS_MAXNAMLEN        255
 
 struct ext2fs_direct {
-       u_int32_t e2d_ino;              /* inode number of entry */
-       u_int16_t e2d_reclen;           /* length of this record */
-       u_int8_t e2d_namlen;            /* length of string in d_name */
-       u_int8_t e2d_type;              /* file type */
+       uint32_t e2d_ino;               /* inode number of entry */
+       uint16_t e2d_reclen;            /* length of this record */
+       uint8_t e2d_namlen;             /* length of string in d_name */
+       uint8_t e2d_type;               /* file type */
        char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */
 };
 
@@ -131,9 +131,9 @@
 
 #define E2IFTODT(mode)    (((mode) & 0170000) >> 12)
 
-static __inline u_int8_t inot2ext2dt(u_int16_t) __unused;
-static __inline u_int8_t
-inot2ext2dt(u_int16_t type)
+static __inline uint8_t inot2ext2dt(uint16_t) __unused;
+static __inline uint8_t
+inot2ext2dt(uint16_t type)
 {
        switch(type) {
        case E2IFTODT(EXT2_IFIFO):
@@ -169,15 +169,15 @@
  * but the name field is EXT2FS_MAXNAMLEN - 1, and this just won't do.
  */
 struct ext2fs_dirtemplate {
-       u_int32_t       dot_ino;
+       uint32_t        dot_ino;
        int16_t         dot_reclen;
-       u_int8_t        dot_namlen;
-       u_int8_t        dot_type;
+       uint8_t         dot_namlen;
+       uint8_t         dot_type;
        char            dot_name[4];    /* must be multiple of 4 */
-       u_int32_t       dotdot_ino;
+       uint32_t        dotdot_ino;
        int16_t         dotdot_reclen;
-       u_int8_t        dotdot_namlen;
-       u_int8_t        dotdot_type;
+       uint8_t         dotdot_namlen;
+       uint8_t         dotdot_type;
        char            dotdot_name[4]; /* ditto */
 };
 
diff -r 38355dc735aa -r 02a9d2ede108 sys/ufs/ext2fs/ext2fs_inode.c
--- a/sys/ufs/ext2fs/ext2fs_inode.c     Sat Sep 12 11:01:55 2009 +0000
+++ b/sys/ufs/ext2fs/ext2fs_inode.c     Sat Sep 12 11:27:39 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_inode.c,v 1.68 2009/03/01 15:59:57 christos Exp $       */
+/*     $NetBSD: ext2fs_inode.c,v 1.69 2009/09/12 11:27:39 tsutsui Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_inode.c,v 1.68 2009/03/01 15:59:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_inode.c,v 1.69 2009/09/12 11:27:39 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,18 +95,18 @@
 /*
  * Get the size of an inode.
  */
-u_int64_t
+uint64_t
 ext2fs_size(struct inode *ip)
 {
-       u_int64_t size = ip->i_e2fs_size;
+       uint64_t size = ip->i_e2fs_size;
 
        if ((ip->i_e2fs_mode & IFMT) == IFREG)
-               size |= (u_int64_t)ip->i_e2fs_dacl << 32;
+               size |= (uint64_t)ip->i_e2fs_dacl << 32;
        return size;
 }
 
 int
-ext2fs_setsize(struct inode *ip, u_int64_t size)
+ext2fs_setsize(struct inode *ip, uint64_t size)
 {
        if ((ip->i_e2fs_mode & IFMT) == IFREG ||
            ip->i_e2fs_mode == 0) {
@@ -507,7 +507,7 @@
                copy = malloc(fs->e2fs_bsize, M_TEMP, M_WAITOK);



Home | Main Index | Thread Index | Old Index