Module Name:    src
Committed By:   tsutsui
Date:           Sat Sep 12 11:27:39 UTC 2009

Modified Files:
        src/sys/ufs/ext2fs: ext2fs.h ext2fs_dinode.h ext2fs_dir.h
            ext2fs_inode.c ext2fs_lookup.c ext2fs_readwrite.c

Log Message:
Migrate from u_intNN_t to uintNN_t.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/ufs/ext2fs/ext2fs.h
cvs rdiff -u -r1.19 -r1.20 src/sys/ufs/ext2fs/ext2fs_dinode.h
cvs rdiff -u -r1.15 -r1.16 src/sys/ufs/ext2fs/ext2fs_dir.h
cvs rdiff -u -r1.68 -r1.69 src/sys/ufs/ext2fs/ext2fs_inode.c
cvs rdiff -u -r1.58 -r1.59 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.53 -r1.54 src/sys/ufs/ext2fs/ext2fs_readwrite.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ext2fs/ext2fs.h
diff -u src/sys/ufs/ext2fs/ext2fs.h:1.26 src/sys/ufs/ext2fs/ext2fs.h:1.27
--- src/sys/ufs/ext2fs/ext2fs.h:1.26	Tue Dec 25 18:33:49 2007
+++ src/sys/ufs/ext2fs/ext2fs.h	Sat Sep 12 11:27:39 2009
@@ -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_ */

Index: src/sys/ufs/ext2fs/ext2fs_dinode.h
diff -u src/sys/ufs/ext2fs/ext2fs_dinode.h:1.19 src/sys/ufs/ext2fs/ext2fs_dinode.h:1.20
--- src/sys/ufs/ext2fs/ext2fs_dinode.h:1.19	Mon Mar  2 09:54:49 2009
+++ src/sys/ufs/ext2fs/ext2fs_dinode.h	Sat Sep 12 11:27:39 2009
@@ -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. */

Index: src/sys/ufs/ext2fs/ext2fs_dir.h
diff -u src/sys/ufs/ext2fs/ext2fs_dir.h:1.15 src/sys/ufs/ext2fs/ext2fs_dir.h:1.16
--- src/sys/ufs/ext2fs/ext2fs_dir.h:1.15	Tue Dec 25 18:33:49 2007
+++ src/sys/ufs/ext2fs/ext2fs_dir.h	Sat Sep 12 11:27:39 2009
@@ -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 */
 };
 

Index: src/sys/ufs/ext2fs/ext2fs_inode.c
diff -u src/sys/ufs/ext2fs/ext2fs_inode.c:1.68 src/sys/ufs/ext2fs/ext2fs_inode.c:1.69
--- src/sys/ufs/ext2fs/ext2fs_inode.c:1.68	Sun Mar  1 15:59:57 2009
+++ src/sys/ufs/ext2fs/ext2fs_inode.c	Sat Sep 12 11:27:39 2009
@@ -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);
 		memcpy((void *)copy, (void *)bap, (u_int)fs->e2fs_bsize);
 		memset((void *)&bap[last + 1], 0,
-			(u_int)(NINDIR(fs) - (last + 1)) * sizeof (u_int32_t));
+			(u_int)(NINDIR(fs) - (last + 1)) * sizeof (uint32_t));
 		error = bwrite(bp);
 		if (error)
 			allerror = error;

Index: src/sys/ufs/ext2fs/ext2fs_lookup.c
diff -u src/sys/ufs/ext2fs/ext2fs_lookup.c:1.58 src/sys/ufs/ext2fs/ext2fs_lookup.c:1.59
--- src/sys/ufs/ext2fs/ext2fs_lookup.c:1.58	Wed Dec 17 20:51:38 2008
+++ src/sys/ufs/ext2fs/ext2fs_lookup.c	Sat Sep 12 11:27:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_lookup.c,v 1.58 2008/12/17 20:51:38 cegger Exp $	*/
+/*	$NetBSD: ext2fs_lookup.c,v 1.59 2009/09/12 11:27:39 tsutsui Exp $	*/
 
 /*
  * Modified for NetBSD 1.2E
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.58 2008/12/17 20:51:38 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.59 2009/09/12 11:27:39 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1017,7 +1017,7 @@
 	struct vnode *vp;
 	int error, rootino, namlen;
 	struct ext2fs_dirtemplate dirbuf;
-	u_int32_t ino;
+	uint32_t ino;
 
 	vp = ITOV(target);
 	if (target->i_number == source->i_number) {

Index: src/sys/ufs/ext2fs/ext2fs_readwrite.c
diff -u src/sys/ufs/ext2fs/ext2fs_readwrite.c:1.53 src/sys/ufs/ext2fs/ext2fs_readwrite.c:1.54
--- src/sys/ufs/ext2fs/ext2fs_readwrite.c:1.53	Wed Nov 26 20:17:33 2008
+++ src/sys/ufs/ext2fs/ext2fs_readwrite.c	Sat Sep 12 11:27:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_readwrite.c,v 1.53 2008/11/26 20:17:33 pooka Exp $	*/
+/*	$NetBSD: ext2fs_readwrite.c,v 1.54 2009/09/12 11:27:39 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_readwrite.c,v 1.53 2008/11/26 20:17:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_readwrite.c,v 1.54 2009/09/12 11:27:39 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -134,7 +134,7 @@
 		panic("%s: type %d", "ext2fs_read", vp->v_type);
 #endif
 	fs = ip->i_e2fs;
-	if ((u_int64_t)uio->uio_offset > ump->um_maxfilesize)
+	if ((uint64_t)uio->uio_offset > ump->um_maxfilesize)
 		return (EFBIG);
 	if (uio->uio_resid == 0)
 		return (0);
@@ -273,7 +273,7 @@
 
 	fs = ip->i_e2fs;
 	if (uio->uio_offset < 0 ||
-	    (u_int64_t)uio->uio_offset + uio->uio_resid > ump->um_maxfilesize)
+	    (uint64_t)uio->uio_offset + uio->uio_resid > ump->um_maxfilesize)
 		return (EFBIG);
 	/*
 	 * Maybe this should be above the vnode op call, but so long as

Reply via email to