All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFCRAP 0/3?] xfs: OH GOD MY EYES!
@ 2017-05-18  1:26 Darrick J. Wong
  2017-05-18  1:30 ` [PATCH 1/3] xfs: remove double-underscore integer types Darrick J. Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-18  1:26 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen

Hi all,

This is a series of three eyewateringly awful patches.  The first two
are semantic patches that perform the long-delayed conversion of double
underscore integer types (e.g. __uint64_t) into the standard C99 types
(e.g. uint64_t) that are available in userspace and the kernel.  They
are both huge, terrifying, and might just piss off vger enough that they
don't come through, but that's fine because if it ever gets approved
I'll simply rerun the sed script:

s/typedef\t__uint8_t/typedef __uint8_t\t/g
s/typedef\t__uint/typedef __uint/g
s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
s/__uint8_t\t/__uint8_t\t\t/g
s/__uint/uint/g
s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
s/__int/int/g
/^typedef.*int[0-9]*_t;$/d

against whatever's current in git.  Lines 1-4 and 6 fix whitespace and
indentation problems; lines 5 and 7 perform the actual transformation,
and line 8 removes the old typedefs.

The third patch in this series adds a reboot notifier that freezes any
rw xfs filesystems prior to a soft reboot to reduce the likelihood that
grub (and other deficient xfs drivers) go stumbling through a dirty
filesystem and make our users crazy.

Flame away! :)

--Darrick

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 1/3] xfs: remove double-underscore integer types
  2017-05-18  1:26 [RFCRAP 0/3?] xfs: OH GOD MY EYES! Darrick J. Wong
@ 2017-05-18  1:30 ` Darrick J. Wong
  2017-05-18  6:01   ` Dave Chinner
  2017-05-18  1:31 ` [PATCH 2/3] xfsprogs: " Darrick J. Wong
  2017-05-18  1:32 ` [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot Darrick J. Wong
  2 siblings, 1 reply; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-18  1:30 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen

This is a purely mechanical patch that removes the private
__{u,}int{8,16,32,64}_t typedefs in favor of using the system
{u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
the transformation and fix the resulting whitespace and indentation
errors:

s/typedef\t__uint8_t/typedef __uint8_t\t/g
s/typedef\t__uint/typedef __uint/g
s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
s/__uint8_t\t/__uint8_t\t\t/g
s/__uint/uint/g
s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
s/__int/int/g
/^typedef.*int[0-9]*_t;$/d

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/libxfs/xfs_alloc_btree.c    |   20 +--
 fs/xfs/libxfs/xfs_attr_remote.c    |    8 +
 fs/xfs/libxfs/xfs_attr_sf.h        |   10 +
 fs/xfs/libxfs/xfs_bit.h            |   24 ++-
 fs/xfs/libxfs/xfs_bmap_btree.c     |    8 +
 fs/xfs/libxfs/xfs_btree.c          |   22 ++-
 fs/xfs/libxfs/xfs_btree.h          |   18 +--
 fs/xfs/libxfs/xfs_cksum.h          |   16 +-
 fs/xfs/libxfs/xfs_da_btree.c       |    2 
 fs/xfs/libxfs/xfs_da_btree.h       |    8 +
 fs/xfs/libxfs/xfs_da_format.c      |   28 ++--
 fs/xfs/libxfs/xfs_da_format.h      |   64 +++++----
 fs/xfs/libxfs/xfs_dir2.h           |    8 +
 fs/xfs/libxfs/xfs_dir2_leaf.c      |   12 +-
 fs/xfs/libxfs/xfs_dir2_priv.h      |    2 
 fs/xfs/libxfs/xfs_dir2_sf.c        |    2 
 fs/xfs/libxfs/xfs_format.h         |  112 ++++++++--------
 fs/xfs/libxfs/xfs_fs.h             |   12 +-
 fs/xfs/libxfs/xfs_ialloc.c         |    6 -
 fs/xfs/libxfs/xfs_ialloc_btree.c   |    4 -
 fs/xfs/libxfs/xfs_inode_buf.c      |    2 
 fs/xfs/libxfs/xfs_inode_buf.h      |   28 ++--
 fs/xfs/libxfs/xfs_log_format.h     |  256 ++++++++++++++++++------------------
 fs/xfs/libxfs/xfs_log_recover.h    |    2 
 fs/xfs/libxfs/xfs_quota_defs.h     |    4 -
 fs/xfs/libxfs/xfs_refcount_btree.c |    8 +
 fs/xfs/libxfs/xfs_rmap.c           |    8 +
 fs/xfs/libxfs/xfs_rmap.h           |    8 +
 fs/xfs/libxfs/xfs_rmap_btree.c     |   30 ++--
 fs/xfs/libxfs/xfs_rtbitmap.c       |    2 
 fs/xfs/libxfs/xfs_sb.c             |    4 -
 fs/xfs/libxfs/xfs_types.h          |   46 +++---
 fs/xfs/xfs_aops.c                  |    4 -
 fs/xfs/xfs_attr_list.c             |    2 
 fs/xfs/xfs_bmap_util.c             |   24 ++-
 fs/xfs/xfs_buf.c                   |    2 
 fs/xfs/xfs_dir2_readdir.c          |    8 +
 fs/xfs/xfs_discard.c               |    4 -
 fs/xfs/xfs_dquot.c                 |    2 
 fs/xfs/xfs_fsops.c                 |   16 +-
 fs/xfs/xfs_fsops.h                 |    4 -
 fs/xfs/xfs_inode.c                 |    6 -
 fs/xfs/xfs_inode.h                 |    4 -
 fs/xfs/xfs_ioctl.c                 |   20 +--
 fs/xfs/xfs_ioctl.h                 |   10 +
 fs/xfs/xfs_ioctl32.h               |    6 -
 fs/xfs/xfs_linux.h                 |   20 +--
 fs/xfs/xfs_log.c                   |   20 +--
 fs/xfs/xfs_log.h                   |    2 
 fs/xfs/xfs_log_priv.h              |    2 
 fs/xfs/xfs_log_recover.c           |   28 ++--
 fs/xfs/xfs_mount.c                 |   16 +-
 fs/xfs/xfs_mount.h                 |   34 ++---
 fs/xfs/xfs_qm_bhv.c                |    2 
 fs/xfs/xfs_rtalloc.c               |    8 +
 fs/xfs/xfs_stats.c                 |    8 +
 fs/xfs/xfs_stats.h                 |  190 +++++++++++++--------------
 fs/xfs/xfs_super.c                 |   26 ++--
 fs/xfs/xfs_trace.h                 |   20 +--
 fs/xfs/xfs_trans.h                 |    2 
 fs/xfs/xfs_trans_rmap.c            |    2 
 61 files changed, 634 insertions(+), 642 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_alloc_btree.c b/fs/xfs/libxfs/xfs_alloc_btree.c
index e1fcfe7..5020cbc 100644
--- a/fs/xfs/libxfs/xfs_alloc_btree.c
+++ b/fs/xfs/libxfs/xfs_alloc_btree.c
@@ -253,7 +253,7 @@ xfs_allocbt_init_ptr_from_cur(
 	ptr->s = agf->agf_roots[cur->bc_btnum];
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_bnobt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
@@ -261,42 +261,42 @@ xfs_bnobt_key_diff(
 	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
 	xfs_alloc_key_t		*kp = &key->alloc;
 
-	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
+	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_cntbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
 {
 	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
 	xfs_alloc_key_t		*kp = &key->alloc;
-	__int64_t		diff;
+	int64_t			diff;
 
-	diff = (__int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
+	diff = (int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
 	if (diff)
 		return diff;
 
-	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
+	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_bnobt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	return (__int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
+	return (int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
 			  be32_to_cpu(k2->alloc.ar_startblock);
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_cntbt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	__int64_t		diff;
+	int64_t			diff;
 
 	diff =  be32_to_cpu(k1->alloc.ar_blockcount) -
 		be32_to_cpu(k2->alloc.ar_blockcount);
diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index d52f525..da72b16 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -253,7 +253,7 @@ xfs_attr_rmtval_copyout(
 	xfs_ino_t	ino,
 	int		*offset,
 	int		*valuelen,
-	__uint8_t	**dst)
+	uint8_t		**dst)
 {
 	char		*src = bp->b_addr;
 	xfs_daddr_t	bno = bp->b_bn;
@@ -301,7 +301,7 @@ xfs_attr_rmtval_copyin(
 	xfs_ino_t	ino,
 	int		*offset,
 	int		*valuelen,
-	__uint8_t	**src)
+	uint8_t		**src)
 {
 	char		*dst = bp->b_addr;
 	xfs_daddr_t	bno = bp->b_bn;
@@ -355,7 +355,7 @@ xfs_attr_rmtval_get(
 	struct xfs_mount	*mp = args->dp->i_mount;
 	struct xfs_buf		*bp;
 	xfs_dablk_t		lblkno = args->rmtblkno;
-	__uint8_t		*dst = args->value;
+	uint8_t			*dst = args->value;
 	int			valuelen;
 	int			nmap;
 	int			error;
@@ -421,7 +421,7 @@ xfs_attr_rmtval_set(
 	struct xfs_bmbt_irec	map;
 	xfs_dablk_t		lblkno;
 	xfs_fileoff_t		lfileoff = 0;
-	__uint8_t		*src = args->value;
+	uint8_t			*src = args->value;
 	int			blkcnt;
 	int			valuelen;
 	int			nmap;
diff --git a/fs/xfs/libxfs/xfs_attr_sf.h b/fs/xfs/libxfs/xfs_attr_sf.h
index 90928bb..afd684a 100644
--- a/fs/xfs/libxfs/xfs_attr_sf.h
+++ b/fs/xfs/libxfs/xfs_attr_sf.h
@@ -31,10 +31,10 @@ typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t;
  * We generate this then sort it, attr_list() must return things in hash-order.
  */
 typedef struct xfs_attr_sf_sort {
-	__uint8_t	entno;		/* entry number in original list */
-	__uint8_t	namelen;	/* length of name value (no null) */
-	__uint8_t	valuelen;	/* length of value */
-	__uint8_t	flags;		/* flags bits (see xfs_attr_leaf.h) */
+	uint8_t		entno;		/* entry number in original list */
+	uint8_t		namelen;	/* length of name value (no null) */
+	uint8_t		valuelen;	/* length of value */
+	uint8_t		flags;		/* flags bits (see xfs_attr_leaf.h) */
 	xfs_dahash_t	hash;		/* this entry's hash value */
 	unsigned char	*name;		/* name value, pointer into buffer */
 } xfs_attr_sf_sort_t;
@@ -42,7 +42,7 @@ typedef struct xfs_attr_sf_sort {
 #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen)	/* space name/value uses */ \
 	(((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen)))
 #define XFS_ATTR_SF_ENTSIZE_MAX			/* max space for name&value */ \
-	((1 << (NBBY*(int)sizeof(__uint8_t))) - 1)
+	((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
 #define XFS_ATTR_SF_ENTSIZE(sfep)		/* space an entry uses */ \
 	((int)sizeof(xfs_attr_sf_entry_t)-1 + (sfep)->namelen+(sfep)->valuelen)
 #define XFS_ATTR_SF_NEXTENTRY(sfep)		/* next entry in struct */ \
diff --git a/fs/xfs/libxfs/xfs_bit.h b/fs/xfs/libxfs/xfs_bit.h
index e1649c0..61c6b20 100644
--- a/fs/xfs/libxfs/xfs_bit.h
+++ b/fs/xfs/libxfs/xfs_bit.h
@@ -25,47 +25,47 @@
 /*
  * masks with n high/low bits set, 64-bit values
  */
-static inline __uint64_t xfs_mask64hi(int n)
+static inline uint64_t xfs_mask64hi(int n)
 {
-	return (__uint64_t)-1 << (64 - (n));
+	return (uint64_t)-1 << (64 - (n));
 }
-static inline __uint32_t xfs_mask32lo(int n)
+static inline uint32_t xfs_mask32lo(int n)
 {
-	return ((__uint32_t)1 << (n)) - 1;
+	return ((uint32_t)1 << (n)) - 1;
 }
-static inline __uint64_t xfs_mask64lo(int n)
+static inline uint64_t xfs_mask64lo(int n)
 {
-	return ((__uint64_t)1 << (n)) - 1;
+	return ((uint64_t)1 << (n)) - 1;
 }
 
 /* Get high bit set out of 32-bit argument, -1 if none set */
-static inline int xfs_highbit32(__uint32_t v)
+static inline int xfs_highbit32(uint32_t v)
 {
 	return fls(v) - 1;
 }
 
 /* Get high bit set out of 64-bit argument, -1 if none set */
-static inline int xfs_highbit64(__uint64_t v)
+static inline int xfs_highbit64(uint64_t v)
 {
 	return fls64(v) - 1;
 }
 
 /* Get low bit set out of 32-bit argument, -1 if none set */
-static inline int xfs_lowbit32(__uint32_t v)
+static inline int xfs_lowbit32(uint32_t v)
 {
 	return ffs(v) - 1;
 }
 
 /* Get low bit set out of 64-bit argument, -1 if none set */
-static inline int xfs_lowbit64(__uint64_t v)
+static inline int xfs_lowbit64(uint64_t v)
 {
-	__uint32_t	w = (__uint32_t)v;
+	uint32_t	w = (uint32_t)v;
 	int		n = 0;
 
 	if (w) {	/* lower bits */
 		n = ffs(w);
 	} else {	/* upper bits */
-		w = (__uint32_t)(v >> 32);
+		w = (uint32_t)(v >> 32);
 		if (w) {
 			n = ffs(w);
 			if (n)
diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c
index 6cba69a..5e2b3dc 100644
--- a/fs/xfs/libxfs/xfs_bmap_btree.c
+++ b/fs/xfs/libxfs/xfs_bmap_btree.c
@@ -94,8 +94,8 @@ xfs_bmdr_to_bmbt(
  */
 STATIC void
 __xfs_bmbt_get_all(
-		__uint64_t l0,
-		__uint64_t l1,
+		uint64_t l0,
+		uint64_t l1,
 		xfs_bmbt_irec_t *s)
 {
 	int	ext_flag;
@@ -588,12 +588,12 @@ xfs_bmbt_init_ptr_from_cur(
 	ptr->l = 0;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_bmbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
 {
-	return (__int64_t)be64_to_cpu(key->bmbt.br_startoff) -
+	return (int64_t)be64_to_cpu(key->bmbt.br_startoff) -
 				      cur->bc_rec.b.br_startoff;
 }
 
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 5392674..8e09d29 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -43,7 +43,7 @@ kmem_zone_t	*xfs_btree_cur_zone;
 /*
  * Btree magic numbers.
  */
-static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
+static const uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
 	{ XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, 0, XFS_BMAP_MAGIC, XFS_IBT_MAGIC,
 	  XFS_FIBT_MAGIC, 0 },
 	{ XFS_ABTB_CRC_MAGIC, XFS_ABTC_CRC_MAGIC, XFS_RMAP_CRC_MAGIC,
@@ -51,12 +51,12 @@ static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
 	  XFS_REFC_CRC_MAGIC }
 };
 
-__uint32_t
+uint32_t
 xfs_btree_magic(
 	int			crc,
 	xfs_btnum_t		btnum)
 {
-	__uint32_t		magic = xfs_magics[crc][btnum];
+	uint32_t		magic = xfs_magics[crc][btnum];
 
 	/* Ensure we asked for crc for crc-only magics. */
 	ASSERT(magic != 0);
@@ -778,14 +778,14 @@ xfs_btree_lastrec(
  */
 void
 xfs_btree_offsets(
-	__int64_t	fields,		/* bitmask of fields */
+	int64_t		fields,		/* bitmask of fields */
 	const short	*offsets,	/* table of field offsets */
 	int		nbits,		/* number of bits to inspect */
 	int		*first,		/* output: first byte offset */
 	int		*last)		/* output: last byte offset */
 {
 	int		i;		/* current bit number */
-	__int64_t	imask;		/* mask for current bit number */
+	int64_t		imask;		/* mask for current bit number */
 
 	ASSERT(fields != 0);
 	/*
@@ -1846,7 +1846,7 @@ xfs_btree_lookup(
 	int			*stat)	/* success/failure */
 {
 	struct xfs_btree_block	*block;	/* current btree block */
-	__int64_t		diff;	/* difference for the current key */
+	int64_t			diff;	/* difference for the current key */
 	int			error;	/* error return value */
 	int			keyno;	/* current key number */
 	int			level;	/* level in the btree */
@@ -4435,7 +4435,7 @@ xfs_btree_visit_blocks(
  * recovery completion writes the changes to disk.
  */
 struct xfs_btree_block_change_owner_info {
-	__uint64_t		new_owner;
+	uint64_t		new_owner;
 	struct list_head	*buffer_list;
 };
 
@@ -4481,7 +4481,7 @@ xfs_btree_block_change_owner(
 int
 xfs_btree_change_owner(
 	struct xfs_btree_cur	*cur,
-	__uint64_t		new_owner,
+	uint64_t		new_owner,
 	struct list_head	*buffer_list)
 {
 	struct xfs_btree_block_change_owner_info	bbcoi;
@@ -4585,7 +4585,7 @@ xfs_btree_simple_query_range(
 {
 	union xfs_btree_rec		*recp;
 	union xfs_btree_key		rec_key;
-	__int64_t			diff;
+	int64_t				diff;
 	int				stat;
 	bool				firstrec = true;
 	int				error;
@@ -4682,8 +4682,8 @@ xfs_btree_overlapped_query_range(
 	union xfs_btree_key		*hkp;
 	union xfs_btree_rec		*recp;
 	struct xfs_btree_block		*block;
-	__int64_t			ldiff;
-	__int64_t			hdiff;
+	int64_t				ldiff;
+	int64_t				hdiff;
 	int				level;
 	struct xfs_buf			*bp;
 	int				i;
diff --git a/fs/xfs/libxfs/xfs_btree.h b/fs/xfs/libxfs/xfs_btree.h
index 27bed08..0a931f6 100644
--- a/fs/xfs/libxfs/xfs_btree.h
+++ b/fs/xfs/libxfs/xfs_btree.h
@@ -76,7 +76,7 @@ union xfs_btree_rec {
 #define	XFS_BTNUM_RMAP	((xfs_btnum_t)XFS_BTNUM_RMAPi)
 #define	XFS_BTNUM_REFC	((xfs_btnum_t)XFS_BTNUM_REFCi)
 
-__uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
+uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
 
 /*
  * For logging record fields.
@@ -150,14 +150,14 @@ struct xfs_btree_ops {
 					  union xfs_btree_rec *rec);
 
 	/* difference between key value and cursor value */
-	__int64_t (*key_diff)(struct xfs_btree_cur *cur,
+	int64_t (*key_diff)(struct xfs_btree_cur *cur,
 			      union xfs_btree_key *key);
 
 	/*
 	 * Difference between key2 and key1 -- positive if key1 > key2,
 	 * negative if key1 < key2, and zero if equal.
 	 */
-	__int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
+	int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
 				   union xfs_btree_key *key1,
 				   union xfs_btree_key *key2);
 
@@ -213,11 +213,11 @@ typedef struct xfs_btree_cur
 	union xfs_btree_irec	bc_rec;	/* current insert/search record value */
 	struct xfs_buf	*bc_bufs[XFS_BTREE_MAXLEVELS];	/* buf ptr per level */
 	int		bc_ptrs[XFS_BTREE_MAXLEVELS];	/* key/record # */
-	__uint8_t	bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
+	uint8_t		bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
 #define	XFS_BTCUR_LEFTRA	1	/* left sibling has been read-ahead */
 #define	XFS_BTCUR_RIGHTRA	2	/* right sibling has been read-ahead */
-	__uint8_t	bc_nlevels;	/* number of levels in the tree */
-	__uint8_t	bc_blocklog;	/* log2(blocksize) of btree blocks */
+	uint8_t		bc_nlevels;	/* number of levels in the tree */
+	uint8_t		bc_blocklog;	/* log2(blocksize) of btree blocks */
 	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
 	int		bc_statoff;	/* offset of btre stats array */
 	union {
@@ -330,7 +330,7 @@ xfs_btree_islastblock(
  */
 void
 xfs_btree_offsets(
-	__int64_t		fields,	/* bitmask of fields */
+	int64_t			fields,	/* bitmask of fields */
 	const short		*offsets,/* table of field offsets */
 	int			nbits,	/* number of bits to inspect */
 	int			*first,	/* output: first byte offset */
@@ -408,7 +408,7 @@ int xfs_btree_new_iroot(struct xfs_btree_cur *, int *, int *);
 int xfs_btree_insert(struct xfs_btree_cur *, int *);
 int xfs_btree_delete(struct xfs_btree_cur *, int *);
 int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *);
-int xfs_btree_change_owner(struct xfs_btree_cur *cur, __uint64_t new_owner,
+int xfs_btree_change_owner(struct xfs_btree_cur *cur, uint64_t new_owner,
 			   struct list_head *buffer_list);
 
 /*
@@ -434,7 +434,7 @@ static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block)
 }
 
 static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block,
-		__uint16_t numrecs)
+		uint16_t numrecs)
 {
 	block->bb_numrecs = cpu_to_be16(numrecs);
 }
diff --git a/fs/xfs/libxfs/xfs_cksum.h b/fs/xfs/libxfs/xfs_cksum.h
index a416c7c..8211f48 100644
--- a/fs/xfs/libxfs/xfs_cksum.h
+++ b/fs/xfs/libxfs/xfs_cksum.h
@@ -1,7 +1,7 @@
 #ifndef _XFS_CKSUM_H
 #define _XFS_CKSUM_H 1
 
-#define XFS_CRC_SEED	(~(__uint32_t)0)
+#define XFS_CRC_SEED	(~(uint32_t)0)
 
 /*
  * Calculate the intermediate checksum for a buffer that has the CRC field
@@ -9,11 +9,11 @@
  * cksum_offset parameter. We do not modify the buffer during verification,
  * hence we have to split the CRC calculation across the cksum_offset.
  */
-static inline __uint32_t
+static inline uint32_t
 xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
 {
-	__uint32_t zero = 0;
-	__uint32_t crc;
+	uint32_t zero = 0;
+	uint32_t crc;
 
 	/* Calculate CRC up to the checksum. */
 	crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset);
@@ -30,7 +30,7 @@ xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
  * Fast CRC method where the buffer is modified. Callers must have exclusive
  * access to the buffer while the calculation takes place.
  */
-static inline __uint32_t
+static inline uint32_t
 xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
 {
 	/* zero the CRC field */
@@ -48,7 +48,7 @@ xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
  * so that it is consistent on disk.
  */
 static inline __le32
-xfs_end_cksum(__uint32_t crc)
+xfs_end_cksum(uint32_t crc)
 {
 	return ~cpu_to_le32(crc);
 }
@@ -62,7 +62,7 @@ xfs_end_cksum(__uint32_t crc)
 static inline void
 xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 {
-	__uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
+	uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
 
 	*(__le32 *)(buffer + cksum_offset) = xfs_end_cksum(crc);
 }
@@ -73,7 +73,7 @@ xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 static inline int
 xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 {
-	__uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
+	uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
 
 	return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc);
 }
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
index 1bdf288..48f1136 100644
--- a/fs/xfs/libxfs/xfs_da_btree.c
+++ b/fs/xfs/libxfs/xfs_da_btree.c
@@ -1952,7 +1952,7 @@ xfs_da3_path_shift(
  * This is implemented with some source-level loop unrolling.
  */
 xfs_dahash_t
-xfs_da_hashname(const __uint8_t *name, int namelen)
+xfs_da_hashname(const uint8_t *name, int namelen)
 {
 	xfs_dahash_t hash;
 
diff --git a/fs/xfs/libxfs/xfs_da_btree.h b/fs/xfs/libxfs/xfs_da_btree.h
index 4e29cb6..ae6de17 100644
--- a/fs/xfs/libxfs/xfs_da_btree.h
+++ b/fs/xfs/libxfs/xfs_da_btree.h
@@ -60,10 +60,10 @@ enum xfs_dacmp {
  */
 typedef struct xfs_da_args {
 	struct xfs_da_geometry *geo;	/* da block geometry */
-	const __uint8_t	*name;		/* string (maybe not NULL terminated) */
+	const uint8_t		*name;		/* string (maybe not NULL terminated) */
 	int		namelen;	/* length of string (maybe no NULL) */
-	__uint8_t	filetype;	/* filetype of inode for directories */
-	__uint8_t	*value;		/* set of bytes (maybe contain NULLs) */
+	uint8_t		filetype;	/* filetype of inode for directories */
+	uint8_t		*value;		/* set of bytes (maybe contain NULLs) */
 	int		valuelen;	/* length of value */
 	int		flags;		/* argument flags (eg: ATTR_NOCREATE) */
 	xfs_dahash_t	hashval;	/* hash value of name */
@@ -207,7 +207,7 @@ int	xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
 int	xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
 					  struct xfs_buf *dead_buf);
 
-uint xfs_da_hashname(const __uint8_t *name_string, int name_length);
+uint xfs_da_hashname(const uint8_t *name_string, int name_length);
 enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
 				const unsigned char *name, int len);
 
diff --git a/fs/xfs/libxfs/xfs_da_format.c b/fs/xfs/libxfs/xfs_da_format.c
index f1e8d4d..6d77d1a 100644
--- a/fs/xfs/libxfs/xfs_da_format.c
+++ b/fs/xfs/libxfs/xfs_da_format.c
@@ -49,7 +49,7 @@ xfs_dir3_sf_entsize(
 	struct xfs_dir2_sf_hdr	*hdr,
 	int			len)
 {
-	return xfs_dir2_sf_entsize(hdr, len) + sizeof(__uint8_t);
+	return xfs_dir2_sf_entsize(hdr, len) + sizeof(uint8_t);
 }
 
 static struct xfs_dir2_sf_entry *
@@ -77,7 +77,7 @@ xfs_dir3_sf_nextentry(
  * not necessary. For non-filetype enable directories, the type is always
  * unknown and we never store the value.
  */
-static __uint8_t
+static uint8_t
 xfs_dir2_sfe_get_ftype(
 	struct xfs_dir2_sf_entry *sfep)
 {
@@ -87,16 +87,16 @@ xfs_dir2_sfe_get_ftype(
 static void
 xfs_dir2_sfe_put_ftype(
 	struct xfs_dir2_sf_entry *sfep,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	ASSERT(ftype < XFS_DIR3_FT_MAX);
 }
 
-static __uint8_t
+static uint8_t
 xfs_dir3_sfe_get_ftype(
 	struct xfs_dir2_sf_entry *sfep)
 {
-	__uint8_t	ftype;
+	uint8_t		ftype;
 
 	ftype = sfep->name[sfep->namelen];
 	if (ftype >= XFS_DIR3_FT_MAX)
@@ -107,7 +107,7 @@ xfs_dir3_sfe_get_ftype(
 static void
 xfs_dir3_sfe_put_ftype(
 	struct xfs_dir2_sf_entry *sfep,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	ASSERT(ftype < XFS_DIR3_FT_MAX);
 
@@ -124,7 +124,7 @@ xfs_dir3_sfe_put_ftype(
 static xfs_ino_t
 xfs_dir2_sf_get_ino(
 	struct xfs_dir2_sf_hdr	*hdr,
-	__uint8_t		*from)
+	uint8_t			*from)
 {
 	if (hdr->i8count)
 		return get_unaligned_be64(from) & 0x00ffffffffffffffULL;
@@ -135,7 +135,7 @@ xfs_dir2_sf_get_ino(
 static void
 xfs_dir2_sf_put_ino(
 	struct xfs_dir2_sf_hdr	*hdr,
-	__uint8_t		*to,
+	uint8_t			*to,
 	xfs_ino_t		ino)
 {
 	ASSERT((ino & 0xff00000000000000ULL) == 0);
@@ -225,7 +225,7 @@ xfs_dir3_sfe_put_ino(
 
 #define XFS_DIR3_DATA_ENTSIZE(n)					\
 	round_up((offsetof(struct xfs_dir2_data_entry, name[0]) + (n) +	\
-		 sizeof(xfs_dir2_data_off_t) + sizeof(__uint8_t)),	\
+		 sizeof(xfs_dir2_data_off_t) + sizeof(uint8_t)),	\
 		XFS_DIR2_DATA_ALIGN)
 
 static int
@@ -242,7 +242,7 @@ xfs_dir3_data_entsize(
 	return XFS_DIR3_DATA_ENTSIZE(n);
 }
 
-static __uint8_t
+static uint8_t
 xfs_dir2_data_get_ftype(
 	struct xfs_dir2_data_entry *dep)
 {
@@ -252,16 +252,16 @@ xfs_dir2_data_get_ftype(
 static void
 xfs_dir2_data_put_ftype(
 	struct xfs_dir2_data_entry *dep,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	ASSERT(ftype < XFS_DIR3_FT_MAX);
 }
 
-static __uint8_t
+static uint8_t
 xfs_dir3_data_get_ftype(
 	struct xfs_dir2_data_entry *dep)
 {
-	__uint8_t	ftype = dep->name[dep->namelen];
+	uint8_t		ftype = dep->name[dep->namelen];
 
 	if (ftype >= XFS_DIR3_FT_MAX)
 		return XFS_DIR3_FT_UNKNOWN;
@@ -271,7 +271,7 @@ xfs_dir3_data_get_ftype(
 static void
 xfs_dir3_data_put_ftype(
 	struct xfs_dir2_data_entry *dep,
-	__uint8_t		type)
+	uint8_t			type)
 {
 	ASSERT(type < XFS_DIR3_FT_MAX);
 	ASSERT(dep->namelen != 0);
diff --git a/fs/xfs/libxfs/xfs_da_format.h b/fs/xfs/libxfs/xfs_da_format.h
index 9a492a9..3771edc 100644
--- a/fs/xfs/libxfs/xfs_da_format.h
+++ b/fs/xfs/libxfs/xfs_da_format.h
@@ -111,11 +111,11 @@ struct xfs_da3_intnode {
  * appropriate.
  */
 struct xfs_da3_icnode_hdr {
-	__uint32_t	forw;
-	__uint32_t	back;
-	__uint16_t	magic;
-	__uint16_t	count;
-	__uint16_t	level;
+	uint32_t	forw;
+	uint32_t	back;
+	uint16_t	magic;
+	uint16_t	count;
+	uint16_t	level;
 };
 
 /*
@@ -187,14 +187,14 @@ struct xfs_da3_icnode_hdr {
 /*
  * Byte offset in data block and shortform entry.
  */
-typedef	__uint16_t	xfs_dir2_data_off_t;
+typedef uint16_t	xfs_dir2_data_off_t;
 #define	NULLDATAOFF	0xffffU
 typedef uint		xfs_dir2_data_aoff_t;	/* argument form */
 
 /*
  * Offset in data space of a data entry.
  */
-typedef	__uint32_t	xfs_dir2_dataptr_t;
+typedef uint32_t	xfs_dir2_dataptr_t;
 #define	XFS_DIR2_MAX_DATAPTR	((xfs_dir2_dataptr_t)0xffffffff)
 #define	XFS_DIR2_NULL_DATAPTR	((xfs_dir2_dataptr_t)0)
 
@@ -206,7 +206,7 @@ typedef	xfs_off_t	xfs_dir2_off_t;
 /*
  * Directory block number (logical dirblk in file)
  */
-typedef	__uint32_t	xfs_dir2_db_t;
+typedef uint32_t	xfs_dir2_db_t;
 
 #define XFS_INO32_SIZE	4
 #define XFS_INO64_SIZE	8
@@ -226,9 +226,9 @@ typedef	__uint32_t	xfs_dir2_db_t;
  * over them.
  */
 typedef struct xfs_dir2_sf_hdr {
-	__uint8_t		count;		/* count of entries */
-	__uint8_t		i8count;	/* count of 8-byte inode #s */
-	__uint8_t		parent[8];	/* parent dir inode number */
+	uint8_t			count;		/* count of entries */
+	uint8_t			i8count;	/* count of 8-byte inode #s */
+	uint8_t			parent[8];	/* parent dir inode number */
 } __packed xfs_dir2_sf_hdr_t;
 
 typedef struct xfs_dir2_sf_entry {
@@ -447,11 +447,11 @@ struct xfs_dir3_leaf_hdr {
 };
 
 struct xfs_dir3_icleaf_hdr {
-	__uint32_t		forw;
-	__uint32_t		back;
-	__uint16_t		magic;
-	__uint16_t		count;
-	__uint16_t		stale;
+	uint32_t		forw;
+	uint32_t		back;
+	uint16_t		magic;
+	uint16_t		count;
+	uint16_t		stale;
 };
 
 /*
@@ -538,10 +538,10 @@ struct xfs_dir3_free {
  * xfs_dir3_free_hdr_from_disk/xfs_dir3_free_hdr_to_disk.
  */
 struct xfs_dir3_icfree_hdr {
-	__uint32_t	magic;
-	__uint32_t	firstdb;
-	__uint32_t	nvalid;
-	__uint32_t	nused;
+	uint32_t	magic;
+	uint32_t	firstdb;
+	uint32_t	nvalid;
+	uint32_t	nused;
 
 };
 
@@ -632,10 +632,10 @@ typedef struct xfs_attr_shortform {
 		__u8	padding;
 	} hdr;
 	struct xfs_attr_sf_entry {
-		__uint8_t namelen;	/* actual length of name (no NULL) */
-		__uint8_t valuelen;	/* actual length of value (no NULL) */
-		__uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
-		__uint8_t nameval[1];	/* name & value bytes concatenated */
+		uint8_t namelen;	/* actual length of name (no NULL) */
+		uint8_t valuelen;	/* actual length of value (no NULL) */
+		uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
+		uint8_t nameval[1];	/* name & value bytes concatenated */
 	} list[1];			/* variable sized array */
 } xfs_attr_shortform_t;
 
@@ -725,22 +725,22 @@ struct xfs_attr3_leafblock {
  * incore, neutral version of the attribute leaf header
  */
 struct xfs_attr3_icleaf_hdr {
-	__uint32_t	forw;
-	__uint32_t	back;
-	__uint16_t	magic;
-	__uint16_t	count;
-	__uint16_t	usedbytes;
+	uint32_t	forw;
+	uint32_t	back;
+	uint16_t	magic;
+	uint16_t	count;
+	uint16_t	usedbytes;
 	/*
 	 * firstused is 32-bit here instead of 16-bit like the on-disk variant
 	 * to support maximum fsb size of 64k without overflow issues throughout
 	 * the attr code. Instead, the overflow condition is handled on
 	 * conversion to/from disk.
 	 */
-	__uint32_t	firstused;
+	uint32_t	firstused;
 	__u8		holes;
 	struct {
-		__uint16_t	base;
-		__uint16_t	size;
+		uint16_t	base;
+		uint16_t	size;
 	} freemap[XFS_ATTR_LEAF_MAPSIZE];
 };
 
diff --git a/fs/xfs/libxfs/xfs_dir2.h b/fs/xfs/libxfs/xfs_dir2.h
index d6e6d9d..21c8f8b 100644
--- a/fs/xfs/libxfs/xfs_dir2.h
+++ b/fs/xfs/libxfs/xfs_dir2.h
@@ -47,9 +47,9 @@ struct xfs_dir_ops {
 	struct xfs_dir2_sf_entry *
 		(*sf_nextentry)(struct xfs_dir2_sf_hdr *hdr,
 				struct xfs_dir2_sf_entry *sfep);
-	__uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
+	uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
 	void	(*sf_put_ftype)(struct xfs_dir2_sf_entry *sfep,
-				__uint8_t ftype);
+				uint8_t ftype);
 	xfs_ino_t (*sf_get_ino)(struct xfs_dir2_sf_hdr *hdr,
 				struct xfs_dir2_sf_entry *sfep);
 	void	(*sf_put_ino)(struct xfs_dir2_sf_hdr *hdr,
@@ -60,9 +60,9 @@ struct xfs_dir_ops {
 				     xfs_ino_t ino);
 
 	int	(*data_entsize)(int len);
-	__uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
+	uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
 	void	(*data_put_ftype)(struct xfs_dir2_data_entry *dep,
-				__uint8_t ftype);
+				uint8_t ftype);
 	__be16 * (*data_entry_tag_p)(struct xfs_dir2_data_entry *dep);
 	struct xfs_dir2_data_free *
 		(*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr);
diff --git a/fs/xfs/libxfs/xfs_dir2_leaf.c b/fs/xfs/libxfs/xfs_dir2_leaf.c
index b887fb2..68bf3e8 100644
--- a/fs/xfs/libxfs/xfs_dir2_leaf.c
+++ b/fs/xfs/libxfs/xfs_dir2_leaf.c
@@ -145,7 +145,7 @@ xfs_dir3_leaf_check_int(
 static bool
 xfs_dir3_leaf_verify(
 	struct xfs_buf		*bp,
-	__uint16_t		magic)
+	uint16_t		magic)
 {
 	struct xfs_mount	*mp = bp->b_target->bt_mount;
 	struct xfs_dir2_leaf	*leaf = bp->b_addr;
@@ -154,7 +154,7 @@ xfs_dir3_leaf_verify(
 
 	if (xfs_sb_version_hascrc(&mp->m_sb)) {
 		struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
-		__uint16_t		magic3;
+		uint16_t		magic3;
 
 		magic3 = (magic == XFS_DIR2_LEAF1_MAGIC) ? XFS_DIR3_LEAF1_MAGIC
 							 : XFS_DIR3_LEAFN_MAGIC;
@@ -178,7 +178,7 @@ xfs_dir3_leaf_verify(
 static void
 __read_verify(
 	struct xfs_buf  *bp,
-	__uint16_t	magic)
+	uint16_t	magic)
 {
 	struct xfs_mount	*mp = bp->b_target->bt_mount;
 
@@ -195,7 +195,7 @@ __read_verify(
 static void
 __write_verify(
 	struct xfs_buf  *bp,
-	__uint16_t	magic)
+	uint16_t	magic)
 {
 	struct xfs_mount	*mp = bp->b_target->bt_mount;
 	struct xfs_buf_log_item	*bip = bp->b_fspriv;
@@ -299,7 +299,7 @@ xfs_dir3_leaf_init(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp,
 	xfs_ino_t		owner,
-	__uint16_t		type)
+	uint16_t		type)
 {
 	struct xfs_dir2_leaf	*leaf = bp->b_addr;
 
@@ -343,7 +343,7 @@ xfs_dir3_leaf_get_buf(
 	xfs_da_args_t		*args,
 	xfs_dir2_db_t		bno,
 	struct xfs_buf		**bpp,
-	__uint16_t		magic)
+	uint16_t		magic)
 {
 	struct xfs_inode	*dp = args->dp;
 	struct xfs_trans	*tp = args->trans;
diff --git a/fs/xfs/libxfs/xfs_dir2_priv.h b/fs/xfs/libxfs/xfs_dir2_priv.h
index 39f8604..011df4d 100644
--- a/fs/xfs/libxfs/xfs_dir2_priv.h
+++ b/fs/xfs/libxfs/xfs_dir2_priv.h
@@ -69,7 +69,7 @@ extern void xfs_dir3_leaf_compact_x1(struct xfs_dir3_icleaf_hdr *leafhdr,
 		struct xfs_dir2_leaf_entry *ents, int *indexp,
 		int *lowstalep, int *highstalep, int *lowlogp, int *highlogp);
 extern int xfs_dir3_leaf_get_buf(struct xfs_da_args *args, xfs_dir2_db_t bno,
-		struct xfs_buf **bpp, __uint16_t magic);
+		struct xfs_buf **bpp, uint16_t magic);
 extern void xfs_dir3_leaf_log_ents(struct xfs_da_args *args,
 		struct xfs_buf *bp, int first, int last);
 extern void xfs_dir3_leaf_log_header(struct xfs_da_args *args,
diff --git a/fs/xfs/libxfs/xfs_dir2_sf.c b/fs/xfs/libxfs/xfs_dir2_sf.c
index e84af09..be8b975 100644
--- a/fs/xfs/libxfs/xfs_dir2_sf.c
+++ b/fs/xfs/libxfs/xfs_dir2_sf.c
@@ -647,7 +647,7 @@ xfs_dir2_sf_verify(
 	int				offset;
 	int				size;
 	int				error;
-	__uint8_t			filetype;
+	uint8_t				filetype;
 
 	ASSERT(ip->i_d.di_format == XFS_DINODE_FMT_LOCAL);
 	/*
diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h
index a1dccd8..e204a94 100644
--- a/fs/xfs/libxfs/xfs_format.h
+++ b/fs/xfs/libxfs/xfs_format.h
@@ -103,8 +103,8 @@ struct xfs_ifork;
  * Must be padded to 64 bit alignment.
  */
 typedef struct xfs_sb {
-	__uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
-	__uint32_t	sb_blocksize;	/* logical block size, bytes */
+	uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
+	uint32_t	sb_blocksize;	/* logical block size, bytes */
 	xfs_rfsblock_t	sb_dblocks;	/* number of data blocks */
 	xfs_rfsblock_t	sb_rblocks;	/* number of realtime blocks */
 	xfs_rtblock_t	sb_rextents;	/* number of realtime extents */
@@ -118,45 +118,45 @@ typedef struct xfs_sb {
 	xfs_agnumber_t	sb_agcount;	/* number of allocation groups */
 	xfs_extlen_t	sb_rbmblocks;	/* number of rt bitmap blocks */
 	xfs_extlen_t	sb_logblocks;	/* number of log blocks */
-	__uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
-	__uint16_t	sb_sectsize;	/* volume sector size, bytes */
-	__uint16_t	sb_inodesize;	/* inode size, bytes */
-	__uint16_t	sb_inopblock;	/* inodes per block */
+	uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
+	uint16_t	sb_sectsize;	/* volume sector size, bytes */
+	uint16_t	sb_inodesize;	/* inode size, bytes */
+	uint16_t	sb_inopblock;	/* inodes per block */
 	char		sb_fname[12];	/* file system name */
-	__uint8_t	sb_blocklog;	/* log2 of sb_blocksize */
-	__uint8_t	sb_sectlog;	/* log2 of sb_sectsize */
-	__uint8_t	sb_inodelog;	/* log2 of sb_inodesize */
-	__uint8_t	sb_inopblog;	/* log2 of sb_inopblock */
-	__uint8_t	sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
-	__uint8_t	sb_rextslog;	/* log2 of sb_rextents */
-	__uint8_t	sb_inprogress;	/* mkfs is in progress, don't mount */
-	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
+	uint8_t		sb_blocklog;	/* log2 of sb_blocksize */
+	uint8_t		sb_sectlog;	/* log2 of sb_sectsize */
+	uint8_t		sb_inodelog;	/* log2 of sb_inodesize */
+	uint8_t		sb_inopblog;	/* log2 of sb_inopblock */
+	uint8_t		sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
+	uint8_t		sb_rextslog;	/* log2 of sb_rextents */
+	uint8_t		sb_inprogress;	/* mkfs is in progress, don't mount */
+	uint8_t		sb_imax_pct;	/* max % of fs for inode space */
 					/* statistics */
 	/*
 	 * These fields must remain contiguous.  If you really
 	 * want to change their layout, make sure you fix the
 	 * code in xfs_trans_apply_sb_deltas().
 	 */
-	__uint64_t	sb_icount;	/* allocated inodes */
-	__uint64_t	sb_ifree;	/* free inodes */
-	__uint64_t	sb_fdblocks;	/* free data blocks */
-	__uint64_t	sb_frextents;	/* free realtime extents */
+	uint64_t	sb_icount;	/* allocated inodes */
+	uint64_t	sb_ifree;	/* free inodes */
+	uint64_t	sb_fdblocks;	/* free data blocks */
+	uint64_t	sb_frextents;	/* free realtime extents */
 	/*
 	 * End contiguous fields.
 	 */
 	xfs_ino_t	sb_uquotino;	/* user quota inode */
 	xfs_ino_t	sb_gquotino;	/* group quota inode */
-	__uint16_t	sb_qflags;	/* quota flags */
-	__uint8_t	sb_flags;	/* misc. flags */
-	__uint8_t	sb_shared_vn;	/* shared version number */
+	uint16_t	sb_qflags;	/* quota flags */
+	uint8_t		sb_flags;	/* misc. flags */
+	uint8_t		sb_shared_vn;	/* shared version number */
 	xfs_extlen_t	sb_inoalignmt;	/* inode chunk alignment, fsblocks */
-	__uint32_t	sb_unit;	/* stripe or raid unit */
-	__uint32_t	sb_width;	/* stripe or raid width */
-	__uint8_t	sb_dirblklog;	/* log2 of dir block size (fsbs) */
-	__uint8_t	sb_logsectlog;	/* log2 of the log sector size */
-	__uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
-	__uint32_t	sb_logsunit;	/* stripe unit size for the log */
-	__uint32_t	sb_features2;	/* additional feature bits */
+	uint32_t	sb_unit;	/* stripe or raid unit */
+	uint32_t	sb_width;	/* stripe or raid width */
+	uint8_t		sb_dirblklog;	/* log2 of dir block size (fsbs) */
+	uint8_t		sb_logsectlog;	/* log2 of the log sector size */
+	uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
+	uint32_t	sb_logsunit;	/* stripe unit size for the log */
+	uint32_t	sb_features2;	/* additional feature bits */
 
 	/*
 	 * bad features2 field as a result of failing to pad the sb structure to
@@ -167,17 +167,17 @@ typedef struct xfs_sb {
 	 * the value in sb_features2 when formatting the incore superblock to
 	 * the disk buffer.
 	 */
-	__uint32_t	sb_bad_features2;
+	uint32_t	sb_bad_features2;
 
 	/* version 5 superblock fields start here */
 
 	/* feature masks */
-	__uint32_t	sb_features_compat;
-	__uint32_t	sb_features_ro_compat;
-	__uint32_t	sb_features_incompat;
-	__uint32_t	sb_features_log_incompat;
+	uint32_t	sb_features_compat;
+	uint32_t	sb_features_ro_compat;
+	uint32_t	sb_features_incompat;
+	uint32_t	sb_features_log_incompat;
 
-	__uint32_t	sb_crc;		/* superblock crc */
+	uint32_t	sb_crc;		/* superblock crc */
 	xfs_extlen_t	sb_spino_align;	/* sparse inode chunk alignment */
 
 	xfs_ino_t	sb_pquotino;	/* project quota inode */
@@ -449,7 +449,7 @@ static inline void xfs_sb_version_addprojid32bit(struct xfs_sb *sbp)
 static inline bool
 xfs_sb_has_compat_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_compat & feature) != 0;
 }
@@ -465,7 +465,7 @@ xfs_sb_has_compat_feature(
 static inline bool
 xfs_sb_has_ro_compat_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_ro_compat & feature) != 0;
 }
@@ -482,7 +482,7 @@ xfs_sb_has_ro_compat_feature(
 static inline bool
 xfs_sb_has_incompat_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_incompat & feature) != 0;
 }
@@ -492,7 +492,7 @@ xfs_sb_has_incompat_feature(
 static inline bool
 xfs_sb_has_incompat_log_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_log_incompat & feature) != 0;
 }
@@ -594,8 +594,8 @@ xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
  */
 #define XFS_FSB_TO_B(mp,fsbno)	((xfs_fsize_t)(fsbno) << (mp)->m_sb.sb_blocklog)
 #define XFS_B_TO_FSB(mp,b)	\
-	((((__uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
-#define XFS_B_TO_FSBT(mp,b)	(((__uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
+	((((uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
+#define XFS_B_TO_FSBT(mp,b)	(((uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
 #define XFS_B_FSB_OFFSET(mp,b)	((b) & (mp)->m_blockmask)
 
 /*
@@ -1072,7 +1072,7 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
  * next agno_log bits - ag number
  * high agno_log-agblklog-inopblog bits - 0
  */
-#define	XFS_INO_MASK(k)			(__uint32_t)((1ULL << (k)) - 1)
+#define	XFS_INO_MASK(k)			(uint32_t)((1ULL << (k)) - 1)
 #define	XFS_INO_OFFSET_BITS(mp)		(mp)->m_sb.sb_inopblog
 #define	XFS_INO_AGBNO_BITS(mp)		(mp)->m_sb.sb_agblklog
 #define	XFS_INO_AGINO_BITS(mp)		(mp)->m_agino_log
@@ -1269,16 +1269,16 @@ typedef __be32 xfs_alloc_ptr_t;
 #define	XFS_FIBT_MAGIC		0x46494254	/* 'FIBT' */
 #define	XFS_FIBT_CRC_MAGIC	0x46494233	/* 'FIB3' */
 
-typedef	__uint64_t	xfs_inofree_t;
+typedef uint64_t	xfs_inofree_t;
 #define	XFS_INODES_PER_CHUNK		(NBBY * sizeof(xfs_inofree_t))
 #define	XFS_INODES_PER_CHUNK_LOG	(XFS_NBBYLOG + 3)
 #define	XFS_INOBT_ALL_FREE		((xfs_inofree_t)-1)
 #define	XFS_INOBT_MASK(i)		((xfs_inofree_t)1 << (i))
 
 #define XFS_INOBT_HOLEMASK_FULL		0	/* holemask for full chunk */
-#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(__uint16_t))
+#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(uint16_t))
 #define XFS_INODES_PER_HOLEMASK_BIT	\
-	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(__uint16_t)))
+	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(uint16_t)))
 
 static inline xfs_inofree_t xfs_inobt_maskn(int i, int n)
 {
@@ -1312,9 +1312,9 @@ typedef struct xfs_inobt_rec {
 
 typedef struct xfs_inobt_rec_incore {
 	xfs_agino_t	ir_startino;	/* starting inode number */
-	__uint16_t	ir_holemask;	/* hole mask for sparse chunks */
-	__uint8_t	ir_count;	/* total inode count */
-	__uint8_t	ir_freecount;	/* count of free inodes (set bits) */
+	uint16_t	ir_holemask;	/* hole mask for sparse chunks */
+	uint8_t		ir_count;	/* total inode count */
+	uint8_t		ir_freecount;	/* count of free inodes (set bits) */
 	xfs_inofree_t	ir_free;	/* free inode mask */
 } xfs_inobt_rec_incore_t;
 
@@ -1397,15 +1397,15 @@ struct xfs_rmap_rec {
  *  rm_offset:54-60 aren't used and should be zero
  *  rm_offset:0-53 is the block offset within the inode
  */
-#define XFS_RMAP_OFF_ATTR_FORK	((__uint64_t)1ULL << 63)
-#define XFS_RMAP_OFF_BMBT_BLOCK	((__uint64_t)1ULL << 62)
-#define XFS_RMAP_OFF_UNWRITTEN	((__uint64_t)1ULL << 61)
+#define XFS_RMAP_OFF_ATTR_FORK	((uint64_t)1ULL << 63)
+#define XFS_RMAP_OFF_BMBT_BLOCK	((uint64_t)1ULL << 62)
+#define XFS_RMAP_OFF_UNWRITTEN	((uint64_t)1ULL << 61)
 
-#define XFS_RMAP_LEN_MAX	((__uint32_t)~0U)
+#define XFS_RMAP_LEN_MAX	((uint32_t)~0U)
 #define XFS_RMAP_OFF_FLAGS	(XFS_RMAP_OFF_ATTR_FORK | \
 				 XFS_RMAP_OFF_BMBT_BLOCK | \
 				 XFS_RMAP_OFF_UNWRITTEN)
-#define XFS_RMAP_OFF_MASK	((__uint64_t)0x3FFFFFFFFFFFFFULL)
+#define XFS_RMAP_OFF_MASK	((uint64_t)0x3FFFFFFFFFFFFFULL)
 
 #define XFS_RMAP_OFF(off)		((off) & XFS_RMAP_OFF_MASK)
 
@@ -1431,8 +1431,8 @@ struct xfs_rmap_rec {
 struct xfs_rmap_irec {
 	xfs_agblock_t	rm_startblock;	/* extent start block */
 	xfs_extlen_t	rm_blockcount;	/* extent length */
-	__uint64_t	rm_owner;	/* extent owner */
-	__uint64_t	rm_offset;	/* offset within the owner */
+	uint64_t	rm_owner;	/* extent owner */
+	uint64_t	rm_offset;	/* offset within the owner */
 	unsigned int	rm_flags;	/* state flags */
 };
 
@@ -1544,11 +1544,11 @@ typedef struct xfs_bmbt_rec {
 	__be64			l0, l1;
 } xfs_bmbt_rec_t;
 
-typedef __uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
+typedef uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
 typedef xfs_bmbt_rec_t xfs_bmdr_rec_t;
 
 typedef struct xfs_bmbt_rec_host {
-	__uint64_t		l0, l1;
+	uint64_t		l0, l1;
 } xfs_bmbt_rec_host_t;
 
 /*
diff --git a/fs/xfs/libxfs/xfs_fs.h b/fs/xfs/libxfs/xfs_fs.h
index 095bdf0..e895d32 100644
--- a/fs/xfs/libxfs/xfs_fs.h
+++ b/fs/xfs/libxfs/xfs_fs.h
@@ -302,10 +302,10 @@ typedef struct xfs_bstat {
  * and using two 16bit values to hold new 32bit projid was choosen
  * to retain compatibility with "old" filesystems).
  */
-static inline __uint32_t
+static inline uint32_t
 bstat_get_projid(struct xfs_bstat *bs)
 {
-	return (__uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
+	return (uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
 }
 
 /*
@@ -455,10 +455,10 @@ typedef struct xfs_handle {
  */
 typedef struct xfs_swapext
 {
-	__int64_t	sx_version;	/* version */
+	int64_t		sx_version;	/* version */
 #define XFS_SX_VERSION		0
-	__int64_t	sx_fdtarget;	/* fd of target file */
-	__int64_t	sx_fdtmp;	/* fd of tmp file */
+	int64_t		sx_fdtarget;	/* fd of target file */
+	int64_t		sx_fdtmp;	/* fd of tmp file */
 	xfs_off_t	sx_offset;	/* offset into file */
 	xfs_off_t	sx_length;	/* leng from offset */
 	char		sx_pad[16];	/* pad space, unused */
@@ -546,7 +546,7 @@ typedef struct xfs_swapext
 #define XFS_IOC_ATTRLIST_BY_HANDLE   _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
 #define XFS_IOC_ATTRMULTI_BY_HANDLE  _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
 #define XFS_IOC_FSGEOMETRY	     _IOR ('X', 124, struct xfs_fsop_geom)
-#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, __uint32_t)
+#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, uint32_t)
 /*	XFS_IOC_GETFSUUID ---------- deprecated 140	 */
 
 
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index d41ade5..1e5ed94 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -140,9 +140,9 @@ xfs_inobt_get_rec(
 STATIC int
 xfs_inobt_insert_rec(
 	struct xfs_btree_cur	*cur,
-	__uint16_t		holemask,
-	__uint8_t		count,
-	__int32_t		freecount,
+	uint16_t		holemask,
+	uint8_t			count,
+	int32_t			freecount,
 	xfs_inofree_t		free,
 	int			*stat)
 {
diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c
index 7c47188..ed52d99 100644
--- a/fs/xfs/libxfs/xfs_ialloc_btree.c
+++ b/fs/xfs/libxfs/xfs_ialloc_btree.c
@@ -219,12 +219,12 @@ xfs_finobt_init_ptr_from_cur(
 	ptr->s = agi->agi_free_root;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_inobt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
 {
-	return (__int64_t)be32_to_cpu(key->inobt.ir_startino) -
+	return (int64_t)be32_to_cpu(key->inobt.ir_startino) -
 			  cur->bc_rec.i.ir_startino;
 }
 
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index 09c3d1a..d887af9 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -444,7 +444,7 @@ xfs_dinode_calc_crc(
 	struct xfs_mount	*mp,
 	struct xfs_dinode	*dip)
 {
-	__uint32_t		crc;
+	uint32_t		crc;
 
 	if (dip->di_version < 3)
 		return;
diff --git a/fs/xfs/libxfs/xfs_inode_buf.h b/fs/xfs/libxfs/xfs_inode_buf.h
index 6848a0a..0827d7d 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.h
+++ b/fs/xfs/libxfs/xfs_inode_buf.h
@@ -28,26 +28,26 @@ struct xfs_dinode;
  * format specific structures at the appropriate time.
  */
 struct xfs_icdinode {
-	__int8_t	di_version;	/* inode version */
-	__int8_t	di_format;	/* format of di_c data */
-	__uint16_t	di_flushiter;	/* incremented on flush */
-	__uint32_t	di_uid;		/* owner's user id */
-	__uint32_t	di_gid;		/* owner's group id */
-	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
-	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
+	int8_t		di_version;	/* inode version */
+	int8_t		di_format;	/* format of di_c data */
+	uint16_t	di_flushiter;	/* incremented on flush */
+	uint32_t	di_uid;		/* owner's user id */
+	uint32_t	di_gid;		/* owner's group id */
+	uint16_t	di_projid_lo;	/* lower part of owner's project id */
+	uint16_t	di_projid_hi;	/* higher part of owner's project id */
 	xfs_fsize_t	di_size;	/* number of bytes in file */
 	xfs_rfsblock_t	di_nblocks;	/* # of direct & btree blocks used */
 	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
 	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
 	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
-	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
-	__int8_t	di_aformat;	/* format of attr fork's data */
-	__uint32_t	di_dmevmask;	/* DMIG event mask */
-	__uint16_t	di_dmstate;	/* DMIG state info */
-	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
+	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
+	int8_t		di_aformat;	/* format of attr fork's data */
+	uint32_t	di_dmevmask;	/* DMIG event mask */
+	uint16_t	di_dmstate;	/* DMIG state info */
+	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
 
-	__uint64_t	di_flags2;	/* more random flags */
-	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
+	uint64_t	di_flags2;	/* more random flags */
+	uint32_t	di_cowextsize;	/* basic cow extent size for file */
 
 	xfs_ictimestamp_t di_crtime;	/* time created */
 };
diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h
index 7ae571f..8372e9b 100644
--- a/fs/xfs/libxfs/xfs_log_format.h
+++ b/fs/xfs/libxfs/xfs_log_format.h
@@ -31,7 +31,7 @@ struct xfs_trans_res;
  * through all the log items definitions and everything they encode into the
  * log.
  */
-typedef __uint32_t xlog_tid_t;
+typedef uint32_t xlog_tid_t;
 
 #define XLOG_MIN_ICLOGS		2
 #define XLOG_MAX_ICLOGS		8
@@ -211,7 +211,7 @@ typedef struct xfs_log_iovec {
 typedef struct xfs_trans_header {
 	uint		th_magic;		/* magic number */
 	uint		th_type;		/* transaction type */
-	__int32_t	th_tid;			/* transaction id (unused) */
+	int32_t		th_tid;			/* transaction id (unused) */
 	uint		th_num_items;		/* num items logged by trans */
 } xfs_trans_header_t;
 
@@ -265,52 +265,52 @@ typedef struct xfs_trans_header {
  * must be added on to the end.
  */
 typedef struct xfs_inode_log_format {
-	__uint16_t		ilf_type;	/* inode log item type */
-	__uint16_t		ilf_size;	/* size of this item */
-	__uint32_t		ilf_fields;	/* flags for fields logged */
-	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
-	__uint16_t		ilf_dsize;	/* size of data/ext/root */
-	__uint64_t		ilf_ino;	/* inode number */
+	uint16_t		ilf_type;	/* inode log item type */
+	uint16_t		ilf_size;	/* size of this item */
+	uint32_t		ilf_fields;	/* flags for fields logged */
+	uint16_t		ilf_asize;	/* size of attr d/ext/root */
+	uint16_t		ilf_dsize;	/* size of data/ext/root */
+	uint64_t		ilf_ino;	/* inode number */
 	union {
-		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
+		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
 		uuid_t		ilfu_uuid;	/* mount point value */
 	} ilf_u;
-	__int64_t		ilf_blkno;	/* blkno of inode buffer */
-	__int32_t		ilf_len;	/* len of inode buffer */
-	__int32_t		ilf_boffset;	/* off of inode in buffer */
+	int64_t			ilf_blkno;	/* blkno of inode buffer */
+	int32_t			ilf_len;	/* len of inode buffer */
+	int32_t			ilf_boffset;	/* off of inode in buffer */
 } xfs_inode_log_format_t;
 
 typedef struct xfs_inode_log_format_32 {
-	__uint16_t		ilf_type;	/* inode log item type */
-	__uint16_t		ilf_size;	/* size of this item */
-	__uint32_t		ilf_fields;	/* flags for fields logged */
-	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
-	__uint16_t		ilf_dsize;	/* size of data/ext/root */
-	__uint64_t		ilf_ino;	/* inode number */
+	uint16_t		ilf_type;	/* inode log item type */
+	uint16_t		ilf_size;	/* size of this item */
+	uint32_t		ilf_fields;	/* flags for fields logged */
+	uint16_t		ilf_asize;	/* size of attr d/ext/root */
+	uint16_t		ilf_dsize;	/* size of data/ext/root */
+	uint64_t		ilf_ino;	/* inode number */
 	union {
-		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
+		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
 		uuid_t		ilfu_uuid;	/* mount point value */
 	} ilf_u;
-	__int64_t		ilf_blkno;	/* blkno of inode buffer */
-	__int32_t		ilf_len;	/* len of inode buffer */
-	__int32_t		ilf_boffset;	/* off of inode in buffer */
+	int64_t			ilf_blkno;	/* blkno of inode buffer */
+	int32_t			ilf_len;	/* len of inode buffer */
+	int32_t			ilf_boffset;	/* off of inode in buffer */
 } __attribute__((packed)) xfs_inode_log_format_32_t;
 
 typedef struct xfs_inode_log_format_64 {
-	__uint16_t		ilf_type;	/* inode log item type */
-	__uint16_t		ilf_size;	/* size of this item */
-	__uint32_t		ilf_fields;	/* flags for fields logged */
-	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
-	__uint16_t		ilf_dsize;	/* size of data/ext/root */
-	__uint32_t		ilf_pad;	/* pad for 64 bit boundary */
-	__uint64_t		ilf_ino;	/* inode number */
+	uint16_t		ilf_type;	/* inode log item type */
+	uint16_t		ilf_size;	/* size of this item */
+	uint32_t		ilf_fields;	/* flags for fields logged */
+	uint16_t		ilf_asize;	/* size of attr d/ext/root */
+	uint16_t		ilf_dsize;	/* size of data/ext/root */
+	uint32_t		ilf_pad;	/* pad for 64 bit boundary */
+	uint64_t		ilf_ino;	/* inode number */
 	union {
-		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
+		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
 		uuid_t		ilfu_uuid;	/* mount point value */
 	} ilf_u;
-	__int64_t		ilf_blkno;	/* blkno of inode buffer */
-	__int32_t		ilf_len;	/* len of inode buffer */
-	__int32_t		ilf_boffset;	/* off of inode in buffer */
+	int64_t			ilf_blkno;	/* blkno of inode buffer */
+	int32_t			ilf_len;	/* len of inode buffer */
+	int32_t			ilf_boffset;	/* off of inode in buffer */
 } xfs_inode_log_format_64_t;
 
 
@@ -379,8 +379,8 @@ static inline int xfs_ilog_fdata(int w)
  * information.
  */
 typedef struct xfs_ictimestamp {
-	__int32_t	t_sec;		/* timestamp seconds */
-	__int32_t	t_nsec;		/* timestamp nanoseconds */
+	int32_t		t_sec;		/* timestamp seconds */
+	int32_t		t_nsec;		/* timestamp nanoseconds */
 } xfs_ictimestamp_t;
 
 /*
@@ -388,18 +388,18 @@ typedef struct xfs_ictimestamp {
  * kept identical to struct xfs_dinode except for the endianness annotations.
  */
 struct xfs_log_dinode {
-	__uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
-	__uint16_t	di_mode;	/* mode and type of file */
-	__int8_t	di_version;	/* inode version */
-	__int8_t	di_format;	/* format of di_c data */
-	__uint8_t	di_pad3[2];	/* unused in v2/3 inodes */
-	__uint32_t	di_uid;		/* owner's user id */
-	__uint32_t	di_gid;		/* owner's group id */
-	__uint32_t	di_nlink;	/* number of links to file */
-	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
-	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
-	__uint8_t	di_pad[6];	/* unused, zeroed space */
-	__uint16_t	di_flushiter;	/* incremented on flush */
+	uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
+	uint16_t	di_mode;	/* mode and type of file */
+	int8_t		di_version;	/* inode version */
+	int8_t		di_format;	/* format of di_c data */
+	uint8_t		di_pad3[2];	/* unused in v2/3 inodes */
+	uint32_t	di_uid;		/* owner's user id */
+	uint32_t	di_gid;		/* owner's group id */
+	uint32_t	di_nlink;	/* number of links to file */
+	uint16_t	di_projid_lo;	/* lower part of owner's project id */
+	uint16_t	di_projid_hi;	/* higher part of owner's project id */
+	uint8_t		di_pad[6];	/* unused, zeroed space */
+	uint16_t	di_flushiter;	/* incremented on flush */
 	xfs_ictimestamp_t di_atime;	/* time last accessed */
 	xfs_ictimestamp_t di_mtime;	/* time last modified */
 	xfs_ictimestamp_t di_ctime;	/* time created/inode modified */
@@ -408,23 +408,23 @@ struct xfs_log_dinode {
 	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
 	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
 	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
-	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
-	__int8_t	di_aformat;	/* format of attr fork's data */
-	__uint32_t	di_dmevmask;	/* DMIG event mask */
-	__uint16_t	di_dmstate;	/* DMIG state info */
-	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
-	__uint32_t	di_gen;		/* generation number */
+	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
+	int8_t		di_aformat;	/* format of attr fork's data */
+	uint32_t	di_dmevmask;	/* DMIG event mask */
+	uint16_t	di_dmstate;	/* DMIG state info */
+	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
+	uint32_t	di_gen;		/* generation number */
 
 	/* di_next_unlinked is the only non-core field in the old dinode */
 	xfs_agino_t	di_next_unlinked;/* agi unlinked list ptr */
 
 	/* start of the extended dinode, writable fields */
-	__uint32_t	di_crc;		/* CRC of the inode */
-	__uint64_t	di_changecount;	/* number of attribute changes */
+	uint32_t	di_crc;		/* CRC of the inode */
+	uint64_t	di_changecount;	/* number of attribute changes */
 	xfs_lsn_t	di_lsn;		/* flush sequence */
-	__uint64_t	di_flags2;	/* more random flags */
-	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
-	__uint8_t	di_pad2[12];	/* more padding for future expansion */
+	uint64_t	di_flags2;	/* more random flags */
+	uint32_t	di_cowextsize;	/* basic cow extent size for file */
+	uint8_t		di_pad2[12];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */
 	xfs_ictimestamp_t di_crtime;	/* time created */
@@ -483,7 +483,7 @@ typedef struct xfs_buf_log_format {
 	unsigned short	blf_size;	/* size of this item */
 	unsigned short	blf_flags;	/* misc state */
 	unsigned short	blf_len;	/* number of blocks in this buf */
-	__int64_t	blf_blkno;	/* starting blkno of this buf */
+	int64_t		blf_blkno;	/* starting blkno of this buf */
 	unsigned int	blf_map_size;	/* used size of data bitmap in words */
 	unsigned int	blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
 } xfs_buf_log_format_t;
@@ -533,7 +533,7 @@ xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
 	blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
 }
 
-static inline __uint16_t
+static inline uint16_t
 xfs_blft_from_flags(struct xfs_buf_log_format *blf)
 {
 	return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
@@ -554,14 +554,14 @@ typedef struct xfs_extent {
  * conversion routine.
  */
 typedef struct xfs_extent_32 {
-	__uint64_t	ext_start;
-	__uint32_t	ext_len;
+	uint64_t	ext_start;
+	uint32_t	ext_len;
 } __attribute__((packed)) xfs_extent_32_t;
 
 typedef struct xfs_extent_64 {
-	__uint64_t	ext_start;
-	__uint32_t	ext_len;
-	__uint32_t	ext_pad;
+	uint64_t	ext_start;
+	uint32_t	ext_len;
+	uint32_t	ext_pad;
 } xfs_extent_64_t;
 
 /*
@@ -570,26 +570,26 @@ typedef struct xfs_extent_64 {
  * size is given by efi_nextents.
  */
 typedef struct xfs_efi_log_format {
-	__uint16_t		efi_type;	/* efi log item type */
-	__uint16_t		efi_size;	/* size of this item */
-	__uint32_t		efi_nextents;	/* # extents to free */
-	__uint64_t		efi_id;		/* efi identifier */
+	uint16_t		efi_type;	/* efi log item type */
+	uint16_t		efi_size;	/* size of this item */
+	uint32_t		efi_nextents;	/* # extents to free */
+	uint64_t		efi_id;		/* efi identifier */
 	xfs_extent_t		efi_extents[1];	/* array of extents to free */
 } xfs_efi_log_format_t;
 
 typedef struct xfs_efi_log_format_32 {
-	__uint16_t		efi_type;	/* efi log item type */
-	__uint16_t		efi_size;	/* size of this item */
-	__uint32_t		efi_nextents;	/* # extents to free */
-	__uint64_t		efi_id;		/* efi identifier */
+	uint16_t		efi_type;	/* efi log item type */
+	uint16_t		efi_size;	/* size of this item */
+	uint32_t		efi_nextents;	/* # extents to free */
+	uint64_t		efi_id;		/* efi identifier */
 	xfs_extent_32_t		efi_extents[1];	/* array of extents to free */
 } __attribute__((packed)) xfs_efi_log_format_32_t;
 
 typedef struct xfs_efi_log_format_64 {
-	__uint16_t		efi_type;	/* efi log item type */
-	__uint16_t		efi_size;	/* size of this item */
-	__uint32_t		efi_nextents;	/* # extents to free */
-	__uint64_t		efi_id;		/* efi identifier */
+	uint16_t		efi_type;	/* efi log item type */
+	uint16_t		efi_size;	/* size of this item */
+	uint32_t		efi_nextents;	/* # extents to free */
+	uint64_t		efi_id;		/* efi identifier */
 	xfs_extent_64_t		efi_extents[1];	/* array of extents to free */
 } xfs_efi_log_format_64_t;
 
@@ -599,26 +599,26 @@ typedef struct xfs_efi_log_format_64 {
  * size is given by efd_nextents;
  */
 typedef struct xfs_efd_log_format {
-	__uint16_t		efd_type;	/* efd log item type */
-	__uint16_t		efd_size;	/* size of this item */
-	__uint32_t		efd_nextents;	/* # of extents freed */
-	__uint64_t		efd_efi_id;	/* id of corresponding efi */
+	uint16_t		efd_type;	/* efd log item type */
+	uint16_t		efd_size;	/* size of this item */
+	uint32_t		efd_nextents;	/* # of extents freed */
+	uint64_t		efd_efi_id;	/* id of corresponding efi */
 	xfs_extent_t		efd_extents[1];	/* array of extents freed */
 } xfs_efd_log_format_t;
 
 typedef struct xfs_efd_log_format_32 {
-	__uint16_t		efd_type;	/* efd log item type */
-	__uint16_t		efd_size;	/* size of this item */
-	__uint32_t		efd_nextents;	/* # of extents freed */
-	__uint64_t		efd_efi_id;	/* id of corresponding efi */
+	uint16_t		efd_type;	/* efd log item type */
+	uint16_t		efd_size;	/* size of this item */
+	uint32_t		efd_nextents;	/* # of extents freed */
+	uint64_t		efd_efi_id;	/* id of corresponding efi */
 	xfs_extent_32_t		efd_extents[1];	/* array of extents freed */
 } __attribute__((packed)) xfs_efd_log_format_32_t;
 
 typedef struct xfs_efd_log_format_64 {
-	__uint16_t		efd_type;	/* efd log item type */
-	__uint16_t		efd_size;	/* size of this item */
-	__uint32_t		efd_nextents;	/* # of extents freed */
-	__uint64_t		efd_efi_id;	/* id of corresponding efi */
+	uint16_t		efd_type;	/* efd log item type */
+	uint16_t		efd_size;	/* size of this item */
+	uint32_t		efd_nextents;	/* # of extents freed */
+	uint64_t		efd_efi_id;	/* id of corresponding efi */
 	xfs_extent_64_t		efd_extents[1];	/* array of extents freed */
 } xfs_efd_log_format_64_t;
 
@@ -626,11 +626,11 @@ typedef struct xfs_efd_log_format_64 {
  * RUI/RUD (reverse mapping) log format definitions
  */
 struct xfs_map_extent {
-	__uint64_t		me_owner;
-	__uint64_t		me_startblock;
-	__uint64_t		me_startoff;
-	__uint32_t		me_len;
-	__uint32_t		me_flags;
+	uint64_t		me_owner;
+	uint64_t		me_startblock;
+	uint64_t		me_startoff;
+	uint32_t		me_len;
+	uint32_t		me_flags;
 };
 
 /* rmap me_flags: upper bits are flags, lower byte is type code */
@@ -659,10 +659,10 @@ struct xfs_map_extent {
  * size is given by rui_nextents.
  */
 struct xfs_rui_log_format {
-	__uint16_t		rui_type;	/* rui log item type */
-	__uint16_t		rui_size;	/* size of this item */
-	__uint32_t		rui_nextents;	/* # extents to free */
-	__uint64_t		rui_id;		/* rui identifier */
+	uint16_t		rui_type;	/* rui log item type */
+	uint16_t		rui_size;	/* size of this item */
+	uint32_t		rui_nextents;	/* # extents to free */
+	uint64_t		rui_id;		/* rui identifier */
 	struct xfs_map_extent	rui_extents[];	/* array of extents to rmap */
 };
 
@@ -680,19 +680,19 @@ xfs_rui_log_format_sizeof(
  * size is given by rud_nextents;
  */
 struct xfs_rud_log_format {
-	__uint16_t		rud_type;	/* rud log item type */
-	__uint16_t		rud_size;	/* size of this item */
-	__uint32_t		__pad;
-	__uint64_t		rud_rui_id;	/* id of corresponding rui */
+	uint16_t		rud_type;	/* rud log item type */
+	uint16_t		rud_size;	/* size of this item */
+	uint32_t		__pad;
+	uint64_t		rud_rui_id;	/* id of corresponding rui */
 };
 
 /*
  * CUI/CUD (refcount update) log format definitions
  */
 struct xfs_phys_extent {
-	__uint64_t		pe_startblock;
-	__uint32_t		pe_len;
-	__uint32_t		pe_flags;
+	uint64_t		pe_startblock;
+	uint32_t		pe_len;
+	uint32_t		pe_flags;
 };
 
 /* refcount pe_flags: upper bits are flags, lower byte is type code */
@@ -707,10 +707,10 @@ struct xfs_phys_extent {
  * size is given by cui_nextents.
  */
 struct xfs_cui_log_format {
-	__uint16_t		cui_type;	/* cui log item type */
-	__uint16_t		cui_size;	/* size of this item */
-	__uint32_t		cui_nextents;	/* # extents to free */
-	__uint64_t		cui_id;		/* cui identifier */
+	uint16_t		cui_type;	/* cui log item type */
+	uint16_t		cui_size;	/* size of this item */
+	uint32_t		cui_nextents;	/* # extents to free */
+	uint64_t		cui_id;		/* cui identifier */
 	struct xfs_phys_extent	cui_extents[];	/* array of extents */
 };
 
@@ -728,10 +728,10 @@ xfs_cui_log_format_sizeof(
  * size is given by cud_nextents;
  */
 struct xfs_cud_log_format {
-	__uint16_t		cud_type;	/* cud log item type */
-	__uint16_t		cud_size;	/* size of this item */
-	__uint32_t		__pad;
-	__uint64_t		cud_cui_id;	/* id of corresponding cui */
+	uint16_t		cud_type;	/* cud log item type */
+	uint16_t		cud_size;	/* size of this item */
+	uint32_t		__pad;
+	uint64_t		cud_cui_id;	/* id of corresponding cui */
 };
 
 /*
@@ -755,10 +755,10 @@ struct xfs_cud_log_format {
  * size is given by bui_nextents.
  */
 struct xfs_bui_log_format {
-	__uint16_t		bui_type;	/* bui log item type */
-	__uint16_t		bui_size;	/* size of this item */
-	__uint32_t		bui_nextents;	/* # extents to free */
-	__uint64_t		bui_id;		/* bui identifier */
+	uint16_t		bui_type;	/* bui log item type */
+	uint16_t		bui_size;	/* size of this item */
+	uint32_t		bui_nextents;	/* # extents to free */
+	uint64_t		bui_id;		/* bui identifier */
 	struct xfs_map_extent	bui_extents[];	/* array of extents to bmap */
 };
 
@@ -776,10 +776,10 @@ xfs_bui_log_format_sizeof(
  * size is given by bud_nextents;
  */
 struct xfs_bud_log_format {
-	__uint16_t		bud_type;	/* bud log item type */
-	__uint16_t		bud_size;	/* size of this item */
-	__uint32_t		__pad;
-	__uint64_t		bud_bui_id;	/* id of corresponding bui */
+	uint16_t		bud_type;	/* bud log item type */
+	uint16_t		bud_size;	/* size of this item */
+	uint32_t		__pad;
+	uint64_t		bud_bui_id;	/* id of corresponding bui */
 };
 
 /*
@@ -789,12 +789,12 @@ struct xfs_bud_log_format {
  * 32 bits : log_recovery code assumes that.
  */
 typedef struct xfs_dq_logformat {
-	__uint16_t		qlf_type;      /* dquot log item type */
-	__uint16_t		qlf_size;      /* size of this item */
+	uint16_t		qlf_type;      /* dquot log item type */
+	uint16_t		qlf_size;      /* size of this item */
 	xfs_dqid_t		qlf_id;	       /* usr/grp/proj id : 32 bits */
-	__int64_t		qlf_blkno;     /* blkno of dquot buffer */
-	__int32_t		qlf_len;       /* len of dquot buffer */
-	__uint32_t		qlf_boffset;   /* off of dquot in buffer */
+	int64_t			qlf_blkno;     /* blkno of dquot buffer */
+	int32_t			qlf_len;       /* len of dquot buffer */
+	uint32_t		qlf_boffset;   /* off of dquot in buffer */
 } xfs_dq_logformat_t;
 
 /*
@@ -853,8 +853,8 @@ typedef struct xfs_qoff_logformat {
  * decoding can be done correctly.
  */
 struct xfs_icreate_log {
-	__uint16_t	icl_type;	/* type of log format structure */
-	__uint16_t	icl_size;	/* size of log format structure */
+	uint16_t	icl_type;	/* type of log format structure */
+	uint16_t	icl_size;	/* size of log format structure */
 	__be32		icl_ag;		/* ag being allocated in */
 	__be32		icl_agbno;	/* start block of inode range */
 	__be32		icl_count;	/* number of inodes to initialise */
diff --git a/fs/xfs/libxfs/xfs_log_recover.h b/fs/xfs/libxfs/xfs_log_recover.h
index 29a01ec..66948a9 100644
--- a/fs/xfs/libxfs/xfs_log_recover.h
+++ b/fs/xfs/libxfs/xfs_log_recover.h
@@ -26,7 +26,7 @@
 #define XLOG_RHASH_SIZE	16
 #define XLOG_RHASH_SHIFT 2
 #define XLOG_RHASH(tid)	\
-	((((__uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
+	((((uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
 
 #define XLOG_MAX_REGIONS_IN_ITEM   (XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK / 2 + 1)
 
diff --git a/fs/xfs/libxfs/xfs_quota_defs.h b/fs/xfs/libxfs/xfs_quota_defs.h
index 8eed512..d69c772 100644
--- a/fs/xfs/libxfs/xfs_quota_defs.h
+++ b/fs/xfs/libxfs/xfs_quota_defs.h
@@ -27,8 +27,8 @@
  * they may need 64-bit accounting. Hence, 64-bit quota-counters,
  * and quota-limits. This is a waste in the common case, but hey ...
  */
-typedef __uint64_t	xfs_qcnt_t;
-typedef __uint16_t	xfs_qwarncnt_t;
+typedef uint64_t	xfs_qcnt_t;
+typedef uint16_t	xfs_qwarncnt_t;
 
 /*
  * flags for q_flags field in the dquot.
diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c
index 50add52..65c222a 100644
--- a/fs/xfs/libxfs/xfs_refcount_btree.c
+++ b/fs/xfs/libxfs/xfs_refcount_btree.c
@@ -202,7 +202,7 @@ xfs_refcountbt_init_ptr_from_cur(
 	ptr->s = agf->agf_refcount_root;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_refcountbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
@@ -210,16 +210,16 @@ xfs_refcountbt_key_diff(
 	struct xfs_refcount_irec	*rec = &cur->bc_rec.rc;
 	struct xfs_refcount_key		*kp = &key->refc;
 
-	return (__int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
+	return (int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_refcountbt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	return (__int64_t)be32_to_cpu(k1->refc.rc_startblock) -
+	return (int64_t)be32_to_cpu(k1->refc.rc_startblock) -
 			  be32_to_cpu(k2->refc.rc_startblock);
 }
 
diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
index 06cfb93..1bcb41f 100644
--- a/fs/xfs/libxfs/xfs_rmap.c
+++ b/fs/xfs/libxfs/xfs_rmap.c
@@ -2061,7 +2061,7 @@ int
 xfs_rmap_finish_one(
 	struct xfs_trans		*tp,
 	enum xfs_rmap_intent_type	type,
-	__uint64_t			owner,
+	uint64_t			owner,
 	int				whichfork,
 	xfs_fileoff_t			startoff,
 	xfs_fsblock_t			startblock,
@@ -2182,7 +2182,7 @@ __xfs_rmap_add(
 	struct xfs_mount		*mp,
 	struct xfs_defer_ops		*dfops,
 	enum xfs_rmap_intent_type	type,
-	__uint64_t			owner,
+	uint64_t			owner,
 	int				whichfork,
 	struct xfs_bmbt_irec		*bmap)
 {
@@ -2266,7 +2266,7 @@ xfs_rmap_alloc_extent(
 	xfs_agnumber_t		agno,
 	xfs_agblock_t		bno,
 	xfs_extlen_t		len,
-	__uint64_t		owner)
+	uint64_t		owner)
 {
 	struct xfs_bmbt_irec	bmap;
 
@@ -2290,7 +2290,7 @@ xfs_rmap_free_extent(
 	xfs_agnumber_t		agno,
 	xfs_agblock_t		bno,
 	xfs_extlen_t		len,
-	__uint64_t		owner)
+	uint64_t		owner)
 {
 	struct xfs_bmbt_irec	bmap;
 
diff --git a/fs/xfs/libxfs/xfs_rmap.h b/fs/xfs/libxfs/xfs_rmap.h
index 98f908f..265116d 100644
--- a/fs/xfs/libxfs/xfs_rmap.h
+++ b/fs/xfs/libxfs/xfs_rmap.h
@@ -179,7 +179,7 @@ enum xfs_rmap_intent_type {
 struct xfs_rmap_intent {
 	struct list_head			ri_list;
 	enum xfs_rmap_intent_type		ri_type;
-	__uint64_t				ri_owner;
+	uint64_t				ri_owner;
 	int					ri_whichfork;
 	struct xfs_bmbt_irec			ri_bmap;
 };
@@ -196,15 +196,15 @@ int xfs_rmap_convert_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
 		struct xfs_bmbt_irec *imap);
 int xfs_rmap_alloc_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
 		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
-		__uint64_t owner);
+		uint64_t owner);
 int xfs_rmap_free_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
 		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
-		__uint64_t owner);
+		uint64_t owner);
 
 void xfs_rmap_finish_one_cleanup(struct xfs_trans *tp,
 		struct xfs_btree_cur *rcur, int error);
 int xfs_rmap_finish_one(struct xfs_trans *tp, enum xfs_rmap_intent_type type,
-		__uint64_t owner, int whichfork, xfs_fileoff_t startoff,
+		uint64_t owner, int whichfork, xfs_fileoff_t startoff,
 		xfs_fsblock_t startblock, xfs_filblks_t blockcount,
 		xfs_exntst_t state, struct xfs_btree_cur **pcur);
 
diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c
index 74e5a54..c5b4a1c8 100644
--- a/fs/xfs/libxfs/xfs_rmap_btree.c
+++ b/fs/xfs/libxfs/xfs_rmap_btree.c
@@ -199,7 +199,7 @@ xfs_rmapbt_init_high_key_from_rec(
 	union xfs_btree_key	*key,
 	union xfs_btree_rec	*rec)
 {
-	__uint64_t		off;
+	uint64_t		off;
 	int			adj;
 
 	adj = be32_to_cpu(rec->rmap.rm_blockcount) - 1;
@@ -241,7 +241,7 @@ xfs_rmapbt_init_ptr_from_cur(
 	ptr->s = agf->agf_roots[cur->bc_btnum];
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_rmapbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
@@ -249,9 +249,9 @@ xfs_rmapbt_key_diff(
 	struct xfs_rmap_irec	*rec = &cur->bc_rec.r;
 	struct xfs_rmap_key	*kp = &key->rmap;
 	__u64			x, y;
-	__int64_t		d;
+	int64_t			d;
 
-	d = (__int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
+	d = (int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
 	if (d)
 		return d;
 
@@ -271,7 +271,7 @@ xfs_rmapbt_key_diff(
 	return 0;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_rmapbt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
@@ -279,10 +279,10 @@ xfs_rmapbt_diff_two_keys(
 {
 	struct xfs_rmap_key	*kp1 = &k1->rmap;
 	struct xfs_rmap_key	*kp2 = &k2->rmap;
-	__int64_t		d;
+	int64_t			d;
 	__u64			x, y;
 
-	d = (__int64_t)be32_to_cpu(kp1->rm_startblock) -
+	d = (int64_t)be32_to_cpu(kp1->rm_startblock) -
 		       be32_to_cpu(kp2->rm_startblock);
 	if (d)
 		return d;
@@ -384,10 +384,10 @@ xfs_rmapbt_keys_inorder(
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	__uint32_t		x;
-	__uint32_t		y;
-	__uint64_t		a;
-	__uint64_t		b;
+	uint32_t		x;
+	uint32_t		y;
+	uint64_t		a;
+	uint64_t		b;
 
 	x = be32_to_cpu(k1->rmap.rm_startblock);
 	y = be32_to_cpu(k2->rmap.rm_startblock);
@@ -414,10 +414,10 @@ xfs_rmapbt_recs_inorder(
 	union xfs_btree_rec	*r1,
 	union xfs_btree_rec	*r2)
 {
-	__uint32_t		x;
-	__uint32_t		y;
-	__uint64_t		a;
-	__uint64_t		b;
+	uint32_t		x;
+	uint32_t		y;
+	uint64_t		a;
+	uint64_t		b;
 
 	x = be32_to_cpu(r1->rmap.rm_startblock);
 	y = be32_to_cpu(r2->rmap.rm_startblock);
diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c
index e47b99e..26bba7f 100644
--- a/fs/xfs/libxfs/xfs_rtbitmap.c
+++ b/fs/xfs/libxfs/xfs_rtbitmap.c
@@ -1011,7 +1011,7 @@ xfs_rtfree_extent(
 	    mp->m_sb.sb_rextents) {
 		if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM))
 			mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM;
-		*(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
+		*(uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
 		xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE);
 	}
 	return 0;
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index 584ec89..9b5aae2 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -448,7 +448,7 @@ xfs_sb_quota_to_disk(
 	struct xfs_dsb	*to,
 	struct xfs_sb	*from)
 {
-	__uint16_t	qflags = from->sb_qflags;
+	uint16_t	qflags = from->sb_qflags;
 
 	to->sb_uquotino = cpu_to_be64(from->sb_uquotino);
 	if (xfs_sb_version_has_pquotino(from)) {
@@ -756,7 +756,7 @@ xfs_sb_mount_common(
 	mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2;
 
 	mp->m_bsize = XFS_FSB_TO_BB(mp, 1);
-	mp->m_ialloc_inos = (int)MAX((__uint16_t)XFS_INODES_PER_CHUNK,
+	mp->m_ialloc_inos = (int)MAX((uint16_t)XFS_INODES_PER_CHUNK,
 					sbp->sb_inopblock);
 	mp->m_ialloc_blks = mp->m_ialloc_inos >> sbp->sb_inopblog;
 
diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index 717909f..0220159 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -18,34 +18,34 @@
 #ifndef __XFS_TYPES_H__
 #define	__XFS_TYPES_H__
 
-typedef __uint32_t	prid_t;		/* project ID */
+typedef uint32_t	prid_t;		/* project ID */
 
-typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
-typedef	__uint32_t	xfs_agino_t;	/* inode # within allocation grp */
-typedef	__uint32_t	xfs_extlen_t;	/* extent length in blocks */
-typedef	__uint32_t	xfs_agnumber_t;	/* allocation group number */
-typedef __int32_t	xfs_extnum_t;	/* # of extents in a file */
-typedef __int16_t	xfs_aextnum_t;	/* # extents in an attribute fork */
-typedef	__int64_t	xfs_fsize_t;	/* bytes in a file */
-typedef __uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
+typedef uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
+typedef uint32_t	xfs_agino_t;	/* inode # within allocation grp */
+typedef uint32_t	xfs_extlen_t;	/* extent length in blocks */
+typedef uint32_t	xfs_agnumber_t;	/* allocation group number */
+typedef int32_t		xfs_extnum_t;	/* # of extents in a file */
+typedef int16_t		xfs_aextnum_t;	/* # extents in an attribute fork */
+typedef int64_t		xfs_fsize_t;	/* bytes in a file */
+typedef uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
 
-typedef	__int32_t	xfs_suminfo_t;	/* type of bitmap summary info */
-typedef	__int32_t	xfs_rtword_t;	/* word type for bitmap manipulations */
+typedef int32_t		xfs_suminfo_t;	/* type of bitmap summary info */
+typedef int32_t		xfs_rtword_t;	/* word type for bitmap manipulations */
 
-typedef	__int64_t	xfs_lsn_t;	/* log sequence number */
-typedef	__int32_t	xfs_tid_t;	/* transaction identifier */
+typedef int64_t		xfs_lsn_t;	/* log sequence number */
+typedef int32_t		xfs_tid_t;	/* transaction identifier */
 
-typedef	__uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
-typedef	__uint32_t	xfs_dahash_t;	/* dir/attr hash value */
+typedef uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
+typedef uint32_t	xfs_dahash_t;	/* dir/attr hash value */
 
-typedef	__uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
-typedef __uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
-typedef __uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
-typedef __uint64_t	xfs_fileoff_t;	/* block number in a file */
-typedef __uint64_t	xfs_filblks_t;	/* number of blocks in a file */
+typedef uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
+typedef uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
+typedef uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
+typedef uint64_t	xfs_fileoff_t;	/* block number in a file */
+typedef uint64_t	xfs_filblks_t;	/* number of blocks in a file */
 
-typedef	__int64_t	xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
-typedef __int64_t	xfs_sfiloff_t;	/* signed block number in a file */
+typedef int64_t		xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
+typedef int64_t		xfs_sfiloff_t;	/* signed block number in a file */
 
 /*
  * Null values for the types.
@@ -125,7 +125,7 @@ struct xfs_name {
  * uid_t and gid_t are hard-coded to 32 bits in the inode.
  * Hence, an 'id' in a dquot is 32 bits..
  */
-typedef __uint32_t	xfs_dqid_t;
+typedef uint32_t	xfs_dqid_t;
 
 /*
  * Constants for bit manipulations.
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 09af0f7..6bab8c4 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -836,7 +836,7 @@ xfs_writepage_map(
 	struct inode		*inode,
 	struct page		*page,
 	loff_t			offset,
-	__uint64_t              end_offset)
+	uint64_t              end_offset)
 {
 	LIST_HEAD(submit_list);
 	struct xfs_ioend	*ioend, *next;
@@ -991,7 +991,7 @@ xfs_do_writepage(
 	struct xfs_writepage_ctx *wpc = data;
 	struct inode		*inode = page->mapping->host;
 	loff_t			offset;
-	__uint64_t              end_offset;
+	uint64_t              end_offset;
 	pgoff_t                 end_index;
 
 	trace_xfs_writepage(inode, page, 0, 0);
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index 97c45b6..9bc1e12 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -279,7 +279,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
 	if (bp == NULL) {
 		cursor->blkno = 0;
 		for (;;) {
-			__uint16_t magic;
+			uint16_t magic;
 
 			error = xfs_da3_node_read(NULL, dp,
 						      cursor->blkno, -1, &bp,
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 2e8851e..e4ef149 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -389,11 +389,11 @@ xfs_getbmapx_fix_eof_hole(
 	struct getbmapx		*out,		/* output structure */
 	int			prealloced,	/* this is a file with
 						 * preallocated data space */
-	__int64_t		end,		/* last block requested */
+	int64_t			end,		/* last block requested */
 	xfs_fsblock_t		startblock,
 	bool			moretocome)
 {
-	__int64_t		fixlen;
+	int64_t			fixlen;
 	xfs_mount_t		*mp;		/* file system mount point */
 	xfs_ifork_t		*ifp;		/* inode fork pointer */
 	xfs_extnum_t		lastx;		/* last extent pointer */
@@ -514,9 +514,9 @@ xfs_getbmap(
 	xfs_bmap_format_t	formatter,	/* format to user */
 	void			*arg)		/* formatter arg */
 {
-	__int64_t		bmvend;		/* last block requested */
+	int64_t			bmvend;		/* last block requested */
 	int			error = 0;	/* return value */
-	__int64_t		fixlen;		/* length for -1 case */
+	int64_t			fixlen;		/* length for -1 case */
 	int			i;		/* extent number */
 	int			lock;		/* lock state */
 	xfs_bmbt_irec_t		*map;		/* buffer for user's data */
@@ -605,7 +605,7 @@ xfs_getbmap(
 	if (bmv->bmv_length == -1) {
 		fixlen = XFS_FSB_TO_BB(mp, XFS_B_TO_FSB(mp, fixlen));
 		bmv->bmv_length =
-			max_t(__int64_t, fixlen - bmv->bmv_offset, 0);
+			max_t(int64_t, fixlen - bmv->bmv_offset, 0);
 	} else if (bmv->bmv_length == 0) {
 		bmv->bmv_entries = 0;
 		return 0;
@@ -742,7 +742,7 @@ xfs_getbmap(
 				out[cur_ext].bmv_offset +
 				out[cur_ext].bmv_length;
 			bmv->bmv_length =
-				max_t(__int64_t, 0, bmvend - bmv->bmv_offset);
+				max_t(int64_t, 0, bmvend - bmv->bmv_offset);
 
 			/*
 			 * In case we don't want to return the hole,
@@ -1676,7 +1676,7 @@ xfs_swap_extent_rmap(
 	xfs_filblks_t			ilen;
 	xfs_filblks_t			rlen;
 	int				nimaps;
-	__uint64_t			tip_flags2;
+	uint64_t			tip_flags2;
 
 	/*
 	 * If the source file has shared blocks, we must flag the donor
@@ -1792,7 +1792,7 @@ xfs_swap_extent_forks(
 	int			aforkblks = 0;
 	int			taforkblks = 0;
 	xfs_extnum_t		nextents;
-	__uint64_t		tmp;
+	uint64_t		tmp;
 	int			error;
 
 	/*
@@ -1850,15 +1850,15 @@ xfs_swap_extent_forks(
 	/*
 	 * Fix the on-disk inode values
 	 */
-	tmp = (__uint64_t)ip->i_d.di_nblocks;
+	tmp = (uint64_t)ip->i_d.di_nblocks;
 	ip->i_d.di_nblocks = tip->i_d.di_nblocks - taforkblks + aforkblks;
 	tip->i_d.di_nblocks = tmp + taforkblks - aforkblks;
 
-	tmp = (__uint64_t) ip->i_d.di_nextents;
+	tmp = (uint64_t) ip->i_d.di_nextents;
 	ip->i_d.di_nextents = tip->i_d.di_nextents;
 	tip->i_d.di_nextents = tmp;
 
-	tmp = (__uint64_t) ip->i_d.di_format;
+	tmp = (uint64_t) ip->i_d.di_format;
 	ip->i_d.di_format = tip->i_d.di_format;
 	tip->i_d.di_format = tmp;
 
@@ -1927,7 +1927,7 @@ xfs_swap_extents(
 	int			error = 0;
 	int			lock_flags;
 	struct xfs_ifork	*cowfp;
-	__uint64_t		f;
+	uint64_t		f;
 	int			resblks;
 
 	/*
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 62fa392..e4e254b 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1180,7 +1180,7 @@ xfs_buf_ioerror_alert(
 {
 	xfs_alert(bp->b_target->bt_mount,
 "metadata I/O error: block 0x%llx (\"%s\") error %d numblks %d",
-		(__uint64_t)XFS_BUF_ADDR(bp), func, -bp->b_error, bp->b_length);
+		(uint64_t)XFS_BUF_ADDR(bp), func, -bp->b_error, bp->b_length);
 }
 
 int
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
index 1bc7401..ede4790 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -44,7 +44,7 @@ static unsigned char xfs_dir3_filetype_table[] = {
 static unsigned char
 xfs_dir3_get_dtype(
 	struct xfs_mount	*mp,
-	__uint8_t		filetype)
+	uint8_t			filetype)
 {
 	if (!xfs_sb_version_hasftype(&mp->m_sb))
 		return DT_UNKNOWN;
@@ -117,7 +117,7 @@ xfs_dir2_sf_getdents(
 	 */
 	sfep = xfs_dir2_sf_firstentry(sfp);
 	for (i = 0; i < sfp->count; i++) {
-		__uint8_t filetype;
+		uint8_t filetype;
 
 		off = xfs_dir2_db_off_to_dataptr(geo, geo->datablk,
 				xfs_dir2_sf_get_offset(sfep));
@@ -194,7 +194,7 @@ xfs_dir2_block_getdents(
 	 * Each object is a real entry (dep) or an unused one (dup).
 	 */
 	while (ptr < endptr) {
-		__uint8_t filetype;
+		uint8_t filetype;
 
 		dup = (xfs_dir2_data_unused_t *)ptr;
 		/*
@@ -391,7 +391,7 @@ xfs_dir2_leaf_getdents(
 	 * Get more blocks and readahead as necessary.
 	 */
 	while (curoff < XFS_DIR2_LEAF_OFFSET) {
-		__uint8_t filetype;
+		uint8_t filetype;
 
 		/*
 		 * If we have no buffer, or we're off the end of the
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c
index 6a05d27..b2cde54 100644
--- a/fs/xfs/xfs_discard.c
+++ b/fs/xfs/xfs_discard.c
@@ -39,7 +39,7 @@ xfs_trim_extents(
 	xfs_daddr_t		start,
 	xfs_daddr_t		end,
 	xfs_daddr_t		minlen,
-	__uint64_t		*blocks_trimmed)
+	uint64_t		*blocks_trimmed)
 {
 	struct block_device	*bdev = mp->m_ddev_targp->bt_bdev;
 	struct xfs_btree_cur	*cur;
@@ -166,7 +166,7 @@ xfs_ioc_trim(
 	struct fstrim_range	range;
 	xfs_daddr_t		start, end, minlen;
 	xfs_agnumber_t		start_agno, end_agno, agno;
-	__uint64_t		blocks_trimmed = 0;
+	uint64_t		blocks_trimmed = 0;
 	int			error, last_error = 0;
 
 	if (!capable(CAP_SYS_ADMIN))
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 9d06cc3..e57c6cc 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -276,7 +276,7 @@ xfs_qm_init_dquot_blk(
 void
 xfs_dquot_set_prealloc_limits(struct xfs_dquot *dqp)
 {
-	__uint64_t space;
+	uint64_t space;
 
 	dqp->q_prealloc_hi_wmark = be64_to_cpu(dqp->q_core.d_blk_hardlimit);
 	dqp->q_prealloc_lo_wmark = be64_to_cpu(dqp->q_core.d_blk_softlimit);
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c
index 6ccaae9..8f22fc5 100644
--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -602,7 +602,7 @@ xfs_growfs_data_private(
 	if (nagimax)
 		mp->m_maxagi = nagimax;
 	if (mp->m_sb.sb_imax_pct) {
-		__uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct;
+		uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct;
 		do_div(icount, 100);
 		mp->m_maxicount = icount << mp->m_sb.sb_inopblog;
 	} else
@@ -793,17 +793,17 @@ xfs_fs_counts(
 int
 xfs_reserve_blocks(
 	xfs_mount_t             *mp,
-	__uint64_t              *inval,
+	uint64_t              *inval,
 	xfs_fsop_resblks_t      *outval)
 {
-	__int64_t		lcounter, delta;
-	__int64_t		fdblks_delta = 0;
-	__uint64_t		request;
-	__int64_t		free;
+	int64_t			lcounter, delta;
+	int64_t			fdblks_delta = 0;
+	uint64_t		request;
+	int64_t			free;
 	int			error = 0;
 
 	/* If inval is null, report current values and return */
-	if (inval == (__uint64_t *)NULL) {
+	if (inval == (uint64_t *)NULL) {
 		if (!outval)
 			return -EINVAL;
 		outval->resblks = mp->m_resblks;
@@ -904,7 +904,7 @@ xfs_reserve_blocks(
 int
 xfs_fs_goingdown(
 	xfs_mount_t	*mp,
-	__uint32_t	inflags)
+	uint32_t	inflags)
 {
 	switch (inflags) {
 	case XFS_FSOP_GOING_FLAGS_DEFAULT: {
diff --git a/fs/xfs/xfs_fsops.h b/fs/xfs/xfs_fsops.h
index f349158..2954c13 100644
--- a/fs/xfs/xfs_fsops.h
+++ b/fs/xfs/xfs_fsops.h
@@ -22,9 +22,9 @@ extern int xfs_fs_geometry(xfs_mount_t *mp, xfs_fsop_geom_t *geo, int nversion);
 extern int xfs_growfs_data(xfs_mount_t *mp, xfs_growfs_data_t *in);
 extern int xfs_growfs_log(xfs_mount_t *mp, xfs_growfs_log_t *in);
 extern int xfs_fs_counts(xfs_mount_t *mp, xfs_fsop_counts_t *cnt);
-extern int xfs_reserve_blocks(xfs_mount_t *mp, __uint64_t *inval,
+extern int xfs_reserve_blocks(xfs_mount_t *mp, uint64_t *inval,
 				xfs_fsop_resblks_t *outval);
-extern int xfs_fs_goingdown(xfs_mount_t *mp, __uint32_t inflags);
+extern int xfs_fs_goingdown(xfs_mount_t *mp, uint32_t inflags);
 
 extern int xfs_fs_reserve_ag_blocks(struct xfs_mount *mp);
 extern int xfs_fs_unreserve_ag_blocks(struct xfs_mount *mp);
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index ec9826c..ffbfe7d 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -632,7 +632,7 @@ __xfs_iflock(
 
 STATIC uint
 _xfs_dic2xflags(
-	__uint16_t		di_flags,
+	uint16_t		di_flags,
 	uint64_t		di_flags2,
 	bool			has_attr)
 {
@@ -855,8 +855,8 @@ xfs_ialloc(
 		inode->i_version = 1;
 		ip->i_d.di_flags2 = 0;
 		ip->i_d.di_cowextsize = 0;
-		ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec;
-		ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec;
+		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
+		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
 	}
 
 
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 10e89fc..677d0bf 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -192,8 +192,8 @@ static inline void
 xfs_set_projid(struct xfs_inode *ip,
 		prid_t projid)
 {
-	ip->i_d.di_projid_hi = (__uint16_t) (projid >> 16);
-	ip->i_d.di_projid_lo = (__uint16_t) (projid & 0xffff);
+	ip->i_d.di_projid_hi = (uint16_t) (projid >> 16);
+	ip->i_d.di_projid_lo = (uint16_t) (projid & 0xffff);
 }
 
 static inline prid_t
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 6190697..c8d5523 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -444,8 +444,8 @@ xfs_attrmulti_attr_get(
 	struct inode		*inode,
 	unsigned char		*name,
 	unsigned char		__user *ubuf,
-	__uint32_t		*len,
-	__uint32_t		flags)
+	uint32_t		*len,
+	uint32_t		flags)
 {
 	unsigned char		*kbuf;
 	int			error = -EFAULT;
@@ -473,8 +473,8 @@ xfs_attrmulti_attr_set(
 	struct inode		*inode,
 	unsigned char		*name,
 	const unsigned char	__user *ubuf,
-	__uint32_t		len,
-	__uint32_t		flags)
+	uint32_t		len,
+	uint32_t		flags)
 {
 	unsigned char		*kbuf;
 	int			error;
@@ -499,7 +499,7 @@ int
 xfs_attrmulti_attr_remove(
 	struct inode		*inode,
 	unsigned char		*name,
-	__uint32_t		flags)
+	uint32_t		flags)
 {
 	int			error;
 
@@ -877,7 +877,7 @@ xfs_merge_ioc_xflags(
 
 STATIC unsigned int
 xfs_di2lxflags(
-	__uint16_t	di_flags)
+	uint16_t	di_flags)
 {
 	unsigned int	flags = 0;
 
@@ -1288,7 +1288,7 @@ xfs_ioctl_setattr_check_projid(
 	struct fsxattr		*fa)
 {
 	/* Disallow 32bit project ids if projid32bit feature is not enabled. */
-	if (fa->fsx_projid > (__uint16_t)-1 &&
+	if (fa->fsx_projid > (uint16_t)-1 &&
 	    !xfs_sb_version_hasprojid32bit(&ip->i_mount->m_sb))
 		return -EINVAL;
 
@@ -1932,7 +1932,7 @@ xfs_file_ioctl(
 
 	case XFS_IOC_SET_RESBLKS: {
 		xfs_fsop_resblks_t inout;
-		__uint64_t	   in;
+		uint64_t	   in;
 
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
@@ -2018,12 +2018,12 @@ xfs_file_ioctl(
 	}
 
 	case XFS_IOC_GOINGDOWN: {
-		__uint32_t in;
+		uint32_t in;
 
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 
-		if (get_user(in, (__uint32_t __user *)arg))
+		if (get_user(in, (uint32_t __user *)arg))
 			return -EFAULT;
 
 		return xfs_fs_goingdown(mp, in);
diff --git a/fs/xfs/xfs_ioctl.h b/fs/xfs/xfs_ioctl.h
index 8b52881..e86c3ea 100644
--- a/fs/xfs/xfs_ioctl.h
+++ b/fs/xfs/xfs_ioctl.h
@@ -48,22 +48,22 @@ xfs_attrmulti_attr_get(
 	struct inode		*inode,
 	unsigned char		*name,
 	unsigned char		__user *ubuf,
-	__uint32_t		*len,
-	__uint32_t		flags);
+	uint32_t		*len,
+	uint32_t		flags);
 
 extern int
 xfs_attrmulti_attr_set(
 	struct inode		*inode,
 	unsigned char		*name,
 	const unsigned char	__user *ubuf,
-	__uint32_t		len,
-	__uint32_t		flags);
+	uint32_t		len,
+	uint32_t		flags);
 
 extern int
 xfs_attrmulti_attr_remove(
 	struct inode		*inode,
 	unsigned char		*name,
-	__uint32_t		flags);
+	uint32_t		flags);
 
 extern struct dentry *
 xfs_handle_to_dentry(
diff --git a/fs/xfs/xfs_ioctl32.h b/fs/xfs/xfs_ioctl32.h
index b1bb454..5492bcf 100644
--- a/fs/xfs/xfs_ioctl32.h
+++ b/fs/xfs/xfs_ioctl32.h
@@ -112,9 +112,9 @@ typedef struct compat_xfs_fsop_handlereq {
 
 /* The bstat field in the swapext struct needs translation */
 typedef struct compat_xfs_swapext {
-	__int64_t		sx_version;	/* version */
-	__int64_t		sx_fdtarget;	/* fd of target file */
-	__int64_t		sx_fdtmp;	/* fd of tmp file */
+	int64_t			sx_version;	/* version */
+	int64_t			sx_fdtarget;	/* fd of target file */
+	int64_t			sx_fdtmp;	/* fd of tmp file */
 	xfs_off_t		sx_offset;	/* offset into file */
 	xfs_off_t		sx_length;	/* leng from offset */
 	char			sx_pad[16];	/* pad space, unused */
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
index 044fb0e..ecdae42 100644
--- a/fs/xfs/xfs_linux.h
+++ b/fs/xfs/xfs_linux.h
@@ -23,14 +23,6 @@
 /*
  * Kernel specific type declarations for XFS
  */
-typedef signed char		__int8_t;
-typedef unsigned char		__uint8_t;
-typedef signed short int	__int16_t;
-typedef unsigned short int	__uint16_t;
-typedef signed int		__int32_t;
-typedef unsigned int		__uint32_t;
-typedef signed long long int	__int64_t;
-typedef unsigned long long int	__uint64_t;
 
 typedef __s64			xfs_off_t;	/* <file offset> type */
 typedef unsigned long long	xfs_ino_t;	/* <inode> type */
@@ -186,22 +178,22 @@ extern struct xstats xfsstats;
  * are converting to the init_user_ns. The uid is later mapped to a particular
  * user namespace value when crossing the kernel/user boundary.
  */
-static inline __uint32_t xfs_kuid_to_uid(kuid_t uid)
+static inline uint32_t xfs_kuid_to_uid(kuid_t uid)
 {
 	return from_kuid(&init_user_ns, uid);
 }
 
-static inline kuid_t xfs_uid_to_kuid(__uint32_t uid)
+static inline kuid_t xfs_uid_to_kuid(uint32_t uid)
 {
 	return make_kuid(&init_user_ns, uid);
 }
 
-static inline __uint32_t xfs_kgid_to_gid(kgid_t gid)
+static inline uint32_t xfs_kgid_to_gid(kgid_t gid)
 {
 	return from_kgid(&init_user_ns, gid);
 }
 
-static inline kgid_t xfs_gid_to_kgid(__uint32_t gid)
+static inline kgid_t xfs_gid_to_kgid(uint32_t gid)
 {
 	return make_kgid(&init_user_ns, gid);
 }
@@ -231,14 +223,14 @@ static inline __u32 xfs_do_mod(void *a, __u32 b, int n)
 
 #define do_mod(a, b)	xfs_do_mod(&(a), (b), sizeof(a))
 
-static inline __uint64_t roundup_64(__uint64_t x, __uint32_t y)
+static inline uint64_t roundup_64(uint64_t x, uint32_t y)
 {
 	x += y - 1;
 	do_div(x, y);
 	return x * y;
 }
 
-static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
+static inline uint64_t howmany_64(uint64_t x, uint32_t y)
 {
 	x += y - 1;
 	do_div(x, y);
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 3731f13..12a905b 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -434,7 +434,7 @@ xfs_log_reserve(
 	int		 	unit_bytes,
 	int		 	cnt,
 	struct xlog_ticket	**ticp,
-	__uint8_t	 	client,
+	uint8_t		 	client,
 	bool			permanent)
 {
 	struct xlog		*log = mp->m_log;
@@ -825,9 +825,9 @@ xfs_log_unmount_write(xfs_mount_t *mp)
 		if (!error) {
 			/* the data section must be 32 bit size aligned */
 			struct {
-			    __uint16_t magic;
-			    __uint16_t pad1;
-			    __uint32_t pad2; /* may as well make it 64 bits */
+			    uint16_t magic;
+			    uint16_t pad1;
+			    uint32_t pad2; /* may as well make it 64 bits */
 			} magic = {
 				.magic = XLOG_UNMOUNT_TYPE,
 			};
@@ -1665,7 +1665,7 @@ xlog_cksum(
 	char			*dp,
 	int			size)
 {
-	__uint32_t		crc;
+	uint32_t		crc;
 
 	/* first generate the crc for the record header ... */
 	crc = xfs_start_cksum_update((char *)rhead,
@@ -1828,7 +1828,7 @@ xlog_sync(
 		 */
 		dptr = (char *)&iclog->ic_header + count;
 		for (i = 0; i < split; i += BBSIZE) {
-			__uint32_t cycle = be32_to_cpu(*(__be32 *)dptr);
+			uint32_t cycle = be32_to_cpu(*(__be32 *)dptr);
 			if (++cycle == XLOG_HEADER_MAGIC_NUM)
 				cycle++;
 			*(__be32 *)dptr = cpu_to_be32(cycle);
@@ -2363,8 +2363,8 @@ xlog_write(
 			}
 
 			reg = &vecp[index];
-			ASSERT(reg->i_len % sizeof(__int32_t) == 0);
-			ASSERT((unsigned long)ptr % sizeof(__int32_t) == 0);
+			ASSERT(reg->i_len % sizeof(int32_t) == 0);
+			ASSERT((unsigned long)ptr % sizeof(int32_t) == 0);
 
 			start_rec_copy = xlog_write_start_rec(ptr, ticket);
 			if (start_rec_copy) {
@@ -3143,7 +3143,7 @@ xlog_state_switch_iclogs(
 	/* Round up to next log-sunit */
 	if (xfs_sb_version_haslogv2(&log->l_mp->m_sb) &&
 	    log->l_mp->m_sb.sb_logsunit > 1) {
-		__uint32_t sunit_bb = BTOBB(log->l_mp->m_sb.sb_logsunit);
+		uint32_t sunit_bb = BTOBB(log->l_mp->m_sb.sb_logsunit);
 		log->l_curr_block = roundup(log->l_curr_block, sunit_bb);
 	}
 
@@ -3771,7 +3771,7 @@ xlog_verify_iclog(
 	xlog_in_core_2_t	*xhdr;
 	void			*base_ptr, *ptr, *p;
 	ptrdiff_t		field_offset;
-	__uint8_t		clientid;
+	uint8_t			clientid;
 	int			len, i, j, k, op_len;
 	int			idx;
 
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index cc5a9f1..bf21277 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -159,7 +159,7 @@ int	  xfs_log_reserve(struct xfs_mount *mp,
 			  int		   length,
 			  int		   count,
 			  struct xlog_ticket **ticket,
-			  __uint8_t	   clientid,
+			  uint8_t		   clientid,
 			  bool		   permanent);
 int	  xfs_log_regrant(struct xfs_mount *mp, struct xlog_ticket *tic);
 void      xfs_log_unmount(struct xfs_mount *mp);
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index c2604a5..1accc2c 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -419,7 +419,7 @@ struct xlog {
 };
 
 #define XLOG_BUF_CANCEL_BUCKET(log, blkno) \
-	((log)->l_buf_cancel_table + ((__uint64_t)blkno % XLOG_BC_TABLE_SIZE))
+	((log)->l_buf_cancel_table + ((uint64_t)blkno % XLOG_BC_TABLE_SIZE))
 
 #define XLOG_FORCED_SHUTDOWN(log)	((log)->l_flags & XLOG_IO_ERROR)
 
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index cd0b077..e19b20c 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2230,9 +2230,9 @@ xlog_recover_get_buf_lsn(
 	struct xfs_mount	*mp,
 	struct xfs_buf		*bp)
 {
-	__uint32_t		magic32;
-	__uint16_t		magic16;
-	__uint16_t		magicda;
+	uint32_t		magic32;
+	uint16_t		magic16;
+	uint16_t		magicda;
 	void			*blk = bp->b_addr;
 	uuid_t			*uuid;
 	xfs_lsn_t		lsn = -1;
@@ -2381,9 +2381,9 @@ xlog_recover_validate_buf_type(
 	xfs_lsn_t		current_lsn)
 {
 	struct xfs_da_blkinfo	*info = bp->b_addr;
-	__uint32_t		magic32;
-	__uint16_t		magic16;
-	__uint16_t		magicda;
+	uint32_t		magic32;
+	uint16_t		magic16;
+	uint16_t		magicda;
 	char			*warnmsg = NULL;
 
 	/*
@@ -2852,7 +2852,7 @@ xlog_recover_buffer_pass2(
 	if (XFS_DINODE_MAGIC ==
 	    be16_to_cpu(*((__be16 *)xfs_buf_offset(bp, 0))) &&
 	    (BBTOB(bp->b_io_length) != MAX(log->l_mp->m_sb.sb_blocksize,
-			(__uint32_t)log->l_mp->m_inode_cluster_size))) {
+			(uint32_t)log->l_mp->m_inode_cluster_size))) {
 		xfs_buf_stale(bp);
 		error = xfs_bwrite(bp);
 	} else {
@@ -3423,7 +3423,7 @@ xlog_recover_efd_pass2(
 	xfs_efd_log_format_t	*efd_formatp;
 	xfs_efi_log_item_t	*efip = NULL;
 	xfs_log_item_t		*lip;
-	__uint64_t		efi_id;
+	uint64_t		efi_id;
 	struct xfs_ail_cursor	cur;
 	struct xfs_ail		*ailp = log->l_ailp;
 
@@ -3519,7 +3519,7 @@ xlog_recover_rud_pass2(
 	struct xfs_rud_log_format	*rud_formatp;
 	struct xfs_rui_log_item		*ruip = NULL;
 	struct xfs_log_item		*lip;
-	__uint64_t			rui_id;
+	uint64_t			rui_id;
 	struct xfs_ail_cursor		cur;
 	struct xfs_ail			*ailp = log->l_ailp;
 
@@ -3635,7 +3635,7 @@ xlog_recover_cud_pass2(
 	struct xfs_cud_log_format	*cud_formatp;
 	struct xfs_cui_log_item		*cuip = NULL;
 	struct xfs_log_item		*lip;
-	__uint64_t			cui_id;
+	uint64_t			cui_id;
 	struct xfs_ail_cursor		cur;
 	struct xfs_ail			*ailp = log->l_ailp;
 
@@ -3754,7 +3754,7 @@ xlog_recover_bud_pass2(
 	struct xfs_bud_log_format	*bud_formatp;
 	struct xfs_bui_log_item		*buip = NULL;
 	struct xfs_log_item		*lip;
-	__uint64_t			bui_id;
+	uint64_t			bui_id;
 	struct xfs_ail_cursor		cur;
 	struct xfs_ail			*ailp = log->l_ailp;
 
@@ -5772,9 +5772,9 @@ xlog_recover_check_summary(
 	xfs_buf_t	*agfbp;
 	xfs_buf_t	*agibp;
 	xfs_agnumber_t	agno;
-	__uint64_t	freeblks;
-	__uint64_t	itotal;
-	__uint64_t	ifree;
+	uint64_t	freeblks;
+	uint64_t	itotal;
+	uint64_t	ifree;
 	int		error;
 
 	mp = log->l_mp;
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 2eaf818..cc6789d 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -174,7 +174,7 @@ xfs_free_perag(
 int
 xfs_sb_validate_fsb_count(
 	xfs_sb_t	*sbp,
-	__uint64_t	nblocks)
+	uint64_t	nblocks)
 {
 	ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
 	ASSERT(sbp->sb_blocklog >= BBSHIFT);
@@ -436,7 +436,7 @@ STATIC void
 xfs_set_maxicount(xfs_mount_t *mp)
 {
 	xfs_sb_t	*sbp = &(mp->m_sb);
-	__uint64_t	icount;
+	uint64_t	icount;
 
 	if (sbp->sb_imax_pct) {
 		/*
@@ -502,7 +502,7 @@ xfs_set_low_space_thresholds(
 	int i;
 
 	for (i = 0; i < XFS_LOWSP_MAX; i++) {
-		__uint64_t space = mp->m_sb.sb_dblocks;
+		uint64_t space = mp->m_sb.sb_dblocks;
 
 		do_div(space, 100);
 		mp->m_low_space[i] = space * (i + 1);
@@ -598,10 +598,10 @@ xfs_mount_reset_sbqflags(
 	return xfs_sync_sb(mp, false);
 }
 
-__uint64_t
+uint64_t
 xfs_default_resblks(xfs_mount_t *mp)
 {
-	__uint64_t resblks;
+	uint64_t resblks;
 
 	/*
 	 * We default to 5% or 8192 fsbs of space reserved, whichever is
@@ -612,7 +612,7 @@ xfs_default_resblks(xfs_mount_t *mp)
 	 */
 	resblks = mp->m_sb.sb_dblocks;
 	do_div(resblks, 20);
-	resblks = min_t(__uint64_t, resblks, 8192);
+	resblks = min_t(uint64_t, resblks, 8192);
 	return resblks;
 }
 
@@ -632,7 +632,7 @@ xfs_mountfs(
 {
 	struct xfs_sb		*sbp = &(mp->m_sb);
 	struct xfs_inode	*rip;
-	__uint64_t		resblks;
+	uint64_t		resblks;
 	uint			quotamount = 0;
 	uint			quotaflags = 0;
 	int			error = 0;
@@ -1060,7 +1060,7 @@ void
 xfs_unmountfs(
 	struct xfs_mount	*mp)
 {
-	__uint64_t		resblks;
+	uint64_t		resblks;
 	int			error;
 
 	cancel_delayed_work_sync(&mp->m_eofblocks_work);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 9fa312a..305d953 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -108,10 +108,10 @@ typedef struct xfs_mount {
 	xfs_buftarg_t		*m_ddev_targp;	/* saves taking the address */
 	xfs_buftarg_t		*m_logdev_targp;/* ptr to log device */
 	xfs_buftarg_t		*m_rtdev_targp;	/* ptr to rt device */
-	__uint8_t		m_blkbit_log;	/* blocklog + NBBY */
-	__uint8_t		m_blkbb_log;	/* blocklog - BBSHIFT */
-	__uint8_t		m_agno_log;	/* log #ag's */
-	__uint8_t		m_agino_log;	/* #bits for agino in inum */
+	uint8_t			m_blkbit_log;	/* blocklog + NBBY */
+	uint8_t			m_blkbb_log;	/* blocklog - BBSHIFT */
+	uint8_t			m_agno_log;	/* log #ag's */
+	uint8_t			m_agino_log;	/* #bits for agino in inum */
 	uint			m_inode_cluster_size;/* min inode buf size */
 	uint			m_blockmask;	/* sb_blocksize-1 */
 	uint			m_blockwsize;	/* sb_blocksize in words */
@@ -139,7 +139,7 @@ typedef struct xfs_mount {
 	struct mutex		m_growlock;	/* growfs mutex */
 	int			m_fixedfsid[2];	/* unchanged for life of FS */
 	uint			m_dmevmask;	/* DMI events for this FS */
-	__uint64_t		m_flags;	/* global mount flags */
+	uint64_t		m_flags;	/* global mount flags */
 	bool			m_inotbt_nores; /* no per-AG finobt resv. */
 	int			m_ialloc_inos;	/* inodes in inode allocation */
 	int			m_ialloc_blks;	/* blocks in inode allocation */
@@ -148,14 +148,14 @@ typedef struct xfs_mount {
 	int			m_inoalign_mask;/* mask sb_inoalignmt if used */
 	uint			m_qflags;	/* quota status flags */
 	struct xfs_trans_resv	m_resv;		/* precomputed res values */
-	__uint64_t		m_maxicount;	/* maximum inode count */
-	__uint64_t		m_resblks;	/* total reserved blocks */
-	__uint64_t		m_resblks_avail;/* available reserved blocks */
-	__uint64_t		m_resblks_save;	/* reserved blks @ remount,ro */
+	uint64_t		m_maxicount;	/* maximum inode count */
+	uint64_t		m_resblks;	/* total reserved blocks */
+	uint64_t		m_resblks_avail;/* available reserved blocks */
+	uint64_t		m_resblks_save;	/* reserved blks @ remount,ro */
 	int			m_dalign;	/* stripe unit */
 	int			m_swidth;	/* stripe width */
 	int			m_sinoalign;	/* stripe unit inode alignment */
-	__uint8_t		m_sectbb_log;	/* sectlog - BBSHIFT */
+	uint8_t			m_sectbb_log;	/* sectlog - BBSHIFT */
 	const struct xfs_nameops *m_dirnameops;	/* vector of dir name ops */
 	const struct xfs_dir_ops *m_dir_inode_ops; /* vector of dir inode ops */
 	const struct xfs_dir_ops *m_nondir_inode_ops; /* !dir inode ops */
@@ -194,7 +194,7 @@ typedef struct xfs_mount {
 	 * ever support shrinks it would have to be persisted in addition
 	 * to various other kinds of pain inflicted on the pNFS server.
 	 */
-	__uint32_t		m_generation;
+	uint32_t		m_generation;
 
 	bool			m_fail_unmount;
 #ifdef DEBUG
@@ -367,12 +367,12 @@ typedef struct xfs_perag {
 	char		pagi_init;	/* this agi's entry is initialized */
 	char		pagf_metadata;	/* the agf is preferred to be metadata */
 	char		pagi_inodeok;	/* The agi is ok for inodes */
-	__uint8_t	pagf_levels[XFS_BTNUM_AGF];
+	uint8_t		pagf_levels[XFS_BTNUM_AGF];
 					/* # of levels in bno & cnt btree */
-	__uint32_t	pagf_flcount;	/* count of blocks in freelist */
+	uint32_t	pagf_flcount;	/* count of blocks in freelist */
 	xfs_extlen_t	pagf_freeblks;	/* total free blocks */
 	xfs_extlen_t	pagf_longest;	/* longest free space */
-	__uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
+	uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
 	xfs_agino_t	pagi_freecount;	/* number of free inodes */
 	xfs_agino_t	pagi_count;	/* number of allocated inodes */
 
@@ -411,7 +411,7 @@ typedef struct xfs_perag {
 	struct xfs_ag_resv	pag_agfl_resv;
 
 	/* reference count */
-	__uint8_t		pagf_refcount_level;
+	uint8_t			pagf_refcount_level;
 } xfs_perag_t;
 
 static inline struct xfs_ag_resv *
@@ -434,7 +434,7 @@ void xfs_buf_hash_destroy(xfs_perag_t *pag);
 
 extern void	xfs_uuid_table_free(void);
 extern int	xfs_log_sbcount(xfs_mount_t *);
-extern __uint64_t xfs_default_resblks(xfs_mount_t *mp);
+extern uint64_t xfs_default_resblks(xfs_mount_t *mp);
 extern int	xfs_mountfs(xfs_mount_t *mp);
 extern int	xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount,
 				     xfs_agnumber_t *maxagi);
@@ -450,7 +450,7 @@ extern struct xfs_buf *xfs_getsb(xfs_mount_t *, int);
 extern int	xfs_readsb(xfs_mount_t *, int);
 extern void	xfs_freesb(xfs_mount_t *);
 extern bool	xfs_fs_writable(struct xfs_mount *mp, int level);
-extern int	xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t);
+extern int	xfs_sb_validate_fsb_count(struct xfs_sb *, uint64_t);
 
 extern int	xfs_dev_is_read_only(struct xfs_mount *, char *);
 
diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
index 3e52d5d..2be6d27 100644
--- a/fs/xfs/xfs_qm_bhv.c
+++ b/fs/xfs/xfs_qm_bhv.c
@@ -33,7 +33,7 @@ xfs_fill_statvfs_from_dquot(
 	struct kstatfs		*statp,
 	struct xfs_dquot	*dqp)
 {
-	__uint64_t		limit;
+	uint64_t		limit;
 
 	limit = dqp->q_core.d_blk_softlimit ?
 		be64_to_cpu(dqp->q_core.d_blk_softlimit) :
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index c57aa7f..9147219 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1256,13 +1256,13 @@ xfs_rtpick_extent(
 {
 	xfs_rtblock_t	b;		/* result block */
 	int		log2;		/* log of sequence number */
-	__uint64_t	resid;		/* residual after log removed */
-	__uint64_t	seq;		/* sequence number of file creation */
-	__uint64_t	*seqp;		/* pointer to seqno in inode */
+	uint64_t	resid;		/* residual after log removed */
+	uint64_t	seq;		/* sequence number of file creation */
+	uint64_t	*seqp;		/* pointer to seqno in inode */
 
 	ASSERT(xfs_isilocked(mp->m_rbmip, XFS_ILOCK_EXCL));
 
-	seqp = (__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime;
+	seqp = (uint64_t *)&VFS_I(mp->m_rbmip)->i_atime;
 	if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM)) {
 		mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM;
 		*seqp = 0;
diff --git a/fs/xfs/xfs_stats.c b/fs/xfs/xfs_stats.c
index f11282c..056e12b 100644
--- a/fs/xfs/xfs_stats.c
+++ b/fs/xfs/xfs_stats.c
@@ -33,9 +33,9 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
 {
 	int		i, j;
 	int		len = 0;
-	__uint64_t	xs_xstrat_bytes = 0;
-	__uint64_t	xs_write_bytes = 0;
-	__uint64_t	xs_read_bytes = 0;
+	uint64_t	xs_xstrat_bytes = 0;
+	uint64_t	xs_write_bytes = 0;
+	uint64_t	xs_read_bytes = 0;
 
 	static const struct xstats_entry {
 		char	*desc;
@@ -100,7 +100,7 @@ int xfs_stats_format(struct xfsstats __percpu *stats, char *buf)
 void xfs_stats_clearall(struct xfsstats __percpu *stats)
 {
 	int		c;
-	__uint32_t	vn_active;
+	uint32_t	vn_active;
 
 	xfs_notice(NULL, "Clearing xfsstats");
 	for_each_possible_cpu(c) {
diff --git a/fs/xfs/xfs_stats.h b/fs/xfs/xfs_stats.h
index 375840f..f64d0ae 100644
--- a/fs/xfs/xfs_stats.h
+++ b/fs/xfs/xfs_stats.h
@@ -54,125 +54,125 @@ enum {
  */
 struct __xfsstats {
 # define XFSSTAT_END_EXTENT_ALLOC	4
-	__uint32_t		xs_allocx;
-	__uint32_t		xs_allocb;
-	__uint32_t		xs_freex;
-	__uint32_t		xs_freeb;
+	uint32_t		xs_allocx;
+	uint32_t		xs_allocb;
+	uint32_t		xs_freex;
+	uint32_t		xs_freeb;
 # define XFSSTAT_END_ALLOC_BTREE	(XFSSTAT_END_EXTENT_ALLOC+4)
-	__uint32_t		xs_abt_lookup;
-	__uint32_t		xs_abt_compare;
-	__uint32_t		xs_abt_insrec;
-	__uint32_t		xs_abt_delrec;
+	uint32_t		xs_abt_lookup;
+	uint32_t		xs_abt_compare;
+	uint32_t		xs_abt_insrec;
+	uint32_t		xs_abt_delrec;
 # define XFSSTAT_END_BLOCK_MAPPING	(XFSSTAT_END_ALLOC_BTREE+7)
-	__uint32_t		xs_blk_mapr;
-	__uint32_t		xs_blk_mapw;
-	__uint32_t		xs_blk_unmap;
-	__uint32_t		xs_add_exlist;
-	__uint32_t		xs_del_exlist;
-	__uint32_t		xs_look_exlist;
-	__uint32_t		xs_cmp_exlist;
+	uint32_t		xs_blk_mapr;
+	uint32_t		xs_blk_mapw;
+	uint32_t		xs_blk_unmap;
+	uint32_t		xs_add_exlist;
+	uint32_t		xs_del_exlist;
+	uint32_t		xs_look_exlist;
+	uint32_t		xs_cmp_exlist;
 # define XFSSTAT_END_BLOCK_MAP_BTREE	(XFSSTAT_END_BLOCK_MAPPING+4)
-	__uint32_t		xs_bmbt_lookup;
-	__uint32_t		xs_bmbt_compare;
-	__uint32_t		xs_bmbt_insrec;
-	__uint32_t		xs_bmbt_delrec;
+	uint32_t		xs_bmbt_lookup;
+	uint32_t		xs_bmbt_compare;
+	uint32_t		xs_bmbt_insrec;
+	uint32_t		xs_bmbt_delrec;
 # define XFSSTAT_END_DIRECTORY_OPS	(XFSSTAT_END_BLOCK_MAP_BTREE+4)
-	__uint32_t		xs_dir_lookup;
-	__uint32_t		xs_dir_create;
-	__uint32_t		xs_dir_remove;
-	__uint32_t		xs_dir_getdents;
+	uint32_t		xs_dir_lookup;
+	uint32_t		xs_dir_create;
+	uint32_t		xs_dir_remove;
+	uint32_t		xs_dir_getdents;
 # define XFSSTAT_END_TRANSACTIONS	(XFSSTAT_END_DIRECTORY_OPS+3)
-	__uint32_t		xs_trans_sync;
-	__uint32_t		xs_trans_async;
-	__uint32_t		xs_trans_empty;
+	uint32_t		xs_trans_sync;
+	uint32_t		xs_trans_async;
+	uint32_t		xs_trans_empty;
 # define XFSSTAT_END_INODE_OPS		(XFSSTAT_END_TRANSACTIONS+7)
-	__uint32_t		xs_ig_attempts;
-	__uint32_t		xs_ig_found;
-	__uint32_t		xs_ig_frecycle;
-	__uint32_t		xs_ig_missed;
-	__uint32_t		xs_ig_dup;
-	__uint32_t		xs_ig_reclaims;
-	__uint32_t		xs_ig_attrchg;
+	uint32_t		xs_ig_attempts;
+	uint32_t		xs_ig_found;
+	uint32_t		xs_ig_frecycle;
+	uint32_t		xs_ig_missed;
+	uint32_t		xs_ig_dup;
+	uint32_t		xs_ig_reclaims;
+	uint32_t		xs_ig_attrchg;
 # define XFSSTAT_END_LOG_OPS		(XFSSTAT_END_INODE_OPS+5)
-	__uint32_t		xs_log_writes;
-	__uint32_t		xs_log_blocks;
-	__uint32_t		xs_log_noiclogs;
-	__uint32_t		xs_log_force;
-	__uint32_t		xs_log_force_sleep;
+	uint32_t		xs_log_writes;
+	uint32_t		xs_log_blocks;
+	uint32_t		xs_log_noiclogs;
+	uint32_t		xs_log_force;
+	uint32_t		xs_log_force_sleep;
 # define XFSSTAT_END_TAIL_PUSHING	(XFSSTAT_END_LOG_OPS+10)
-	__uint32_t		xs_try_logspace;
-	__uint32_t		xs_sleep_logspace;
-	__uint32_t		xs_push_ail;
-	__uint32_t		xs_push_ail_success;
-	__uint32_t		xs_push_ail_pushbuf;
-	__uint32_t		xs_push_ail_pinned;
-	__uint32_t		xs_push_ail_locked;
-	__uint32_t		xs_push_ail_flushing;
-	__uint32_t		xs_push_ail_restarts;
-	__uint32_t		xs_push_ail_flush;
+	uint32_t		xs_try_logspace;
+	uint32_t		xs_sleep_logspace;
+	uint32_t		xs_push_ail;
+	uint32_t		xs_push_ail_success;
+	uint32_t		xs_push_ail_pushbuf;
+	uint32_t		xs_push_ail_pinned;
+	uint32_t		xs_push_ail_locked;
+	uint32_t		xs_push_ail_flushing;
+	uint32_t		xs_push_ail_restarts;
+	uint32_t		xs_push_ail_flush;
 # define XFSSTAT_END_WRITE_CONVERT	(XFSSTAT_END_TAIL_PUSHING+2)
-	__uint32_t		xs_xstrat_quick;
-	__uint32_t		xs_xstrat_split;
+	uint32_t		xs_xstrat_quick;
+	uint32_t		xs_xstrat_split;
 # define XFSSTAT_END_READ_WRITE_OPS	(XFSSTAT_END_WRITE_CONVERT+2)
-	__uint32_t		xs_write_calls;
-	__uint32_t		xs_read_calls;
+	uint32_t		xs_write_calls;
+	uint32_t		xs_read_calls;
 # define XFSSTAT_END_ATTRIBUTE_OPS	(XFSSTAT_END_READ_WRITE_OPS+4)
-	__uint32_t		xs_attr_get;
-	__uint32_t		xs_attr_set;
-	__uint32_t		xs_attr_remove;
-	__uint32_t		xs_attr_list;
+	uint32_t		xs_attr_get;
+	uint32_t		xs_attr_set;
+	uint32_t		xs_attr_remove;
+	uint32_t		xs_attr_list;
 # define XFSSTAT_END_INODE_CLUSTER	(XFSSTAT_END_ATTRIBUTE_OPS+3)
-	__uint32_t		xs_iflush_count;
-	__uint32_t		xs_icluster_flushcnt;
-	__uint32_t		xs_icluster_flushinode;
+	uint32_t		xs_iflush_count;
+	uint32_t		xs_icluster_flushcnt;
+	uint32_t		xs_icluster_flushinode;
 # define XFSSTAT_END_VNODE_OPS		(XFSSTAT_END_INODE_CLUSTER+8)
-	__uint32_t		vn_active;	/* # vnodes not on free lists */
-	__uint32_t		vn_alloc;	/* # times vn_alloc called */
-	__uint32_t		vn_get;		/* # times vn_get called */
-	__uint32_t		vn_hold;	/* # times vn_hold called */
-	__uint32_t		vn_rele;	/* # times vn_rele called */
-	__uint32_t		vn_reclaim;	/* # times vn_reclaim called */
-	__uint32_t		vn_remove;	/* # times vn_remove called */
-	__uint32_t		vn_free;	/* # times vn_free called */
+	uint32_t		vn_active;	/* # vnodes not on free lists */
+	uint32_t		vn_alloc;	/* # times vn_alloc called */
+	uint32_t		vn_get;		/* # times vn_get called */
+	uint32_t		vn_hold;	/* # times vn_hold called */
+	uint32_t		vn_rele;	/* # times vn_rele called */
+	uint32_t		vn_reclaim;	/* # times vn_reclaim called */
+	uint32_t		vn_remove;	/* # times vn_remove called */
+	uint32_t		vn_free;	/* # times vn_free called */
 #define XFSSTAT_END_BUF			(XFSSTAT_END_VNODE_OPS+9)
-	__uint32_t		xb_get;
-	__uint32_t		xb_create;
-	__uint32_t		xb_get_locked;
-	__uint32_t		xb_get_locked_waited;
-	__uint32_t		xb_busy_locked;
-	__uint32_t		xb_miss_locked;
-	__uint32_t		xb_page_retries;
-	__uint32_t		xb_page_found;
-	__uint32_t		xb_get_read;
+	uint32_t		xb_get;
+	uint32_t		xb_create;
+	uint32_t		xb_get_locked;
+	uint32_t		xb_get_locked_waited;
+	uint32_t		xb_busy_locked;
+	uint32_t		xb_miss_locked;
+	uint32_t		xb_page_retries;
+	uint32_t		xb_page_found;
+	uint32_t		xb_get_read;
 /* Version 2 btree counters */
 #define XFSSTAT_END_ABTB_V2		(XFSSTAT_END_BUF + __XBTS_MAX)
-	__uint32_t		xs_abtb_2[__XBTS_MAX];
+	uint32_t		xs_abtb_2[__XBTS_MAX];
 #define XFSSTAT_END_ABTC_V2		(XFSSTAT_END_ABTB_V2 + __XBTS_MAX)
-	__uint32_t		xs_abtc_2[__XBTS_MAX];
+	uint32_t		xs_abtc_2[__XBTS_MAX];
 #define XFSSTAT_END_BMBT_V2		(XFSSTAT_END_ABTC_V2 + __XBTS_MAX)
-	__uint32_t		xs_bmbt_2[__XBTS_MAX];
+	uint32_t		xs_bmbt_2[__XBTS_MAX];
 #define XFSSTAT_END_IBT_V2		(XFSSTAT_END_BMBT_V2 + __XBTS_MAX)
-	__uint32_t		xs_ibt_2[__XBTS_MAX];
+	uint32_t		xs_ibt_2[__XBTS_MAX];
 #define XFSSTAT_END_FIBT_V2		(XFSSTAT_END_IBT_V2 + __XBTS_MAX)
-	__uint32_t		xs_fibt_2[__XBTS_MAX];
+	uint32_t		xs_fibt_2[__XBTS_MAX];
 #define XFSSTAT_END_RMAP_V2		(XFSSTAT_END_FIBT_V2 + __XBTS_MAX)
-	__uint32_t		xs_rmap_2[__XBTS_MAX];
+	uint32_t		xs_rmap_2[__XBTS_MAX];
 #define XFSSTAT_END_REFCOUNT		(XFSSTAT_END_RMAP_V2 + __XBTS_MAX)
-	__uint32_t		xs_refcbt_2[__XBTS_MAX];
+	uint32_t		xs_refcbt_2[__XBTS_MAX];
 #define XFSSTAT_END_XQMSTAT		(XFSSTAT_END_REFCOUNT + 6)
-	__uint32_t		xs_qm_dqreclaims;
-	__uint32_t		xs_qm_dqreclaim_misses;
-	__uint32_t		xs_qm_dquot_dups;
-	__uint32_t		xs_qm_dqcachemisses;
-	__uint32_t		xs_qm_dqcachehits;
-	__uint32_t		xs_qm_dqwants;
+	uint32_t		xs_qm_dqreclaims;
+	uint32_t		xs_qm_dqreclaim_misses;
+	uint32_t		xs_qm_dquot_dups;
+	uint32_t		xs_qm_dqcachemisses;
+	uint32_t		xs_qm_dqcachehits;
+	uint32_t		xs_qm_dqwants;
 #define XFSSTAT_END_QM			(XFSSTAT_END_XQMSTAT+2)
-	__uint32_t		xs_qm_dquot;
-	__uint32_t		xs_qm_dquot_unused;
+	uint32_t		xs_qm_dquot;
+	uint32_t		xs_qm_dquot_unused;
 /* Extra precision counters */
-	__uint64_t		xs_xstrat_bytes;
-	__uint64_t		xs_write_bytes;
-	__uint64_t		xs_read_bytes;
+	uint64_t		xs_xstrat_bytes;
+	uint64_t		xs_write_bytes;
+	uint64_t		xs_read_bytes;
 };
 
 struct xfsstats {
@@ -186,7 +186,7 @@ struct xfsstats {
  * simple wrapper for getting the array index of s struct member offset
  */
 #define XFS_STATS_CALC_INDEX(member)	\
-	(offsetof(struct __xfsstats, member) / (int)sizeof(__uint32_t))
+	(offsetof(struct __xfsstats, member) / (int)sizeof(uint32_t))
 
 
 int xfs_stats_format(struct xfsstats __percpu *stats, char *buf);
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 455a575..a19aab8 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -196,7 +196,7 @@ xfs_parseargs(
 	int			dsunit = 0;
 	int			dswidth = 0;
 	int			iosize = 0;
-	__uint8_t		iosizelog = 0;
+	uint8_t			iosizelog = 0;
 
 	/*
 	 * set up the mount name first so all the errors will refer to the
@@ -556,7 +556,7 @@ xfs_showargs(
 
 	return 0;
 }
-static __uint64_t
+static uint64_t
 xfs_max_file_offset(
 	unsigned int		blockshift)
 {
@@ -587,7 +587,7 @@ xfs_max_file_offset(
 # endif
 #endif
 
-	return (((__uint64_t)pagefactor) << bitshift) - 1;
+	return (((uint64_t)pagefactor) << bitshift) - 1;
 }
 
 /*
@@ -622,7 +622,7 @@ xfs_set_inode_alloc(
 	 * the max inode percentage.  Used only for inode32.
 	 */
 	if (mp->m_maxicount) {
-		__uint64_t	icount;
+		uint64_t	icount;
 
 		icount = sbp->sb_dblocks * sbp->sb_imax_pct;
 		do_div(icount, 100);
@@ -1088,12 +1088,12 @@ xfs_fs_statfs(
 	struct xfs_mount	*mp = XFS_M(dentry->d_sb);
 	xfs_sb_t		*sbp = &mp->m_sb;
 	struct xfs_inode	*ip = XFS_I(d_inode(dentry));
-	__uint64_t		fakeinos, id;
-	__uint64_t		icount;
-	__uint64_t		ifree;
-	__uint64_t		fdblocks;
+	uint64_t		fakeinos, id;
+	uint64_t		icount;
+	uint64_t		ifree;
+	uint64_t		fdblocks;
 	xfs_extlen_t		lsize;
-	__int64_t		ffree;
+	int64_t			ffree;
 
 	statp->f_type = XFS_SB_MAGIC;
 	statp->f_namelen = MAXNAMELEN - 1;
@@ -1116,7 +1116,7 @@ xfs_fs_statfs(
 	statp->f_bavail = statp->f_bfree;
 
 	fakeinos = statp->f_bfree << sbp->sb_inopblog;
-	statp->f_files = MIN(icount + fakeinos, (__uint64_t)XFS_MAXINUMBER);
+	statp->f_files = MIN(icount + fakeinos, (uint64_t)XFS_MAXINUMBER);
 	if (mp->m_maxicount)
 		statp->f_files = min_t(typeof(statp->f_files),
 					statp->f_files,
@@ -1129,7 +1129,7 @@ xfs_fs_statfs(
 
 	/* make sure statp->f_ffree does not underflow */
 	ffree = statp->f_files - (icount - ifree);
-	statp->f_ffree = max_t(__int64_t, ffree, 0);
+	statp->f_ffree = max_t(int64_t, ffree, 0);
 
 
 	if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
@@ -1142,7 +1142,7 @@ xfs_fs_statfs(
 STATIC void
 xfs_save_resvblks(struct xfs_mount *mp)
 {
-	__uint64_t resblks = 0;
+	uint64_t resblks = 0;
 
 	mp->m_resblks_save = mp->m_resblks;
 	xfs_reserve_blocks(mp, &resblks, NULL);
@@ -1151,7 +1151,7 @@ xfs_save_resvblks(struct xfs_mount *mp)
 STATIC void
 xfs_restore_resvblks(struct xfs_mount *mp)
 {
-	__uint64_t resblks;
+	uint64_t resblks;
 
 	if (mp->m_resblks_save) {
 		resblks = mp->m_resblks_save;
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 7c5a165..1a63919 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -251,7 +251,7 @@ TRACE_EVENT(xfs_iext_insert,
 		  __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
 		  (long)__entry->idx,
 		  __entry->startoff,
-		  (__int64_t)__entry->startblock,
+		  (int64_t)__entry->startblock,
 		  __entry->blockcount,
 		  __entry->state,
 		  (char *)__entry->caller_ip)
@@ -295,7 +295,7 @@ DECLARE_EVENT_CLASS(xfs_bmap_class,
 		  __print_flags(__entry->bmap_state, "|", XFS_BMAP_EXT_FLAGS),
 		  (long)__entry->idx,
 		  __entry->startoff,
-		  (__int64_t)__entry->startblock,
+		  (int64_t)__entry->startblock,
 		  __entry->blockcount,
 		  __entry->state,
 		  (char *)__entry->caller_ip)
@@ -1280,7 +1280,7 @@ DECLARE_EVENT_CLASS(xfs_imap_class,
 		  __entry->count,
 		  __print_symbolic(__entry->type, XFS_IO_TYPES),
 		  __entry->startoff,
-		  (__int64_t)__entry->startblock,
+		  (int64_t)__entry->startblock,
 		  __entry->blockcount)
 )
 
@@ -2057,7 +2057,7 @@ DECLARE_EVENT_CLASS(xfs_log_recover_buf_item_class,
 	TP_ARGS(log, buf_f),
 	TP_STRUCT__entry(
 		__field(dev_t, dev)
-		__field(__int64_t, blkno)
+		__field(int64_t, blkno)
 		__field(unsigned short, len)
 		__field(unsigned short, flags)
 		__field(unsigned short, size)
@@ -2106,7 +2106,7 @@ DECLARE_EVENT_CLASS(xfs_log_recover_ino_item_class,
 		__field(int, fields)
 		__field(unsigned short, asize)
 		__field(unsigned short, dsize)
-		__field(__int64_t, blkno)
+		__field(int64_t, blkno)
 		__field(int, len)
 		__field(int, boffset)
 	),
@@ -3256,8 +3256,8 @@ DECLARE_EVENT_CLASS(xfs_fsmap_class,
 		__field(xfs_agnumber_t, agno)
 		__field(xfs_fsblock_t, bno)
 		__field(xfs_filblks_t, len)
-		__field(__uint64_t, owner)
-		__field(__uint64_t, offset)
+		__field(uint64_t, owner)
+		__field(uint64_t, offset)
 		__field(unsigned int, flags)
 	),
 	TP_fast_assign(
@@ -3297,9 +3297,9 @@ DECLARE_EVENT_CLASS(xfs_getfsmap_class,
 		__field(dev_t, keydev)
 		__field(xfs_daddr_t, block)
 		__field(xfs_daddr_t, len)
-		__field(__uint64_t, owner)
-		__field(__uint64_t, offset)
-		__field(__uint64_t, flags)
+		__field(uint64_t, owner)
+		__field(uint64_t, offset)
+		__field(uint64_t, flags)
 	),
 	TP_fast_assign(
 		__entry->dev = mp->m_super->s_dev;
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index a07acbf..92db14e 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -249,7 +249,7 @@ struct xfs_rud_log_item *xfs_trans_get_rud(struct xfs_trans *tp,
 		struct xfs_rui_log_item *ruip);
 int xfs_trans_log_finish_rmap_update(struct xfs_trans *tp,
 		struct xfs_rud_log_item *rudp, enum xfs_rmap_intent_type type,
-		__uint64_t owner, int whichfork, xfs_fileoff_t startoff,
+		uint64_t owner, int whichfork, xfs_fileoff_t startoff,
 		xfs_fsblock_t startblock, xfs_filblks_t blockcount,
 		xfs_exntst_t state, struct xfs_btree_cur **pcur);
 
diff --git a/fs/xfs/xfs_trans_rmap.c b/fs/xfs/xfs_trans_rmap.c
index 9ead064..9b577be 100644
--- a/fs/xfs/xfs_trans_rmap.c
+++ b/fs/xfs/xfs_trans_rmap.c
@@ -96,7 +96,7 @@ xfs_trans_log_finish_rmap_update(
 	struct xfs_trans		*tp,
 	struct xfs_rud_log_item		*rudp,
 	enum xfs_rmap_intent_type	type,
-	__uint64_t			owner,
+	uint64_t			owner,
 	int				whichfork,
 	xfs_fileoff_t			startoff,
 	xfs_fsblock_t			startblock,

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 2/3] xfsprogs: remove double-underscore integer types
  2017-05-18  1:26 [RFCRAP 0/3?] xfs: OH GOD MY EYES! Darrick J. Wong
  2017-05-18  1:30 ` [PATCH 1/3] xfs: remove double-underscore integer types Darrick J. Wong
@ 2017-05-18  1:31 ` Darrick J. Wong
  2017-05-18  6:32   ` Christoph Hellwig
  2017-05-23  2:24   ` Eric Sandeen
  2017-05-18  1:32 ` [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot Darrick J. Wong
  2 siblings, 2 replies; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-18  1:31 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen

This is a purely mechanical patch that removes the private
__{u,}int{8,16,32,64}_t typedefs in favor of using the system
{u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
the transformation and fix the resulting whitespace and indentation
errors:

s/typedef\t__uint8_t/typedef __uint8_t\t/g
s/typedef\t__uint/typedef __uint/g
s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
s/__uint8_t\t/__uint8_t\t\t/g
s/__uint/uint/g
s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
s/__int/int/g
/^typedef.*int[0-9]*_t;$/d

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 copy/xfs_copy.c             |   14 +-
 copy/xfs_copy.h             |    2 
 db/attr.c                   |    8 +
 db/attrshort.c              |    4 -
 db/bit.c                    |    4 -
 db/bit.h                    |    2 
 db/block.c                  |    8 +
 db/check.c                  |   18 ++-
 db/convert.c                |   28 ++---
 db/faddr.c                  |   14 +-
 db/field.c                  |   44 ++++---
 db/fprint.c                 |    8 +
 db/frag.c                   |    8 +
 db/inode.c                  |   34 +++---
 db/io.c                     |    4 -
 db/io.h                     |    8 +
 db/metadump.c               |   12 +-
 db/sb.c                     |    6 +
 fsr/xfs_fsr.c               |    2 
 include/darwin.h            |   18 ++-
 include/freebsd.h           |    6 +
 include/gnukfreebsd.h       |    6 +
 include/libxcmd.h           |    6 +
 include/linux.h             |    8 +
 include/xfs_arch.h          |   22 ++--
 include/xfs_inode.h         |    4 -
 include/xfs_log_recover.h   |    2 
 include/xfs_metadump.h      |    4 -
 include/xfs_mount.h         |   22 ++--
 libhandle/handle.c          |    2 
 libhandle/jdm.c             |    2 
 libxcmd/topology.c          |   14 +-
 libxfs/darwin.c             |    2 
 libxfs/freebsd.c            |    2 
 libxfs/init.c               |    2 
 libxfs/irix.c               |    2 
 libxfs/libxfs_priv.h        |    4 -
 libxfs/linux.c              |    2 
 libxfs/logitem.c            |    2 
 libxfs/radix-tree.c         |    8 +
 libxfs/rdwr.c               |    6 +
 libxfs/util.c               |    8 +
 libxfs/xfs_alloc_btree.c    |   20 ++-
 libxfs/xfs_attr_remote.c    |    8 +
 libxfs/xfs_attr_sf.h        |   10 +-
 libxfs/xfs_bit.h            |   24 ++--
 libxfs/xfs_bmap_btree.c     |    8 +
 libxfs/xfs_btree.c          |   22 ++--
 libxfs/xfs_btree.h          |   18 ++-
 libxfs/xfs_cksum.h          |   16 +--
 libxfs/xfs_da_btree.c       |    2 
 libxfs/xfs_da_btree.h       |    8 +
 libxfs/xfs_da_format.c      |   28 ++---
 libxfs/xfs_da_format.h      |   64 +++++------
 libxfs/xfs_dir2.h           |    8 +
 libxfs/xfs_dir2_leaf.c      |   12 +-
 libxfs/xfs_dir2_priv.h      |    2 
 libxfs/xfs_dir2_sf.c        |    2 
 libxfs/xfs_format.h         |  112 +++++++++----------
 libxfs/xfs_fs.h             |   12 +-
 libxfs/xfs_ialloc.c         |    6 +
 libxfs/xfs_ialloc_btree.c   |    4 -
 libxfs/xfs_inode_buf.c      |    2 
 libxfs/xfs_inode_buf.h      |   28 ++---
 libxfs/xfs_log_format.h     |  256 ++++++++++++++++++++++---------------------
 libxfs/xfs_quota_defs.h     |    4 -
 libxfs/xfs_refcount_btree.c |    8 +
 libxfs/xfs_rmap.c           |    8 +
 libxfs/xfs_rmap.h           |    8 +
 libxfs/xfs_rmap_btree.c     |   30 +++--
 libxfs/xfs_rtbitmap.c       |    2 
 libxfs/xfs_sb.c             |    4 -
 libxfs/xfs_types.h          |   46 ++++----
 logprint/log_misc.c         |    6 +
 mdrestore/xfs_mdrestore.c   |    2 
 mkfs/proto.c                |    2 
 mkfs/xfs_mkfs.c             |   76 ++++++-------
 quota/edit.c                |   64 +++++------
 quota/free.c                |   44 ++++---
 quota/quot.c                |   24 ++--
 quota/quota.c               |    4 -
 quota/quota.h               |   12 +-
 quota/report.c              |    4 -
 quota/state.c               |    2 
 quota/util.c                |   66 ++++++-----
 repair/README               |    2 
 repair/agheader.h           |   14 +-
 repair/attr_repair.h        |   26 ++--
 repair/avl64.c              |   38 +++---
 repair/avl64.h              |   18 ++-
 repair/dinode.c             |   38 +++---
 repair/dinode.h             |    4 -
 repair/dir2.c               |    2 
 repair/globals.h            |   16 +--
 repair/incore.c             |   10 +-
 repair/incore.h             |   46 ++++----
 repair/incore_ext.c         |    6 +
 repair/incore_ino.c         |   72 ++++++------
 repair/phase2.c             |    2 
 repair/phase3.c             |    6 +
 repair/phase4.c             |    4 -
 repair/phase5.c             |   28 ++---
 repair/phase6.c             |   16 +--
 repair/phase7.c             |    6 +
 repair/progress.c           |   30 +++--
 repair/progress.h           |    4 -
 repair/rmap.c               |   18 ++-
 repair/rmap.h               |    2 
 repair/sb.c                 |   24 ++--
 repair/scan.c               |   50 ++++----
 repair/scan.h               |   12 +-
 111 files changed, 982 insertions(+), 982 deletions(-)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index a7da824..33e05df 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -43,7 +43,7 @@ unsigned int	source_sectorsize;	/* source disk sectorsize */
 
 xfs_agblock_t	first_agbno;
 
-__uint64_t	barcount[11];
+uint64_t	barcount[11];
 
 unsigned int	num_targets;
 target_control	*target;
@@ -313,7 +313,7 @@ usage(void)
 }
 
 void
-init_bar(__uint64_t source_blocks)
+init_bar(uint64_t source_blocks)
 {
 	int	i;
 
@@ -322,7 +322,7 @@ init_bar(__uint64_t source_blocks)
 }
 
 int
-bump_bar(int tenths, __uint64_t numblocks)
+bump_bar(int tenths, uint64_t numblocks)
 {
 	static char *bar[11] = {
 		" 0% ",
@@ -534,8 +534,8 @@ main(int argc, char **argv)
 	xfs_off_t	pos;
 	size_t		length;
 	int		c;
-	__uint64_t	size, sizeb;
-	__uint64_t	numblocks = 0;
+	uint64_t	size, sizeb;
+	uint64_t	numblocks = 0;
 	int		wblocks = 0;
 	int		num_threads = 0;
 	struct dioattr	d;
@@ -951,8 +951,8 @@ main(int argc, char **argv)
 	num_ags = mp->m_sb.sb_agcount;
 
 	init_bar(mp->m_sb.sb_blocksize / BBSIZE
-			* ((__uint64_t)mp->m_sb.sb_dblocks
-			    - (__uint64_t)mp->m_sb.sb_fdblocks + 10 * num_ags));
+			* ((uint64_t)mp->m_sb.sb_dblocks
+			    - (uint64_t)mp->m_sb.sb_fdblocks + 10 * num_ags));
 
 	kids = num_targets;
 
diff --git a/copy/xfs_copy.h b/copy/xfs_copy.h
index 2737068..53c6e42 100644
--- a/copy/xfs_copy.h
+++ b/copy/xfs_copy.h
@@ -76,7 +76,7 @@ typedef struct {
 
 typedef int thread_id;
 typedef int tm_index;			/* index into thread mask array */
-typedef __uint32_t thread_mask;		/* a thread mask */
+typedef uint32_t thread_mask;		/* a thread mask */
 
 typedef struct {
 	char		*name;
diff --git a/db/attr.c b/db/attr.c
index e26ac67..6f56953 100644
--- a/db/attr.c
+++ b/db/attr.c
@@ -77,16 +77,16 @@ const field_t	attr_leaf_entry_flds[] = {
 	{ "nameidx", FLDT_UINT16D, OI(LEOFF(nameidx)), C1, 0, TYP_NONE },
 	{ "flags", FLDT_UINT8X, OI(LEOFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
 	{ "incomplete", FLDT_UINT1,
-	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_INCOMPLETE_BIT - 1), C1,
+	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_INCOMPLETE_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "root", FLDT_UINT1,
-	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
+	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
 	  TYP_NONE },
 	{ "secure", FLDT_UINT1,
-	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
+	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
 	  TYP_NONE },
 	{ "local", FLDT_UINT1,
-	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_LOCAL_BIT - 1), C1, 0,
+	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_LOCAL_BIT - 1), C1, 0,
 	  TYP_NONE },
 	{ "pad2", FLDT_UINT8X, OI(LEOFF(pad2)), C1, FLD_SKIPALL, TYP_NONE },
 	{ NULL }
diff --git a/db/attrshort.c b/db/attrshort.c
index d82559c..2ef358f 100644
--- a/db/attrshort.c
+++ b/db/attrshort.c
@@ -51,10 +51,10 @@ const field_t	attr_sf_entry_flds[] = {
 	{ "valuelen", FLDT_UINT8D, OI(EOFF(valuelen)), C1, 0, TYP_NONE },
 	{ "flags", FLDT_UINT8X, OI(EOFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
 	{ "root", FLDT_UINT1,
-	  OI(EOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
+	  OI(EOFF(flags) + bitsz(uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
 	  TYP_NONE },
 	{ "secure", FLDT_UINT1,
-	  OI(EOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
+	  OI(EOFF(flags) + bitsz(uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
 	  TYP_NONE },
 	{ "name", FLDT_CHARNS, OI(EOFF(nameval)), attr_sf_entry_name_count,
 	  FLD_COUNT, TYP_NONE },
diff --git a/db/bit.c b/db/bit.c
index 24872bf..f5ebf68 100644
--- a/db/bit.c
+++ b/db/bit.c
@@ -60,7 +60,7 @@ setbit(
 	}
 }
 
-__int64_t
+int64_t
 getbitval(
 	void		*obj,
 	int		bitoff,
@@ -70,7 +70,7 @@ getbitval(
 	int		bit;
 	int		i;
 	char		*p;
-	__int64_t	rval;
+	int64_t		rval;
 	int		signext;
 	int		z1, z2, z3, z4;
 
diff --git a/db/bit.h b/db/bit.h
index 80ba24c..9fd71f4 100644
--- a/db/bit.h
+++ b/db/bit.h
@@ -25,5 +25,5 @@
 #define	BVUNSIGNED	0
 #define	BVSIGNED	1
 
-extern __int64_t	getbitval(void *obj, int bitoff, int nbits, int flags);
+extern int64_t		getbitval(void *obj, int bitoff, int nbits, int flags);
 extern void             setbitval(void *obuf, int bitoff, int nbits, void *ibuf);
diff --git a/db/block.c b/db/block.c
index 4a357ce..5ecd687 100644
--- a/db/block.c
+++ b/db/block.c
@@ -98,7 +98,7 @@ ablock_f(
 	}
 	dfsbno = bm.startblock + (bno - bm.startoff);
 	ASSERT(typtab[TYP_ATTR].typnm == TYP_ATTR);
-	set_cur(&typtab[TYP_ATTR], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
+	set_cur(&typtab[TYP_ATTR], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
 		blkbb, DB_RING_ADD, NULL);
 	return 0;
 }
@@ -128,14 +128,14 @@ daddr_f(
 	int		argc,
 	char		**argv)
 {
-	__int64_t	d;
+	int64_t		d;
 	char		*p;
 
 	if (argc == 1) {
 		dbprintf(_("current daddr is %lld\n"), iocur_top->off >> BBSHIFT);
 		return 0;
 	}
-	d = (__int64_t)strtoull(argv[1], &p, 0);
+	d = (int64_t)strtoull(argv[1], &p, 0);
 	if (*p != '\0' ||
 	    d >= mp->m_sb.sb_dblocks << (mp->m_sb.sb_blocklog - BBSHIFT)) {
 		dbprintf(_("bad daddr %s\n"), argv[1]);
@@ -197,7 +197,7 @@ dblock_f(
 	ASSERT(typtab[type].typnm == type);
 	if (nex > 1)
 		make_bbmap(&bbmap, nex, bmp);
-	set_cur(&typtab[type], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
+	set_cur(&typtab[type], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
 		nb * blkbb, DB_RING_ADD, nex > 1 ? &bbmap : NULL);
 	free(bmp);
 	return 0;
diff --git a/db/check.c b/db/check.c
index 8e618a2..81ba63a 100644
--- a/db/check.c
+++ b/db/check.c
@@ -114,8 +114,8 @@ typedef struct dirhash {
 
 static xfs_extlen_t	agffreeblks;
 static xfs_extlen_t	agflongest;
-static __uint64_t	agf_aggr_freeblks;	/* aggregate count over all */
-static __uint32_t	agfbtreeblks;
+static uint64_t	agf_aggr_freeblks;	/* aggregate count over all */
+static uint32_t	agfbtreeblks;
 static int		lazycount;
 static xfs_agino_t	agicount;
 static xfs_agino_t	agifreecount;
@@ -124,10 +124,10 @@ static int		blist_size;
 static char		**dbmap;	/* really dbm_t:8 */
 static dirhash_t	**dirhash;
 static int		error;
-static __uint64_t	fdblocks;
-static __uint64_t	frextents;
-static __uint64_t	icount;
-static __uint64_t	ifree;
+static uint64_t	fdblocks;
+static uint64_t	frextents;
+static uint64_t	icount;
+static uint64_t	ifree;
 static inodata_t	***inodata;
 static int		inodata_hash_size;
 static inodata_t	***inomap;
@@ -1187,7 +1187,7 @@ blocktrash_f(
 		goto out;
 	}
 	for (i = 0; i < count; i++) {
-		randb = (xfs_rfsblock_t)((((__int64_t)random() << 32) |
+		randb = (xfs_rfsblock_t)((((int64_t)random() << 32) |
 					 random()) % blocks);
 		for (bi = 0, agno = 0, done = 0;
 		     !done && agno < mp->m_sb.sb_agcount;
@@ -3032,7 +3032,7 @@ process_leaf_node_dir_v2(
 		}
 		if (v)
 			dbprintf(_("dir inode %lld block %u=%llu\n"), id->ino,
-				(__uint32_t)dbno,
+				(uint32_t)dbno,
 				(xfs_fsblock_t)bmp->startblock);
 		push_cur();
 		if (nex > 1)
@@ -3045,7 +3045,7 @@ process_leaf_node_dir_v2(
 			if (!sflag || v)
 				dbprintf(_("can't read block %u for directory "
 					 "inode %lld\n"),
-					(__uint32_t)dbno, id->ino);
+					(uint32_t)dbno, id->ino);
 			error++;
 			pop_cur();
 			dbno += mp->m_dir_geo->fsbcount - 1;
diff --git a/db/convert.c b/db/convert.c
index a337abe..fa4f962 100644
--- a/db/convert.c
+++ b/db/convert.c
@@ -24,13 +24,13 @@
 
 #define	M(A)	(1 << CT_ ## A)
 #define	agblock_to_bytes(x)	\
-	((__uint64_t)(x) << mp->m_sb.sb_blocklog)
+	((uint64_t)(x) << mp->m_sb.sb_blocklog)
 #define	agino_to_bytes(x)	\
-	((__uint64_t)(x) << mp->m_sb.sb_inodelog)
+	((uint64_t)(x) << mp->m_sb.sb_inodelog)
 #define	agnumber_to_bytes(x)	\
-	agblock_to_bytes((__uint64_t)(x) * mp->m_sb.sb_agblocks)
+	agblock_to_bytes((uint64_t)(x) * mp->m_sb.sb_agblocks)
 #define	daddr_to_bytes(x)	\
-	((__uint64_t)(x) << BBSHIFT)
+	((uint64_t)(x) << BBSHIFT)
 #define	fsblock_to_bytes(x)	\
 	(agnumber_to_bytes(XFS_FSB_TO_AGNO(mp, (x))) + \
 	 agblock_to_bytes(XFS_FSB_TO_AGBNO(mp, (x))))
@@ -38,7 +38,7 @@
 	(agnumber_to_bytes(XFS_INO_TO_AGNO(mp, (x))) + \
 	 agino_to_bytes(XFS_INO_TO_AGINO(mp, (x))))
 #define	inoidx_to_bytes(x)	\
-	((__uint64_t)(x) << mp->m_sb.sb_inodelog)
+	((uint64_t)(x) << mp->m_sb.sb_inodelog)
 
 typedef enum {
 	CT_NONE = -1,
@@ -68,7 +68,7 @@ typedef union {
 	xfs_agnumber_t	agnumber;
 	int		bboff;
 	int		blkoff;
-	__uint64_t	byte;
+	uint64_t	byte;
 	xfs_daddr_t	daddr;
 	xfs_fsblock_t	fsblock;
 	xfs_ino_t	ino;
@@ -76,7 +76,7 @@ typedef union {
 	int		inooff;
 } cval_t;
 
-static __uint64_t		bytevalue(ctype_t ctype, cval_t *val);
+static uint64_t		bytevalue(ctype_t ctype, cval_t *val);
 static int		convert_f(int argc, char **argv);
 static int		getvalue(char *s, ctype_t ctype, cval_t *val);
 static ctype_t		lookupcty(char *ctyname);
@@ -118,7 +118,7 @@ static const cmdinfo_t	convert_cmd =
 	{ "convert", NULL, convert_f, 3, 9, 0, "type num [type num]... type",
 	  "convert from one address form to another", NULL };
 
-static __uint64_t
+static uint64_t
 bytevalue(ctype_t ctype, cval_t *val)
 {
 	switch (ctype) {
@@ -129,9 +129,9 @@ bytevalue(ctype_t ctype, cval_t *val)
 	case CT_AGNUMBER:
 		return agnumber_to_bytes(val->agnumber);
 	case CT_BBOFF:
-		return (__uint64_t)val->bboff;
+		return (uint64_t)val->bboff;
 	case CT_BLKOFF:
-		return (__uint64_t)val->blkoff;
+		return (uint64_t)val->blkoff;
 	case CT_BYTE:
 		return val->byte;
 	case CT_DADDR:
@@ -143,7 +143,7 @@ bytevalue(ctype_t ctype, cval_t *val)
 	case CT_INOIDX:
 		return inoidx_to_bytes(val->inoidx);
 	case CT_INOOFF:
-		return (__uint64_t)val->inooff;
+		return (uint64_t)val->inooff;
 	case CT_NONE:
 	case NCTS:
 		break;
@@ -160,7 +160,7 @@ convert_f(int argc, char **argv)
 	cval_t		cvals[NCTS] = {};
 	int		i;
 	int		mask;
-	__uint64_t	v;
+	uint64_t	v;
 	ctype_t		wtype;
 
 	/* move past the "convert" command */
@@ -262,7 +262,7 @@ static int
 getvalue(char *s, ctype_t ctype, cval_t *val)
 {
 	char		*p;
-	__uint64_t	v;
+	uint64_t	v;
 
 	v = strtoull(s, &p, 0);
 	if (*p != '\0') {
@@ -286,7 +286,7 @@ getvalue(char *s, ctype_t ctype, cval_t *val)
 		val->blkoff = (int)v;
 		break;
 	case CT_BYTE:
-		val->byte = (__uint64_t)v;
+		val->byte = (uint64_t)v;
 		break;
 	case CT_DADDR:
 		val->daddr = (xfs_daddr_t)v;
diff --git a/db/faddr.c b/db/faddr.c
index 877200b..5620764 100644
--- a/db/faddr.c
+++ b/db/faddr.c
@@ -79,11 +79,11 @@ fa_attrblock(
 	typnm_t		next)
 {
 	bmap_ext_t	bm;
-	__uint32_t	bno;
+	uint32_t	bno;
 	xfs_fsblock_t	dfsbno;
 	int		nex;
 
-	bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
+	bno = (uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
 	if (bno == 0) {
 		dbprintf(_("null attribute block number, cannot set new addr\n"));
 		return;
@@ -96,7 +96,7 @@ fa_attrblock(
 	}
 	dfsbno = bm.startblock + (bno - bm.startoff);
 	ASSERT(typtab[next].typnm == next);
-	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno), blkbb,
+	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno), blkbb,
 		DB_RING_ADD, NULL);
 }
 
@@ -276,11 +276,11 @@ fa_dirblock(
 {
 	bbmap_t		bbmap;
 	bmap_ext_t	*bmp;
-	__uint32_t	bno;
+	uint32_t	bno;
 	xfs_fsblock_t	dfsbno;
 	int		nex;
 
-	bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
+	bno = (uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
 	if (bno == 0) {
 		dbprintf(_("null directory block number, cannot set new addr\n"));
 		return;
@@ -297,7 +297,7 @@ fa_dirblock(
 	ASSERT(typtab[next].typnm == next);
 	if (nex > 1)
 		make_bbmap(&bbmap, nex, bmp);
-	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
+	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
 		XFS_FSB_TO_BB(mp, mp->m_dir_geo->fsbcount), DB_RING_ADD,
 		nex > 1 ? &bbmap : NULL);
 	free(bmp);
@@ -317,7 +317,7 @@ fa_drfsbno(
 		return;
 	}
 	ASSERT(typtab[next].typnm == next);
-	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_BB(mp, bno), blkbb,
+	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_BB(mp, bno), blkbb,
 		DB_RING_ADD, NULL);
 }
 
diff --git a/db/field.c b/db/field.c
index 1968dd5..2a2197a 100644
--- a/db/field.c
+++ b/db/field.c
@@ -83,7 +83,7 @@ const ftattr_t	ftattrtab[] = {
 	  attr_sf_entry_size, FTARG_SIZE, NULL, attr_sf_entry_flds },
 	{ FLDT_ATTR_SF_HDR, "attr_sf_hdr", NULL, (char *)attr_sf_hdr_flds,
 	  SI(bitsz(struct xfs_attr_sf_hdr)), 0, NULL, attr_sf_hdr_flds },
-	{ FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
+	{ FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
 	  fa_attrblock, NULL },
 	{ FLDT_ATTRSHORT, "attrshort", NULL, (char *)attr_shortform_flds,
 	  attrshort_size, FTARG_SIZE, NULL, attr_shortform_flds },
@@ -197,7 +197,7 @@ const ftattr_t	ftattrtab[] = {
 	  SI(bitsz(struct xfs_refcount_rec)), 0, NULL, refcbt_rec_flds },
 
 /* CRC field */
-	{ FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(__uint32_t)),
+	{ FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(uint32_t)),
 	  0, NULL, NULL },
 
 	{ FLDT_DEV, "dev", fp_num, "%#x", SI(bitsz(xfs_dev_t)), 0, NULL, NULL },
@@ -212,7 +212,7 @@ const ftattr_t	ftattrtab[] = {
 	{ FLDT_DINODE_CORE, "dinode_core", NULL, (char *)inode_core_flds,
 	  SI(bitsz(xfs_dinode_t)), 0, NULL, inode_core_flds },
 	{ FLDT_DINODE_FMT, "dinode_fmt", fp_dinode_fmt, NULL,
-	  SI(bitsz(__int8_t)), 0, NULL, NULL },
+	  SI(bitsz(int8_t)), 0, NULL, NULL },
 	{ FLDT_DINODE_U, "dinode_u", NULL, (char *)inode_u_flds, inode_u_size,
 	  FTARG_SIZE|FTARG_OKEMPTY, NULL, inode_u_flds },
 	{ FLDT_DINODE_V3, "dinode_v3", NULL, (char *)inode_v3_flds,
@@ -293,7 +293,7 @@ const ftattr_t	ftattrtab[] = {
 	{ FLDT_DA3_NODE_HDR, "dir_node_hdr", NULL, (char *)da3_node_hdr_flds,
 	  SI(bitsz(struct xfs_da3_node_hdr)), 0, NULL, da3_node_hdr_flds },
 
-	{ FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
+	{ FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
 	  fa_dirblock, NULL },
 	{ FLDT_DISK_DQUOT, "disk_dquot", NULL, (char *)disk_dquot_flds,
 	  SI(bitsz(xfs_disk_dquot_t)), 0, NULL, disk_dquot_flds },
@@ -333,15 +333,15 @@ const ftattr_t	ftattrtab[] = {
 	  FTARG_SIZE, NULL, inode_crc_flds },
 	{ FLDT_INOFREE, "inofree", fp_num, "%#llx", SI(bitsz(xfs_inofree_t)), 0,
 	  NULL, NULL },
-	{ FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(__int16_t)),
+	{ FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(int16_t)),
 	  FTARG_SIGNED, NULL, NULL },
-	{ FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(__int32_t)),
+	{ FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(int32_t)),
 	  FTARG_SIGNED, NULL, NULL },
-	{ FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(__int64_t)),
+	{ FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(int64_t)),
 	  FTARG_SIGNED, NULL, NULL },
-	{ FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(__int8_t)), FTARG_SIGNED,
+	{ FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(int8_t)), FTARG_SIGNED,
 	  NULL, NULL },
-	{ FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(__int32_t)), FTARG_SIGNED,
+	{ FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(int32_t)), FTARG_SIGNED,
 	  NULL, NULL },
 	{ FLDT_QCNT, "qcnt", fp_num, "%llu", SI(bitsz(xfs_qcnt_t)), 0, NULL,
 	  NULL },
@@ -354,34 +354,34 @@ const ftattr_t	ftattrtab[] = {
 	{ FLDT_SYMLINK_CRC, "symlink", NULL, (char *)symlink_crc_flds,
 	  symlink_size, FTARG_SIZE, NULL, symlink_crc_flds },
 
-	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(__int32_t)), FTARG_SIGNED,
+	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(int32_t)), FTARG_SIGNED,
 	  NULL, NULL },
 	{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
 	  SI(bitsz(xfs_timestamp_t)), 0, NULL, timestamp_flds },
 	{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
-	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(__uint16_t)), 0, NULL,
+	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
 	  NULL },
-	{ FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(__uint16_t)), 0,
+	{ FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(uint16_t)), 0,
 	  NULL, NULL },
-	{ FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(__uint16_t)), 0,
+	{ FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(uint16_t)), 0,
 	  NULL, NULL },
-	{ FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(__uint32_t)), 0, NULL,
+	{ FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(uint32_t)), 0, NULL,
 	  NULL },
-	{ FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(__uint32_t)), 0,
+	{ FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(uint32_t)), 0,
 	  NULL, NULL },
-	{ FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(__uint32_t)), 0,
+	{ FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(uint32_t)), 0,
 	  NULL, NULL },
-	{ FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(__uint64_t)), 0,
+	{ FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(uint64_t)), 0,
 	  NULL, NULL },
-	{ FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(__uint64_t)), 0,
+	{ FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(uint64_t)), 0,
 	  NULL, NULL },
-	{ FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(__uint64_t)), 0,
+	{ FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(uint64_t)), 0,
 	  NULL, NULL },
-	{ FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(__uint8_t)), 0, NULL,
+	{ FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(uint8_t)), 0, NULL,
 	  NULL },
-	{ FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(__uint8_t)), 0, NULL,
+	{ FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(uint8_t)), 0, NULL,
 	  NULL },
-	{ FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(__uint8_t)), 0, NULL,
+	{ FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(uint8_t)), 0, NULL,
 	  NULL },
 	{ FLDT_UUID, "uuid", fp_uuid, NULL, SI(bitsz(uuid_t)), 0, NULL, NULL },
 	{ FLDT_ZZZ, NULL }
diff --git a/db/fprint.c b/db/fprint.c
index fd7e7f4..261a31e 100644
--- a/db/fprint.c
+++ b/db/fprint.c
@@ -80,7 +80,7 @@ fp_num(
 	int		bitpos;
 	int		i;
 	int		isnull;
-	__int64_t	val;
+	int64_t		val;
 
 	for (i = 0, bitpos = bit;
 	     i < count && !seenint();
@@ -100,7 +100,7 @@ fp_num(
 		else if (size > 32)
 			dbprintf(fmtstr, val);
 		else
-			dbprintf(fmtstr, (__int32_t)val);
+			dbprintf(fmtstr, (int32_t)val);
 		if (i < count - 1)
 			dbprintf(" ");
 	}
@@ -203,7 +203,7 @@ fp_crc(
 {
 	int		bitpos;
 	int		i;
-	__int64_t	val;
+	int64_t		val;
 	char		*ok;
 
 	switch (iocur_crc_valid()) {
@@ -230,7 +230,7 @@ fp_crc(
 		if (size > 32)
 			dbprintf(fmtstr, val, ok);
 		else
-			dbprintf(fmtstr, (__int32_t)val, ok);
+			dbprintf(fmtstr, (int32_t)val, ok);
 		if (i < count - 1)
 			dbprintf(" ");
 	}
diff --git a/db/frag.c b/db/frag.c
index 8005e45..d224f0c 100644
--- a/db/frag.c
+++ b/db/frag.c
@@ -42,8 +42,8 @@ typedef	struct extmap {
 
 static int		aflag;
 static int		dflag;
-static __uint64_t	extcount_actual;
-static __uint64_t	extcount_ideal;
+static uint64_t	extcount_actual;
+static uint64_t	extcount_ideal;
 static int		fflag;
 static int		lflag;
 static int		qflag;
@@ -310,8 +310,8 @@ process_inode(
 	xfs_agino_t		agino,
 	xfs_dinode_t		*dip)
 {
-	__uint64_t		actual;
-	__uint64_t		ideal;
+	uint64_t		actual;
+	uint64_t		ideal;
 	xfs_ino_t		ino;
 	int			skipa;
 	int			skipd;
diff --git a/db/inode.c b/db/inode.c
index 8b7a41e..7538ee0 100644
--- a/db/inode.c
+++ b/db/inode.c
@@ -119,49 +119,49 @@ const field_t	inode_core_flds[] = {
 	{ "dmstate", FLDT_UINT16D, OI(COFF(dmstate)), C1, 0, TYP_NONE },
 	{ "flags", FLDT_UINT16X, OI(COFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
 	{ "newrtbm", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NEWRTBM_BIT - 1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NEWRTBM_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "prealloc", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_PREALLOC_BIT - 1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_PREALLOC_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "realtime", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_REALTIME_BIT - 1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_REALTIME_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "immutable", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_IMMUTABLE_BIT-1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_IMMUTABLE_BIT-1), C1,
 	  0, TYP_NONE },
 	{ "append", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_APPEND_BIT - 1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_APPEND_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "sync", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_SYNC_BIT - 1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_SYNC_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "noatime", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NOATIME_BIT - 1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NOATIME_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "nodump", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NODUMP_BIT - 1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NODUMP_BIT - 1), C1,
 	  0, TYP_NONE },
 	{ "rtinherit", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_RTINHERIT_BIT-1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_RTINHERIT_BIT-1), C1,
 	  0, TYP_NONE },
 	{ "projinherit", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT-1),C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT-1),C1,
 	  0, TYP_NONE },
 	{ "nosymlinks", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT-1), C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT-1), C1,
 	  0, TYP_NONE },
 	{ "extsz", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_EXTSIZE_BIT-1),C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_EXTSIZE_BIT-1),C1,
 	  0, TYP_NONE },
 	{ "extszinherit", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT-1),C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT-1),C1,
 	  0, TYP_NONE },
 	{ "nodefrag", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NODEFRAG_BIT-1),C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NODEFRAG_BIT-1),C1,
 	  0, TYP_NONE },
 	{ "filestream", FLDT_UINT1,
-	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_FILESTREAM_BIT-1),C1,
+	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_FILESTREAM_BIT-1),C1,
 	  0, TYP_NONE },
 	{ "gen", FLDT_UINT32D, OI(COFF(gen)), C1, 0, TYP_NONE },
 	{ NULL }
@@ -177,10 +177,10 @@ const field_t	inode_v3_flds[] = {
 	{ "inumber", FLDT_INO, OI(COFF(ino)), C1, 0, TYP_NONE },
 	{ "uuid", FLDT_UUID, OI(COFF(uuid)), C1, 0, TYP_NONE },
 	{ "reflink", FLDT_UINT1,
-	  OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
+	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
 	  0, TYP_NONE },
 	{ "cowextsz", FLDT_UINT1,
-	  OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
+	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
 	  0, TYP_NONE },
 	{ NULL }
 };
diff --git a/db/io.c b/db/io.c
index 9918a51..f93c8af 100644
--- a/db/io.c
+++ b/db/io.c
@@ -536,7 +536,7 @@ write_cur(void)
 void
 set_cur(
 	const typ_t	*t,
-	__int64_t	d,
+	int64_t		d,
 	int		c,
 	int		ring_flag,
 	bbmap_t		*bbmap)
@@ -544,7 +544,7 @@ set_cur(
 	struct xfs_buf	*bp;
 	xfs_ino_t	dirino;
 	xfs_ino_t	ino;
-	__uint16_t	mode;
+	uint16_t	mode;
 	const struct xfs_buf_ops *ops = t ? t->bops : NULL;
 
 	if (iocur_sp < 0) {
diff --git a/db/io.h b/db/io.h
index b415b82..0b3cba4 100644
--- a/db/io.h
+++ b/db/io.h
@@ -25,7 +25,7 @@ typedef struct bbmap {
 } bbmap_t;
 
 typedef struct iocur {
-	__int64_t		bb;	/* BB number in filesystem of buf */
+	int64_t			bb;	/* BB number in filesystem of buf */
 	int			blen;	/* length of "buf", bb's */
 	int			boff;	/* data - buf */
 	void			*buf;	/* base address of buffer */
@@ -33,7 +33,7 @@ typedef struct iocur {
 	xfs_ino_t		dirino;	/* current directory inode number */
 	xfs_ino_t		ino;	/* current inode number */
 	int			len;	/* length of "data", bytes */
-	__uint16_t		mode;	/* current inode's mode */
+	uint16_t		mode;	/* current inode's mode */
 	xfs_off_t		off;	/* fs offset of "data" in bytes */
 	const struct typ	*typ;	/* type of "data" */
 	bbmap_t			*bbmap;	/* map daddr if fragmented */
@@ -57,9 +57,9 @@ extern void	off_cur(int off, int len);
 extern void	pop_cur(void);
 extern void	print_iocur(char *tag, iocur_t *ioc);
 extern void	push_cur(void);
-extern int	read_buf(__int64_t daddr, int count, void *bufp);
+extern int	read_buf(int64_t daddr, int count, void *bufp);
 extern void     write_cur(void);
-extern void	set_cur(const struct typ *t, __int64_t d, int c, int ring_add,
+extern void	set_cur(const struct typ *t, int64_t d, int c, int ring_add,
 			bbmap_t *bbmap);
 extern void     ring_add(void);
 extern void	set_iocur_type(const struct typ *t);
diff --git a/db/metadump.c b/db/metadump.c
index 66952f6..06da7c6 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -175,7 +175,7 @@ write_index(void)
 static int
 write_buf_segment(
 	char		*data,
-	__int64_t	off,
+	int64_t		off,
 	int		len)
 {
 	int		i;
@@ -1256,7 +1256,7 @@ process_sf_dir(
 {
 	struct xfs_dir2_sf_hdr	*sfp;
 	xfs_dir2_sf_entry_t	*sfep;
-	__uint64_t		ino_dir_size;
+	uint64_t		ino_dir_size;
 	int			i;
 
 	sfp = (struct xfs_dir2_sf_hdr *)XFS_DFORK_DPTR(dip);
@@ -1322,7 +1322,7 @@ process_sf_dir(
 static void
 obfuscate_path_components(
 	char			*buf,
-	__uint64_t		len)
+	uint64_t		len)
 {
 	unsigned char		*comp = (unsigned char *)buf;
 	unsigned char		*end = comp + len;
@@ -1359,7 +1359,7 @@ static void
 process_sf_symlink(
 	xfs_dinode_t		*dip)
 {
-	__uint64_t		len;
+	uint64_t		len;
 	char			*buf;
 
 	len = be64_to_cpu(dip->di_size);
@@ -1631,7 +1631,7 @@ process_attr_block(
 	xfs_attr_leaf_entry_t 		*entry;
 	xfs_attr_leaf_name_local_t 	*local;
 	xfs_attr_leaf_name_remote_t 	*remote;
-	__uint32_t			bs = mp->m_sb.sb_blocksize;
+	uint32_t			bs = mp->m_sb.sb_blocksize;
 	char				*first_name;
 
 
@@ -2270,7 +2270,7 @@ process_inode(
 	return success;
 }
 
-static __uint32_t	inodes_copied = 0;
+static uint32_t	inodes_copied = 0;
 
 static int
 copy_inode_chunk(
diff --git a/db/sb.c b/db/sb.c
index 8e7722c..f19248d 100644
--- a/db/sb.c
+++ b/db/sb.c
@@ -606,7 +606,7 @@ version_help(void)
 }
 
 static int
-do_version(xfs_agnumber_t agno, __uint16_t version, __uint32_t features)
+do_version(xfs_agnumber_t agno, uint16_t version, uint32_t features)
 {
 	xfs_sb_t	tsb;
 
@@ -710,8 +710,8 @@ version_f(
 	int		argc,
 	char		**argv)
 {
-	__uint16_t	version = 0;
-	__uint32_t	features = 0;
+	uint16_t	version = 0;
+	uint32_t	features = 0;
 	xfs_agnumber_t	ag;
 
 	if (argc == 2) {	/* WRITE VERSION */
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 517b75f..d4846a3 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -54,7 +54,7 @@ struct getbmap  *outmap = NULL;
 int             outmap_size = 0;
 int		RealUid;
 int		tmp_agi;
-static __int64_t	minimumfree = 2048;
+static int64_t		minimumfree = 2048;
 
 #define MNTTYPE_XFS             "xfs"
 
diff --git a/include/darwin.h b/include/darwin.h
index 7bbd576..51031c4 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -125,15 +125,15 @@ typedef signed int		__s32;
 typedef unsigned long long int	__u64;
 typedef signed long long int	__s64;
 
-#define __int8_t	int8_t
-#define __int16_t	int16_t
-#define __int32_t	int32_t
-#define __int32_t	int32_t
-#define __int64_t	int64_t
-#define __uint8_t	u_int8_t
-#define __uint16_t	u_int16_t
-#define __uint32_t	u_int32_t
-#define __uint64_t	u_int64_t
+#define int8_t		int8_t
+#define int16_t		int16_t
+#define int32_t		int32_t
+#define int32_t		int32_t
+#define int64_t		int64_t
+#define uint8_t		u_int8_t
+#define uint16_t	u_int16_t
+#define uint32_t	u_int32_t
+#define uint64_t	u_int64_t
 
 typedef off_t		xfs_off_t;
 typedef u_int64_t	xfs_ino_t;
diff --git a/include/freebsd.h b/include/freebsd.h
index fb318b8..f52ed0a 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -50,9 +50,9 @@ typedef unsigned long long int	__u64;
 typedef signed long long int	__s64;
 
 typedef off_t		xfs_off_t;
-typedef __uint64_t	xfs_ino_t;
-typedef __uint32_t	xfs_dev_t;
-typedef __int64_t	xfs_daddr_t;
+typedef uint64_t	xfs_ino_t;
+typedef uint32_t	xfs_dev_t;
+typedef int64_t		xfs_daddr_t;
 typedef __u32		xfs_nlink_t;
 
 #define	O_LARGEFILE	0
diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
index 6916e65..1db3f4f 100644
--- a/include/gnukfreebsd.h
+++ b/include/gnukfreebsd.h
@@ -46,9 +46,9 @@ typedef unsigned long long int	__u64;
 typedef signed long long int	__s64;
 
 typedef off_t		xfs_off_t;
-typedef __uint64_t	xfs_ino_t;
-typedef __uint32_t	xfs_dev_t;
-typedef __int64_t	xfs_daddr_t;
+typedef uint64_t	xfs_ino_t;
+typedef uint32_t	xfs_dev_t;
+typedef int64_t		xfs_daddr_t;
 typedef __u32		xfs_nlink_t;
 
 #define HAVE_FID	1
diff --git a/include/libxcmd.h b/include/libxcmd.h
index e8d2ffc..6806380 100644
--- a/include/libxcmd.h
+++ b/include/libxcmd.h
@@ -42,10 +42,10 @@ get_topology(
 extern void
 calc_default_ag_geometry(
 	int		blocklog,
-	__uint64_t	dblocks,
+	uint64_t	dblocks,
 	int		multidisk,
-	__uint64_t	*agsize,
-	__uint64_t	*agcount);
+	uint64_t	*agsize,
+	uint64_t	*agcount);
 
 extern int
 check_overwrite(
diff --git a/include/linux.h b/include/linux.h
index 181d25c..4726915 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -140,7 +140,7 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
 static __inline__ int
 platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 {
-	__uint64_t range[2] = { start, len };
+	uint64_t range[2] = { start, len };
 
 	if (ioctl(fd, BLKDISCARD, &range) < 0)
 		return errno;
@@ -152,9 +152,9 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
 #define EFSBADCRC	EBADMSG	/* Bad CRC detected */
 
 typedef off_t		xfs_off_t;
-typedef __uint64_t	xfs_ino_t;
-typedef __uint32_t	xfs_dev_t;
-typedef __int64_t	xfs_daddr_t;
+typedef uint64_t	xfs_ino_t;
+typedef uint32_t	xfs_dev_t;
+typedef int64_t		xfs_daddr_t;
 typedef __u32		xfs_nlink_t;
 
 /**
diff --git a/include/xfs_arch.h b/include/xfs_arch.h
index 12cd43e..186cadb 100644
--- a/include/xfs_arch.h
+++ b/include/xfs_arch.h
@@ -244,39 +244,39 @@ static inline void be64_add_cpu(__be64 *a, __s64 b)
 	*a = cpu_to_be64(be64_to_cpu(*a) + b);
 }
 
-static inline __uint16_t get_unaligned_be16(void *p)
+static inline uint16_t get_unaligned_be16(void *p)
 {
-	__uint8_t *__p = p;
+	uint8_t *__p = p;
 	return __p[0] << 8 | __p[1];
 }
 
-static inline __uint32_t get_unaligned_be32(void *p)
+static inline uint32_t get_unaligned_be32(void *p)
 {
-	__uint8_t *__p = p;
+	uint8_t *__p = p;
         return __p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3];
 }
 
-static inline __uint64_t get_unaligned_be64(void *p)
+static inline uint64_t get_unaligned_be64(void *p)
 {
-	return (__uint64_t)get_unaligned_be32(p) << 32 |
+	return (uint64_t)get_unaligned_be32(p) << 32 |
 			   get_unaligned_be32(p + 4);
 }
 
-static inline void put_unaligned_be16(__uint16_t val, void *p)
+static inline void put_unaligned_be16(uint16_t val, void *p)
 {
-	__uint8_t *__p = p;
+	uint8_t *__p = p;
 	*__p++ = val >> 8;
 	*__p++ = val;
 }
 
-static inline void put_unaligned_be32(__uint32_t val, void *p)
+static inline void put_unaligned_be32(uint32_t val, void *p)
 {
-	__uint8_t *__p = p;
+	uint8_t *__p = p;
 	put_unaligned_be16(val >> 16, __p);
 	put_unaligned_be16(val, __p + 2);
 }
 
-static inline void put_unaligned_be64(__uint64_t val, void *p)
+static inline void put_unaligned_be64(uint64_t val, void *p)
 {
 	put_unaligned_be32(val >> 32, p);
 	put_unaligned_be32(val, p + 4);
diff --git a/include/xfs_inode.h b/include/xfs_inode.h
index fb6b542..8766024 100644
--- a/include/xfs_inode.h
+++ b/include/xfs_inode.h
@@ -123,8 +123,8 @@ xfs_get_projid(struct xfs_icdinode *id)
 static inline void
 xfs_set_projid(struct xfs_icdinode *id, prid_t projid)
 {
-	id->di_projid_hi = (__uint16_t) (projid >> 16);
-	id->di_projid_lo = (__uint16_t) (projid & 0xffff);
+	id->di_projid_hi = (uint16_t) (projid >> 16);
+	id->di_projid_lo = (uint16_t) (projid & 0xffff);
 }
 
 static inline bool xfs_is_reflink_inode(struct xfs_inode *ip)
diff --git a/include/xfs_log_recover.h b/include/xfs_log_recover.h
index 7582676..0d09862 100644
--- a/include/xfs_log_recover.h
+++ b/include/xfs_log_recover.h
@@ -26,7 +26,7 @@
 #define XLOG_RHASH_SIZE	16
 #define XLOG_RHASH_SHIFT 2
 #define XLOG_RHASH(tid)	\
-	((((__uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
+	((((uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
 
 #define XLOG_MAX_REGIONS_IN_ITEM   (XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK / 2 + 1)
 
diff --git a/include/xfs_metadump.h b/include/xfs_metadump.h
index f4be51b..90d6cb1 100644
--- a/include/xfs_metadump.h
+++ b/include/xfs_metadump.h
@@ -24,8 +24,8 @@
 typedef struct xfs_metablock {
 	__be32		mb_magic;
 	__be16		mb_count;
-	__uint8_t	mb_blocklog;
-	__uint8_t	mb_reserved;
+	uint8_t		mb_blocklog;
+	uint8_t		mb_reserved;
 	/* followed by an array of xfs_daddr_t */
 } xfs_metablock_t;
 
diff --git a/include/xfs_mount.h b/include/xfs_mount.h
index 5ff24eb..5b323bb 100644
--- a/include/xfs_mount.h
+++ b/include/xfs_mount.h
@@ -48,12 +48,12 @@ typedef struct xfs_mount {
 #define m_dev		m_ddev_targp
 #define m_logdev	m_logdev_targp
 #define m_rtdev		m_rtdev_targp
-	__uint8_t		m_dircook_elog;	/* log d-cookie entry bits */
-	__uint8_t		m_blkbit_log;	/* blocklog + NBBY */
-	__uint8_t		m_blkbb_log;	/* blocklog - BBSHIFT */
-	__uint8_t		m_sectbb_log;	/* sectorlog - BBSHIFT */
-	__uint8_t		m_agno_log;	/* log #ag's */
-	__uint8_t		m_agino_log;	/* #bits for agino in inum */
+	uint8_t			m_dircook_elog;	/* log d-cookie entry bits */
+	uint8_t			m_blkbit_log;	/* blocklog + NBBY */
+	uint8_t			m_blkbb_log;	/* blocklog - BBSHIFT */
+	uint8_t			m_sectbb_log;	/* sectorlog - BBSHIFT */
+	uint8_t			m_agno_log;	/* log #ag's */
+	uint8_t			m_agino_log;	/* #bits for agino in inum */
 	uint			m_inode_cluster_size;/* min inode buf size */
 	uint			m_blockmask;	/* sb_blocksize-1 */
 	uint			m_blockwsize;	/* sb_blocksize in words */
@@ -88,7 +88,7 @@ typedef struct xfs_mount {
 	int			m_litino;	/* size of inode union area */
 	int			m_inoalign_mask;/* mask sb_inoalignmt if used */
 	struct xfs_trans_resv	m_resv;		/* precomputed res values */
-	__uint64_t		m_maxicount;	/* maximum inode count */
+	uint64_t		m_maxicount;	/* maximum inode count */
 	int			m_dalign;	/* stripe unit */
 	int			m_swidth;	/* stripe width */
 	int			m_sinoalign;	/* stripe unit inode alignmnt */
@@ -144,12 +144,12 @@ typedef struct xfs_perag {
 	char		pagi_init;	/* this agi's entry is initialized */
 	char		pagf_metadata;	/* the agf is preferred to be metadata */
 	char		pagi_inodeok;	/* The agi is ok for inodes */
-	__uint8_t	pagf_levels[XFS_BTNUM_AGF];
+	uint8_t		pagf_levels[XFS_BTNUM_AGF];
 					/* # of levels in bno & cnt btree */
-	__uint32_t	pagf_flcount;	/* count of blocks in freelist */
+	uint32_t	pagf_flcount;	/* count of blocks in freelist */
 	xfs_extlen_t	pagf_freeblks;	/* total free blocks */
 	xfs_extlen_t	pagf_longest;	/* longest free space */
-	__uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
+	uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
 	xfs_agino_t	pagi_freecount;	/* number of free inodes */
 	xfs_agino_t	pagi_count;	/* number of allocated inodes */
 
@@ -169,7 +169,7 @@ typedef struct xfs_perag {
 	struct xfs_ag_resv	pag_agfl_resv;
 
 	/* reference count */
-	__uint8_t	pagf_refcount_level;
+	uint8_t		pagf_refcount_level;
 } xfs_perag_t;
 
 static inline struct xfs_ag_resv *
diff --git a/libhandle/handle.c b/libhandle/handle.c
index 236ed22..00127b3 100644
--- a/libhandle/handle.c
+++ b/libhandle/handle.c
@@ -232,7 +232,7 @@ obj_to_handle(
 {
 	char		hbuf [MAXHANSIZ];
 	int		ret;
-	__uint32_t	handlen;
+	uint32_t	handlen;
 	xfs_fsop_handlereq_t hreq;
 
 	if (opcode == XFS_IOC_FD_TO_HANDLE) {
diff --git a/libhandle/jdm.c b/libhandle/jdm.c
index e52f5d8..821061b 100644
--- a/libhandle/jdm.c
+++ b/libhandle/jdm.c
@@ -36,7 +36,7 @@ typedef struct filehandle {
 	fshandle_t fh_fshandle;		/* handle of fs containing this inode */
 	int16_t fh_sz_following;	/* bytes in handle after this member */
 	char fh_pad[FILEHANDLE_SZ_PAD];	/* padding, must be zeroed */
-	__uint32_t fh_gen;		/* generation count */
+	uint32_t fh_gen;		/* generation count */
 	xfs_ino_t fh_ino;		/* 64 bit ino */
 } filehandle_t;
 
diff --git a/libxcmd/topology.c b/libxcmd/topology.c
index 8b0276a..f66dd1b 100644
--- a/libxcmd/topology.c
+++ b/libxcmd/topology.c
@@ -23,19 +23,19 @@
 #endif /* ENABLE_BLKID */
 #include "xfs_multidisk.h"
 
-#define TERABYTES(count, blog)	((__uint64_t)(count) << (40 - (blog)))
-#define GIGABYTES(count, blog)	((__uint64_t)(count) << (30 - (blog)))
-#define MEGABYTES(count, blog)	((__uint64_t)(count) << (20 - (blog)))
+#define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
+#define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
+#define MEGABYTES(count, blog)	((uint64_t)(count) << (20 - (blog)))
 
 void
 calc_default_ag_geometry(
 	int		blocklog,
-	__uint64_t	dblocks,
+	uint64_t	dblocks,
 	int		multidisk,
-	__uint64_t	*agsize,
-	__uint64_t	*agcount)
+	uint64_t	*agsize,
+	uint64_t	*agcount)
 {
-	__uint64_t	blocks = 0;
+	uint64_t	blocks = 0;
 	int		shift = 0;
 
 	/*
diff --git a/libxfs/darwin.c b/libxfs/darwin.c
index 74507e8..16d2c35 100644
--- a/libxfs/darwin.c
+++ b/libxfs/darwin.c
@@ -68,7 +68,7 @@ platform_flush_device(int fd, dev_t device)
 void
 platform_findsizes(char *path, int fd, long long *sz, int *bsz)
 {
-	__uint64_t	size;
+	uint64_t	size;
 	struct stat	st;
 
 	if (fstat(fd, &st) < 0) {
diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c
index 4667d1f..d7bca14 100644
--- a/libxfs/freebsd.c
+++ b/libxfs/freebsd.c
@@ -109,7 +109,7 @@ void
 platform_findsizes(char *path, int fd, long long *sz, int *bsz)
 {
 	struct stat	st;
-	__int64_t	size;
+	int64_t		size;
 	u_int		ssize;
 
 	if (fstat(fd, &st) < 0) {
diff --git a/libxfs/init.c b/libxfs/init.c
index 85e0d15..27a7600 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -546,7 +546,7 @@ libxfs_initialize_perag(
 		 * the max inode percentage.
 		 */
 		if (mp->m_maxicount) {
-			__uint64_t	icount;
+			uint64_t	icount;
 
 			icount = sbp->sb_dblocks * sbp->sb_imax_pct;
 			do_div(icount, 100);
diff --git a/libxfs/irix.c b/libxfs/irix.c
index 32fcb3e..0f14aec 100644
--- a/libxfs/irix.c
+++ b/libxfs/irix.c
@@ -22,7 +22,7 @@
 
 int platform_has_uuid = 0;
 extern char *progname;
-extern __int64_t findsize(char *);
+extern int64_t findsize(char *);
 
 int
 platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 0b4c489..a3912e7 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h
@@ -296,8 +296,8 @@ roundup_pow_of_two(uint v)
 	return 0;
 }
 
-static inline __uint64_t
-roundup_64(__uint64_t x, __uint32_t y)
+static inline uint64_t
+roundup_64(uint64_t x, uint32_t y)
 {
 	x += y - 1;
 	do_div(x, y);
diff --git a/libxfs/linux.c b/libxfs/linux.c
index 69f04ad..0bace3e 100644
--- a/libxfs/linux.c
+++ b/libxfs/linux.c
@@ -163,7 +163,7 @@ void
 platform_findsizes(char *path, int fd, long long *sz, int *bsz)
 {
 	struct stat	st;
-	__uint64_t	size;
+	uint64_t	size;
 	int		error;
 
 	if (fstat(fd, &st) < 0) {
diff --git a/libxfs/logitem.c b/libxfs/logitem.c
index 7e93f60..466b442 100644
--- a/libxfs/logitem.c
+++ b/libxfs/logitem.c
@@ -121,7 +121,7 @@ xfs_buf_item_init(
 	bip->bli_item.li_mountp = mp;
 	bip->bli_buf = bp;
 	bip->bli_format.blf_type = XFS_LI_BUF;
-	bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp);
+	bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
 	bip->bli_format.blf_len = (unsigned short)BTOBB(XFS_BUF_COUNT(bp));
 	XFS_BUF_SET_FSPRIVATE(bp, bip);
 }
diff --git a/libxfs/radix-tree.c b/libxfs/radix-tree.c
index eef9c36..3f0257f 100644
--- a/libxfs/radix-tree.c
+++ b/libxfs/radix-tree.c
@@ -66,21 +66,21 @@ static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH];
 static inline void tag_set(struct radix_tree_node *node, unsigned int tag,
 		int offset)
 {
-	*((__uint32_t *)node->tags[tag] + (offset >> 5)) |= (1 << (offset & 31));
+	*((uint32_t *)node->tags[tag] + (offset >> 5)) |= (1 << (offset & 31));
 }
 
 static inline void tag_clear(struct radix_tree_node *node, unsigned int tag,
 		int offset)
 {
-	__uint32_t 	*p = (__uint32_t*)node->tags[tag] + (offset >> 5);
-	__uint32_t 	m = 1 << (offset & 31);
+	uint32_t 	*p = (uint32_t*)node->tags[tag] + (offset >> 5);
+	uint32_t 	m = 1 << (offset & 31);
 	*p &= ~m;
 }
 
 static inline int tag_get(struct radix_tree_node *node, unsigned int tag,
 		int offset)
 {
-	return 1 & (((const __uint32_t *)node->tags[tag])[offset >> 5] >> (offset & 31));
+	return 1 & (((const uint32_t *)node->tags[tag])[offset >> 5] >> (offset & 31));
 }
 
 /*
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 6c8a192..43b4f1d 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -118,9 +118,9 @@ static void unmount_record(void *p)
 	xlog_op_header_t	*op = (xlog_op_header_t *)p;
 	/* the data section must be 32 bit size aligned */
 	struct {
-	    __uint16_t magic;
-	    __uint16_t pad1;
-	    __uint32_t pad2; /* may as well make it 64 bits */
+	    uint16_t magic;
+	    uint16_t pad1;
+	    uint32_t pad2; /* may as well make it 64 bits */
 	} magic = { XLOG_UNMOUNT_TYPE, 0, 0 };
 
 	memset(p, 0, BBSIZE);
diff --git a/libxfs/util.c b/libxfs/util.c
index dcfca39..7938e31 100644
--- a/libxfs/util.c
+++ b/libxfs/util.c
@@ -170,8 +170,8 @@ libxfs_trans_ichgtime(
 	if (flags & XFS_ICHGTIME_CHG)
 		VFS_I(ip)->i_ctime = tv;
 	if (flags & XFS_ICHGTIME_CREATE) {
-		ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec;
-		ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec;
+		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
+		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
 	}
 }
 
@@ -261,8 +261,8 @@ libxfs_ialloc(
 		ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid));
 		VFS_I(ip)->i_version = 1;
 		ip->i_d.di_flags2 = 0;
-		ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec;
-		ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec;
+		ip->i_d.di_crtime.t_sec = (int32_t)VFS_I(ip)->i_mtime.tv_sec;
+		ip->i_d.di_crtime.t_nsec = (int32_t)VFS_I(ip)->i_mtime.tv_nsec;
 	}
 
 	flags = XFS_ILOG_CORE;
diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c
index e11d89a..8e77e6e 100644
--- a/libxfs/xfs_alloc_btree.c
+++ b/libxfs/xfs_alloc_btree.c
@@ -251,7 +251,7 @@ xfs_allocbt_init_ptr_from_cur(
 	ptr->s = agf->agf_roots[cur->bc_btnum];
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_bnobt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
@@ -259,42 +259,42 @@ xfs_bnobt_key_diff(
 	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
 	xfs_alloc_key_t		*kp = &key->alloc;
 
-	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
+	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_cntbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
 {
 	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
 	xfs_alloc_key_t		*kp = &key->alloc;
-	__int64_t		diff;
+	int64_t			diff;
 
-	diff = (__int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
+	diff = (int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
 	if (diff)
 		return diff;
 
-	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
+	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_bnobt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	return (__int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
+	return (int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
 			  be32_to_cpu(k2->alloc.ar_startblock);
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_cntbt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	__int64_t		diff;
+	int64_t			diff;
 
 	diff =  be32_to_cpu(k1->alloc.ar_blockcount) -
 		be32_to_cpu(k2->alloc.ar_blockcount);
diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c
index abe1705..1f25e36 100644
--- a/libxfs/xfs_attr_remote.c
+++ b/libxfs/xfs_attr_remote.c
@@ -248,7 +248,7 @@ xfs_attr_rmtval_copyout(
 	xfs_ino_t	ino,
 	int		*offset,
 	int		*valuelen,
-	__uint8_t	**dst)
+	uint8_t		**dst)
 {
 	char		*src = bp->b_addr;
 	xfs_daddr_t	bno = bp->b_bn;
@@ -296,7 +296,7 @@ xfs_attr_rmtval_copyin(
 	xfs_ino_t	ino,
 	int		*offset,
 	int		*valuelen,
-	__uint8_t	**src)
+	uint8_t		**src)
 {
 	char		*dst = bp->b_addr;
 	xfs_daddr_t	bno = bp->b_bn;
@@ -350,7 +350,7 @@ xfs_attr_rmtval_get(
 	struct xfs_mount	*mp = args->dp->i_mount;
 	struct xfs_buf		*bp;
 	xfs_dablk_t		lblkno = args->rmtblkno;
-	__uint8_t		*dst = args->value;
+	uint8_t			*dst = args->value;
 	int			valuelen;
 	int			nmap;
 	int			error;
@@ -416,7 +416,7 @@ xfs_attr_rmtval_set(
 	struct xfs_bmbt_irec	map;
 	xfs_dablk_t		lblkno;
 	xfs_fileoff_t		lfileoff = 0;
-	__uint8_t		*src = args->value;
+	uint8_t			*src = args->value;
 	int			blkcnt;
 	int			valuelen;
 	int			nmap;
diff --git a/libxfs/xfs_attr_sf.h b/libxfs/xfs_attr_sf.h
index 90928bb..afd684a 100644
--- a/libxfs/xfs_attr_sf.h
+++ b/libxfs/xfs_attr_sf.h
@@ -31,10 +31,10 @@ typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t;
  * We generate this then sort it, attr_list() must return things in hash-order.
  */
 typedef struct xfs_attr_sf_sort {
-	__uint8_t	entno;		/* entry number in original list */
-	__uint8_t	namelen;	/* length of name value (no null) */
-	__uint8_t	valuelen;	/* length of value */
-	__uint8_t	flags;		/* flags bits (see xfs_attr_leaf.h) */
+	uint8_t		entno;		/* entry number in original list */
+	uint8_t		namelen;	/* length of name value (no null) */
+	uint8_t		valuelen;	/* length of value */
+	uint8_t		flags;		/* flags bits (see xfs_attr_leaf.h) */
 	xfs_dahash_t	hash;		/* this entry's hash value */
 	unsigned char	*name;		/* name value, pointer into buffer */
 } xfs_attr_sf_sort_t;
@@ -42,7 +42,7 @@ typedef struct xfs_attr_sf_sort {
 #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen)	/* space name/value uses */ \
 	(((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen)))
 #define XFS_ATTR_SF_ENTSIZE_MAX			/* max space for name&value */ \
-	((1 << (NBBY*(int)sizeof(__uint8_t))) - 1)
+	((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
 #define XFS_ATTR_SF_ENTSIZE(sfep)		/* space an entry uses */ \
 	((int)sizeof(xfs_attr_sf_entry_t)-1 + (sfep)->namelen+(sfep)->valuelen)
 #define XFS_ATTR_SF_NEXTENTRY(sfep)		/* next entry in struct */ \
diff --git a/libxfs/xfs_bit.h b/libxfs/xfs_bit.h
index e1649c0..61c6b20 100644
--- a/libxfs/xfs_bit.h
+++ b/libxfs/xfs_bit.h
@@ -25,47 +25,47 @@
 /*
  * masks with n high/low bits set, 64-bit values
  */
-static inline __uint64_t xfs_mask64hi(int n)
+static inline uint64_t xfs_mask64hi(int n)
 {
-	return (__uint64_t)-1 << (64 - (n));
+	return (uint64_t)-1 << (64 - (n));
 }
-static inline __uint32_t xfs_mask32lo(int n)
+static inline uint32_t xfs_mask32lo(int n)
 {
-	return ((__uint32_t)1 << (n)) - 1;
+	return ((uint32_t)1 << (n)) - 1;
 }
-static inline __uint64_t xfs_mask64lo(int n)
+static inline uint64_t xfs_mask64lo(int n)
 {
-	return ((__uint64_t)1 << (n)) - 1;
+	return ((uint64_t)1 << (n)) - 1;
 }
 
 /* Get high bit set out of 32-bit argument, -1 if none set */
-static inline int xfs_highbit32(__uint32_t v)
+static inline int xfs_highbit32(uint32_t v)
 {
 	return fls(v) - 1;
 }
 
 /* Get high bit set out of 64-bit argument, -1 if none set */
-static inline int xfs_highbit64(__uint64_t v)
+static inline int xfs_highbit64(uint64_t v)
 {
 	return fls64(v) - 1;
 }
 
 /* Get low bit set out of 32-bit argument, -1 if none set */
-static inline int xfs_lowbit32(__uint32_t v)
+static inline int xfs_lowbit32(uint32_t v)
 {
 	return ffs(v) - 1;
 }
 
 /* Get low bit set out of 64-bit argument, -1 if none set */
-static inline int xfs_lowbit64(__uint64_t v)
+static inline int xfs_lowbit64(uint64_t v)
 {
-	__uint32_t	w = (__uint32_t)v;
+	uint32_t	w = (uint32_t)v;
 	int		n = 0;
 
 	if (w) {	/* lower bits */
 		n = ffs(w);
 	} else {	/* upper bits */
-		w = (__uint32_t)(v >> 32);
+		w = (uint32_t)(v >> 32);
 		if (w) {
 			n = ffs(w);
 			if (n)
diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c
index c48cbec..9ee40d8 100644
--- a/libxfs/xfs_bmap_btree.c
+++ b/libxfs/xfs_bmap_btree.c
@@ -91,8 +91,8 @@ xfs_bmdr_to_bmbt(
  */
 STATIC void
 __xfs_bmbt_get_all(
-		__uint64_t l0,
-		__uint64_t l1,
+		uint64_t l0,
+		uint64_t l1,
 		xfs_bmbt_irec_t *s)
 {
 	int	ext_flag;
@@ -585,12 +585,12 @@ xfs_bmbt_init_ptr_from_cur(
 	ptr->l = 0;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_bmbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
 {
-	return (__int64_t)be64_to_cpu(key->bmbt.br_startoff) -
+	return (int64_t)be64_to_cpu(key->bmbt.br_startoff) -
 				      cur->bc_rec.b.br_startoff;
 }
 
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index a9e1fa8..646f2bf 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c
@@ -39,7 +39,7 @@ kmem_zone_t	*xfs_btree_cur_zone;
 /*
  * Btree magic numbers.
  */
-static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
+static const uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
 	{ XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, 0, XFS_BMAP_MAGIC, XFS_IBT_MAGIC,
 	  XFS_FIBT_MAGIC, 0 },
 	{ XFS_ABTB_CRC_MAGIC, XFS_ABTC_CRC_MAGIC, XFS_RMAP_CRC_MAGIC,
@@ -47,12 +47,12 @@ static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
 	  XFS_REFC_CRC_MAGIC }
 };
 
-__uint32_t
+uint32_t
 xfs_btree_magic(
 	int			crc,
 	xfs_btnum_t		btnum)
 {
-	__uint32_t		magic = xfs_magics[crc][btnum];
+	uint32_t		magic = xfs_magics[crc][btnum];
 
 	/* Ensure we asked for crc for crc-only magics. */
 	ASSERT(magic != 0);
@@ -774,14 +774,14 @@ xfs_btree_lastrec(
  */
 void
 xfs_btree_offsets(
-	__int64_t	fields,		/* bitmask of fields */
+	int64_t		fields,		/* bitmask of fields */
 	const short	*offsets,	/* table of field offsets */
 	int		nbits,		/* number of bits to inspect */
 	int		*first,		/* output: first byte offset */
 	int		*last)		/* output: last byte offset */
 {
 	int		i;		/* current bit number */
-	__int64_t	imask;		/* mask for current bit number */
+	int64_t		imask;		/* mask for current bit number */
 
 	ASSERT(fields != 0);
 	/*
@@ -1842,7 +1842,7 @@ xfs_btree_lookup(
 	int			*stat)	/* success/failure */
 {
 	struct xfs_btree_block	*block;	/* current btree block */
-	__int64_t		diff;	/* difference for the current key */
+	int64_t			diff;	/* difference for the current key */
 	int			error;	/* error return value */
 	int			keyno;	/* current key number */
 	int			level;	/* level in the btree */
@@ -4435,7 +4435,7 @@ xfs_btree_visit_blocks(
  * recovery completion writes the changes to disk.
  */
 struct xfs_btree_block_change_owner_info {
-	__uint64_t		new_owner;
+	uint64_t		new_owner;
 	struct list_head	*buffer_list;
 };
 
@@ -4481,7 +4481,7 @@ xfs_btree_block_change_owner(
 int
 xfs_btree_change_owner(
 	struct xfs_btree_cur	*cur,
-	__uint64_t		new_owner,
+	uint64_t		new_owner,
 	struct list_head	*buffer_list)
 {
 	struct xfs_btree_block_change_owner_info	bbcoi;
@@ -4585,7 +4585,7 @@ xfs_btree_simple_query_range(
 {
 	union xfs_btree_rec		*recp;
 	union xfs_btree_key		rec_key;
-	__int64_t			diff;
+	int64_t				diff;
 	int				stat;
 	bool				firstrec = true;
 	int				error;
@@ -4682,8 +4682,8 @@ xfs_btree_overlapped_query_range(
 	union xfs_btree_key		*hkp;
 	union xfs_btree_rec		*recp;
 	struct xfs_btree_block		*block;
-	__int64_t			ldiff;
-	__int64_t			hdiff;
+	int64_t				ldiff;
+	int64_t				hdiff;
 	int				level;
 	struct xfs_buf			*bp;
 	int				i;
diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h
index 05cf35b..3c1fed2 100644
--- a/libxfs/xfs_btree.h
+++ b/libxfs/xfs_btree.h
@@ -76,7 +76,7 @@ union xfs_btree_rec {
 #define	XFS_BTNUM_RMAP	((xfs_btnum_t)XFS_BTNUM_RMAPi)
 #define	XFS_BTNUM_REFC	((xfs_btnum_t)XFS_BTNUM_REFCi)
 
-__uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
+uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
 
 /*
  * For logging record fields.
@@ -150,14 +150,14 @@ struct xfs_btree_ops {
 					  union xfs_btree_rec *rec);
 
 	/* difference between key value and cursor value */
-	__int64_t (*key_diff)(struct xfs_btree_cur *cur,
+	int64_t (*key_diff)(struct xfs_btree_cur *cur,
 			      union xfs_btree_key *key);
 
 	/*
 	 * Difference between key2 and key1 -- positive if key1 > key2,
 	 * negative if key1 < key2, and zero if equal.
 	 */
-	__int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
+	int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
 				   union xfs_btree_key *key1,
 				   union xfs_btree_key *key2);
 
@@ -213,11 +213,11 @@ typedef struct xfs_btree_cur
 	union xfs_btree_irec	bc_rec;	/* current insert/search record value */
 	struct xfs_buf	*bc_bufs[XFS_BTREE_MAXLEVELS];	/* buf ptr per level */
 	int		bc_ptrs[XFS_BTREE_MAXLEVELS];	/* key/record # */
-	__uint8_t	bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
+	uint8_t		bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
 #define	XFS_BTCUR_LEFTRA	1	/* left sibling has been read-ahead */
 #define	XFS_BTCUR_RIGHTRA	2	/* right sibling has been read-ahead */
-	__uint8_t	bc_nlevels;	/* number of levels in the tree */
-	__uint8_t	bc_blocklog;	/* log2(blocksize) of btree blocks */
+	uint8_t		bc_nlevels;	/* number of levels in the tree */
+	uint8_t		bc_blocklog;	/* log2(blocksize) of btree blocks */
 	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
 	int		bc_statoff;	/* offset of btre stats array */
 	union {
@@ -330,7 +330,7 @@ xfs_btree_islastblock(
  */
 void
 xfs_btree_offsets(
-	__int64_t		fields,	/* bitmask of fields */
+	int64_t			fields,	/* bitmask of fields */
 	const short		*offsets,/* table of field offsets */
 	int			nbits,	/* number of bits to inspect */
 	int			*first,	/* output: first byte offset */
@@ -408,7 +408,7 @@ int xfs_btree_new_iroot(struct xfs_btree_cur *, int *, int *);
 int xfs_btree_insert(struct xfs_btree_cur *, int *);
 int xfs_btree_delete(struct xfs_btree_cur *, int *);
 int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *);
-int xfs_btree_change_owner(struct xfs_btree_cur *cur, __uint64_t new_owner,
+int xfs_btree_change_owner(struct xfs_btree_cur *cur, uint64_t new_owner,
 			   struct list_head *buffer_list);
 
 /*
@@ -434,7 +434,7 @@ static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block)
 }
 
 static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block,
-		__uint16_t numrecs)
+		uint16_t numrecs)
 {
 	block->bb_numrecs = cpu_to_be16(numrecs);
 }
diff --git a/libxfs/xfs_cksum.h b/libxfs/xfs_cksum.h
index a416c7c..8211f48 100644
--- a/libxfs/xfs_cksum.h
+++ b/libxfs/xfs_cksum.h
@@ -1,7 +1,7 @@
 #ifndef _XFS_CKSUM_H
 #define _XFS_CKSUM_H 1
 
-#define XFS_CRC_SEED	(~(__uint32_t)0)
+#define XFS_CRC_SEED	(~(uint32_t)0)
 
 /*
  * Calculate the intermediate checksum for a buffer that has the CRC field
@@ -9,11 +9,11 @@
  * cksum_offset parameter. We do not modify the buffer during verification,
  * hence we have to split the CRC calculation across the cksum_offset.
  */
-static inline __uint32_t
+static inline uint32_t
 xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
 {
-	__uint32_t zero = 0;
-	__uint32_t crc;
+	uint32_t zero = 0;
+	uint32_t crc;
 
 	/* Calculate CRC up to the checksum. */
 	crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset);
@@ -30,7 +30,7 @@ xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
  * Fast CRC method where the buffer is modified. Callers must have exclusive
  * access to the buffer while the calculation takes place.
  */
-static inline __uint32_t
+static inline uint32_t
 xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
 {
 	/* zero the CRC field */
@@ -48,7 +48,7 @@ xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
  * so that it is consistent on disk.
  */
 static inline __le32
-xfs_end_cksum(__uint32_t crc)
+xfs_end_cksum(uint32_t crc)
 {
 	return ~cpu_to_le32(crc);
 }
@@ -62,7 +62,7 @@ xfs_end_cksum(__uint32_t crc)
 static inline void
 xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 {
-	__uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
+	uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
 
 	*(__le32 *)(buffer + cksum_offset) = xfs_end_cksum(crc);
 }
@@ -73,7 +73,7 @@ xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 static inline int
 xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
 {
-	__uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
+	uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
 
 	return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc);
 }
diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
index bc12f58..08447be 100644
--- a/libxfs/xfs_da_btree.c
+++ b/libxfs/xfs_da_btree.c
@@ -1947,7 +1947,7 @@ xfs_da3_path_shift(
  * This is implemented with some source-level loop unrolling.
  */
 xfs_dahash_t
-xfs_da_hashname(const __uint8_t *name, int namelen)
+xfs_da_hashname(const uint8_t *name, int namelen)
 {
 	xfs_dahash_t hash;
 
diff --git a/libxfs/xfs_da_btree.h b/libxfs/xfs_da_btree.h
index 4e29cb6..ae6de17 100644
--- a/libxfs/xfs_da_btree.h
+++ b/libxfs/xfs_da_btree.h
@@ -60,10 +60,10 @@ enum xfs_dacmp {
  */
 typedef struct xfs_da_args {
 	struct xfs_da_geometry *geo;	/* da block geometry */
-	const __uint8_t	*name;		/* string (maybe not NULL terminated) */
+	const uint8_t		*name;		/* string (maybe not NULL terminated) */
 	int		namelen;	/* length of string (maybe no NULL) */
-	__uint8_t	filetype;	/* filetype of inode for directories */
-	__uint8_t	*value;		/* set of bytes (maybe contain NULLs) */
+	uint8_t		filetype;	/* filetype of inode for directories */
+	uint8_t		*value;		/* set of bytes (maybe contain NULLs) */
 	int		valuelen;	/* length of value */
 	int		flags;		/* argument flags (eg: ATTR_NOCREATE) */
 	xfs_dahash_t	hashval;	/* hash value of name */
@@ -207,7 +207,7 @@ int	xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
 int	xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
 					  struct xfs_buf *dead_buf);
 
-uint xfs_da_hashname(const __uint8_t *name_string, int name_length);
+uint xfs_da_hashname(const uint8_t *name_string, int name_length);
 enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
 				const unsigned char *name, int len);
 
diff --git a/libxfs/xfs_da_format.c b/libxfs/xfs_da_format.c
index 2b732b3..f30004f 100644
--- a/libxfs/xfs_da_format.c
+++ b/libxfs/xfs_da_format.c
@@ -49,7 +49,7 @@ xfs_dir3_sf_entsize(
 	struct xfs_dir2_sf_hdr	*hdr,
 	int			len)
 {
-	return xfs_dir2_sf_entsize(hdr, len) + sizeof(__uint8_t);
+	return xfs_dir2_sf_entsize(hdr, len) + sizeof(uint8_t);
 }
 
 static struct xfs_dir2_sf_entry *
@@ -77,7 +77,7 @@ xfs_dir3_sf_nextentry(
  * not necessary. For non-filetype enable directories, the type is always
  * unknown and we never store the value.
  */
-static __uint8_t
+static uint8_t
 xfs_dir2_sfe_get_ftype(
 	struct xfs_dir2_sf_entry *sfep)
 {
@@ -87,16 +87,16 @@ xfs_dir2_sfe_get_ftype(
 static void
 xfs_dir2_sfe_put_ftype(
 	struct xfs_dir2_sf_entry *sfep,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	ASSERT(ftype < XFS_DIR3_FT_MAX);
 }
 
-static __uint8_t
+static uint8_t
 xfs_dir3_sfe_get_ftype(
 	struct xfs_dir2_sf_entry *sfep)
 {
-	__uint8_t	ftype;
+	uint8_t		ftype;
 
 	ftype = sfep->name[sfep->namelen];
 	if (ftype >= XFS_DIR3_FT_MAX)
@@ -107,7 +107,7 @@ xfs_dir3_sfe_get_ftype(
 static void
 xfs_dir3_sfe_put_ftype(
 	struct xfs_dir2_sf_entry *sfep,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	ASSERT(ftype < XFS_DIR3_FT_MAX);
 
@@ -124,7 +124,7 @@ xfs_dir3_sfe_put_ftype(
 static xfs_ino_t
 xfs_dir2_sf_get_ino(
 	struct xfs_dir2_sf_hdr	*hdr,
-	__uint8_t		*from)
+	uint8_t			*from)
 {
 	if (hdr->i8count)
 		return get_unaligned_be64(from) & 0x00ffffffffffffffULL;
@@ -135,7 +135,7 @@ xfs_dir2_sf_get_ino(
 static void
 xfs_dir2_sf_put_ino(
 	struct xfs_dir2_sf_hdr	*hdr,
-	__uint8_t		*to,
+	uint8_t			*to,
 	xfs_ino_t		ino)
 {
 	ASSERT((ino & 0xff00000000000000ULL) == 0);
@@ -225,7 +225,7 @@ xfs_dir3_sfe_put_ino(
 
 #define XFS_DIR3_DATA_ENTSIZE(n)					\
 	round_up((offsetof(struct xfs_dir2_data_entry, name[0]) + (n) +	\
-		 sizeof(xfs_dir2_data_off_t) + sizeof(__uint8_t)),	\
+		 sizeof(xfs_dir2_data_off_t) + sizeof(uint8_t)),	\
 		XFS_DIR2_DATA_ALIGN)
 
 static int
@@ -242,7 +242,7 @@ xfs_dir3_data_entsize(
 	return XFS_DIR3_DATA_ENTSIZE(n);
 }
 
-static __uint8_t
+static uint8_t
 xfs_dir2_data_get_ftype(
 	struct xfs_dir2_data_entry *dep)
 {
@@ -252,16 +252,16 @@ xfs_dir2_data_get_ftype(
 static void
 xfs_dir2_data_put_ftype(
 	struct xfs_dir2_data_entry *dep,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	ASSERT(ftype < XFS_DIR3_FT_MAX);
 }
 
-static __uint8_t
+static uint8_t
 xfs_dir3_data_get_ftype(
 	struct xfs_dir2_data_entry *dep)
 {
-	__uint8_t	ftype = dep->name[dep->namelen];
+	uint8_t		ftype = dep->name[dep->namelen];
 
 	if (ftype >= XFS_DIR3_FT_MAX)
 		return XFS_DIR3_FT_UNKNOWN;
@@ -271,7 +271,7 @@ xfs_dir3_data_get_ftype(
 static void
 xfs_dir3_data_put_ftype(
 	struct xfs_dir2_data_entry *dep,
-	__uint8_t		type)
+	uint8_t			type)
 {
 	ASSERT(type < XFS_DIR3_FT_MAX);
 	ASSERT(dep->namelen != 0);
diff --git a/libxfs/xfs_da_format.h b/libxfs/xfs_da_format.h
index 9a492a9..3771edc 100644
--- a/libxfs/xfs_da_format.h
+++ b/libxfs/xfs_da_format.h
@@ -111,11 +111,11 @@ struct xfs_da3_intnode {
  * appropriate.
  */
 struct xfs_da3_icnode_hdr {
-	__uint32_t	forw;
-	__uint32_t	back;
-	__uint16_t	magic;
-	__uint16_t	count;
-	__uint16_t	level;
+	uint32_t	forw;
+	uint32_t	back;
+	uint16_t	magic;
+	uint16_t	count;
+	uint16_t	level;
 };
 
 /*
@@ -187,14 +187,14 @@ struct xfs_da3_icnode_hdr {
 /*
  * Byte offset in data block and shortform entry.
  */
-typedef	__uint16_t	xfs_dir2_data_off_t;
+typedef uint16_t	xfs_dir2_data_off_t;
 #define	NULLDATAOFF	0xffffU
 typedef uint		xfs_dir2_data_aoff_t;	/* argument form */
 
 /*
  * Offset in data space of a data entry.
  */
-typedef	__uint32_t	xfs_dir2_dataptr_t;
+typedef uint32_t	xfs_dir2_dataptr_t;
 #define	XFS_DIR2_MAX_DATAPTR	((xfs_dir2_dataptr_t)0xffffffff)
 #define	XFS_DIR2_NULL_DATAPTR	((xfs_dir2_dataptr_t)0)
 
@@ -206,7 +206,7 @@ typedef	xfs_off_t	xfs_dir2_off_t;
 /*
  * Directory block number (logical dirblk in file)
  */
-typedef	__uint32_t	xfs_dir2_db_t;
+typedef uint32_t	xfs_dir2_db_t;
 
 #define XFS_INO32_SIZE	4
 #define XFS_INO64_SIZE	8
@@ -226,9 +226,9 @@ typedef	__uint32_t	xfs_dir2_db_t;
  * over them.
  */
 typedef struct xfs_dir2_sf_hdr {
-	__uint8_t		count;		/* count of entries */
-	__uint8_t		i8count;	/* count of 8-byte inode #s */
-	__uint8_t		parent[8];	/* parent dir inode number */
+	uint8_t			count;		/* count of entries */
+	uint8_t			i8count;	/* count of 8-byte inode #s */
+	uint8_t			parent[8];	/* parent dir inode number */
 } __packed xfs_dir2_sf_hdr_t;
 
 typedef struct xfs_dir2_sf_entry {
@@ -447,11 +447,11 @@ struct xfs_dir3_leaf_hdr {
 };
 
 struct xfs_dir3_icleaf_hdr {
-	__uint32_t		forw;
-	__uint32_t		back;
-	__uint16_t		magic;
-	__uint16_t		count;
-	__uint16_t		stale;
+	uint32_t		forw;
+	uint32_t		back;
+	uint16_t		magic;
+	uint16_t		count;
+	uint16_t		stale;
 };
 
 /*
@@ -538,10 +538,10 @@ struct xfs_dir3_free {
  * xfs_dir3_free_hdr_from_disk/xfs_dir3_free_hdr_to_disk.
  */
 struct xfs_dir3_icfree_hdr {
-	__uint32_t	magic;
-	__uint32_t	firstdb;
-	__uint32_t	nvalid;
-	__uint32_t	nused;
+	uint32_t	magic;
+	uint32_t	firstdb;
+	uint32_t	nvalid;
+	uint32_t	nused;
 
 };
 
@@ -632,10 +632,10 @@ typedef struct xfs_attr_shortform {
 		__u8	padding;
 	} hdr;
 	struct xfs_attr_sf_entry {
-		__uint8_t namelen;	/* actual length of name (no NULL) */
-		__uint8_t valuelen;	/* actual length of value (no NULL) */
-		__uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
-		__uint8_t nameval[1];	/* name & value bytes concatenated */
+		uint8_t namelen;	/* actual length of name (no NULL) */
+		uint8_t valuelen;	/* actual length of value (no NULL) */
+		uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
+		uint8_t nameval[1];	/* name & value bytes concatenated */
 	} list[1];			/* variable sized array */
 } xfs_attr_shortform_t;
 
@@ -725,22 +725,22 @@ struct xfs_attr3_leafblock {
  * incore, neutral version of the attribute leaf header
  */
 struct xfs_attr3_icleaf_hdr {
-	__uint32_t	forw;
-	__uint32_t	back;
-	__uint16_t	magic;
-	__uint16_t	count;
-	__uint16_t	usedbytes;
+	uint32_t	forw;
+	uint32_t	back;
+	uint16_t	magic;
+	uint16_t	count;
+	uint16_t	usedbytes;
 	/*
 	 * firstused is 32-bit here instead of 16-bit like the on-disk variant
 	 * to support maximum fsb size of 64k without overflow issues throughout
 	 * the attr code. Instead, the overflow condition is handled on
 	 * conversion to/from disk.
 	 */
-	__uint32_t	firstused;
+	uint32_t	firstused;
 	__u8		holes;
 	struct {
-		__uint16_t	base;
-		__uint16_t	size;
+		uint16_t	base;
+		uint16_t	size;
 	} freemap[XFS_ATTR_LEAF_MAPSIZE];
 };
 
diff --git a/libxfs/xfs_dir2.h b/libxfs/xfs_dir2.h
index d6e6d9d..21c8f8b 100644
--- a/libxfs/xfs_dir2.h
+++ b/libxfs/xfs_dir2.h
@@ -47,9 +47,9 @@ struct xfs_dir_ops {
 	struct xfs_dir2_sf_entry *
 		(*sf_nextentry)(struct xfs_dir2_sf_hdr *hdr,
 				struct xfs_dir2_sf_entry *sfep);
-	__uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
+	uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
 	void	(*sf_put_ftype)(struct xfs_dir2_sf_entry *sfep,
-				__uint8_t ftype);
+				uint8_t ftype);
 	xfs_ino_t (*sf_get_ino)(struct xfs_dir2_sf_hdr *hdr,
 				struct xfs_dir2_sf_entry *sfep);
 	void	(*sf_put_ino)(struct xfs_dir2_sf_hdr *hdr,
@@ -60,9 +60,9 @@ struct xfs_dir_ops {
 				     xfs_ino_t ino);
 
 	int	(*data_entsize)(int len);
-	__uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
+	uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
 	void	(*data_put_ftype)(struct xfs_dir2_data_entry *dep,
-				__uint8_t ftype);
+				uint8_t ftype);
 	__be16 * (*data_entry_tag_p)(struct xfs_dir2_data_entry *dep);
 	struct xfs_dir2_data_free *
 		(*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr);
diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c
index f80d91f..40a35b8 100644
--- a/libxfs/xfs_dir2_leaf.c
+++ b/libxfs/xfs_dir2_leaf.c
@@ -142,7 +142,7 @@ xfs_dir3_leaf_check_int(
 static bool
 xfs_dir3_leaf_verify(
 	struct xfs_buf		*bp,
-	__uint16_t		magic)
+	uint16_t		magic)
 {
 	struct xfs_mount	*mp = bp->b_target->bt_mount;
 	struct xfs_dir2_leaf	*leaf = bp->b_addr;
@@ -151,7 +151,7 @@ xfs_dir3_leaf_verify(
 
 	if (xfs_sb_version_hascrc(&mp->m_sb)) {
 		struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
-		__uint16_t		magic3;
+		uint16_t		magic3;
 
 		magic3 = (magic == XFS_DIR2_LEAF1_MAGIC) ? XFS_DIR3_LEAF1_MAGIC
 							 : XFS_DIR3_LEAFN_MAGIC;
@@ -175,7 +175,7 @@ xfs_dir3_leaf_verify(
 static void
 __read_verify(
 	struct xfs_buf  *bp,
-	__uint16_t	magic)
+	uint16_t	magic)
 {
 	struct xfs_mount	*mp = bp->b_target->bt_mount;
 
@@ -192,7 +192,7 @@ __read_verify(
 static void
 __write_verify(
 	struct xfs_buf  *bp,
-	__uint16_t	magic)
+	uint16_t	magic)
 {
 	struct xfs_mount	*mp = bp->b_target->bt_mount;
 	struct xfs_buf_log_item	*bip = bp->b_fspriv;
@@ -296,7 +296,7 @@ xfs_dir3_leaf_init(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp,
 	xfs_ino_t		owner,
-	__uint16_t		type)
+	uint16_t		type)
 {
 	struct xfs_dir2_leaf	*leaf = bp->b_addr;
 
@@ -340,7 +340,7 @@ xfs_dir3_leaf_get_buf(
 	xfs_da_args_t		*args,
 	xfs_dir2_db_t		bno,
 	struct xfs_buf		**bpp,
-	__uint16_t		magic)
+	uint16_t		magic)
 {
 	struct xfs_inode	*dp = args->dp;
 	struct xfs_trans	*tp = args->trans;
diff --git a/libxfs/xfs_dir2_priv.h b/libxfs/xfs_dir2_priv.h
index 39f8604..011df4d 100644
--- a/libxfs/xfs_dir2_priv.h
+++ b/libxfs/xfs_dir2_priv.h
@@ -69,7 +69,7 @@ extern void xfs_dir3_leaf_compact_x1(struct xfs_dir3_icleaf_hdr *leafhdr,
 		struct xfs_dir2_leaf_entry *ents, int *indexp,
 		int *lowstalep, int *highstalep, int *lowlogp, int *highlogp);
 extern int xfs_dir3_leaf_get_buf(struct xfs_da_args *args, xfs_dir2_db_t bno,
-		struct xfs_buf **bpp, __uint16_t magic);
+		struct xfs_buf **bpp, uint16_t magic);
 extern void xfs_dir3_leaf_log_ents(struct xfs_da_args *args,
 		struct xfs_buf *bp, int first, int last);
 extern void xfs_dir3_leaf_log_header(struct xfs_da_args *args,
diff --git a/libxfs/xfs_dir2_sf.c b/libxfs/xfs_dir2_sf.c
index 195f816..fdbe5e1 100644
--- a/libxfs/xfs_dir2_sf.c
+++ b/libxfs/xfs_dir2_sf.c
@@ -645,7 +645,7 @@ xfs_dir2_sf_verify(
 	int				offset;
 	int				size;
 	int				error;
-	__uint8_t			filetype;
+	uint8_t				filetype;
 
 	ASSERT(ip->i_d.di_format == XFS_DINODE_FMT_LOCAL);
 	/*
diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
index 4c3ed1f..a53f035 100644
--- a/libxfs/xfs_format.h
+++ b/libxfs/xfs_format.h
@@ -103,8 +103,8 @@ struct xfs_ifork;
  * Must be padded to 64 bit alignment.
  */
 typedef struct xfs_sb {
-	__uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
-	__uint32_t	sb_blocksize;	/* logical block size, bytes */
+	uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
+	uint32_t	sb_blocksize;	/* logical block size, bytes */
 	xfs_rfsblock_t	sb_dblocks;	/* number of data blocks */
 	xfs_rfsblock_t	sb_rblocks;	/* number of realtime blocks */
 	xfs_rtblock_t	sb_rextents;	/* number of realtime extents */
@@ -118,45 +118,45 @@ typedef struct xfs_sb {
 	xfs_agnumber_t	sb_agcount;	/* number of allocation groups */
 	xfs_extlen_t	sb_rbmblocks;	/* number of rt bitmap blocks */
 	xfs_extlen_t	sb_logblocks;	/* number of log blocks */
-	__uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
-	__uint16_t	sb_sectsize;	/* volume sector size, bytes */
-	__uint16_t	sb_inodesize;	/* inode size, bytes */
-	__uint16_t	sb_inopblock;	/* inodes per block */
+	uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
+	uint16_t	sb_sectsize;	/* volume sector size, bytes */
+	uint16_t	sb_inodesize;	/* inode size, bytes */
+	uint16_t	sb_inopblock;	/* inodes per block */
 	char		sb_fname[12];	/* file system name */
-	__uint8_t	sb_blocklog;	/* log2 of sb_blocksize */
-	__uint8_t	sb_sectlog;	/* log2 of sb_sectsize */
-	__uint8_t	sb_inodelog;	/* log2 of sb_inodesize */
-	__uint8_t	sb_inopblog;	/* log2 of sb_inopblock */
-	__uint8_t	sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
-	__uint8_t	sb_rextslog;	/* log2 of sb_rextents */
-	__uint8_t	sb_inprogress;	/* mkfs is in progress, don't mount */
-	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
+	uint8_t		sb_blocklog;	/* log2 of sb_blocksize */
+	uint8_t		sb_sectlog;	/* log2 of sb_sectsize */
+	uint8_t		sb_inodelog;	/* log2 of sb_inodesize */
+	uint8_t		sb_inopblog;	/* log2 of sb_inopblock */
+	uint8_t		sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
+	uint8_t		sb_rextslog;	/* log2 of sb_rextents */
+	uint8_t		sb_inprogress;	/* mkfs is in progress, don't mount */
+	uint8_t		sb_imax_pct;	/* max % of fs for inode space */
 					/* statistics */
 	/*
 	 * These fields must remain contiguous.  If you really
 	 * want to change their layout, make sure you fix the
 	 * code in xfs_trans_apply_sb_deltas().
 	 */
-	__uint64_t	sb_icount;	/* allocated inodes */
-	__uint64_t	sb_ifree;	/* free inodes */
-	__uint64_t	sb_fdblocks;	/* free data blocks */
-	__uint64_t	sb_frextents;	/* free realtime extents */
+	uint64_t	sb_icount;	/* allocated inodes */
+	uint64_t	sb_ifree;	/* free inodes */
+	uint64_t	sb_fdblocks;	/* free data blocks */
+	uint64_t	sb_frextents;	/* free realtime extents */
 	/*
 	 * End contiguous fields.
 	 */
 	xfs_ino_t	sb_uquotino;	/* user quota inode */
 	xfs_ino_t	sb_gquotino;	/* group quota inode */
-	__uint16_t	sb_qflags;	/* quota flags */
-	__uint8_t	sb_flags;	/* misc. flags */
-	__uint8_t	sb_shared_vn;	/* shared version number */
+	uint16_t	sb_qflags;	/* quota flags */
+	uint8_t		sb_flags;	/* misc. flags */
+	uint8_t		sb_shared_vn;	/* shared version number */
 	xfs_extlen_t	sb_inoalignmt;	/* inode chunk alignment, fsblocks */
-	__uint32_t	sb_unit;	/* stripe or raid unit */
-	__uint32_t	sb_width;	/* stripe or raid width */
-	__uint8_t	sb_dirblklog;	/* log2 of dir block size (fsbs) */
-	__uint8_t	sb_logsectlog;	/* log2 of the log sector size */
-	__uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
-	__uint32_t	sb_logsunit;	/* stripe unit size for the log */
-	__uint32_t	sb_features2;	/* additional feature bits */
+	uint32_t	sb_unit;	/* stripe or raid unit */
+	uint32_t	sb_width;	/* stripe or raid width */
+	uint8_t		sb_dirblklog;	/* log2 of dir block size (fsbs) */
+	uint8_t		sb_logsectlog;	/* log2 of the log sector size */
+	uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
+	uint32_t	sb_logsunit;	/* stripe unit size for the log */
+	uint32_t	sb_features2;	/* additional feature bits */
 
 	/*
 	 * bad features2 field as a result of failing to pad the sb structure to
@@ -167,17 +167,17 @@ typedef struct xfs_sb {
 	 * the value in sb_features2 when formatting the incore superblock to
 	 * the disk buffer.
 	 */
-	__uint32_t	sb_bad_features2;
+	uint32_t	sb_bad_features2;
 
 	/* version 5 superblock fields start here */
 
 	/* feature masks */
-	__uint32_t	sb_features_compat;
-	__uint32_t	sb_features_ro_compat;
-	__uint32_t	sb_features_incompat;
-	__uint32_t	sb_features_log_incompat;
+	uint32_t	sb_features_compat;
+	uint32_t	sb_features_ro_compat;
+	uint32_t	sb_features_incompat;
+	uint32_t	sb_features_log_incompat;
 
-	__uint32_t	sb_crc;		/* superblock crc */
+	uint32_t	sb_crc;		/* superblock crc */
 	xfs_extlen_t	sb_spino_align;	/* sparse inode chunk alignment */
 
 	xfs_ino_t	sb_pquotino;	/* project quota inode */
@@ -449,7 +449,7 @@ static inline void xfs_sb_version_addprojid32bit(struct xfs_sb *sbp)
 static inline bool
 xfs_sb_has_compat_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_compat & feature) != 0;
 }
@@ -465,7 +465,7 @@ xfs_sb_has_compat_feature(
 static inline bool
 xfs_sb_has_ro_compat_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_ro_compat & feature) != 0;
 }
@@ -482,7 +482,7 @@ xfs_sb_has_ro_compat_feature(
 static inline bool
 xfs_sb_has_incompat_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_incompat & feature) != 0;
 }
@@ -492,7 +492,7 @@ xfs_sb_has_incompat_feature(
 static inline bool
 xfs_sb_has_incompat_log_feature(
 	struct xfs_sb	*sbp,
-	__uint32_t	feature)
+	uint32_t	feature)
 {
 	return (sbp->sb_features_log_incompat & feature) != 0;
 }
@@ -594,8 +594,8 @@ xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
  */
 #define XFS_FSB_TO_B(mp,fsbno)	((xfs_fsize_t)(fsbno) << (mp)->m_sb.sb_blocklog)
 #define XFS_B_TO_FSB(mp,b)	\
-	((((__uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
-#define XFS_B_TO_FSBT(mp,b)	(((__uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
+	((((uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
+#define XFS_B_TO_FSBT(mp,b)	(((uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
 #define XFS_B_FSB_OFFSET(mp,b)	((b) & (mp)->m_blockmask)
 
 /*
@@ -1072,7 +1072,7 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
  * next agno_log bits - ag number
  * high agno_log-agblklog-inopblog bits - 0
  */
-#define	XFS_INO_MASK(k)			(__uint32_t)((1ULL << (k)) - 1)
+#define	XFS_INO_MASK(k)			(uint32_t)((1ULL << (k)) - 1)
 #define	XFS_INO_OFFSET_BITS(mp)		(mp)->m_sb.sb_inopblog
 #define	XFS_INO_AGBNO_BITS(mp)		(mp)->m_sb.sb_agblklog
 #define	XFS_INO_AGINO_BITS(mp)		(mp)->m_agino_log
@@ -1269,16 +1269,16 @@ typedef __be32 xfs_alloc_ptr_t;
 #define	XFS_FIBT_MAGIC		0x46494254	/* 'FIBT' */
 #define	XFS_FIBT_CRC_MAGIC	0x46494233	/* 'FIB3' */
 
-typedef	__uint64_t	xfs_inofree_t;
+typedef uint64_t	xfs_inofree_t;
 #define	XFS_INODES_PER_CHUNK		(NBBY * sizeof(xfs_inofree_t))
 #define	XFS_INODES_PER_CHUNK_LOG	(XFS_NBBYLOG + 3)
 #define	XFS_INOBT_ALL_FREE		((xfs_inofree_t)-1)
 #define	XFS_INOBT_MASK(i)		((xfs_inofree_t)1 << (i))
 
 #define XFS_INOBT_HOLEMASK_FULL		0	/* holemask for full chunk */
-#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(__uint16_t))
+#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(uint16_t))
 #define XFS_INODES_PER_HOLEMASK_BIT	\
-	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(__uint16_t)))
+	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(uint16_t)))
 
 static inline xfs_inofree_t xfs_inobt_maskn(int i, int n)
 {
@@ -1312,9 +1312,9 @@ typedef struct xfs_inobt_rec {
 
 typedef struct xfs_inobt_rec_incore {
 	xfs_agino_t	ir_startino;	/* starting inode number */
-	__uint16_t	ir_holemask;	/* hole mask for sparse chunks */
-	__uint8_t	ir_count;	/* total inode count */
-	__uint8_t	ir_freecount;	/* count of free inodes (set bits) */
+	uint16_t	ir_holemask;	/* hole mask for sparse chunks */
+	uint8_t		ir_count;	/* total inode count */
+	uint8_t		ir_freecount;	/* count of free inodes (set bits) */
 	xfs_inofree_t	ir_free;	/* free inode mask */
 } xfs_inobt_rec_incore_t;
 
@@ -1397,15 +1397,15 @@ struct xfs_rmap_rec {
  *  rm_offset:54-60 aren't used and should be zero
  *  rm_offset:0-53 is the block offset within the inode
  */
-#define XFS_RMAP_OFF_ATTR_FORK	((__uint64_t)1ULL << 63)
-#define XFS_RMAP_OFF_BMBT_BLOCK	((__uint64_t)1ULL << 62)
-#define XFS_RMAP_OFF_UNWRITTEN	((__uint64_t)1ULL << 61)
+#define XFS_RMAP_OFF_ATTR_FORK	((uint64_t)1ULL << 63)
+#define XFS_RMAP_OFF_BMBT_BLOCK	((uint64_t)1ULL << 62)
+#define XFS_RMAP_OFF_UNWRITTEN	((uint64_t)1ULL << 61)
 
-#define XFS_RMAP_LEN_MAX	((__uint32_t)~0U)
+#define XFS_RMAP_LEN_MAX	((uint32_t)~0U)
 #define XFS_RMAP_OFF_FLAGS	(XFS_RMAP_OFF_ATTR_FORK | \
 				 XFS_RMAP_OFF_BMBT_BLOCK | \
 				 XFS_RMAP_OFF_UNWRITTEN)
-#define XFS_RMAP_OFF_MASK	((__uint64_t)0x3FFFFFFFFFFFFFULL)
+#define XFS_RMAP_OFF_MASK	((uint64_t)0x3FFFFFFFFFFFFFULL)
 
 #define XFS_RMAP_OFF(off)		((off) & XFS_RMAP_OFF_MASK)
 
@@ -1431,8 +1431,8 @@ struct xfs_rmap_rec {
 struct xfs_rmap_irec {
 	xfs_agblock_t	rm_startblock;	/* extent start block */
 	xfs_extlen_t	rm_blockcount;	/* extent length */
-	__uint64_t	rm_owner;	/* extent owner */
-	__uint64_t	rm_offset;	/* offset within the owner */
+	uint64_t	rm_owner;	/* extent owner */
+	uint64_t	rm_offset;	/* offset within the owner */
 	unsigned int	rm_flags;	/* state flags */
 };
 
@@ -1544,11 +1544,11 @@ typedef struct xfs_bmbt_rec {
 	__be64			l0, l1;
 } xfs_bmbt_rec_t;
 
-typedef __uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
+typedef uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
 typedef xfs_bmbt_rec_t xfs_bmdr_rec_t;
 
 typedef struct xfs_bmbt_rec_host {
-	__uint64_t		l0, l1;
+	uint64_t		l0, l1;
 } xfs_bmbt_rec_host_t;
 
 /*
diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
index 1831cff..2d28332 100644
--- a/libxfs/xfs_fs.h
+++ b/libxfs/xfs_fs.h
@@ -323,10 +323,10 @@ typedef struct xfs_bstat {
  * and using two 16bit values to hold new 32bit projid was choosen
  * to retain compatibility with "old" filesystems).
  */
-static inline __uint32_t
+static inline uint32_t
 bstat_get_projid(struct xfs_bstat *bs)
 {
-	return (__uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
+	return (uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
 }
 
 /*
@@ -476,10 +476,10 @@ typedef struct xfs_handle {
  */
 typedef struct xfs_swapext
 {
-	__int64_t	sx_version;	/* version */
+	int64_t		sx_version;	/* version */
 #define XFS_SX_VERSION		0
-	__int64_t	sx_fdtarget;	/* fd of target file */
-	__int64_t	sx_fdtmp;	/* fd of tmp file */
+	int64_t		sx_fdtarget;	/* fd of target file */
+	int64_t		sx_fdtmp;	/* fd of tmp file */
 	xfs_off_t	sx_offset;	/* offset into file */
 	xfs_off_t	sx_length;	/* leng from offset */
 	char		sx_pad[16];	/* pad space, unused */
@@ -566,7 +566,7 @@ typedef struct xfs_swapext
 #define XFS_IOC_ATTRLIST_BY_HANDLE   _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
 #define XFS_IOC_ATTRMULTI_BY_HANDLE  _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
 #define XFS_IOC_FSGEOMETRY	     _IOR ('X', 124, struct xfs_fsop_geom)
-#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, __uint32_t)
+#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, uint32_t)
 /*	XFS_IOC_GETFSUUID ---------- deprecated 140	 */
 
 /* reflink ioctls; these MUST match the btrfs ioctl definitions */
diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
index 55cc450..8d24518 100644
--- a/libxfs/xfs_ialloc.c
+++ b/libxfs/xfs_ialloc.c
@@ -134,9 +134,9 @@ xfs_inobt_get_rec(
 STATIC int
 xfs_inobt_insert_rec(
 	struct xfs_btree_cur	*cur,
-	__uint16_t		holemask,
-	__uint8_t		count,
-	__int32_t		freecount,
+	uint16_t		holemask,
+	uint8_t			count,
+	int32_t			freecount,
 	xfs_inofree_t		free,
 	int			*stat)
 {
diff --git a/libxfs/xfs_ialloc_btree.c b/libxfs/xfs_ialloc_btree.c
index 7b4be76..5b28105 100644
--- a/libxfs/xfs_ialloc_btree.c
+++ b/libxfs/xfs_ialloc_btree.c
@@ -218,12 +218,12 @@ xfs_finobt_init_ptr_from_cur(
 	ptr->s = agi->agi_free_root;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_inobt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
 {
-	return (__int64_t)be32_to_cpu(key->inobt.ir_startino) -
+	return (int64_t)be32_to_cpu(key->inobt.ir_startino) -
 			  cur->bc_rec.i.ir_startino;
 }
 
diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
index 2972701..fcc6fb8 100644
--- a/libxfs/xfs_inode_buf.c
+++ b/libxfs/xfs_inode_buf.c
@@ -442,7 +442,7 @@ xfs_dinode_calc_crc(
 	struct xfs_mount	*mp,
 	struct xfs_dinode	*dip)
 {
-	__uint32_t		crc;
+	uint32_t		crc;
 
 	if (dip->di_version < 3)
 		return;
diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
index 6848a0a..0827d7d 100644
--- a/libxfs/xfs_inode_buf.h
+++ b/libxfs/xfs_inode_buf.h
@@ -28,26 +28,26 @@ struct xfs_dinode;
  * format specific structures at the appropriate time.
  */
 struct xfs_icdinode {
-	__int8_t	di_version;	/* inode version */
-	__int8_t	di_format;	/* format of di_c data */
-	__uint16_t	di_flushiter;	/* incremented on flush */
-	__uint32_t	di_uid;		/* owner's user id */
-	__uint32_t	di_gid;		/* owner's group id */
-	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
-	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
+	int8_t		di_version;	/* inode version */
+	int8_t		di_format;	/* format of di_c data */
+	uint16_t	di_flushiter;	/* incremented on flush */
+	uint32_t	di_uid;		/* owner's user id */
+	uint32_t	di_gid;		/* owner's group id */
+	uint16_t	di_projid_lo;	/* lower part of owner's project id */
+	uint16_t	di_projid_hi;	/* higher part of owner's project id */
 	xfs_fsize_t	di_size;	/* number of bytes in file */
 	xfs_rfsblock_t	di_nblocks;	/* # of direct & btree blocks used */
 	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
 	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
 	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
-	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
-	__int8_t	di_aformat;	/* format of attr fork's data */
-	__uint32_t	di_dmevmask;	/* DMIG event mask */
-	__uint16_t	di_dmstate;	/* DMIG state info */
-	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
+	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
+	int8_t		di_aformat;	/* format of attr fork's data */
+	uint32_t	di_dmevmask;	/* DMIG event mask */
+	uint16_t	di_dmstate;	/* DMIG state info */
+	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
 
-	__uint64_t	di_flags2;	/* more random flags */
-	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
+	uint64_t	di_flags2;	/* more random flags */
+	uint32_t	di_cowextsize;	/* basic cow extent size for file */
 
 	xfs_ictimestamp_t di_crtime;	/* time created */
 };
diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
index 7ae571f..8372e9b 100644
--- a/libxfs/xfs_log_format.h
+++ b/libxfs/xfs_log_format.h
@@ -31,7 +31,7 @@ struct xfs_trans_res;
  * through all the log items definitions and everything they encode into the
  * log.
  */
-typedef __uint32_t xlog_tid_t;
+typedef uint32_t xlog_tid_t;
 
 #define XLOG_MIN_ICLOGS		2
 #define XLOG_MAX_ICLOGS		8
@@ -211,7 +211,7 @@ typedef struct xfs_log_iovec {
 typedef struct xfs_trans_header {
 	uint		th_magic;		/* magic number */
 	uint		th_type;		/* transaction type */
-	__int32_t	th_tid;			/* transaction id (unused) */
+	int32_t		th_tid;			/* transaction id (unused) */
 	uint		th_num_items;		/* num items logged by trans */
 } xfs_trans_header_t;
 
@@ -265,52 +265,52 @@ typedef struct xfs_trans_header {
  * must be added on to the end.
  */
 typedef struct xfs_inode_log_format {
-	__uint16_t		ilf_type;	/* inode log item type */
-	__uint16_t		ilf_size;	/* size of this item */
-	__uint32_t		ilf_fields;	/* flags for fields logged */
-	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
-	__uint16_t		ilf_dsize;	/* size of data/ext/root */
-	__uint64_t		ilf_ino;	/* inode number */
+	uint16_t		ilf_type;	/* inode log item type */
+	uint16_t		ilf_size;	/* size of this item */
+	uint32_t		ilf_fields;	/* flags for fields logged */
+	uint16_t		ilf_asize;	/* size of attr d/ext/root */
+	uint16_t		ilf_dsize;	/* size of data/ext/root */
+	uint64_t		ilf_ino;	/* inode number */
 	union {
-		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
+		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
 		uuid_t		ilfu_uuid;	/* mount point value */
 	} ilf_u;
-	__int64_t		ilf_blkno;	/* blkno of inode buffer */
-	__int32_t		ilf_len;	/* len of inode buffer */
-	__int32_t		ilf_boffset;	/* off of inode in buffer */
+	int64_t			ilf_blkno;	/* blkno of inode buffer */
+	int32_t			ilf_len;	/* len of inode buffer */
+	int32_t			ilf_boffset;	/* off of inode in buffer */
 } xfs_inode_log_format_t;
 
 typedef struct xfs_inode_log_format_32 {
-	__uint16_t		ilf_type;	/* inode log item type */
-	__uint16_t		ilf_size;	/* size of this item */
-	__uint32_t		ilf_fields;	/* flags for fields logged */
-	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
-	__uint16_t		ilf_dsize;	/* size of data/ext/root */
-	__uint64_t		ilf_ino;	/* inode number */
+	uint16_t		ilf_type;	/* inode log item type */
+	uint16_t		ilf_size;	/* size of this item */
+	uint32_t		ilf_fields;	/* flags for fields logged */
+	uint16_t		ilf_asize;	/* size of attr d/ext/root */
+	uint16_t		ilf_dsize;	/* size of data/ext/root */
+	uint64_t		ilf_ino;	/* inode number */
 	union {
-		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
+		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
 		uuid_t		ilfu_uuid;	/* mount point value */
 	} ilf_u;
-	__int64_t		ilf_blkno;	/* blkno of inode buffer */
-	__int32_t		ilf_len;	/* len of inode buffer */
-	__int32_t		ilf_boffset;	/* off of inode in buffer */
+	int64_t			ilf_blkno;	/* blkno of inode buffer */
+	int32_t			ilf_len;	/* len of inode buffer */
+	int32_t			ilf_boffset;	/* off of inode in buffer */
 } __attribute__((packed)) xfs_inode_log_format_32_t;
 
 typedef struct xfs_inode_log_format_64 {
-	__uint16_t		ilf_type;	/* inode log item type */
-	__uint16_t		ilf_size;	/* size of this item */
-	__uint32_t		ilf_fields;	/* flags for fields logged */
-	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
-	__uint16_t		ilf_dsize;	/* size of data/ext/root */
-	__uint32_t		ilf_pad;	/* pad for 64 bit boundary */
-	__uint64_t		ilf_ino;	/* inode number */
+	uint16_t		ilf_type;	/* inode log item type */
+	uint16_t		ilf_size;	/* size of this item */
+	uint32_t		ilf_fields;	/* flags for fields logged */
+	uint16_t		ilf_asize;	/* size of attr d/ext/root */
+	uint16_t		ilf_dsize;	/* size of data/ext/root */
+	uint32_t		ilf_pad;	/* pad for 64 bit boundary */
+	uint64_t		ilf_ino;	/* inode number */
 	union {
-		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
+		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
 		uuid_t		ilfu_uuid;	/* mount point value */
 	} ilf_u;
-	__int64_t		ilf_blkno;	/* blkno of inode buffer */
-	__int32_t		ilf_len;	/* len of inode buffer */
-	__int32_t		ilf_boffset;	/* off of inode in buffer */
+	int64_t			ilf_blkno;	/* blkno of inode buffer */
+	int32_t			ilf_len;	/* len of inode buffer */
+	int32_t			ilf_boffset;	/* off of inode in buffer */
 } xfs_inode_log_format_64_t;
 
 
@@ -379,8 +379,8 @@ static inline int xfs_ilog_fdata(int w)
  * information.
  */
 typedef struct xfs_ictimestamp {
-	__int32_t	t_sec;		/* timestamp seconds */
-	__int32_t	t_nsec;		/* timestamp nanoseconds */
+	int32_t		t_sec;		/* timestamp seconds */
+	int32_t		t_nsec;		/* timestamp nanoseconds */
 } xfs_ictimestamp_t;
 
 /*
@@ -388,18 +388,18 @@ typedef struct xfs_ictimestamp {
  * kept identical to struct xfs_dinode except for the endianness annotations.
  */
 struct xfs_log_dinode {
-	__uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
-	__uint16_t	di_mode;	/* mode and type of file */
-	__int8_t	di_version;	/* inode version */
-	__int8_t	di_format;	/* format of di_c data */
-	__uint8_t	di_pad3[2];	/* unused in v2/3 inodes */
-	__uint32_t	di_uid;		/* owner's user id */
-	__uint32_t	di_gid;		/* owner's group id */
-	__uint32_t	di_nlink;	/* number of links to file */
-	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
-	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
-	__uint8_t	di_pad[6];	/* unused, zeroed space */
-	__uint16_t	di_flushiter;	/* incremented on flush */
+	uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
+	uint16_t	di_mode;	/* mode and type of file */
+	int8_t		di_version;	/* inode version */
+	int8_t		di_format;	/* format of di_c data */
+	uint8_t		di_pad3[2];	/* unused in v2/3 inodes */
+	uint32_t	di_uid;		/* owner's user id */
+	uint32_t	di_gid;		/* owner's group id */
+	uint32_t	di_nlink;	/* number of links to file */
+	uint16_t	di_projid_lo;	/* lower part of owner's project id */
+	uint16_t	di_projid_hi;	/* higher part of owner's project id */
+	uint8_t		di_pad[6];	/* unused, zeroed space */
+	uint16_t	di_flushiter;	/* incremented on flush */
 	xfs_ictimestamp_t di_atime;	/* time last accessed */
 	xfs_ictimestamp_t di_mtime;	/* time last modified */
 	xfs_ictimestamp_t di_ctime;	/* time created/inode modified */
@@ -408,23 +408,23 @@ struct xfs_log_dinode {
 	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
 	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
 	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
-	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
-	__int8_t	di_aformat;	/* format of attr fork's data */
-	__uint32_t	di_dmevmask;	/* DMIG event mask */
-	__uint16_t	di_dmstate;	/* DMIG state info */
-	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
-	__uint32_t	di_gen;		/* generation number */
+	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
+	int8_t		di_aformat;	/* format of attr fork's data */
+	uint32_t	di_dmevmask;	/* DMIG event mask */
+	uint16_t	di_dmstate;	/* DMIG state info */
+	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
+	uint32_t	di_gen;		/* generation number */
 
 	/* di_next_unlinked is the only non-core field in the old dinode */
 	xfs_agino_t	di_next_unlinked;/* agi unlinked list ptr */
 
 	/* start of the extended dinode, writable fields */
-	__uint32_t	di_crc;		/* CRC of the inode */
-	__uint64_t	di_changecount;	/* number of attribute changes */
+	uint32_t	di_crc;		/* CRC of the inode */
+	uint64_t	di_changecount;	/* number of attribute changes */
 	xfs_lsn_t	di_lsn;		/* flush sequence */
-	__uint64_t	di_flags2;	/* more random flags */
-	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
-	__uint8_t	di_pad2[12];	/* more padding for future expansion */
+	uint64_t	di_flags2;	/* more random flags */
+	uint32_t	di_cowextsize;	/* basic cow extent size for file */
+	uint8_t		di_pad2[12];	/* more padding for future expansion */
 
 	/* fields only written to during inode creation */
 	xfs_ictimestamp_t di_crtime;	/* time created */
@@ -483,7 +483,7 @@ typedef struct xfs_buf_log_format {
 	unsigned short	blf_size;	/* size of this item */
 	unsigned short	blf_flags;	/* misc state */
 	unsigned short	blf_len;	/* number of blocks in this buf */
-	__int64_t	blf_blkno;	/* starting blkno of this buf */
+	int64_t		blf_blkno;	/* starting blkno of this buf */
 	unsigned int	blf_map_size;	/* used size of data bitmap in words */
 	unsigned int	blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
 } xfs_buf_log_format_t;
@@ -533,7 +533,7 @@ xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
 	blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
 }
 
-static inline __uint16_t
+static inline uint16_t
 xfs_blft_from_flags(struct xfs_buf_log_format *blf)
 {
 	return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
@@ -554,14 +554,14 @@ typedef struct xfs_extent {
  * conversion routine.
  */
 typedef struct xfs_extent_32 {
-	__uint64_t	ext_start;
-	__uint32_t	ext_len;
+	uint64_t	ext_start;
+	uint32_t	ext_len;
 } __attribute__((packed)) xfs_extent_32_t;
 
 typedef struct xfs_extent_64 {
-	__uint64_t	ext_start;
-	__uint32_t	ext_len;
-	__uint32_t	ext_pad;
+	uint64_t	ext_start;
+	uint32_t	ext_len;
+	uint32_t	ext_pad;
 } xfs_extent_64_t;
 
 /*
@@ -570,26 +570,26 @@ typedef struct xfs_extent_64 {
  * size is given by efi_nextents.
  */
 typedef struct xfs_efi_log_format {
-	__uint16_t		efi_type;	/* efi log item type */
-	__uint16_t		efi_size;	/* size of this item */
-	__uint32_t		efi_nextents;	/* # extents to free */
-	__uint64_t		efi_id;		/* efi identifier */
+	uint16_t		efi_type;	/* efi log item type */
+	uint16_t		efi_size;	/* size of this item */
+	uint32_t		efi_nextents;	/* # extents to free */
+	uint64_t		efi_id;		/* efi identifier */
 	xfs_extent_t		efi_extents[1];	/* array of extents to free */
 } xfs_efi_log_format_t;
 
 typedef struct xfs_efi_log_format_32 {
-	__uint16_t		efi_type;	/* efi log item type */
-	__uint16_t		efi_size;	/* size of this item */
-	__uint32_t		efi_nextents;	/* # extents to free */
-	__uint64_t		efi_id;		/* efi identifier */
+	uint16_t		efi_type;	/* efi log item type */
+	uint16_t		efi_size;	/* size of this item */
+	uint32_t		efi_nextents;	/* # extents to free */
+	uint64_t		efi_id;		/* efi identifier */
 	xfs_extent_32_t		efi_extents[1];	/* array of extents to free */
 } __attribute__((packed)) xfs_efi_log_format_32_t;
 
 typedef struct xfs_efi_log_format_64 {
-	__uint16_t		efi_type;	/* efi log item type */
-	__uint16_t		efi_size;	/* size of this item */
-	__uint32_t		efi_nextents;	/* # extents to free */
-	__uint64_t		efi_id;		/* efi identifier */
+	uint16_t		efi_type;	/* efi log item type */
+	uint16_t		efi_size;	/* size of this item */
+	uint32_t		efi_nextents;	/* # extents to free */
+	uint64_t		efi_id;		/* efi identifier */
 	xfs_extent_64_t		efi_extents[1];	/* array of extents to free */
 } xfs_efi_log_format_64_t;
 
@@ -599,26 +599,26 @@ typedef struct xfs_efi_log_format_64 {
  * size is given by efd_nextents;
  */
 typedef struct xfs_efd_log_format {
-	__uint16_t		efd_type;	/* efd log item type */
-	__uint16_t		efd_size;	/* size of this item */
-	__uint32_t		efd_nextents;	/* # of extents freed */
-	__uint64_t		efd_efi_id;	/* id of corresponding efi */
+	uint16_t		efd_type;	/* efd log item type */
+	uint16_t		efd_size;	/* size of this item */
+	uint32_t		efd_nextents;	/* # of extents freed */
+	uint64_t		efd_efi_id;	/* id of corresponding efi */
 	xfs_extent_t		efd_extents[1];	/* array of extents freed */
 } xfs_efd_log_format_t;
 
 typedef struct xfs_efd_log_format_32 {
-	__uint16_t		efd_type;	/* efd log item type */
-	__uint16_t		efd_size;	/* size of this item */
-	__uint32_t		efd_nextents;	/* # of extents freed */
-	__uint64_t		efd_efi_id;	/* id of corresponding efi */
+	uint16_t		efd_type;	/* efd log item type */
+	uint16_t		efd_size;	/* size of this item */
+	uint32_t		efd_nextents;	/* # of extents freed */
+	uint64_t		efd_efi_id;	/* id of corresponding efi */
 	xfs_extent_32_t		efd_extents[1];	/* array of extents freed */
 } __attribute__((packed)) xfs_efd_log_format_32_t;
 
 typedef struct xfs_efd_log_format_64 {
-	__uint16_t		efd_type;	/* efd log item type */
-	__uint16_t		efd_size;	/* size of this item */
-	__uint32_t		efd_nextents;	/* # of extents freed */
-	__uint64_t		efd_efi_id;	/* id of corresponding efi */
+	uint16_t		efd_type;	/* efd log item type */
+	uint16_t		efd_size;	/* size of this item */
+	uint32_t		efd_nextents;	/* # of extents freed */
+	uint64_t		efd_efi_id;	/* id of corresponding efi */
 	xfs_extent_64_t		efd_extents[1];	/* array of extents freed */
 } xfs_efd_log_format_64_t;
 
@@ -626,11 +626,11 @@ typedef struct xfs_efd_log_format_64 {
  * RUI/RUD (reverse mapping) log format definitions
  */
 struct xfs_map_extent {
-	__uint64_t		me_owner;
-	__uint64_t		me_startblock;
-	__uint64_t		me_startoff;
-	__uint32_t		me_len;
-	__uint32_t		me_flags;
+	uint64_t		me_owner;
+	uint64_t		me_startblock;
+	uint64_t		me_startoff;
+	uint32_t		me_len;
+	uint32_t		me_flags;
 };
 
 /* rmap me_flags: upper bits are flags, lower byte is type code */
@@ -659,10 +659,10 @@ struct xfs_map_extent {
  * size is given by rui_nextents.
  */
 struct xfs_rui_log_format {
-	__uint16_t		rui_type;	/* rui log item type */
-	__uint16_t		rui_size;	/* size of this item */
-	__uint32_t		rui_nextents;	/* # extents to free */
-	__uint64_t		rui_id;		/* rui identifier */
+	uint16_t		rui_type;	/* rui log item type */
+	uint16_t		rui_size;	/* size of this item */
+	uint32_t		rui_nextents;	/* # extents to free */
+	uint64_t		rui_id;		/* rui identifier */
 	struct xfs_map_extent	rui_extents[];	/* array of extents to rmap */
 };
 
@@ -680,19 +680,19 @@ xfs_rui_log_format_sizeof(
  * size is given by rud_nextents;
  */
 struct xfs_rud_log_format {
-	__uint16_t		rud_type;	/* rud log item type */
-	__uint16_t		rud_size;	/* size of this item */
-	__uint32_t		__pad;
-	__uint64_t		rud_rui_id;	/* id of corresponding rui */
+	uint16_t		rud_type;	/* rud log item type */
+	uint16_t		rud_size;	/* size of this item */
+	uint32_t		__pad;
+	uint64_t		rud_rui_id;	/* id of corresponding rui */
 };
 
 /*
  * CUI/CUD (refcount update) log format definitions
  */
 struct xfs_phys_extent {
-	__uint64_t		pe_startblock;
-	__uint32_t		pe_len;
-	__uint32_t		pe_flags;
+	uint64_t		pe_startblock;
+	uint32_t		pe_len;
+	uint32_t		pe_flags;
 };
 
 /* refcount pe_flags: upper bits are flags, lower byte is type code */
@@ -707,10 +707,10 @@ struct xfs_phys_extent {
  * size is given by cui_nextents.
  */
 struct xfs_cui_log_format {
-	__uint16_t		cui_type;	/* cui log item type */
-	__uint16_t		cui_size;	/* size of this item */
-	__uint32_t		cui_nextents;	/* # extents to free */
-	__uint64_t		cui_id;		/* cui identifier */
+	uint16_t		cui_type;	/* cui log item type */
+	uint16_t		cui_size;	/* size of this item */
+	uint32_t		cui_nextents;	/* # extents to free */
+	uint64_t		cui_id;		/* cui identifier */
 	struct xfs_phys_extent	cui_extents[];	/* array of extents */
 };
 
@@ -728,10 +728,10 @@ xfs_cui_log_format_sizeof(
  * size is given by cud_nextents;
  */
 struct xfs_cud_log_format {
-	__uint16_t		cud_type;	/* cud log item type */
-	__uint16_t		cud_size;	/* size of this item */
-	__uint32_t		__pad;
-	__uint64_t		cud_cui_id;	/* id of corresponding cui */
+	uint16_t		cud_type;	/* cud log item type */
+	uint16_t		cud_size;	/* size of this item */
+	uint32_t		__pad;
+	uint64_t		cud_cui_id;	/* id of corresponding cui */
 };
 
 /*
@@ -755,10 +755,10 @@ struct xfs_cud_log_format {
  * size is given by bui_nextents.
  */
 struct xfs_bui_log_format {
-	__uint16_t		bui_type;	/* bui log item type */
-	__uint16_t		bui_size;	/* size of this item */
-	__uint32_t		bui_nextents;	/* # extents to free */
-	__uint64_t		bui_id;		/* bui identifier */
+	uint16_t		bui_type;	/* bui log item type */
+	uint16_t		bui_size;	/* size of this item */
+	uint32_t		bui_nextents;	/* # extents to free */
+	uint64_t		bui_id;		/* bui identifier */
 	struct xfs_map_extent	bui_extents[];	/* array of extents to bmap */
 };
 
@@ -776,10 +776,10 @@ xfs_bui_log_format_sizeof(
  * size is given by bud_nextents;
  */
 struct xfs_bud_log_format {
-	__uint16_t		bud_type;	/* bud log item type */
-	__uint16_t		bud_size;	/* size of this item */
-	__uint32_t		__pad;
-	__uint64_t		bud_bui_id;	/* id of corresponding bui */
+	uint16_t		bud_type;	/* bud log item type */
+	uint16_t		bud_size;	/* size of this item */
+	uint32_t		__pad;
+	uint64_t		bud_bui_id;	/* id of corresponding bui */
 };
 
 /*
@@ -789,12 +789,12 @@ struct xfs_bud_log_format {
  * 32 bits : log_recovery code assumes that.
  */
 typedef struct xfs_dq_logformat {
-	__uint16_t		qlf_type;      /* dquot log item type */
-	__uint16_t		qlf_size;      /* size of this item */
+	uint16_t		qlf_type;      /* dquot log item type */
+	uint16_t		qlf_size;      /* size of this item */
 	xfs_dqid_t		qlf_id;	       /* usr/grp/proj id : 32 bits */
-	__int64_t		qlf_blkno;     /* blkno of dquot buffer */
-	__int32_t		qlf_len;       /* len of dquot buffer */
-	__uint32_t		qlf_boffset;   /* off of dquot in buffer */
+	int64_t			qlf_blkno;     /* blkno of dquot buffer */
+	int32_t			qlf_len;       /* len of dquot buffer */
+	uint32_t		qlf_boffset;   /* off of dquot in buffer */
 } xfs_dq_logformat_t;
 
 /*
@@ -853,8 +853,8 @@ typedef struct xfs_qoff_logformat {
  * decoding can be done correctly.
  */
 struct xfs_icreate_log {
-	__uint16_t	icl_type;	/* type of log format structure */
-	__uint16_t	icl_size;	/* size of log format structure */
+	uint16_t	icl_type;	/* type of log format structure */
+	uint16_t	icl_size;	/* size of log format structure */
 	__be32		icl_ag;		/* ag being allocated in */
 	__be32		icl_agbno;	/* start block of inode range */
 	__be32		icl_count;	/* number of inodes to initialise */
diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h
index 8eed512..d69c772 100644
--- a/libxfs/xfs_quota_defs.h
+++ b/libxfs/xfs_quota_defs.h
@@ -27,8 +27,8 @@
  * they may need 64-bit accounting. Hence, 64-bit quota-counters,
  * and quota-limits. This is a waste in the common case, but hey ...
  */
-typedef __uint64_t	xfs_qcnt_t;
-typedef __uint16_t	xfs_qwarncnt_t;
+typedef uint64_t	xfs_qcnt_t;
+typedef uint16_t	xfs_qwarncnt_t;
 
 /*
  * flags for q_flags field in the dquot.
diff --git a/libxfs/xfs_refcount_btree.c b/libxfs/xfs_refcount_btree.c
index 2814f94..bd1a8f2 100644
--- a/libxfs/xfs_refcount_btree.c
+++ b/libxfs/xfs_refcount_btree.c
@@ -201,7 +201,7 @@ xfs_refcountbt_init_ptr_from_cur(
 	ptr->s = agf->agf_refcount_root;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_refcountbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
@@ -209,16 +209,16 @@ xfs_refcountbt_key_diff(
 	struct xfs_refcount_irec	*rec = &cur->bc_rec.rc;
 	struct xfs_refcount_key		*kp = &key->refc;
 
-	return (__int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
+	return (int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_refcountbt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	return (__int64_t)be32_to_cpu(k1->refc.rc_startblock) -
+	return (int64_t)be32_to_cpu(k1->refc.rc_startblock) -
 			  be32_to_cpu(k2->refc.rc_startblock);
 }
 
diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c
index f78771d..0d6b5d4 100644
--- a/libxfs/xfs_rmap.c
+++ b/libxfs/xfs_rmap.c
@@ -2059,7 +2059,7 @@ int
 xfs_rmap_finish_one(
 	struct xfs_trans		*tp,
 	enum xfs_rmap_intent_type	type,
-	__uint64_t			owner,
+	uint64_t			owner,
 	int				whichfork,
 	xfs_fileoff_t			startoff,
 	xfs_fsblock_t			startblock,
@@ -2180,7 +2180,7 @@ __xfs_rmap_add(
 	struct xfs_mount		*mp,
 	struct xfs_defer_ops		*dfops,
 	enum xfs_rmap_intent_type	type,
-	__uint64_t			owner,
+	uint64_t			owner,
 	int				whichfork,
 	struct xfs_bmbt_irec		*bmap)
 {
@@ -2264,7 +2264,7 @@ xfs_rmap_alloc_extent(
 	xfs_agnumber_t		agno,
 	xfs_agblock_t		bno,
 	xfs_extlen_t		len,
-	__uint64_t		owner)
+	uint64_t		owner)
 {
 	struct xfs_bmbt_irec	bmap;
 
@@ -2288,7 +2288,7 @@ xfs_rmap_free_extent(
 	xfs_agnumber_t		agno,
 	xfs_agblock_t		bno,
 	xfs_extlen_t		len,
-	__uint64_t		owner)
+	uint64_t		owner)
 {
 	struct xfs_bmbt_irec	bmap;
 
diff --git a/libxfs/xfs_rmap.h b/libxfs/xfs_rmap.h
index 98f908f..265116d 100644
--- a/libxfs/xfs_rmap.h
+++ b/libxfs/xfs_rmap.h
@@ -179,7 +179,7 @@ enum xfs_rmap_intent_type {
 struct xfs_rmap_intent {
 	struct list_head			ri_list;
 	enum xfs_rmap_intent_type		ri_type;
-	__uint64_t				ri_owner;
+	uint64_t				ri_owner;
 	int					ri_whichfork;
 	struct xfs_bmbt_irec			ri_bmap;
 };
@@ -196,15 +196,15 @@ int xfs_rmap_convert_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
 		struct xfs_bmbt_irec *imap);
 int xfs_rmap_alloc_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
 		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
-		__uint64_t owner);
+		uint64_t owner);
 int xfs_rmap_free_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
 		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
-		__uint64_t owner);
+		uint64_t owner);
 
 void xfs_rmap_finish_one_cleanup(struct xfs_trans *tp,
 		struct xfs_btree_cur *rcur, int error);
 int xfs_rmap_finish_one(struct xfs_trans *tp, enum xfs_rmap_intent_type type,
-		__uint64_t owner, int whichfork, xfs_fileoff_t startoff,
+		uint64_t owner, int whichfork, xfs_fileoff_t startoff,
 		xfs_fsblock_t startblock, xfs_filblks_t blockcount,
 		xfs_exntst_t state, struct xfs_btree_cur **pcur);
 
diff --git a/libxfs/xfs_rmap_btree.c b/libxfs/xfs_rmap_btree.c
index a186c87..45ac436 100644
--- a/libxfs/xfs_rmap_btree.c
+++ b/libxfs/xfs_rmap_btree.c
@@ -197,7 +197,7 @@ xfs_rmapbt_init_high_key_from_rec(
 	union xfs_btree_key	*key,
 	union xfs_btree_rec	*rec)
 {
-	__uint64_t		off;
+	uint64_t		off;
 	int			adj;
 
 	adj = be32_to_cpu(rec->rmap.rm_blockcount) - 1;
@@ -239,7 +239,7 @@ xfs_rmapbt_init_ptr_from_cur(
 	ptr->s = agf->agf_roots[cur->bc_btnum];
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_rmapbt_key_diff(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*key)
@@ -247,9 +247,9 @@ xfs_rmapbt_key_diff(
 	struct xfs_rmap_irec	*rec = &cur->bc_rec.r;
 	struct xfs_rmap_key	*kp = &key->rmap;
 	__u64			x, y;
-	__int64_t		d;
+	int64_t			d;
 
-	d = (__int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
+	d = (int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
 	if (d)
 		return d;
 
@@ -269,7 +269,7 @@ xfs_rmapbt_key_diff(
 	return 0;
 }
 
-STATIC __int64_t
+STATIC int64_t
 xfs_rmapbt_diff_two_keys(
 	struct xfs_btree_cur	*cur,
 	union xfs_btree_key	*k1,
@@ -277,10 +277,10 @@ xfs_rmapbt_diff_two_keys(
 {
 	struct xfs_rmap_key	*kp1 = &k1->rmap;
 	struct xfs_rmap_key	*kp2 = &k2->rmap;
-	__int64_t		d;
+	int64_t			d;
 	__u64			x, y;
 
-	d = (__int64_t)be32_to_cpu(kp1->rm_startblock) -
+	d = (int64_t)be32_to_cpu(kp1->rm_startblock) -
 		       be32_to_cpu(kp2->rm_startblock);
 	if (d)
 		return d;
@@ -382,10 +382,10 @@ xfs_rmapbt_keys_inorder(
 	union xfs_btree_key	*k1,
 	union xfs_btree_key	*k2)
 {
-	__uint32_t		x;
-	__uint32_t		y;
-	__uint64_t		a;
-	__uint64_t		b;
+	uint32_t		x;
+	uint32_t		y;
+	uint64_t		a;
+	uint64_t		b;
 
 	x = be32_to_cpu(k1->rmap.rm_startblock);
 	y = be32_to_cpu(k2->rmap.rm_startblock);
@@ -412,10 +412,10 @@ xfs_rmapbt_recs_inorder(
 	union xfs_btree_rec	*r1,
 	union xfs_btree_rec	*r2)
 {
-	__uint32_t		x;
-	__uint32_t		y;
-	__uint64_t		a;
-	__uint64_t		b;
+	uint32_t		x;
+	uint32_t		y;
+	uint64_t		a;
+	uint64_t		b;
 
 	x = be32_to_cpu(r1->rmap.rm_startblock);
 	y = be32_to_cpu(r2->rmap.rm_startblock);
diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
index dbd2f88..8f8a99d 100644
--- a/libxfs/xfs_rtbitmap.c
+++ b/libxfs/xfs_rtbitmap.c
@@ -1006,7 +1006,7 @@ xfs_rtfree_extent(
 	    mp->m_sb.sb_rextents) {
 		if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM))
 			mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM;
-		*(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
+		*(uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
 		xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE);
 	}
 	return 0;
diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
index 93a1819..51f6970 100644
--- a/libxfs/xfs_sb.c
+++ b/libxfs/xfs_sb.c
@@ -430,7 +430,7 @@ xfs_sb_quota_to_disk(
 	struct xfs_dsb	*to,
 	struct xfs_sb	*from)
 {
-	__uint16_t	qflags = from->sb_qflags;
+	uint16_t	qflags = from->sb_qflags;
 
 	to->sb_uquotino = cpu_to_be64(from->sb_uquotino);
 	if (xfs_sb_version_has_pquotino(from)) {
@@ -738,7 +738,7 @@ xfs_sb_mount_common(
 	mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2;
 
 	mp->m_bsize = XFS_FSB_TO_BB(mp, 1);
-	mp->m_ialloc_inos = (int)MAX((__uint16_t)XFS_INODES_PER_CHUNK,
+	mp->m_ialloc_inos = (int)MAX((uint16_t)XFS_INODES_PER_CHUNK,
 					sbp->sb_inopblock);
 	mp->m_ialloc_blks = mp->m_ialloc_inos >> sbp->sb_inopblog;
 
diff --git a/libxfs/xfs_types.h b/libxfs/xfs_types.h
index 717909f..0220159 100644
--- a/libxfs/xfs_types.h
+++ b/libxfs/xfs_types.h
@@ -18,34 +18,34 @@
 #ifndef __XFS_TYPES_H__
 #define	__XFS_TYPES_H__
 
-typedef __uint32_t	prid_t;		/* project ID */
+typedef uint32_t	prid_t;		/* project ID */
 
-typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
-typedef	__uint32_t	xfs_agino_t;	/* inode # within allocation grp */
-typedef	__uint32_t	xfs_extlen_t;	/* extent length in blocks */
-typedef	__uint32_t	xfs_agnumber_t;	/* allocation group number */
-typedef __int32_t	xfs_extnum_t;	/* # of extents in a file */
-typedef __int16_t	xfs_aextnum_t;	/* # extents in an attribute fork */
-typedef	__int64_t	xfs_fsize_t;	/* bytes in a file */
-typedef __uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
+typedef uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
+typedef uint32_t	xfs_agino_t;	/* inode # within allocation grp */
+typedef uint32_t	xfs_extlen_t;	/* extent length in blocks */
+typedef uint32_t	xfs_agnumber_t;	/* allocation group number */
+typedef int32_t		xfs_extnum_t;	/* # of extents in a file */
+typedef int16_t		xfs_aextnum_t;	/* # extents in an attribute fork */
+typedef int64_t		xfs_fsize_t;	/* bytes in a file */
+typedef uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
 
-typedef	__int32_t	xfs_suminfo_t;	/* type of bitmap summary info */
-typedef	__int32_t	xfs_rtword_t;	/* word type for bitmap manipulations */
+typedef int32_t		xfs_suminfo_t;	/* type of bitmap summary info */
+typedef int32_t		xfs_rtword_t;	/* word type for bitmap manipulations */
 
-typedef	__int64_t	xfs_lsn_t;	/* log sequence number */
-typedef	__int32_t	xfs_tid_t;	/* transaction identifier */
+typedef int64_t		xfs_lsn_t;	/* log sequence number */
+typedef int32_t		xfs_tid_t;	/* transaction identifier */
 
-typedef	__uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
-typedef	__uint32_t	xfs_dahash_t;	/* dir/attr hash value */
+typedef uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
+typedef uint32_t	xfs_dahash_t;	/* dir/attr hash value */
 
-typedef	__uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
-typedef __uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
-typedef __uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
-typedef __uint64_t	xfs_fileoff_t;	/* block number in a file */
-typedef __uint64_t	xfs_filblks_t;	/* number of blocks in a file */
+typedef uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
+typedef uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
+typedef uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
+typedef uint64_t	xfs_fileoff_t;	/* block number in a file */
+typedef uint64_t	xfs_filblks_t;	/* number of blocks in a file */
 
-typedef	__int64_t	xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
-typedef __int64_t	xfs_sfiloff_t;	/* signed block number in a file */
+typedef int64_t		xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
+typedef int64_t		xfs_sfiloff_t;	/* signed block number in a file */
 
 /*
  * Null values for the types.
@@ -125,7 +125,7 @@ struct xfs_name {
  * uid_t and gid_t are hard-coded to 32 bits in the inode.
  * Hence, an 'id' in a dquot is 32 bits..
  */
-typedef __uint32_t	xfs_dqid_t;
+typedef uint32_t	xfs_dqid_t;
 
 /*
  * Constants for bit manipulations.
diff --git a/logprint/log_misc.c b/logprint/log_misc.c
index 0dfcfd1..fe27f15 100644
--- a/logprint/log_misc.c
+++ b/logprint/log_misc.c
@@ -166,12 +166,12 @@ xlog_print_trans_header(char **ptr, int len)
 {
     xfs_trans_header_t  *h;
     char		*cptr = *ptr;
-    __uint32_t          magic;
+    uint32_t          magic;
     char                *magic_c = (char *)&magic;
 
     *ptr += len;
 
-    magic=*(__uint32_t*)cptr; /* XXX be32_to_cpu soon */
+    magic=*(uint32_t*)cptr; /* XXX be32_to_cpu soon */
 
     if (len >= 4) {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -201,7 +201,7 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
     int			 num, skip;
     int			 super_block = 0;
     int			 bucket, col, buckets;
-    __int64_t		 blkno;
+    int64_t			 blkno;
     xfs_buf_log_format_t lbuf;
     int			 size, blen, map_size, struct_size;
     __be64		 x, y;
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index 0d399f1..0667e39 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -65,7 +65,7 @@ perform_restore(
 	int			mb_count;
 	xfs_metablock_t		tmb;
 	xfs_sb_t		sb;
-	__int64_t		bytes_read;
+	int64_t			bytes_read;
 
 	/*
 	 * read in first blocks (superblock 0), set "inprogress" flag for it,
diff --git a/mkfs/proto.c b/mkfs/proto.c
index 89cd237..cf8cc39 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -667,7 +667,7 @@ rtinit(
 	mp->m_sb.sb_rbmino = rbmip->i_ino;
 	rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
 	rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
-	*(__uint64_t *)&VFS_I(rbmip)->i_atime = 0;
+	*(uint64_t *)&VFS_I(rbmip)->i_atime = 0;
 	libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
 	libxfs_log_sb(tp);
 	mp->m_rbmip = rbmip;
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 930f3d2..45ab83c 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -708,9 +708,9 @@ struct opt_params mopts = {
 	},
 };
 
-#define TERABYTES(count, blog)	((__uint64_t)(count) << (40 - (blog)))
-#define GIGABYTES(count, blog)	((__uint64_t)(count) << (30 - (blog)))
-#define MEGABYTES(count, blog)	((__uint64_t)(count) << (20 - (blog)))
+#define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
+#define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
+#define MEGABYTES(count, blog)	((uint64_t)(count) << (20 - (blog)))
 
 /*
  * Use this macro before we have superblock and mount structure
@@ -881,7 +881,7 @@ fixup_log_stripe_unit(
 	xfs_rfsblock_t	*logblocks,
 	int		blocklog)
 {
-	__uint64_t	tmp_logblocks;
+	uint64_t	tmp_logblocks;
 
 	/*
 	 * Make sure that the log size is a multiple of the stripe unit
@@ -913,7 +913,7 @@ fixup_internal_log_stripe(
 	xfs_mount_t	*mp,
 	int		lsflag,
 	xfs_fsblock_t	logstart,
-	__uint64_t	agsize,
+	uint64_t	agsize,
 	int		sunit,
 	xfs_rfsblock_t	*logblocks,
 	int		blocklog,
@@ -937,7 +937,7 @@ fixup_internal_log_stripe(
 }
 
 void
-validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks)
+validate_log_size(uint64_t logblocks, int blocklog, int min_logblocks)
 {
 	if (logblocks < min_logblocks) {
 		fprintf(stderr,
@@ -962,7 +962,7 @@ validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks)
 static int
 calc_default_imaxpct(
 	int		blocklog,
-	__uint64_t	dblocks)
+	uint64_t	dblocks)
 {
 	/*
 	 * This returns the % of the disk space that is used for
@@ -984,9 +984,9 @@ calc_default_imaxpct(
 static void
 validate_ag_geometry(
 	int		blocklog,
-	__uint64_t	dblocks,
-	__uint64_t	agsize,
-	__uint64_t	agcount)
+	uint64_t	dblocks,
+	uint64_t	agsize,
+	uint64_t	agcount)
 {
 	if (agsize < XFS_AG_MIN_BLOCKS(blocklog)) {
 		fprintf(stderr,
@@ -1062,7 +1062,7 @@ zero_old_xfs_structures(
 {
 	void 			*buf;
 	xfs_sb_t 		sb;
-	__uint32_t		bsize;
+	uint32_t		bsize;
 	int			i;
 	xfs_off_t		off;
 
@@ -1115,8 +1115,8 @@ zero_old_xfs_structures(
 			i != sb.sb_blocklog)
 		goto done;
 
-	if (sb.sb_dblocks > ((__uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
-			sb.sb_dblocks < ((__uint64_t)(sb.sb_agcount - 1) *
+	if (sb.sb_dblocks > ((uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
+			sb.sb_dblocks < ((uint64_t)(sb.sb_agcount - 1) *
 					 sb.sb_agblocks + XFS_MIN_AG_BLOCKS))
 		goto done;
 
@@ -1136,7 +1136,7 @@ zero_old_xfs_structures(
 }
 
 static void
-discard_blocks(dev_t dev, __uint64_t nsectors)
+discard_blocks(dev_t dev, uint64_t nsectors)
 {
 	int fd;
 
@@ -1398,11 +1398,11 @@ main(
 	int			argc,
 	char			**argv)
 {
-	__uint64_t		agcount;
+	uint64_t		agcount;
 	xfs_agf_t		*agf;
 	xfs_agi_t		*agi;
 	xfs_agnumber_t		agno;
-	__uint64_t		agsize;
+	uint64_t		agsize;
 	xfs_alloc_rec_t		*arec;
 	struct xfs_btree_block	*block;
 	int			blflag;
@@ -1477,10 +1477,10 @@ main(
 	char			*rtsize;
 	xfs_sb_t		*sbp;
 	int			sectorlog;
-	__uint64_t		sector_mask;
+	uint64_t		sector_mask;
 	int			slflag;
 	int			ssflag;
-	__uint64_t		tmp_agsize;
+	uint64_t		tmp_agsize;
 	uuid_t			uuid;
 	int			worst_freelist;
 	libxfs_init_t		xi;
@@ -2165,7 +2165,7 @@ _("rmapbt not supported with realtime devices\n"));
 
 
 	if (dsize) {
-		__uint64_t dbytes;
+		uint64_t dbytes;
 
 		dbytes = getnum(dsize, &dopts, D_SIZE);
 		if (dbytes % XFS_MIN_BLOCKSIZE) {
@@ -2197,7 +2197,7 @@ _("rmapbt not supported with realtime devices\n"));
 	}
 
 	if (logsize) {
-		__uint64_t logbytes;
+		uint64_t logbytes;
 
 		logbytes = getnum(logsize, &lopts, L_SIZE);
 		if (logbytes % XFS_MIN_BLOCKSIZE) {
@@ -2214,7 +2214,7 @@ _("rmapbt not supported with realtime devices\n"));
 				(long long)(logblocks << blocklog));
 	}
 	if (rtsize) {
-		__uint64_t rtbytes;
+		uint64_t rtbytes;
 
 		rtbytes = getnum(rtsize, &ropts, R_SIZE);
 		if (rtbytes % XFS_MIN_BLOCKSIZE) {
@@ -2234,7 +2234,7 @@ _("rmapbt not supported with realtime devices\n"));
 	 * If specified, check rt extent size against its constraints.
 	 */
 	if (rtextsize) {
-		__uint64_t rtextbytes;
+		uint64_t rtextbytes;
 
 		rtextbytes = getnum(rtextsize, &ropts, R_EXTSIZE);
 		if (rtextbytes % blocksize) {
@@ -2250,8 +2250,8 @@ _("rmapbt not supported with realtime devices\n"));
 		 * and the underlying volume is striped, then set rtextblocks
 		 * to the stripe width.
 		 */
-		__uint64_t	rswidth;
-		__uint64_t	rtextbytes;
+		uint64_t	rswidth;
+		uint64_t	rtextbytes;
 
 		if (!norsflag && !xi.risfile && !(!rtsize && xi.disfile))
 			rswidth = ft.rtswidth;
@@ -2329,10 +2329,10 @@ _("rmapbt not supported with realtime devices\n"));
 	 * multiple of the sector size, or 1024, whichever is larger.
 	 */
 
-	sector_mask = (__uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
+	sector_mask = (uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
 	xi.dsize &= sector_mask;
 	xi.rtsize &= sector_mask;
-	xi.logBBsize &= (__uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
+	xi.logBBsize &= (uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
 
 
 	/* don't do discards on print-only runs or on files */
@@ -2689,9 +2689,9 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
 	mp = &mbuf;
 	sbp = &mp->m_sb;
 	memset(mp, 0, sizeof(xfs_mount_t));
-	sbp->sb_blocklog = (__uint8_t)blocklog;
-	sbp->sb_sectlog = (__uint8_t)sectorlog;
-	sbp->sb_agblklog = (__uint8_t)libxfs_log2_roundup((unsigned int)agsize);
+	sbp->sb_blocklog = (uint8_t)blocklog;
+	sbp->sb_sectlog = (uint8_t)sectorlog;
+	sbp->sb_agblklog = (uint8_t)libxfs_log2_roundup((unsigned int)agsize);
 	sbp->sb_agblocks = (xfs_agblock_t)agsize;
 	mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
 	mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
@@ -2798,14 +2798,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
 	sbp->sb_agcount = (xfs_agnumber_t)agcount;
 	sbp->sb_rbmblocks = nbmblocks;
 	sbp->sb_logblocks = (xfs_extlen_t)logblocks;
-	sbp->sb_sectsize = (__uint16_t)sectorsize;
-	sbp->sb_inodesize = (__uint16_t)isize;
-	sbp->sb_inopblock = (__uint16_t)(blocksize / isize);
-	sbp->sb_sectlog = (__uint8_t)sectorlog;
-	sbp->sb_inodelog = (__uint8_t)inodelog;
-	sbp->sb_inopblog = (__uint8_t)(blocklog - inodelog);
+	sbp->sb_sectsize = (uint16_t)sectorsize;
+	sbp->sb_inodesize = (uint16_t)isize;
+	sbp->sb_inopblock = (uint16_t)(blocksize / isize);
+	sbp->sb_sectlog = (uint8_t)sectorlog;
+	sbp->sb_inodelog = (uint8_t)inodelog;
+	sbp->sb_inopblog = (uint8_t)(blocklog - inodelog);
 	sbp->sb_rextslog =
-		(__uint8_t)(rtextents ?
+		(uint8_t)(rtextents ?
 			libxfs_highbit32((unsigned int)rtextents) : 0);
 	sbp->sb_inprogress = 1;	/* mkfs is in progress */
 	sbp->sb_imax_pct = imaxpct;
@@ -2833,8 +2833,8 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
 	} else
 		sbp->sb_inoalignmt = 0;
 	if (lsectorsize != BBSIZE || sectorsize != BBSIZE) {
-		sbp->sb_logsectlog = (__uint8_t)lsectorlog;
-		sbp->sb_logsectsize = (__uint16_t)lsectorsize;
+		sbp->sb_logsectlog = (uint8_t)lsectorlog;
+		sbp->sb_logsectsize = (uint16_t)lsectorsize;
 	} else {
 		sbp->sb_logsectlog = 0;
 		sbp->sb_logsectsize = 0;
diff --git a/quota/edit.c b/quota/edit.c
index 36b327a..8418e85 100644
--- a/quota/edit.c
+++ b/quota/edit.c
@@ -115,16 +115,16 @@ warn_help(void)
 
 static void
 set_limits(
-	__uint32_t	id,
+	uint32_t	id,
 	uint		type,
 	uint		mask,
 	char		*dev,
-	__uint64_t	*bsoft,
-	__uint64_t	*bhard,
-	__uint64_t	*isoft,
-	__uint64_t	*ihard,
-	__uint64_t	*rtbsoft,
-	__uint64_t	*rtbhard)
+	uint64_t	*bsoft,
+	uint64_t	*bhard,
+	uint64_t	*isoft,
+	uint64_t	*ihard,
+	uint64_t	*rtbsoft,
+	uint64_t	*rtbhard)
 {
 	fs_disk_quota_t	d;
 
@@ -152,12 +152,12 @@ set_user_limits(
 	char		*name,
 	uint		type,
 	uint		mask,
-	__uint64_t	*bsoft,
-	__uint64_t	*bhard,
-	__uint64_t	*isoft,
-	__uint64_t	*ihard,
-	__uint64_t	*rtbsoft,
-	__uint64_t	*rtbhard)
+	uint64_t	*bsoft,
+	uint64_t	*bhard,
+	uint64_t	*isoft,
+	uint64_t	*ihard,
+	uint64_t	*rtbsoft,
+	uint64_t	*rtbhard)
 {
 	uid_t		uid = uid_from_string(name);
 
@@ -175,12 +175,12 @@ set_group_limits(
 	char		*name,
 	uint		type,
 	uint		mask,
-	__uint64_t	*bsoft,
-	__uint64_t	*bhard,
-	__uint64_t	*isoft,
-	__uint64_t	*ihard,
-	__uint64_t	*rtbsoft,
-	__uint64_t	*rtbhard)
+	uint64_t	*bsoft,
+	uint64_t	*bhard,
+	uint64_t	*isoft,
+	uint64_t	*ihard,
+	uint64_t	*rtbsoft,
+	uint64_t	*rtbhard)
 {
 	gid_t		gid = gid_from_string(name);
 
@@ -198,12 +198,12 @@ set_project_limits(
 	char		*name,
 	uint		type,
 	uint		mask,
-	__uint64_t	*bsoft,
-	__uint64_t	*bhard,
-	__uint64_t	*isoft,
-	__uint64_t	*ihard,
-	__uint64_t	*rtbsoft,
-	__uint64_t	*rtbhard)
+	uint64_t	*bsoft,
+	uint64_t	*bhard,
+	uint64_t	*isoft,
+	uint64_t	*ihard,
+	uint64_t	*rtbsoft,
+	uint64_t	*rtbhard)
 {
 	prid_t		prid = prid_from_string(name);
 
@@ -224,7 +224,7 @@ extractb(
 	int		length,
 	uint		blocksize,
 	uint		sectorsize,
-	__uint64_t	*value)
+	uint64_t	*value)
 {
 	long long	v;
 	char		*s = string;
@@ -238,7 +238,7 @@ extractb(
 				progname, s);
 			return 0;
 		}
-		*value = (__uint64_t)v >> 9;	/* syscalls use basic blocks */
+		*value = (uint64_t)v >> 9;	/* syscalls use basic blocks */
 		if (v > 0 && *value == 0)
 			fprintf(stderr, _("%s: Warning: `%s' in quota blocks is 0 (unlimited).\n"), progname, s);
 		return 1;
@@ -252,7 +252,7 @@ extracti(
 	char		*string,
 	const char	*prefix,
 	int		length,
-	__uint64_t	*value)
+	uint64_t	*value)
 {
 	char		*sp, *s = string;
 
@@ -270,7 +270,7 @@ limit_f(
 	char		**argv)
 {
 	char		*name;
-	__uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
+	uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
 	int		c, type = 0, mask = 0, flags = 0;
 	uint		bsize, ssize, endoptions;
 
@@ -384,8 +384,8 @@ restore_file(
 	char		*dev = NULL;
 	uint		mask;
 	int		cnt;
-	__uint32_t	id;
-	__uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
+	uint32_t	id;
+	uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
 
 	while (fgets(buffer, sizeof(buffer), fp) != NULL) {
 		if (strncmp("fs = ", buffer, 5) == 0) {
@@ -546,7 +546,7 @@ timer_f(
 
 static void
 set_warnings(
-	__uint32_t	id,
+	uint32_t	id,
 	uint		type,
 	uint		mask,
 	char		*dev,
diff --git a/quota/free.c b/quota/free.c
index cee15ee..1f8378d 100644
--- a/quota/free.c
+++ b/quota/free.c
@@ -49,20 +49,20 @@ free_help(void)
 static int
 mount_free_space_data(
 	struct fs_path		*mount,
-	__uint64_t		*bcount,
-	__uint64_t		*bused,
-	__uint64_t		*bfree,
-	__uint64_t		*icount,
-	__uint64_t		*iused,
-	__uint64_t		*ifree,
-	__uint64_t		*rcount,
-	__uint64_t		*rused,
-	__uint64_t		*rfree)
+	uint64_t		*bcount,
+	uint64_t		*bused,
+	uint64_t		*bfree,
+	uint64_t		*icount,
+	uint64_t		*iused,
+	uint64_t		*ifree,
+	uint64_t		*rcount,
+	uint64_t		*rused,
+	uint64_t		*rfree)
 {
 	struct xfs_fsop_counts	fscounts;
 	struct xfs_fsop_geom	fsgeo;
 	struct statfs		st;
-	__uint64_t		logsize, count, free;
+	uint64_t		logsize, count, free;
 	int			fd;
 
 	if ((fd = open(mount->fs_dir, O_RDONLY)) < 0) {
@@ -132,15 +132,15 @@ mount_free_space_data(
 static int
 projects_free_space_data(
 	struct fs_path		*path,
-	__uint64_t		*bcount,
-	__uint64_t		*bused,
-	__uint64_t		*bfree,
-	__uint64_t		*icount,
-	__uint64_t		*iused,
-	__uint64_t		*ifree,
-	__uint64_t		*rcount,
-	__uint64_t		*rused,
-	__uint64_t		*rfree)
+	uint64_t		*bcount,
+	uint64_t		*bused,
+	uint64_t		*bfree,
+	uint64_t		*icount,
+	uint64_t		*iused,
+	uint64_t		*ifree,
+	uint64_t		*rcount,
+	uint64_t		*rused,
+	uint64_t		*rfree)
 {
 	fs_quota_stat_t		qfs;
 	fs_disk_quota_t		d;
@@ -226,9 +226,9 @@ free_space(
 	fs_path_t	*path,
 	uint		flags)
 {
-	__uint64_t	bcount, bused, bfree;
-	__uint64_t	icount, iused, ifree;
-	__uint64_t	rcount, rused, rfree;
+	uint64_t	bcount, bused, bfree;
+	uint64_t	icount, iused, ifree;
+	uint64_t	rcount, rused, rfree;
 	char		a[8], s[8], u[8], p[8];
 	int		count;
 
diff --git a/quota/quot.c b/quota/quot.c
index ccc154f..6378fbb 100644
--- a/quota/quot.c
+++ b/quota/quot.c
@@ -26,17 +26,17 @@
 
 typedef struct du {
 	struct du	*next;
-	__uint64_t	blocks;
-	__uint64_t	blocks30;
-	__uint64_t	blocks60;
-	__uint64_t	blocks90;
-	__uint64_t	nfiles;
-	__uint32_t	id;
+	uint64_t	blocks;
+	uint64_t	blocks30;
+	uint64_t	blocks60;
+	uint64_t	blocks90;
+	uint64_t	nfiles;
+	uint32_t	id;
 } du_t;
 
 #define	TSIZE		500
-static __uint64_t	sizes[TSIZE];
-static __uint64_t	overflow;
+static uint64_t	sizes[TSIZE];
+static uint64_t	overflow;
 
 #define	NDU		60000
 #define	DUHASH		8209
@@ -84,8 +84,8 @@ quot_bulkstat_add(
 {
 	du_t		*dp;
 	du_t		**hp;
-	__uint64_t	size;
-	__uint32_t	i, id;
+	uint64_t	size;
+	uint32_t	i, id;
 
 	if ((p->bs_mode & S_IFMT) == 0)
 		return;
@@ -203,7 +203,7 @@ qcompare(
 	return 0;
 }
 
-typedef char *(*idtoname_t)(__uint32_t);
+typedef char *(*idtoname_t)(uint32_t);
 
 static void
 quot_report_mount_any_type(
@@ -291,7 +291,7 @@ quot_histogram_mount(
 	fs_path_t	*mount,
 	uint		flags)
 {
-	__uint64_t	t = 0;
+	uint64_t	t = 0;
 	int		i;
 
 	fprintf(fp, _("%s (%s):\n"), mount->fs_name, mount->fs_dir);
diff --git a/quota/quota.c b/quota/quota.c
index d09e239..479b970 100644
--- a/quota/quota.c
+++ b/quota/quota.c
@@ -52,7 +52,7 @@ quota_help(void)
 static int
 quota_mount(
 	FILE		*fp,
-	__uint32_t	id,
+	uint32_t	id,
 	char		*name,
 	uint		form,
 	uint		type,
@@ -181,7 +181,7 @@ quota_mount(
 static void
 quota(
 	FILE		*fp,
-	__uint32_t	id,
+	uint32_t	id,
 	char		*name,
 	uint		form,
 	uint		type,
diff --git a/quota/quota.h b/quota/quota.h
index 4bde351..9ed28be 100644
--- a/quota/quota.h
+++ b/quota/quota.h
@@ -53,9 +53,9 @@ enum {
 extern char *type_to_string(uint __type);
 extern char *form_to_string(uint __form);
 extern char *time_to_string(time_t __time, uint __flags);
-extern char *bbs_to_string(__uint64_t __v, char *__c, uint __size);
-extern char *num_to_string(__uint64_t __v, char *__c, uint __size);
-extern char *pct_to_string(__uint64_t __v, __uint64_t __t, char *__c, uint __s);
+extern char *bbs_to_string(uint64_t __v, char *__c, uint __size);
+extern char *num_to_string(uint64_t __v, char *__c, uint __size);
+extern char *pct_to_string(uint64_t __v, uint64_t __t, char *__c, uint __s);
 
 extern FILE *fopen_write_secure(char *__filename);
 
@@ -81,7 +81,7 @@ enum {
  * Identifier (uid/gid/prid) cache routines
  */
 #define NMAX 32
-extern char *uid_to_name(__uint32_t __uid);
-extern char *gid_to_name(__uint32_t __gid);
-extern char *prid_to_name(__uint32_t __prid);
+extern char *uid_to_name(uint32_t __uid);
+extern char *gid_to_name(uint32_t __gid);
+extern char *prid_to_name(uint32_t __prid);
 extern bool isdigits_only(const char *);
diff --git a/quota/report.c b/quota/report.c
index d0509c2..b2ea3bb 100644
--- a/quota/report.c
+++ b/quota/report.c
@@ -333,9 +333,9 @@ report_header(
 static int
 report_mount(
 	FILE		*fp,
-	__uint32_t	id,
+	uint32_t	id,
 	char		*name,
-	__uint32_t	*oid,
+	uint32_t	*oid,
 	uint		form,
 	uint		type,
 	fs_path_t	*mount,
diff --git a/quota/state.c b/quota/state.c
index 09dfa70..b08bf50 100644
--- a/quota/state.c
+++ b/quota/state.c
@@ -135,7 +135,7 @@ static void
 state_timelimit(
 	FILE		*fp,
 	uint		form,
-	__uint32_t	timelimit)
+	uint32_t	timelimit)
 {
 	fprintf(fp, _("%s grace time: %s\n"),
 		form_to_string(form),
diff --git a/quota/util.c b/quota/util.c
index cafd45f..37840a8 100644
--- a/quota/util.c
+++ b/quota/util.c
@@ -94,8 +94,8 @@ round_snprintf(
 	size_t		size,
 	const char	*fmt_round,
 	const char	*fmt_not_round,
-	__uint64_t	value,
-	__uint64_t	divisor)
+	uint64_t	value,
+	uint64_t	divisor)
 {
 	double		v = (double)value / divisor;
 
@@ -107,23 +107,23 @@ round_snprintf(
 }
 
 /* Basic blocks (512) bytes are returned from quotactl */
-#define BBS_TO_EXABYTES(bbs)	((__uint64_t)(bbs)>>51)
-#define BBS_TO_PETABYTES(bbs)	((__uint64_t)(bbs)>>41)
-#define BBS_TO_TERABYTES(bbs)	((__uint64_t)(bbs)>>31)
-#define BBS_TO_GIGABYTES(bbs)	((__uint64_t)(bbs)>>21)
-#define BBS_TO_MEGABYTES(bbs)	((__uint64_t)(bbs)>>11)
-#define BBS_TO_KILOBYTES(bbs)	((__uint64_t)(bbs)>>1)
-
-#define BBEXABYTE		((__uint64_t)1<<51)
-#define BBPETABYTE		((__uint64_t)1<<41)
-#define BBTERABYTE		((__uint64_t)1<<31)
-#define BBGIGABYTE		((__uint64_t)1<<21)
-#define BBMEGABYTE		((__uint64_t)1<<11)
-#define BBKILOBYTE		((__uint64_t)1<< 1)
+#define BBS_TO_EXABYTES(bbs)	((uint64_t)(bbs)>>51)
+#define BBS_TO_PETABYTES(bbs)	((uint64_t)(bbs)>>41)
+#define BBS_TO_TERABYTES(bbs)	((uint64_t)(bbs)>>31)
+#define BBS_TO_GIGABYTES(bbs)	((uint64_t)(bbs)>>21)
+#define BBS_TO_MEGABYTES(bbs)	((uint64_t)(bbs)>>11)
+#define BBS_TO_KILOBYTES(bbs)	((uint64_t)(bbs)>>1)
+
+#define BBEXABYTE		((uint64_t)1<<51)
+#define BBPETABYTE		((uint64_t)1<<41)
+#define BBTERABYTE		((uint64_t)1<<31)
+#define BBGIGABYTE		((uint64_t)1<<21)
+#define BBMEGABYTE		((uint64_t)1<<11)
+#define BBKILOBYTE		((uint64_t)1<< 1)
 
 char *
 bbs_to_string(
-	__uint64_t	v,
+	uint64_t	v,
 	char		*sp,
 	uint		size)
 {
@@ -146,17 +146,17 @@ bbs_to_string(
 	return sp;
 }
 
-#define THOUSAND		((__uint64_t)1000)
-#define MILLION			((__uint64_t)1000*1000)
-#define BILLION			((__uint64_t)1000*1000*1000)
-#define TRILLION		((__uint64_t)1000*1000*1000*1000)
-#define GAZILLION		((__uint64_t)1000*1000*1000*1000*1000)
-#define RIDICULOUS		((__uint64_t)1000*1000*1000*1000*1000*1000)
-#define STOPALREADY		((__uint64_t)1000*1000*1000*1000*1000*1000*1000)
+#define THOUSAND		((uint64_t)1000)
+#define MILLION			((uint64_t)1000*1000)
+#define BILLION			((uint64_t)1000*1000*1000)
+#define TRILLION		((uint64_t)1000*1000*1000*1000)
+#define GAZILLION		((uint64_t)1000*1000*1000*1000*1000)
+#define RIDICULOUS		((uint64_t)1000*1000*1000*1000*1000*1000)
+#define STOPALREADY		((uint64_t)1000*1000*1000*1000*1000*1000*1000)
 
 char *
 num_to_string(
-	__uint64_t	v,
+	uint64_t	v,
 	char		*sp,
 	uint		size)
 {
@@ -183,8 +183,8 @@ num_to_string(
 
 char *
 pct_to_string(
-	__uint64_t	portion,
-	__uint64_t	whole,
+	uint64_t	portion,
+	uint64_t	whole,
 	char		*buf,
 	uint		size)
 {
@@ -237,7 +237,7 @@ type_to_string(
 #define IDMASK		(NID-1)
 
 typedef struct {
-	__uint32_t	id;
+	uint32_t	id;
 	char		name[NMAX+1];
 } idcache_t;
 
@@ -250,7 +250,7 @@ static int		pentriesleft = NID;
 
 static idcache_t *
 getnextpwent(
-	__uint32_t	id,
+	uint32_t	id,
 	int		byid)
 {
 	struct passwd	*pw;
@@ -266,7 +266,7 @@ getnextpwent(
 
 static idcache_t *
 getnextgrent(
-	__uint32_t	id,
+	uint32_t	id,
 	int		byid)
 {
 	struct group	*gr;
@@ -281,7 +281,7 @@ getnextgrent(
 
 static idcache_t *
 getnextprent(
-	__uint32_t	id,
+	uint32_t	id,
 	int		byid)
 {
 	fs_project_t	*pr;
@@ -296,7 +296,7 @@ getnextprent(
 
 char *
 uid_to_name(
-	__uint32_t	id)
+	uint32_t	id)
 {
 	idcache_t	*ncp, *idp;
 
@@ -333,7 +333,7 @@ uid_to_name(
 
 char *
 gid_to_name(
-	__uint32_t	id)
+	uint32_t	id)
 {
 	idcache_t	*ncp, *idp;
 
@@ -370,7 +370,7 @@ gid_to_name(
 
 char *
 prid_to_name(
-	__uint32_t	id)
+	uint32_t	id)
 {
 	idcache_t	*ncp, *idp;
 
diff --git a/repair/README b/repair/README
index 7f168e6..4692463 100644
--- a/repair/README
+++ b/repair/README
@@ -189,7 +189,7 @@ D - 0) look at usage of XFS_MAKE_IPTR().  It does the right
 
 
 D - 0) look at references to XFS_INODES_PER_CHUNK.  change the
-	ones that really mean sizeof(__uint64_t)*NBBY to
+	ones that really mean sizeof(uint64_t)*NBBY to
 	something else (like that only defined as a constant
 	INOS_PER_IREC. this isn't as important since
 	XFS_INODES_PER_CHUNK will never chang
diff --git a/repair/agheader.h b/repair/agheader.h
index 6b2974c..2f7246d 100644
--- a/repair/agheader.h
+++ b/repair/agheader.h
@@ -20,7 +20,7 @@ typedef struct fs_geometry  {
 	/*
 	 * these types should match the superblock types
 	 */
-	__uint32_t	sb_blocksize;	/* blocksize (bytes) */
+	uint32_t	sb_blocksize;	/* blocksize (bytes) */
 	xfs_rfsblock_t	sb_dblocks;	/* # data blocks */
 	xfs_rfsblock_t	sb_rblocks;	/* # realtime blocks */
 	xfs_rtblock_t	sb_rextents;	/* # realtime extents */
@@ -30,9 +30,9 @@ typedef struct fs_geometry  {
 	xfs_agnumber_t	sb_agcount;	/* # of ags */
 	xfs_extlen_t	sb_rbmblocks;	/* # of rt bitmap blocks */
 	xfs_extlen_t	sb_logblocks;	/* # of log blocks */
-	__uint16_t	sb_sectsize;	/* volume sector size (bytes) */
-	__uint16_t	sb_inodesize;	/* inode size (bytes) */
-	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
+	uint16_t	sb_sectsize;	/* volume sector size (bytes) */
+	uint16_t	sb_inodesize;	/* inode size (bytes) */
+	uint8_t		sb_imax_pct;	/* max % of fs for inode space */
 
 	/*
 	 * these don't have to match the superblock types but are placed
@@ -49,10 +49,10 @@ typedef struct fs_geometry  {
 	/*
 	 * fields after this point have to be checked manually in compare_sb()
 	 */
-	__uint8_t	sb_shared_vn;	/* shared version number */
+	uint8_t		sb_shared_vn;	/* shared version number */
 	xfs_extlen_t	sb_inoalignmt;	/* inode chunk alignment, fsblocks */
-	__uint32_t	sb_unit;	/* stripe or raid unit */
-	__uint32_t	sb_width;	/* stripe or width unit */
+	uint32_t	sb_unit;	/* stripe or raid unit */
+	uint32_t	sb_width;	/* stripe or width unit */
 
 	/*
 	 * these don't have to match, they track superblock properties
diff --git a/repair/attr_repair.h b/repair/attr_repair.h
index 7010e4f..294fad4 100644
--- a/repair/attr_repair.h
+++ b/repair/attr_repair.h
@@ -32,10 +32,10 @@
 #define ACL_WRITE	02
 #define ACL_EXECUTE	01
 
-typedef __uint16_t	xfs_acl_perm_t;
-typedef __int32_t	xfs_acl_type_t;
-typedef __int32_t	xfs_acl_tag_t;
-typedef __int32_t	xfs_acl_id_t;
+typedef uint16_t	xfs_acl_perm_t;
+typedef int32_t		xfs_acl_type_t;
+typedef int32_t		xfs_acl_tag_t;
+typedef int32_t		xfs_acl_id_t;
 
 /*
  * "icacl" = in-core ACL. There is no equivalent in the XFS kernel code,
@@ -50,7 +50,7 @@ struct xfs_icacl_entry {
 };
 
 struct xfs_icacl {
-	__int32_t		acl_cnt;
+	int32_t			acl_cnt;
 	struct xfs_icacl_entry	acl_entry[0];
 };
 
@@ -59,14 +59,14 @@ struct xfs_icacl {
  */
 #define XFS_MAC_MAX_SETS	250
 typedef struct xfs_mac_label {
-	__uint8_t       ml_msen_type;	/* MSEN label type */
-	__uint8_t       ml_mint_type;	/* MINT label type */
-	__uint8_t       ml_level;	/* Hierarchical level */
-	__uint8_t       ml_grade;	/* Hierarchical grade */
-	__uint16_t      ml_catcount;	/* Category count */
-	__uint16_t      ml_divcount;	/* Division count */
+	uint8_t       ml_msen_type;	/* MSEN label type */
+	uint8_t       ml_mint_type;	/* MINT label type */
+	uint8_t       ml_level;	/* Hierarchical level */
+	uint8_t       ml_grade;	/* Hierarchical grade */
+	uint16_t      ml_catcount;	/* Category count */
+	uint16_t      ml_divcount;	/* Division count */
 					/* Category set, then Division set */
-	__uint16_t      ml_list[XFS_MAC_MAX_SETS];
+	uint16_t      ml_list[XFS_MAC_MAX_SETS];
 } xfs_mac_label_t;
 
 /* MSEN label type names. Choose an upper case ASCII character.  */
@@ -93,7 +93,7 @@ typedef struct xfs_mac_label {
 /*
  * Capabilities (IRIX)
  */
-typedef __uint64_t xfs_cap_value_t;
+typedef uint64_t xfs_cap_value_t;
 
 typedef struct xfs_cap_set {
 	xfs_cap_value_t	cap_effective;  /* use in capability checks */
diff --git a/repair/avl64.c b/repair/avl64.c
index 51cd624..8f4a121 100644
--- a/repair/avl64.c
+++ b/repair/avl64.c
@@ -70,8 +70,8 @@ avl64_checktree(
 	avl64node_t *root)
 {
 	avl64node_t *nlast, *nnext, *np;
-	__uint64_t offset = 0;
-	__uint64_t end;
+	uint64_t offset = 0;
+	uint64_t end;
 
 	nlast = nnext = root;
 
@@ -583,8 +583,8 @@ avl64_delete(
 avl64node_t *
 avl64_findanyrange(
 	avl64tree_desc_t *tree,
-	__uint64_t start,
-	__uint64_t end,
+	uint64_t start,
+	uint64_t end,
 	int	checklen)
 {
 	avl64node_t *np = tree->avl_root;
@@ -655,7 +655,7 @@ avl64_findanyrange(
 avl64node_t *
 avl64_findrange(
 	avl64tree_desc_t *tree,
-	__uint64_t value)
+	uint64_t value)
 {
 	avl64node_t *np = tree->avl_root;
 
@@ -682,10 +682,10 @@ avl64_findrange(
 avl64node_t *
 avl64_find(
 	avl64tree_desc_t *tree,
-	__uint64_t value)
+	uint64_t value)
 {
 	avl64node_t *np = tree->avl_root;
-	__uint64_t nvalue;
+	uint64_t nvalue;
 
 	while (np) {
 		nvalue = AVL_START(tree, np);
@@ -909,8 +909,8 @@ static
 avl64node_t *
 avl64_insert_find_growth(
 		avl64tree_desc_t *tree,
-		__uint64_t start,	/* range start at start, */
-		__uint64_t end,	/* exclusive */
+		uint64_t start,	/* range start at start, */
+		uint64_t end,	/* exclusive */
 		int   *growthp)	/* OUT */
 {
 	avl64node_t *root = tree->avl_root;
@@ -963,7 +963,7 @@ avl64_insert_grow(
 	int growth)
 {
 	avl64node_t *nnext;
-	__uint64_t start = AVL_START(tree, newnode);
+	uint64_t start = AVL_START(tree, newnode);
 
 	if (growth == AVL_BACK) {
 
@@ -1005,8 +1005,8 @@ avl64_insert(
 	avl64node_t *newnode)
 {
 	avl64node_t *np;
-	__uint64_t start = AVL_START(tree, newnode);
-	__uint64_t end = AVL_END(tree, newnode);
+	uint64_t start = AVL_START(tree, newnode);
+	uint64_t end = AVL_END(tree, newnode);
 	int growth;
 
 	ASSERT(newnode);
@@ -1159,16 +1159,16 @@ avl64ops_t avl_debug_ops = {
 	avl_debug_end,
 }
 
-static __uint64_t
+static uint64_t
 avl64_debug_start(avl64node_t *node)
 {
-	return (__uint64_t)(struct avl_debug_node *)node->avl_start;
+	return (uint64_t)(struct avl_debug_node *)node->avl_start;
 }
 
-static __uint64_t
+static uint64_t
 avl64_debug_end(avl64node_t *node)
 {
-	return (__uint64_t)
+	return (uint64_t)
 		((struct avl_debug_node *)node->avl_start +
 		 (struct avl_debug_node *)node->avl_size);
 }
@@ -1304,7 +1304,7 @@ main()
 avl64node_t *
 avl64_findadjacent(
 	avl64tree_desc_t *tree,
-	__uint64_t value,
+	uint64_t value,
 	int		dir)
 {
 	avl64node_t *np = tree->avl_root;
@@ -1378,8 +1378,8 @@ avl64_findadjacent(
 void
 avl64_findranges(
 	avl64tree_desc_t *tree,
-	__uint64_t start,
-	__uint64_t end,
+	uint64_t start,
+	uint64_t end,
 	avl64node_t	        **startp,
 	avl64node_t		**endp)
 {
diff --git a/repair/avl64.h b/repair/avl64.h
index fd19321..cd079a0 100644
--- a/repair/avl64.h
+++ b/repair/avl64.h
@@ -32,8 +32,8 @@ typedef struct	avl64node {
  * avl-tree operations
  */
 typedef struct avl64ops {
-	__uint64_t	(*avl_start)(avl64node_t *);
-	__uint64_t	(*avl_end)(avl64node_t *);
+	uint64_t	(*avl_start)(avl64node_t *);
+	uint64_t	(*avl_end)(avl64node_t *);
 } avl64ops_t;
 
 /*
@@ -89,32 +89,32 @@ avl64_init_tree(
 avl64node_t *
 avl64_findrange(
 	avl64tree_desc_t *tree,
-	__uint64_t value);
+	uint64_t value);
 
 avl64node_t *
 avl64_find(
 	avl64tree_desc_t *tree,
-	__uint64_t value);
+	uint64_t value);
 
 avl64node_t *
 avl64_findanyrange(
 	avl64tree_desc_t *tree,
-	__uint64_t	start,
-	__uint64_t	end,
+	uint64_t	start,
+	uint64_t	end,
 	int     checklen);
 
 
 avl64node_t *
 avl64_findadjacent(
 	avl64tree_desc_t *tree,
-	__uint64_t	value,
+	uint64_t	value,
 	int		dir);
 
 void
 avl64_findranges(
 	avl64tree_desc_t *tree,
-	__uint64_t	start,
-	__uint64_t	end,
+	uint64_t	start,
+	uint64_t	end,
 	avl64node_t	        **startp,
 	avl64node_t		**endp);
 
diff --git a/repair/dinode.c b/repair/dinode.c
index d664f87..da87217 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -746,7 +746,7 @@ _("%s fork in ino %" PRIu64 " claims dup extent, "
 			case XR_E_FREE1:
 				do_warn(
 _("%s fork in ino %" PRIu64 " claims free block %" PRIu64 "\n"),
-					forkname, ino, (__uint64_t) b);
+					forkname, ino, (uint64_t) b);
 				/* fall through ... */
 			case XR_E_INUSE1:	/* seen by rmap */
 			case XR_E_UNKNOWN:
@@ -923,7 +923,7 @@ process_btinode(
 	int			type,
 	int			*dirty,
 	xfs_rfsblock_t		*tot,
-	__uint64_t		*nex,
+	uint64_t		*nex,
 	blkmap_t		**blkmapp,
 	int			whichfork,
 	int			check_dups)
@@ -939,7 +939,7 @@ process_btinode(
 	int			level;
 	int			numrecs;
 	bmap_cursor_t		cursor;
-	__uint64_t		magic;
+	uint64_t		magic;
 
 	dib = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
 	lino = XFS_AGINO_TO_INO(mp, agno, ino);
@@ -1098,7 +1098,7 @@ process_exinode(
 	int			type,
 	int			*dirty,
 	xfs_rfsblock_t		*tot,
-	__uint64_t		*nex,
+	uint64_t		*nex,
 	blkmap_t		**blkmapp,
 	int			whichfork,
 	int			check_dups)
@@ -1200,14 +1200,14 @@ process_symlink_extlist(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino)
 		do_warn(
 _("mismatch between format (%d) and size (%" PRId64 ") in symlink ino %" PRIu64 "\n"),
 			dino->di_format,
-			(__int64_t)be64_to_cpu(dino->di_size), lino);
+			(int64_t)be64_to_cpu(dino->di_size), lino);
 		return 1;
 	}
 	if (dino->di_format == XFS_DINODE_FMT_LOCAL) {
 		do_warn(
 _("mismatch between format (%d) and size (%" PRId64 ") in symlink inode %" PRIu64 "\n"),
 			dino->di_format,
-			(__int64_t)be64_to_cpu(dino->di_size), lino);
+			(int64_t)be64_to_cpu(dino->di_size), lino);
 		return 1;
 	}
 
@@ -1454,22 +1454,22 @@ _("inode %" PRIu64 " has bad inode type (IFMNT)\n"), lino);
 		case XR_INO_CHRDEV:
 			do_warn(
 _("size of character device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
-				(__int64_t)be64_to_cpu(dino->di_size));
+				(int64_t)be64_to_cpu(dino->di_size));
 			break;
 		case XR_INO_BLKDEV:
 			do_warn(
 _("size of block device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
-				(__int64_t)be64_to_cpu(dino->di_size));
+				(int64_t)be64_to_cpu(dino->di_size));
 			break;
 		case XR_INO_SOCK:
 			do_warn(
 _("size of socket inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
-				(__int64_t)be64_to_cpu(dino->di_size));
+				(int64_t)be64_to_cpu(dino->di_size));
 			break;
 		case XR_INO_FIFO:
 			do_warn(
 _("size of fifo inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
-				(__int64_t)be64_to_cpu(dino->di_size));
+				(int64_t)be64_to_cpu(dino->di_size));
 			break;
 		default:
 			do_warn(_("Internal error - process_misc_ino_types, "
@@ -1743,12 +1743,12 @@ _("found inode %" PRIu64 " claiming to be a real-time file\n"), lino);
 		break;
 
 	case XR_INO_RTBITMAP:
-		if (size != (__int64_t)mp->m_sb.sb_rbmblocks *
+		if (size != (int64_t)mp->m_sb.sb_rbmblocks *
 					mp->m_sb.sb_blocksize) {
 			do_warn(
 _("realtime bitmap inode %" PRIu64 " has bad size %" PRId64 " (should be %" PRIu64 ")\n"),
 				lino, size,
-				(__int64_t) mp->m_sb.sb_rbmblocks *
+				(int64_t) mp->m_sb.sb_rbmblocks *
 					mp->m_sb.sb_blocksize);
 			return 1;
 		}
@@ -1817,8 +1817,8 @@ static int
 process_inode_blocks_and_extents(
 	xfs_dinode_t	*dino,
 	xfs_rfsblock_t	nblocks,
-	__uint64_t	nextents,
-	__uint64_t	anextents,
+	uint64_t	nextents,
+	uint64_t	anextents,
 	xfs_ino_t	lino,
 	int		*dirty)
 {
@@ -1908,7 +1908,7 @@ process_inode_data_fork(
 	int		type,
 	int		*dirty,
 	xfs_rfsblock_t	*totblocks,
-	__uint64_t	*nextents,
+	uint64_t	*nextents,
 	blkmap_t	**dblkmap,
 	int		check_dups)
 {
@@ -2017,7 +2017,7 @@ process_inode_attr_fork(
 	int		type,
 	int		*dirty,
 	xfs_rfsblock_t	*atotblocks,
-	__uint64_t	*anextents,
+	uint64_t	*anextents,
 	int		check_dups,
 	int		extra_attr_check,
 	int		*retval)
@@ -2228,8 +2228,8 @@ process_dinode_int(xfs_mount_t *mp,
 	int			di_mode;
 	int			type;
 	int			retval = 0;
-	__uint64_t		nextents;
-	__uint64_t		anextents;
+	uint64_t		nextents;
+	uint64_t		anextents;
 	xfs_ino_t		lino;
 	const int		is_free = 0;
 	const int		is_used = 1;
@@ -2346,7 +2346,7 @@ _("inode identifier %llu mismatch on inode %" PRIu64 "\n"),
 		if (!uncertain)
 			do_warn(
 _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
-				(__int64_t)be64_to_cpu(dino->di_size),
+				(int64_t)be64_to_cpu(dino->di_size),
 				lino);
 		if (verify_mode)
 			return 1;
diff --git a/repair/dinode.h b/repair/dinode.h
index 61d0736..39d6a72 100644
--- a/repair/dinode.h
+++ b/repair/dinode.h
@@ -46,8 +46,8 @@ process_bmbt_reclist(xfs_mount_t	*mp,
 		xfs_ino_t		ino,
 		xfs_rfsblock_t		*tot,
 		struct blkmap		**blkmapp,
-		__uint64_t		*first_key,
-		__uint64_t		*last_key,
+		uint64_t		*first_key,
+		uint64_t		*last_key,
 		int			whichfork);
 
 int
diff --git a/repair/dir2.c b/repair/dir2.c
index e6415e4..73dff90 100644
--- a/repair/dir2.c
+++ b/repair/dir2.c
@@ -160,7 +160,7 @@ process_sf_dir2(
 	int			bad_sfnamelen;
 	int			i;
 	int			i8;
-	__int64_t		ino_dir_size;
+	int64_t			ino_dir_size;
 	int			ino_off;
 	ino_tree_node_t		*irec_p;
 	int			junkit;
diff --git a/repair/globals.h b/repair/globals.h
index 4085ccc..800128a 100644
--- a/repair/globals.h
+++ b/repair/globals.h
@@ -141,7 +141,7 @@ EXTERN int		inodes_per_cluster;
 EXTERN unsigned int	glob_agcount;
 EXTERN int		chunks_pblock;	/* # of 64-ino chunks per allocation */
 EXTERN int		max_symlink_blocks;
-EXTERN __int64_t	fs_max_file_offset;
+EXTERN int64_t		fs_max_file_offset;
 
 /* realtime info */
 
@@ -161,16 +161,16 @@ EXTERN int		full_ino_ex_data;/*
 
 /* superblock counters */
 
-EXTERN __uint64_t	sb_icount;	/* allocated (made) inodes */
-EXTERN __uint64_t	sb_ifree;	/* free inodes */
-EXTERN __uint64_t	sb_fdblocks;	/* free data blocks */
-EXTERN __uint64_t	sb_frextents;	/* free realtime extents */
+EXTERN uint64_t	sb_icount;	/* allocated (made) inodes */
+EXTERN uint64_t	sb_ifree;	/* free inodes */
+EXTERN uint64_t	sb_fdblocks;	/* free data blocks */
+EXTERN uint64_t	sb_frextents;	/* free realtime extents */
 
 /* superblock geometry info */
 
 EXTERN xfs_extlen_t	sb_inoalignmt;
-EXTERN __uint32_t	sb_unit;
-EXTERN __uint32_t	sb_width;
+EXTERN uint32_t	sb_unit;
+EXTERN uint32_t	sb_width;
 
 struct aglock {
 	pthread_mutex_t	lock __attribute__((__aligned__(64)));
@@ -178,7 +178,7 @@ struct aglock {
 EXTERN struct aglock	*ag_locks;
 
 EXTERN int 		report_interval;
-EXTERN __uint64_t 	*prog_rpt_done;
+EXTERN uint64_t 	*prog_rpt_done;
 
 EXTERN int		ag_stride;
 EXTERN int		thread_count;
diff --git a/repair/incore.c b/repair/incore.c
index cb57316..a9191ae 100644
--- a/repair/incore.c
+++ b/repair/incore.c
@@ -179,7 +179,7 @@ get_bmap_ext(
 static uint64_t		*rt_bmap;
 static size_t		rt_bmap_size;
 
-/* block records fit into __uint64_t's units */
+/* block records fit into uint64_t's units */
 #define XR_BB_UNIT	64			/* number of bits/unit */
 #define XR_BB		4			/* bits per block record */
 #define XR_BB_NUM	(XR_BB_UNIT/XR_BB)	/* number of records per unit */
@@ -203,8 +203,8 @@ set_rtbmap(
 {
 	*(rt_bmap + bno / XR_BB_NUM) =
 	 ((*(rt_bmap + bno / XR_BB_NUM) &
-	  (~((__uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
-	 (((__uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
+	  (~((uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
+	 (((uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
 }
 
 static void
@@ -222,9 +222,9 @@ init_rt_bmap(
 		return;
 
 	rt_bmap_size = roundup(mp->m_sb.sb_rextents / (NBBY / XR_BB),
-			       sizeof(__uint64_t));
+			       sizeof(uint64_t));
 
-	rt_bmap = memalign(sizeof(__uint64_t), rt_bmap_size);
+	rt_bmap = memalign(sizeof(uint64_t), rt_bmap_size);
 	if (!rt_bmap) {
 		do_error(
 	_("couldn't allocate realtime block map, size = %" PRIu64 "\n"),
diff --git a/repair/incore.h b/repair/incore.h
index c23a3a3..fd66084 100644
--- a/repair/incore.h
+++ b/repair/incore.h
@@ -257,7 +257,7 @@ typedef xfs_ino_t parent_entry_t;
 struct nlink_ops;
 
 typedef struct parent_list  {
-	__uint64_t		pmask;
+	uint64_t		pmask;
 	parent_entry_t		*pentries;
 #ifdef DEBUG
 	short			cnt;
@@ -265,14 +265,14 @@ typedef struct parent_list  {
 } parent_list_t;
 
 union ino_nlink {
-	__uint8_t	*un8;
-	__uint16_t	*un16;
-	__uint32_t	*un32;
+	uint8_t		*un8;
+	uint16_t	*un16;
+	uint32_t	*un32;
 };
 
 typedef struct ino_ex_data  {
-	__uint64_t		ino_reached;	/* bit == 1 if reached */
-	__uint64_t		ino_processed;	/* reference checked bit mask */
+	uint64_t		ino_reached;	/* bit == 1 if reached */
+	uint64_t		ino_processed;	/* reference checked bit mask */
 	parent_list_t		*parents;
 	union ino_nlink		counted_nlinks;/* counted nlinks in P6 */
 } ino_ex_data_t;
@@ -281,22 +281,22 @@ typedef struct ino_tree_node  {
 	avlnode_t		avl_node;
 	xfs_agino_t		ino_startnum;	/* starting inode # */
 	xfs_inofree_t		ir_free;	/* inode free bit mask */
-	__uint64_t		ir_sparse;	/* sparse inode bitmask */
-	__uint64_t		ino_confirmed;	/* confirmed bitmask */
-	__uint64_t		ino_isa_dir;	/* bit == 1 if a directory */
-	__uint64_t		ino_was_rl;	/* bit == 1 if reflink flag set */
-	__uint64_t		ino_is_rl;	/* bit == 1 if reflink flag should be set */
-	__uint8_t		nlink_size;
+	uint64_t		ir_sparse;	/* sparse inode bitmask */
+	uint64_t		ino_confirmed;	/* confirmed bitmask */
+	uint64_t		ino_isa_dir;	/* bit == 1 if a directory */
+	uint64_t		ino_was_rl;	/* bit == 1 if reflink flag set */
+	uint64_t		ino_is_rl;	/* bit == 1 if reflink flag should be set */
+	uint8_t			nlink_size;
 	union ino_nlink		disk_nlinks;	/* on-disk nlinks, set in P3 */
 	union  {
 		ino_ex_data_t	*ex_data;	/* phases 6,7 */
 		parent_list_t	*plist;		/* phases 2-5 */
 	} ino_un;
-	__uint8_t		*ftypes;	/* phases 3,6 */
+	uint8_t			*ftypes;	/* phases 3,6 */
 } ino_tree_node_t;
 
-#define INOS_PER_IREC	(sizeof(__uint64_t) * NBBY)
-#define	IREC_MASK(i)	((__uint64_t)1 << (i))
+#define INOS_PER_IREC	(sizeof(uint64_t) * NBBY)
+#define	IREC_MASK(i)	((uint64_t)1 << (i))
 
 void		add_ino_ex_data(xfs_mount_t *mp);
 
@@ -543,10 +543,10 @@ static inline int inode_is_rl(struct ino_tree_node *irec, int offset)
  */
 void add_inode_ref(struct ino_tree_node *irec, int offset);
 void drop_inode_ref(struct ino_tree_node *irec, int offset);
-__uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
+uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
 
-void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, __uint32_t nlinks);
-__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
+void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, uint32_t nlinks);
+uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
 
 static inline int is_inode_reached(struct ino_tree_node *irec, int offset)
 {
@@ -567,13 +567,13 @@ static inline void add_inode_reached(struct ino_tree_node *irec, int offset)
 static inline void
 set_inode_ftype(struct ino_tree_node *irec,
 	int		ino_offset,
-	__uint8_t	ftype)
+	uint8_t		ftype)
 {
 	if (irec->ftypes)
 		irec->ftypes[ino_offset] = ftype;
 }
 
-static inline __uint8_t
+static inline uint8_t
 get_inode_ftype(
 	struct ino_tree_node *irec,
 	int		ino_offset)
@@ -606,11 +606,11 @@ typedef struct bm_level_state  {
 	xfs_fsblock_t		fsbno;
 	xfs_fsblock_t		left_fsbno;
 	xfs_fsblock_t		right_fsbno;
-	__uint64_t		first_key;
-	__uint64_t		last_key;
+	uint64_t		first_key;
+	uint64_t		last_key;
 /*
 	int			level;
-	__uint64_t		prev_last_key;
+	uint64_t		prev_last_key;
 	xfs_buf_t		*bp;
 	xfs_bmbt_block_t	*block;
 */
diff --git a/repair/incore_ext.c b/repair/incore_ext.c
index 7e6786c..0a8138a 100644
--- a/repair/incore_ext.c
+++ b/repair/incore_ext.c
@@ -721,13 +721,13 @@ search_rt_dup_extent(xfs_mount_t *mp, xfs_rtblock_t bno)
 	return(ret);
 }
 
-static __uint64_t
+static uint64_t
 avl64_rt_ext_start(avl64node_t *node)
 {
 	return(((rt_extent_tree_node_t *) node)->rt_startblock);
 }
 
-static __uint64_t
+static uint64_t
 avl64_ext_end(avl64node_t *node)
 {
 	return(((rt_extent_tree_node_t *) node)->rt_startblock +
@@ -834,7 +834,7 @@ count_extents(xfs_agnumber_t agno, avltree_desc_t *tree, int whichtree)
 int
 count_bno_extents_blocks(xfs_agnumber_t agno, uint *numblocks)
 {
-	__uint64_t nblocks;
+	uint64_t nblocks;
 	extent_tree_node_t *node;
 	int i = 0;
 
diff --git a/repair/incore_ino.c b/repair/incore_ino.c
index 2ec1765..3b6b44d 100644
--- a/repair/incore_ino.c
+++ b/repair/incore_ino.c
@@ -38,7 +38,7 @@ static avltree_desc_t	**inode_uncertain_tree_ptrs;
 /* memory optimised nlink counting for all inodes */
 
 static void *
-alloc_nlink_array(__uint8_t nlink_size)
+alloc_nlink_array(uint8_t nlink_size)
 {
 	void *ptr;
 
@@ -51,10 +51,10 @@ alloc_nlink_array(__uint8_t nlink_size)
 static void
 nlink_grow_8_to_16(ino_tree_node_t *irec)
 {
-	__uint16_t	*new_nlinks;
+	uint16_t	*new_nlinks;
 	int		i;
 
-	irec->nlink_size = sizeof(__uint16_t);
+	irec->nlink_size = sizeof(uint16_t);
 
 	new_nlinks = alloc_nlink_array(irec->nlink_size);
 	for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
@@ -76,10 +76,10 @@ nlink_grow_8_to_16(ino_tree_node_t *irec)
 static void
 nlink_grow_16_to_32(ino_tree_node_t *irec)
 {
-	__uint32_t	*new_nlinks;
+	uint32_t	*new_nlinks;
 	int		i;
 
-	irec->nlink_size = sizeof(__uint32_t);
+	irec->nlink_size = sizeof(uint32_t);
 
 	new_nlinks = alloc_nlink_array(irec->nlink_size);
 	for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
@@ -104,21 +104,21 @@ void add_inode_ref(struct ino_tree_node *irec, int ino_offset)
 	ASSERT(irec->ino_un.ex_data != NULL);
 
 	switch (irec->nlink_size) {
-	case sizeof(__uint8_t):
+	case sizeof(uint8_t):
 		if (irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] < 0xff) {
 			irec->ino_un.ex_data->counted_nlinks.un8[ino_offset]++;
 			break;
 		}
 		nlink_grow_8_to_16(irec);
 		/*FALLTHRU*/
-	case sizeof(__uint16_t):
+	case sizeof(uint16_t):
 		if (irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] < 0xffff) {
 			irec->ino_un.ex_data->counted_nlinks.un16[ino_offset]++;
 			break;
 		}
 		nlink_grow_16_to_32(irec);
 		/*FALLTHRU*/
-	case sizeof(__uint32_t):
+	case sizeof(uint32_t):
 		irec->ino_un.ex_data->counted_nlinks.un32[ino_offset]++;
 		break;
 	default:
@@ -128,20 +128,20 @@ void add_inode_ref(struct ino_tree_node *irec, int ino_offset)
 
 void drop_inode_ref(struct ino_tree_node *irec, int ino_offset)
 {
-	__uint32_t	refs = 0;
+	uint32_t	refs = 0;
 
 	ASSERT(irec->ino_un.ex_data != NULL);
 
 	switch (irec->nlink_size) {
-	case sizeof(__uint8_t):
+	case sizeof(uint8_t):
 		ASSERT(irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] > 0);
 		refs = --irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
 		break;
-	case sizeof(__uint16_t):
+	case sizeof(uint16_t):
 		ASSERT(irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] > 0);
 		refs = --irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
 		break;
-	case sizeof(__uint32_t):
+	case sizeof(uint32_t):
 		ASSERT(irec->ino_un.ex_data->counted_nlinks.un32[ino_offset] > 0);
 		refs = --irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
 		break;
@@ -153,16 +153,16 @@ void drop_inode_ref(struct ino_tree_node *irec, int ino_offset)
 		irec->ino_un.ex_data->ino_reached &= ~IREC_MASK(ino_offset);
 }
 
-__uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
+uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
 {
 	ASSERT(irec->ino_un.ex_data != NULL);
 
 	switch (irec->nlink_size) {
-	case sizeof(__uint8_t):
+	case sizeof(uint8_t):
 		return irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
-	case sizeof(__uint16_t):
+	case sizeof(uint16_t):
 		return irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
-	case sizeof(__uint32_t):
+	case sizeof(uint32_t):
 		return irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
 	default:
 		ASSERT(0);
@@ -171,24 +171,24 @@ __uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
 }
 
 void set_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset,
-		__uint32_t nlinks)
+		uint32_t nlinks)
 {
 	switch (irec->nlink_size) {
-	case sizeof(__uint8_t):
+	case sizeof(uint8_t):
 		if (nlinks < 0xff) {
 			irec->disk_nlinks.un8[ino_offset] = nlinks;
 			break;
 		}
 		nlink_grow_8_to_16(irec);
 		/*FALLTHRU*/
-	case sizeof(__uint16_t):
+	case sizeof(uint16_t):
 		if (nlinks < 0xffff) {
 			irec->disk_nlinks.un16[ino_offset] = nlinks;
 			break;
 		}
 		nlink_grow_16_to_32(irec);
 		/*FALLTHRU*/
-	case sizeof(__uint32_t):
+	case sizeof(uint32_t):
 		irec->disk_nlinks.un32[ino_offset] = nlinks;
 		break;
 	default:
@@ -196,14 +196,14 @@ void set_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset,
 	}
 }
 
-__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
+uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
 {
 	switch (irec->nlink_size) {
-	case sizeof(__uint8_t):
+	case sizeof(uint8_t):
 		return irec->disk_nlinks.un8[ino_offset];
-	case sizeof(__uint16_t):
+	case sizeof(uint16_t):
 		return irec->disk_nlinks.un16[ino_offset];
-	case sizeof(__uint32_t):
+	case sizeof(uint32_t):
 		return irec->disk_nlinks.un32[ino_offset];
 	default:
 		ASSERT(0);
@@ -211,11 +211,11 @@ __uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
 	return 0;
 }
 
-static __uint8_t *
+static uint8_t *
 alloc_ftypes_array(
 	struct xfs_mount *mp)
 {
-	__uint8_t	*ptr;
+	uint8_t		*ptr;
 
 	if (!xfs_sb_version_hasftype(&mp->m_sb))
 		return NULL;
@@ -262,23 +262,23 @@ alloc_ino_node(
 	irec->ir_free = (xfs_inofree_t) - 1;
 	irec->ir_sparse = 0;
 	irec->ino_un.ex_data = NULL;
-	irec->nlink_size = sizeof(__uint8_t);
+	irec->nlink_size = sizeof(uint8_t);
 	irec->disk_nlinks.un8 = alloc_nlink_array(irec->nlink_size);
 	irec->ftypes = alloc_ftypes_array(mp);
 	return irec;
 }
 
 static void
-free_nlink_array(union ino_nlink nlinks, __uint8_t nlink_size)
+free_nlink_array(union ino_nlink nlinks, uint8_t nlink_size)
 {
 	switch (nlink_size) {
-	case sizeof(__uint8_t):
+	case sizeof(uint8_t):
 		free(nlinks.un8);
 		break;
-	case sizeof(__uint16_t):
+	case sizeof(uint16_t):
 		free(nlinks.un16);
 		break;
-	case sizeof(__uint32_t):
+	case sizeof(uint32_t):
 		free(nlinks.un32);
 		break;
 	default:
@@ -609,7 +609,7 @@ set_inode_parent(
 	int			i;
 	int			cnt;
 	int			target;
-	__uint64_t		bitmask;
+	uint64_t		bitmask;
 	parent_entry_t		*tmp;
 
 	if (full_ino_ex_data)
@@ -699,7 +699,7 @@ set_inode_parent(
 xfs_ino_t
 get_inode_parent(ino_tree_node_t *irec, int offset)
 {
-	__uint64_t	bitmask;
+	uint64_t	bitmask;
 	parent_list_t	*ptbl;
 	int		i;
 	int		target;
@@ -740,15 +740,15 @@ alloc_ex_data(ino_tree_node_t *irec)
 	irec->ino_un.ex_data->parents = ptbl;
 
 	switch (irec->nlink_size) {
-	case sizeof(__uint8_t):
+	case sizeof(uint8_t):
 		irec->ino_un.ex_data->counted_nlinks.un8 =
 			alloc_nlink_array(irec->nlink_size);
 		break;
-	case sizeof(__uint16_t):
+	case sizeof(uint16_t):
 		irec->ino_un.ex_data->counted_nlinks.un16 =
 			alloc_nlink_array(irec->nlink_size);
 		break;
-	case sizeof(__uint32_t):
+	case sizeof(uint32_t):
 		irec->ino_un.ex_data->counted_nlinks.un32 =
 			alloc_nlink_array(irec->nlink_size);
 		break;
diff --git a/repair/phase2.c b/repair/phase2.c
index c21778b..0085732 100644
--- a/repair/phase2.c
+++ b/repair/phase2.c
@@ -179,7 +179,7 @@ phase2(
 
 	bad_ino_btree = 0;
 
-	set_progress_msg(PROG_FMT_SCAN_AG, (__uint64_t) glob_agcount);
+	set_progress_msg(PROG_FMT_SCAN_AG, (uint64_t) glob_agcount);
 
 	scan_ags(mp, scan_threads);
 
diff --git a/repair/phase3.c b/repair/phase3.c
index 0890a27..17b1c28 100644
--- a/repair/phase3.c
+++ b/repair/phase3.c
@@ -122,7 +122,7 @@ phase3(
 	else
 		do_log(_("        - scan (but don't clear) agi unlinked lists...\n"));
 
-	set_progress_msg(PROG_FMT_AGI_UNLINKED, (__uint64_t) glob_agcount);
+	set_progress_msg(PROG_FMT_AGI_UNLINKED, (uint64_t) glob_agcount);
 
 	/* first clear the agi unlinked AGI list */
 	if (!no_modify) {
@@ -142,7 +142,7 @@ phase3(
 	do_log(_(
 	    "        - process known inodes and perform inode discovery...\n"));
 
-	set_progress_msg(PROG_FMT_PROCESS_INO, (__uint64_t) mp->m_sb.sb_icount);
+	set_progress_msg(PROG_FMT_PROCESS_INO, (uint64_t) mp->m_sb.sb_icount);
 
 	process_ags(mp);
 
@@ -152,7 +152,7 @@ phase3(
 	 * process newly discovered inode chunks
 	 */
 	do_log(_("        - process newly discovered inodes...\n"));
-	set_progress_msg(PROG_FMT_NEW_INODES, (__uint64_t) glob_agcount);
+	set_progress_msg(PROG_FMT_NEW_INODES, (uint64_t) glob_agcount);
 
 	counts = calloc(sizeof(*counts), mp->m_sb.sb_agcount);
 	if (!counts) {
diff --git a/repair/phase4.c b/repair/phase4.c
index e59464b..cc17ec0 100644
--- a/repair/phase4.c
+++ b/repair/phase4.c
@@ -290,7 +290,7 @@ phase4(xfs_mount_t *mp)
 	do_log(_("Phase 4 - check for duplicate blocks...\n"));
 	do_log(_("        - setting up duplicate extent list...\n"));
 
-	set_progress_msg(PROG_FMT_DUP_EXTENT, (__uint64_t) glob_agcount);
+	set_progress_msg(PROG_FMT_DUP_EXTENT, (uint64_t) glob_agcount);
 
 	irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino),
 				XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino));
@@ -404,7 +404,7 @@ phase4(xfs_mount_t *mp)
 	reset_bmaps(mp);
 
 	do_log(_("        - check for inodes claiming duplicate blocks...\n"));
-	set_progress_msg(PROG_FMT_DUP_BLOCKS, (__uint64_t) mp->m_sb.sb_icount);
+	set_progress_msg(PROG_FMT_DUP_BLOCKS, (uint64_t) mp->m_sb.sb_icount);
 
 	/*
 	 * ok, now process the inodes -- signal 2-pass check per inode.
diff --git a/repair/phase5.c b/repair/phase5.c
index 0b833f1..bf86730 100644
--- a/repair/phase5.c
+++ b/repair/phase5.c
@@ -86,9 +86,9 @@ struct agi_stat {
 	xfs_agino_t		freecount;
 };
 
-static __uint64_t	*sb_icount_ag;		/* allocated inodes per ag */
-static __uint64_t	*sb_ifree_ag;		/* free inodes per ag */
-static __uint64_t	*sb_fdblocks_ag;	/* free data blocks per ag */
+static uint64_t	*sb_icount_ag;		/* allocated inodes per ag */
+static uint64_t	*sb_ifree_ag;		/* free inodes per ag */
+static uint64_t	*sb_fdblocks_ag;	/* free data blocks per ag */
 
 static int
 mk_incore_fstree(xfs_mount_t *mp, xfs_agnumber_t agno)
@@ -886,10 +886,10 @@ build_freespace_tree(xfs_mount_t *mp, xfs_agnumber_t agno,
  */
 static void
 init_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs,
-		__uint64_t *num_inos, __uint64_t *num_free_inos, int finobt)
+		uint64_t *num_inos, uint64_t *num_free_inos, int finobt)
 {
-	__uint64_t		ninos;
-	__uint64_t		nfinos;
+	uint64_t		ninos;
+	uint64_t		nfinos;
 	int			rec_nfinos;
 	int			rec_ninos;
 	ino_tree_node_t		*ino_rec;
@@ -2193,10 +2193,10 @@ phase5_func(
 	xfs_agnumber_t	agno,
 	struct xfs_slab	*lost_fsb)
 {
-	__uint64_t	num_inos;
-	__uint64_t	num_free_inos;
-	__uint64_t	finobt_num_inos;
-	__uint64_t	finobt_num_free_inos;
+	uint64_t	num_inos;
+	uint64_t	num_free_inos;
+	uint64_t	finobt_num_inos;
+	uint64_t	finobt_num_free_inos;
 	bt_status_t	bno_btree_curs;
 	bt_status_t	bcnt_btree_curs;
 	bt_status_t	ino_btree_curs;
@@ -2471,7 +2471,7 @@ phase5(xfs_mount_t *mp)
 	int			error;
 
 	do_log(_("Phase 5 - rebuild AG headers and trees...\n"));
-	set_progress_msg(PROG_FMT_REBUILD_AG, (__uint64_t )glob_agcount);
+	set_progress_msg(PROG_FMT_REBUILD_AG, (uint64_t )glob_agcount);
 
 #ifdef XR_BLD_FREE_TRACE
 	fprintf(stderr, "inobt level 1, maxrec = %d, minrec = %d\n",
@@ -2497,15 +2497,15 @@ phase5(xfs_mount_t *mp)
 	keep_fsinos(mp);
 
 	/* allocate per ag counters */
-	sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
+	sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
 	if (sb_icount_ag == NULL)
 		do_error(_("cannot alloc sb_icount_ag buffers\n"));
 
-	sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
+	sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
 	if (sb_ifree_ag == NULL)
 		do_error(_("cannot alloc sb_ifree_ag buffers\n"));
 
-	sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
+	sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
 	if (sb_fdblocks_ag == NULL)
 		do_error(_("cannot alloc sb_fdblocks_ag buffers\n"));
 
diff --git a/repair/phase6.c b/repair/phase6.c
index 08636dc..373b1a5 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -82,7 +82,7 @@ typedef struct dir_hash_ent {
 	struct dir_hash_ent	*nextbyhash;	/* next in name bucket */
 	struct dir_hash_ent	*nextbyorder;	/* next in order added */
 	xfs_dahash_t		hashval;	/* hash value of name */
-	__uint32_t		address;	/* offset of data entry */
+	uint32_t		address;	/* offset of data entry */
 	xfs_ino_t 		inum;		/* inode num of entry */
 	short			junkit;		/* name starts with / */
 	short			seen;		/* have seen leaf entry */
@@ -170,11 +170,11 @@ static int
 dir_hash_add(
 	xfs_mount_t		*mp,
 	dir_hash_tab_t		*hashtab,
-	__uint32_t		addr,
+	uint32_t		addr,
 	xfs_ino_t		inum,
 	int			namelen,
 	unsigned char		*name,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	xfs_dahash_t		hash = 0;
 	int			byaddr;
@@ -357,7 +357,7 @@ static void
 dir_hash_update_ftype(
 	dir_hash_tab_t		*hashtab,
 	xfs_dir2_dataptr_t	addr,
-	__uint8_t		ftype)
+	uint8_t			ftype)
 {
 	int			i;
 	dir_hash_ent_t		*p;
@@ -1791,8 +1791,8 @@ longform_dir2_entry_check_data(
 
 		/* validate ftype field if supported */
 		if (xfs_sb_version_hasftype(&mp->m_sb)) {
-			__uint8_t dir_ftype;
-			__uint8_t ino_ftype;
+			uint8_t dir_ftype;
+			uint8_t ino_ftype;
 
 			dir_ftype = M_DIROPS(mp)->data_get_ftype(dep);
 			ino_ftype = get_inode_ftype(irec, ino_offset);
@@ -2703,8 +2703,8 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
 
 		/* validate ftype field if supported */
 		if (xfs_sb_version_hasftype(&mp->m_sb)) {
-			__uint8_t dir_ftype;
-			__uint8_t ino_ftype;
+			uint8_t dir_ftype;
+			uint8_t ino_ftype;
 
 			dir_ftype = M_DIROPS(mp)->sf_get_ftype(sfep);
 			ino_ftype = get_inode_ftype(irec, ino_offset);
diff --git a/repair/phase7.c b/repair/phase7.c
index 8bce117..4ffb81a 100644
--- a/repair/phase7.c
+++ b/repair/phase7.c
@@ -32,7 +32,7 @@ static void
 update_inode_nlinks(
 	xfs_mount_t 		*mp,
 	xfs_ino_t		ino,
-	__uint32_t		nlinks)
+	uint32_t		nlinks)
 {
 	xfs_trans_t		*tp;
 	xfs_inode_t		*ip;
@@ -104,7 +104,7 @@ do_link_updates(
 {
 	ino_tree_node_t		*irec;
 	int			j;
-	__uint32_t		nrefs;
+	uint32_t		nrefs;
 
 	for (irec = findfirst_inode_rec(agno); irec;
 	     irec = next_ino_rec(irec)) {
@@ -143,7 +143,7 @@ phase7(
 	else
 		do_log(_("Phase 7 - verify link counts...\n"));
 
-	set_progress_msg(PROGRESS_FMT_CORR_LINK, (__uint64_t) glob_agcount);
+	set_progress_msg(PROGRESS_FMT_CORR_LINK, (uint64_t) glob_agcount);
 
 	create_work_queue(&wq, mp, scan_threads);
 
diff --git a/repair/progress.c b/repair/progress.c
index 2a09b23..3a2e9a2 100644
--- a/repair/progress.c
+++ b/repair/progress.c
@@ -85,8 +85,8 @@ pthread_t	report_thread;
 typedef struct msg_block_s {
 	pthread_mutex_t	mutex;
 	progress_rpt_t	*format;
-	__uint64_t	*done;
-	__uint64_t	*total;
+	uint64_t	*done;
+	uint64_t	*total;
 	int		count;
 	int		interval;
 } msg_block_t;
@@ -96,14 +96,14 @@ typedef struct phase_times_s {
 	time_t		start;
 	time_t		end;
 	time_t		duration;
-	__uint64_t	item_counts[4];
+	uint64_t	item_counts[4];
 } phase_times_t;
 static phase_times_t phase_times[8];
 
 static void *progress_rpt_thread(void *);
 static int current_phase;
 static int running;
-static __uint64_t prog_rpt_total;
+static uint64_t prog_rpt_total;
 
 void
 init_progress_rpt (void)
@@ -113,11 +113,11 @@ init_progress_rpt (void)
 	 *  allocate the done vector
 	 */
 
-	if ((prog_rpt_done = (__uint64_t *)
-		malloc(sizeof(__uint64_t)*glob_agcount)) == NULL ) {
+	if ((prog_rpt_done = (uint64_t *)
+		malloc(sizeof(uint64_t)*glob_agcount)) == NULL ) {
 		do_error(_("cannot malloc pointer to done vector\n"));
 	}
-	bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
+	bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
 
 	/*
 	 *  Setup comm block, start the thread
@@ -165,10 +165,10 @@ progress_rpt_thread (void *p)
 	timer_t timerid;
 	struct itimerspec timespec;
 	char *msgbuf;
-	__uint64_t *donep;
-	__uint64_t sum;
+	uint64_t *donep;
+	uint64_t sum;
 	msg_block_t *msgp = (msg_block_t *)p;
-	__uint64_t percent;
+	uint64_t percent;
 
 	/* It's possible to get here very early w/ no progress msg set */
 	if (!msgp->format)
@@ -286,7 +286,7 @@ progress_rpt_thread (void *p)
 }
 
 int
-set_progress_msg (int report, __uint64_t total)
+set_progress_msg (int report, uint64_t total)
 {
 
 	if (!ag_stride)
@@ -300,7 +300,7 @@ set_progress_msg (int report, __uint64_t total)
 
 	/* reset all the accumulative totals */
 	if (prog_rpt_done)
-		bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
+		bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
 
 	if (pthread_mutex_unlock(&global_msgs.mutex))
 		do_error(_("set_progress_msg: cannot unlock progress mutex\n"));
@@ -308,14 +308,14 @@ set_progress_msg (int report, __uint64_t total)
 	return (0);
 }
 
-__uint64_t
+uint64_t
 print_final_rpt(void)
 {
 	int i;
 	struct tm *tmp;
 	time_t now;
-	__uint64_t *donep;
-	__uint64_t sum;
+	uint64_t *donep;
+	uint64_t sum;
 	msg_block_t 	*msgp = &global_msgs;
 	char		msgbuf[DURATION_BUF_SIZE];
 
diff --git a/repair/progress.h b/repair/progress.h
index 33db834..5152648 100644
--- a/repair/progress.h
+++ b/repair/progress.h
@@ -32,8 +32,8 @@
 extern void init_progress_rpt(void);
 extern void stop_progress_rpt(void);
 extern void summary_report(void);
-extern int  set_progress_msg(int report, __uint64_t total);
-extern __uint64_t print_final_rpt(void);
+extern int  set_progress_msg(int report, uint64_t total);
+extern uint64_t print_final_rpt(void);
 extern char *timestamp(int end, int phase, char *buf);
 extern char *duration(int val, char *buf);
 extern int do_parallel;
diff --git a/repair/rmap.c b/repair/rmap.c
index ab6e583..01d6f0f 100644
--- a/repair/rmap.c
+++ b/repair/rmap.c
@@ -343,7 +343,7 @@ _("Insufficient memory while allocating raw metadata reverse mapping slabs."));
 
 static int
 find_first_zero_bit(
-	__uint64_t	mask)
+	uint64_t	mask)
 {
 	int		n;
 	int		b = 0;
@@ -356,7 +356,7 @@ find_first_zero_bit(
 
 static int
 popcnt(
-	__uint64_t	mask)
+	uint64_t	mask)
 {
 	int		n;
 	int		b = 0;
@@ -1064,14 +1064,14 @@ _("Incorrect reverse-mapping: saw (%u/%u) %slen %u owner %"PRId64" %s%soff \
  * Compare the key fields of two rmap records -- positive if key1 > key2,
  * negative if key1 < key2, and zero if equal.
  */
-__int64_t
+int64_t
 rmap_diffkeys(
 	struct xfs_rmap_irec	*kp1,
 	struct xfs_rmap_irec	*kp2)
 {
 	__u64			oa;
 	__u64			ob;
-	__int64_t		d;
+	int64_t			d;
 	struct xfs_rmap_irec	tmp;
 
 	tmp = *kp1;
@@ -1081,7 +1081,7 @@ rmap_diffkeys(
 	tmp.rm_flags &= ~XFS_RMAP_REC_FLAGS;
 	ob = libxfs_rmap_irec_offset_pack(&tmp);
 
-	d = (__int64_t)kp1->rm_startblock - kp2->rm_startblock;
+	d = (int64_t)kp1->rm_startblock - kp2->rm_startblock;
 	if (d)
 		return d;
 
@@ -1192,10 +1192,10 @@ fix_inode_reflink_flags(
 {
 	struct ino_tree_node	*irec;
 	int			bit;
-	__uint64_t		was;
-	__uint64_t		is;
-	__uint64_t		diff;
-	__uint64_t		mask;
+	uint64_t		was;
+	uint64_t		is;
+	uint64_t		diff;
+	uint64_t		mask;
 	int			error = 0;
 	xfs_agino_t		agino;
 
diff --git a/repair/rmap.h b/repair/rmap.h
index 752ece8..1616ab7 100644
--- a/repair/rmap.h
+++ b/repair/rmap.h
@@ -44,7 +44,7 @@ extern int rmap_init_cursor(xfs_agnumber_t, struct xfs_slab_cursor **);
 extern void rmap_avoid_check(void);
 extern int rmaps_verify_btree(struct xfs_mount *, xfs_agnumber_t);
 
-extern __int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
+extern int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
 		struct xfs_rmap_irec *kp2);
 extern void rmap_high_key_from_rec(struct xfs_rmap_irec *rec,
 		struct xfs_rmap_irec *key);
diff --git a/repair/sb.c b/repair/sb.c
index 77e5154..acc9283 100644
--- a/repair/sb.c
+++ b/repair/sb.c
@@ -40,7 +40,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest)
 	xfs_ino_t	uquotino;
 	xfs_ino_t	gquotino;
 	xfs_ino_t	pquotino;
-	__uint16_t	versionnum;
+	uint16_t	versionnum;
 
 	rootino = dest->sb_rootino;
 	rbmino = dest->sb_rbmino;
@@ -106,8 +106,8 @@ verify_sb_blocksize(xfs_sb_t *sb)
 static int
 __find_secondary_sb(
 	xfs_sb_t	*rsb,
-	__uint64_t	start,
-	__uint64_t	skip)
+	uint64_t	start,
+	uint64_t	skip)
 {
 	xfs_off_t	off;
 	xfs_sb_t	*sb;
@@ -187,13 +187,13 @@ __find_secondary_sb(
 
 static int
 guess_default_geometry(
-	__uint64_t		*agsize,
-	__uint64_t		*agcount,
+	uint64_t		*agsize,
+	uint64_t		*agcount,
 	libxfs_init_t		*x)
 {
 	struct fs_topology	ft;
 	int			blocklog;
-	__uint64_t		dblocks;
+	uint64_t		dblocks;
 	int			multidisk;
 
 	memset(&ft, 0, sizeof(ft));
@@ -216,9 +216,9 @@ int
 find_secondary_sb(xfs_sb_t *rsb)
 {
 	int		retval = 0;
-	__uint64_t	agcount;
-	__uint64_t	agsize;
-	__uint64_t	skip;
+	uint64_t	agcount;
+	uint64_t	agsize;
+	uint64_t	skip;
 	int		blocklog;
 
 	/*
@@ -229,7 +229,7 @@ find_secondary_sb(xfs_sb_t *rsb)
 	do_warn(_("\nattempting to find secondary superblock...\n"));
 
 	if (verify_sb_blocksize(rsb) == 0) {
-		skip = (__uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
+		skip = (uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
 		if (skip >= XFS_AG_MIN_BYTES && skip <= XFS_AG_MAX_BYTES)
 			retval = __find_secondary_sb(rsb, skip, skip);
 	}
@@ -343,7 +343,7 @@ sb_validate_ino_align(struct xfs_sb *sb)
 int
 verify_sb(char *sb_buf, xfs_sb_t *sb, int is_primary_sb)
 {
-	__uint32_t	bsize;
+	uint32_t	bsize;
 	int		i;
 	int		ret;
 
@@ -399,7 +399,7 @@ verify_sb(char *sb_buf, xfs_sb_t *sb, int is_primary_sb)
 		sb->sb_dblocks < XFS_MIN_DBLOCKS(sb))
 		return(XR_BAD_FS_SIZE_DATA);
 
-	if (sb->sb_agblklog != (__uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
+	if (sb->sb_agblklog != (uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
 		return(XR_BAD_FS_SIZE_DATA);
 
 	if (sb->sb_inodesize < XFS_DINODE_MIN_SIZE                     ||
diff --git a/repair/scan.c b/repair/scan.c
index b9ef4dc..447611a 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -42,13 +42,13 @@ struct aghdr_cnts {
 	xfs_agnumber_t	agno;
 	xfs_extlen_t	agffreeblks;
 	xfs_extlen_t	agflongest;
-	__uint64_t	agfbtreeblks;
-	__uint32_t	agicount;
-	__uint32_t	agifreecount;
-	__uint64_t	fdblocks;
-	__uint64_t	usedblocks;
-	__uint64_t	ifreecount;
-	__uint32_t	fibtfreecount;
+	uint64_t	agfbtreeblks;
+	uint32_t	agicount;
+	uint32_t	agifreecount;
+	uint64_t	fdblocks;
+	uint64_t	usedblocks;
+	uint64_t	ifreecount;
+	uint32_t	fibtfreecount;
 };
 
 void
@@ -70,10 +70,10 @@ scan_sbtree(
 				xfs_agnumber_t		agno,
 				int			suspect,
 				int			isroot,
-				__uint32_t		magic,
+				uint32_t		magic,
 				void			*priv),
 	int		isroot,
-	__uint32_t	magic,
+	uint32_t	magic,
 	void		*priv,
 	const struct xfs_buf_ops *ops)
 {
@@ -110,23 +110,23 @@ scan_lbtree(
 				xfs_fsblock_t		bno,
 				xfs_ino_t		ino,
 				xfs_rfsblock_t		*tot,
-				__uint64_t		*nex,
+				uint64_t		*nex,
 				blkmap_t		**blkmapp,
 				bmap_cursor_t		*bm_cursor,
 				int			isroot,
 				int			check_dups,
 				int			*dirty,
-				__uint64_t		magic),
+				uint64_t		magic),
 	int		type,
 	int		whichfork,
 	xfs_ino_t	ino,
 	xfs_rfsblock_t	*tot,
-	__uint64_t	*nex,
+	uint64_t	*nex,
 	blkmap_t	**blkmapp,
 	bmap_cursor_t	*bm_cursor,
 	int		isroot,
 	int		check_dups,
-	__uint64_t	magic,
+	uint64_t	magic,
 	const struct xfs_buf_ops *ops)
 {
 	xfs_buf_t	*bp;
@@ -179,13 +179,13 @@ scan_bmapbt(
 	xfs_fsblock_t		bno,
 	xfs_ino_t		ino,
 	xfs_rfsblock_t		*tot,
-	__uint64_t		*nex,
+	uint64_t		*nex,
 	blkmap_t		**blkmapp,
 	bmap_cursor_t		*bm_cursor,
 	int			isroot,
 	int			check_dups,
 	int			*dirty,
-	__uint64_t		magic)
+	uint64_t		magic)
 {
 	int			i;
 	int			err;
@@ -548,7 +548,7 @@ scan_allocbt(
 	xfs_agnumber_t		agno,
 	int			suspect,
 	int			isroot,
-	__uint32_t		magic,
+	uint32_t		magic,
 	void			*priv)
 {
 	struct aghdr_cnts	*agcnts = priv;
@@ -930,7 +930,7 @@ scan_rmapbt(
 	xfs_agnumber_t		agno,
 	int			suspect,
 	int			isroot,
-	__uint32_t		magic,
+	uint32_t		magic,
 	void			*priv)
 {
 	const char		*name = "rmap";
@@ -1233,7 +1233,7 @@ scan_refcbt(
 	xfs_agnumber_t		agno,
 	int			suspect,
 	int			isroot,
-	__uint32_t		magic,
+	uint32_t		magic,
 	void			*priv)
 {
 	const char		*name = "refcount";
@@ -1939,7 +1939,7 @@ scan_inobt(
 	xfs_agnumber_t		agno,
 	int			suspect,
 	int			isroot,
-	__uint32_t		magic,
+	uint32_t		magic,
 	void			*priv)
 {
 	struct aghdr_cnts	*agcnts = priv;
@@ -2176,7 +2176,7 @@ validate_agf(
 	struct aghdr_cnts	*agcnts)
 {
 	xfs_agblock_t		bno;
-	__uint32_t		magic;
+	uint32_t		magic;
 
 	bno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]);
 	if (bno != 0 && verify_agbno(mp, agno, bno)) {
@@ -2274,7 +2274,7 @@ validate_agi(
 {
 	xfs_agblock_t		bno;
 	int			i;
-	__uint32_t		magic;
+	uint32_t		magic;
 
 	bno = be32_to_cpu(agi->agi_root);
 	if (bno != 0 && verify_agbno(mp, agno, bno)) {
@@ -2499,10 +2499,10 @@ scan_ags(
 	int			scan_threads)
 {
 	struct aghdr_cnts *agcnts;
-	__uint64_t	fdblocks = 0;
-	__uint64_t	icount = 0;
-	__uint64_t	ifreecount = 0;
-	__uint64_t	usedblocks = 0;
+	uint64_t	fdblocks = 0;
+	uint64_t	icount = 0;
+	uint64_t	ifreecount = 0;
+	uint64_t	usedblocks = 0;
 	xfs_agnumber_t	i;
 	work_queue_t	wq;
 
diff --git a/repair/scan.h b/repair/scan.h
index ea8c0bf..9bbe1e6 100644
--- a/repair/scan.h
+++ b/repair/scan.h
@@ -30,23 +30,23 @@ int scan_lbtree(
 				xfs_fsblock_t		bno,
 				xfs_ino_t		ino,
 				xfs_rfsblock_t		*tot,
-				__uint64_t		*nex,
+				uint64_t		*nex,
 				struct blkmap		**blkmapp,
 				bmap_cursor_t		*bm_cursor,
 				int			isroot,
 				int			check_dups,
 				int			*dirty,
-				__uint64_t		magic),
+				uint64_t		magic),
 	int		type,
 	int		whichfork,
 	xfs_ino_t	ino,
 	xfs_rfsblock_t	*tot,
-	__uint64_t	*nex,
+	uint64_t	*nex,
 	struct blkmap	**blkmapp,
 	bmap_cursor_t	*bm_cursor,
 	int		isroot,
 	int		check_dups,
-	__uint64_t	magic,
+	uint64_t	magic,
 	const struct xfs_buf_ops *ops);
 
 int scan_bmapbt(
@@ -57,13 +57,13 @@ int scan_bmapbt(
 	xfs_fsblock_t		bno,
 	xfs_ino_t		ino,
 	xfs_rfsblock_t		*tot,
-	__uint64_t		*nex,
+	uint64_t		*nex,
 	struct blkmap		**blkmapp,
 	bmap_cursor_t		*bm_cursor,
 	int			isroot,
 	int			check_dups,
 	int			*dirty,
-	__uint64_t		magic);
+	uint64_t		magic);
 
 void
 scan_ags(

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-18  1:26 [RFCRAP 0/3?] xfs: OH GOD MY EYES! Darrick J. Wong
  2017-05-18  1:30 ` [PATCH 1/3] xfs: remove double-underscore integer types Darrick J. Wong
  2017-05-18  1:31 ` [PATCH 2/3] xfsprogs: " Darrick J. Wong
@ 2017-05-18  1:32 ` Darrick J. Wong
  2017-05-18  6:28   ` Christoph Hellwig
  2017-05-18  8:34   ` Dave Chinner
  2 siblings, 2 replies; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-18  1:32 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen

Apparently there are certain system software configurations that do odd
things like update the kernel and reboot without umounting the /boot fs
or remounting it readonly, either of which would push all the AIL items
out to disk.  As a result, a subsequent invocation of something like
grub (which has a frightening willingness to read a fs with a dirty log)
can read stale disk contents and/or miss files the metadata for which
have been written to the log but not checkpointed into the filesystem.

Granted, most of the time /boot is a separate partition and
systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
This "fix" is only needed for people who have one giant filesystem.

Therefore, add a reboot hook to freeze the rw filesystems (which
checkpoints the log) just prior to reboot.  This is an unfortunate and
insufficient workaround for multiple layers of inadequate external
software, but at least it will reduce boot time surprises for the "OS
updater failed to disengage the filesystem before rebooting" case.

Seeing as grub is unlikely ever to learn to replay the XFS log (and we
probably don't want it doing that), *LILO has been discontinued for at
least 18 months, and we're not quite to the point of putting kernel
files directly on the EFI System Partition, this seems like the least
crappy solution to this problem.

Yes, you're still screwed in grub if the system crashes. :)  I don't
anticipate this patch will make it upstream, but the idea could get at
least a single hearing.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_super.c |   40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 455a575..415b1e8 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -61,6 +61,7 @@
 #include <linux/kthread.h>
 #include <linux/freezer.h>
 #include <linux/parser.h>
+#include <linux/reboot.h>
 
 static const struct super_operations xfs_super_operations;
 struct bio_set *xfs_ioend_bioset;
@@ -1982,6 +1983,38 @@ xfs_destroy_workqueues(void)
 	destroy_workqueue(xfs_alloc_wq);
 }
 
+STATIC void
+xfs_reboot_fs(
+	struct super_block	*sb,
+	void			*priv)
+{
+	int			error;
+
+	if (sb->s_flags & MS_RDONLY)
+		return;
+	xfs_info(XFS_M(sb), "Freezing prior to reboot.");
+	up_read(&sb->s_umount);
+	error = freeze_super(sb);
+	down_read(&sb->s_umount);
+	if (error && error != -EBUSY)
+		xfs_info(XFS_M(sb), "Unable to freeze, error=%d", error);
+}
+
+STATIC int
+xfs_reboot(
+	struct notifier_block	*nb,
+	ulong			event,
+	void			*buf)
+{
+	iterate_supers_type(&xfs_fs_type, xfs_reboot_fs, NULL);
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block xfs_reboot_notifier = {
+	.notifier_call = xfs_reboot,
+	.priority = INT_MAX,
+};
+
 STATIC int __init
 init_xfs_fs(void)
 {
@@ -2056,8 +2089,14 @@ init_xfs_fs(void)
 	error = register_filesystem(&xfs_fs_type);
 	if (error)
 		goto out_qm_exit;
+
+	error = register_reboot_notifier(&xfs_reboot_notifier);
+	if (error)
+		goto out_register_fs;
 	return 0;
 
+ out_register_fs:
+	unregister_filesystem(&xfs_fs_type);
  out_qm_exit:
 	xfs_qm_exit();
  out_remove_dbg_kobj:
@@ -2089,6 +2128,7 @@ init_xfs_fs(void)
 STATIC void __exit
 exit_xfs_fs(void)
 {
+	unregister_reboot_notifier(&xfs_reboot_notifier);
 	xfs_qm_exit();
 	unregister_filesystem(&xfs_fs_type);
 #ifdef DEBUG

^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/3] xfs: remove double-underscore integer types
  2017-05-18  1:30 ` [PATCH 1/3] xfs: remove double-underscore integer types Darrick J. Wong
@ 2017-05-18  6:01   ` Dave Chinner
  2017-05-18  6:21     ` Darrick J. Wong
  2017-05-18  6:31     ` Christoph Hellwig
  0 siblings, 2 replies; 27+ messages in thread
From: Dave Chinner @ 2017-05-18  6:01 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs, Eric Sandeen

On Wed, May 17, 2017 at 06:30:43PM -0700, Darrick J. Wong wrote:
> This is a purely mechanical patch that removes the private
> __{u,}int{8,16,32,64}_t typedefs in favor of using the system
> {u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
> the transformation and fix the resulting whitespace and indentation
> errors:
> 
> s/typedef\t__uint8_t/typedef __uint8_t\t/g
> s/typedef\t__uint/typedef __uint/g
> s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
> s/__uint8_t\t/__uint8_t\t\t/g
> s/__uint/uint/g
> s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
> s/__int/int/g
> /^typedef.*int[0-9]*_t;$/d

I'm not sure that this is entirely correct when it comes to sparse
endian notations or the way the __ types were intended to be used.
ISTR we used the __ types were originally for the in-memory endian
converted variable definitions that shadowed the on-disk structures.
The cleanup plan I was planning to do was to convert these all to
the linux kernel definitions of __[s,u][8,16,32,64] so it was clear
they shadow on disk structures of specific sizes.

Once that was done, everything else could be converted to c99 types
(like you've done above) and then we'd be free of all the old
__[u]int*_t types....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/3] xfs: remove double-underscore integer types
  2017-05-18  6:01   ` Dave Chinner
@ 2017-05-18  6:21     ` Darrick J. Wong
  2017-05-18  6:31     ` Christoph Hellwig
  1 sibling, 0 replies; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-18  6:21 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs, Eric Sandeen

On Thu, May 18, 2017 at 04:01:58PM +1000, Dave Chinner wrote:
> On Wed, May 17, 2017 at 06:30:43PM -0700, Darrick J. Wong wrote:
> > This is a purely mechanical patch that removes the private
> > __{u,}int{8,16,32,64}_t typedefs in favor of using the system
> > {u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
> > the transformation and fix the resulting whitespace and indentation
> > errors:
> > 
> > s/typedef\t__uint8_t/typedef __uint8_t\t/g
> > s/typedef\t__uint/typedef __uint/g
> > s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
> > s/__uint8_t\t/__uint8_t\t\t/g
> > s/__uint/uint/g
> > s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
> > s/__int/int/g
> > /^typedef.*int[0-9]*_t;$/d
> 
> I'm not sure that this is entirely correct when it comes to sparse
> endian notations or the way the __ types were intended to be used.
> ISTR we used the __ types were originally for the in-memory endian
> converted variable definitions that shadowed the on-disk structures.
> The cleanup plan I was planning to do was to convert these all to
> the linux kernel definitions of __[s,u][8,16,32,64] so it was clear
> they shadow on disk structures of specific sizes.

<nod> I do see the appeal of __be/__le -> __u in source code, though I
also see that include/linux/types.h typedefs them together (uint16_t is
__u16), though in my head the signedness and size are encode in the name
so they're interchangeable. :)

> Once that was done, everything else could be converted to c99 types
> (like you've done above) and then we'd be free of all the old
> __[u]int*_t types....

Well I /did/ leave the existing __[ui]{8,16,32,64} declarations alone
since /most/ of them looked like incore versions of ondisk structures.
Though truth be told there was a lot of code to look at!

(Though I also wonder why you'd want to have mixed __u32 and
uint32_t...)

Anyway, let's see if anyone else bites. :)

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-18  1:32 ` [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot Darrick J. Wong
@ 2017-05-18  6:28   ` Christoph Hellwig
  2017-05-18  8:34   ` Dave Chinner
  1 sibling, 0 replies; 27+ messages in thread
From: Christoph Hellwig @ 2017-05-18  6:28 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs, Eric Sandeen, linux-fsdevel

NAK.  If the answer is a reboot notifier the question is always wrong.

IF XFS has a problem with this others doe as well and we'll need to fix
it in common code.

On Wed, May 17, 2017 at 06:32:42PM -0700, Darrick J. Wong wrote:
> Apparently there are certain system software configurations that do odd
> things like update the kernel and reboot without umounting the /boot fs
> or remounting it readonly, either of which would push all the AIL items
> out to disk.  As a result, a subsequent invocation of something like
> grub (which has a frightening willingness to read a fs with a dirty log)
> can read stale disk contents and/or miss files the metadata for which
> have been written to the log but not checkpointed into the filesystem.
> 
> Granted, most of the time /boot is a separate partition and
> systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
> This "fix" is only needed for people who have one giant filesystem.
> 
> Therefore, add a reboot hook to freeze the rw filesystems (which
> checkpoints the log) just prior to reboot.  This is an unfortunate and
> insufficient workaround for multiple layers of inadequate external
> software, but at least it will reduce boot time surprises for the "OS
> updater failed to disengage the filesystem before rebooting" case.
> 
> Seeing as grub is unlikely ever to learn to replay the XFS log (and we
> probably don't want it doing that), *LILO has been discontinued for at
> least 18 months, and we're not quite to the point of putting kernel
> files directly on the EFI System Partition, this seems like the least
> crappy solution to this problem.
> 
> Yes, you're still screwed in grub if the system crashes. :)  I don't
> anticipate this patch will make it upstream, but the idea could get at
> least a single hearing.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/xfs_super.c |   40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 455a575..415b1e8 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -61,6 +61,7 @@
>  #include <linux/kthread.h>
>  #include <linux/freezer.h>
>  #include <linux/parser.h>
> +#include <linux/reboot.h>
>  
>  static const struct super_operations xfs_super_operations;
>  struct bio_set *xfs_ioend_bioset;
> @@ -1982,6 +1983,38 @@ xfs_destroy_workqueues(void)
>  	destroy_workqueue(xfs_alloc_wq);
>  }
>  
> +STATIC void
> +xfs_reboot_fs(
> +	struct super_block	*sb,
> +	void			*priv)
> +{
> +	int			error;
> +
> +	if (sb->s_flags & MS_RDONLY)
> +		return;
> +	xfs_info(XFS_M(sb), "Freezing prior to reboot.");
> +	up_read(&sb->s_umount);
> +	error = freeze_super(sb);
> +	down_read(&sb->s_umount);
> +	if (error && error != -EBUSY)
> +		xfs_info(XFS_M(sb), "Unable to freeze, error=%d", error);
> +}
> +
> +STATIC int
> +xfs_reboot(
> +	struct notifier_block	*nb,
> +	ulong			event,
> +	void			*buf)
> +{
> +	iterate_supers_type(&xfs_fs_type, xfs_reboot_fs, NULL);
> +	return NOTIFY_DONE;
> +}
> +
> +static struct notifier_block xfs_reboot_notifier = {
> +	.notifier_call = xfs_reboot,
> +	.priority = INT_MAX,
> +};
> +
>  STATIC int __init
>  init_xfs_fs(void)
>  {
> @@ -2056,8 +2089,14 @@ init_xfs_fs(void)
>  	error = register_filesystem(&xfs_fs_type);
>  	if (error)
>  		goto out_qm_exit;
> +
> +	error = register_reboot_notifier(&xfs_reboot_notifier);
> +	if (error)
> +		goto out_register_fs;
>  	return 0;
>  
> + out_register_fs:
> +	unregister_filesystem(&xfs_fs_type);
>   out_qm_exit:
>  	xfs_qm_exit();
>   out_remove_dbg_kobj:
> @@ -2089,6 +2128,7 @@ init_xfs_fs(void)
>  STATIC void __exit
>  exit_xfs_fs(void)
>  {
> +	unregister_reboot_notifier(&xfs_reboot_notifier);
>  	xfs_qm_exit();
>  	unregister_filesystem(&xfs_fs_type);
>  #ifdef DEBUG
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
---end quoted text---

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/3] xfs: remove double-underscore integer types
  2017-05-18  6:01   ` Dave Chinner
  2017-05-18  6:21     ` Darrick J. Wong
@ 2017-05-18  6:31     ` Christoph Hellwig
  1 sibling, 0 replies; 27+ messages in thread
From: Christoph Hellwig @ 2017-05-18  6:31 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Darrick J. Wong, xfs, Eric Sandeen

> I'm not sure that this is entirely correct when it comes to sparse
> endian notations or the way the __ types were intended to be used.
> ISTR we used the __ types were originally for the in-memory endian
> converted variable definitions that shadowed the on-disk structures.
> The cleanup plan I was planning to do was to convert these all to
> the linux kernel definitions of __[s,u][8,16,32,64] so it was clear
> they shadow on disk structures of specific sizes.
> 
> Once that was done, everything else could be converted to c99 types
> (like you've done above) and then we'd be free of all the old
> __[u]int*_t types....

Sparse doesn't care - what matters there are the __be* and __le*
types.

Otherwise it's just a decision if we want to use C99 or Linux types,
and if we want to use Linux types if we want to use the __-prefixed
ones to avoid name collisions in userspace.

I'm fine either way - I'm used to typing uXX so that'd be my first
preference, but the uintX_t is a close second, so I'd be perfectly
fine with this patch:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/3] xfsprogs: remove double-underscore integer types
  2017-05-18  1:31 ` [PATCH 2/3] xfsprogs: " Darrick J. Wong
@ 2017-05-18  6:32   ` Christoph Hellwig
  2017-05-23  2:48     ` Darrick J. Wong
  2017-05-23  2:24   ` Eric Sandeen
  1 sibling, 1 reply; 27+ messages in thread
From: Christoph Hellwig @ 2017-05-18  6:32 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs, Eric Sandeen

On Wed, May 17, 2017 at 06:31:38PM -0700, Darrick J. Wong wrote:
> This is a purely mechanical patch that removes the private
> __{u,}int{8,16,32,64}_t typedefs in favor of using the system
> {u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
> the transformation and fix the resulting whitespace and indentation
> errors:

While I'm fine with this in general, didn't we run into xfstests error
last time this was attempted?  Or was that just the move from the *64
libc calls to the non64 ones and asking for LFS support?

> s/typedef\t__uint8_t/typedef __uint8_t\t/g
> s/typedef\t__uint/typedef __uint/g
> s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
> s/__uint8_t\t/__uint8_t\t\t/g
> s/__uint/uint/g
> s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
> s/__int/int/g
> /^typedef.*int[0-9]*_t;$/d
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  copy/xfs_copy.c             |   14 +-
>  copy/xfs_copy.h             |    2 
>  db/attr.c                   |    8 +
>  db/attrshort.c              |    4 -
>  db/bit.c                    |    4 -
>  db/bit.h                    |    2 
>  db/block.c                  |    8 +
>  db/check.c                  |   18 ++-
>  db/convert.c                |   28 ++---
>  db/faddr.c                  |   14 +-
>  db/field.c                  |   44 ++++---
>  db/fprint.c                 |    8 +
>  db/frag.c                   |    8 +
>  db/inode.c                  |   34 +++---
>  db/io.c                     |    4 -
>  db/io.h                     |    8 +
>  db/metadump.c               |   12 +-
>  db/sb.c                     |    6 +
>  fsr/xfs_fsr.c               |    2 
>  include/darwin.h            |   18 ++-
>  include/freebsd.h           |    6 +
>  include/gnukfreebsd.h       |    6 +
>  include/libxcmd.h           |    6 +
>  include/linux.h             |    8 +
>  include/xfs_arch.h          |   22 ++--
>  include/xfs_inode.h         |    4 -
>  include/xfs_log_recover.h   |    2 
>  include/xfs_metadump.h      |    4 -
>  include/xfs_mount.h         |   22 ++--
>  libhandle/handle.c          |    2 
>  libhandle/jdm.c             |    2 
>  libxcmd/topology.c          |   14 +-
>  libxfs/darwin.c             |    2 
>  libxfs/freebsd.c            |    2 
>  libxfs/init.c               |    2 
>  libxfs/irix.c               |    2 
>  libxfs/libxfs_priv.h        |    4 -
>  libxfs/linux.c              |    2 
>  libxfs/logitem.c            |    2 
>  libxfs/radix-tree.c         |    8 +
>  libxfs/rdwr.c               |    6 +
>  libxfs/util.c               |    8 +
>  libxfs/xfs_alloc_btree.c    |   20 ++-
>  libxfs/xfs_attr_remote.c    |    8 +
>  libxfs/xfs_attr_sf.h        |   10 +-
>  libxfs/xfs_bit.h            |   24 ++--
>  libxfs/xfs_bmap_btree.c     |    8 +
>  libxfs/xfs_btree.c          |   22 ++--
>  libxfs/xfs_btree.h          |   18 ++-
>  libxfs/xfs_cksum.h          |   16 +--
>  libxfs/xfs_da_btree.c       |    2 
>  libxfs/xfs_da_btree.h       |    8 +
>  libxfs/xfs_da_format.c      |   28 ++---
>  libxfs/xfs_da_format.h      |   64 +++++------
>  libxfs/xfs_dir2.h           |    8 +
>  libxfs/xfs_dir2_leaf.c      |   12 +-
>  libxfs/xfs_dir2_priv.h      |    2 
>  libxfs/xfs_dir2_sf.c        |    2 
>  libxfs/xfs_format.h         |  112 +++++++++----------
>  libxfs/xfs_fs.h             |   12 +-
>  libxfs/xfs_ialloc.c         |    6 +
>  libxfs/xfs_ialloc_btree.c   |    4 -
>  libxfs/xfs_inode_buf.c      |    2 
>  libxfs/xfs_inode_buf.h      |   28 ++---
>  libxfs/xfs_log_format.h     |  256 ++++++++++++++++++++++---------------------
>  libxfs/xfs_quota_defs.h     |    4 -
>  libxfs/xfs_refcount_btree.c |    8 +
>  libxfs/xfs_rmap.c           |    8 +
>  libxfs/xfs_rmap.h           |    8 +
>  libxfs/xfs_rmap_btree.c     |   30 +++--
>  libxfs/xfs_rtbitmap.c       |    2 
>  libxfs/xfs_sb.c             |    4 -
>  libxfs/xfs_types.h          |   46 ++++----
>  logprint/log_misc.c         |    6 +
>  mdrestore/xfs_mdrestore.c   |    2 
>  mkfs/proto.c                |    2 
>  mkfs/xfs_mkfs.c             |   76 ++++++-------
>  quota/edit.c                |   64 +++++------
>  quota/free.c                |   44 ++++---
>  quota/quot.c                |   24 ++--
>  quota/quota.c               |    4 -
>  quota/quota.h               |   12 +-
>  quota/report.c              |    4 -
>  quota/state.c               |    2 
>  quota/util.c                |   66 ++++++-----
>  repair/README               |    2 
>  repair/agheader.h           |   14 +-
>  repair/attr_repair.h        |   26 ++--
>  repair/avl64.c              |   38 +++---
>  repair/avl64.h              |   18 ++-
>  repair/dinode.c             |   38 +++---
>  repair/dinode.h             |    4 -
>  repair/dir2.c               |    2 
>  repair/globals.h            |   16 +--
>  repair/incore.c             |   10 +-
>  repair/incore.h             |   46 ++++----
>  repair/incore_ext.c         |    6 +
>  repair/incore_ino.c         |   72 ++++++------
>  repair/phase2.c             |    2 
>  repair/phase3.c             |    6 +
>  repair/phase4.c             |    4 -
>  repair/phase5.c             |   28 ++---
>  repair/phase6.c             |   16 +--
>  repair/phase7.c             |    6 +
>  repair/progress.c           |   30 +++--
>  repair/progress.h           |    4 -
>  repair/rmap.c               |   18 ++-
>  repair/rmap.h               |    2 
>  repair/sb.c                 |   24 ++--
>  repair/scan.c               |   50 ++++----
>  repair/scan.h               |   12 +-
>  111 files changed, 982 insertions(+), 982 deletions(-)
> 
> diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
> index a7da824..33e05df 100644
> --- a/copy/xfs_copy.c
> +++ b/copy/xfs_copy.c
> @@ -43,7 +43,7 @@ unsigned int	source_sectorsize;	/* source disk sectorsize */
>  
>  xfs_agblock_t	first_agbno;
>  
> -__uint64_t	barcount[11];
> +uint64_t	barcount[11];
>  
>  unsigned int	num_targets;
>  target_control	*target;
> @@ -313,7 +313,7 @@ usage(void)
>  }
>  
>  void
> -init_bar(__uint64_t source_blocks)
> +init_bar(uint64_t source_blocks)
>  {
>  	int	i;
>  
> @@ -322,7 +322,7 @@ init_bar(__uint64_t source_blocks)
>  }
>  
>  int
> -bump_bar(int tenths, __uint64_t numblocks)
> +bump_bar(int tenths, uint64_t numblocks)
>  {
>  	static char *bar[11] = {
>  		" 0% ",
> @@ -534,8 +534,8 @@ main(int argc, char **argv)
>  	xfs_off_t	pos;
>  	size_t		length;
>  	int		c;
> -	__uint64_t	size, sizeb;
> -	__uint64_t	numblocks = 0;
> +	uint64_t	size, sizeb;
> +	uint64_t	numblocks = 0;
>  	int		wblocks = 0;
>  	int		num_threads = 0;
>  	struct dioattr	d;
> @@ -951,8 +951,8 @@ main(int argc, char **argv)
>  	num_ags = mp->m_sb.sb_agcount;
>  
>  	init_bar(mp->m_sb.sb_blocksize / BBSIZE
> -			* ((__uint64_t)mp->m_sb.sb_dblocks
> -			    - (__uint64_t)mp->m_sb.sb_fdblocks + 10 * num_ags));
> +			* ((uint64_t)mp->m_sb.sb_dblocks
> +			    - (uint64_t)mp->m_sb.sb_fdblocks + 10 * num_ags));
>  
>  	kids = num_targets;
>  
> diff --git a/copy/xfs_copy.h b/copy/xfs_copy.h
> index 2737068..53c6e42 100644
> --- a/copy/xfs_copy.h
> +++ b/copy/xfs_copy.h
> @@ -76,7 +76,7 @@ typedef struct {
>  
>  typedef int thread_id;
>  typedef int tm_index;			/* index into thread mask array */
> -typedef __uint32_t thread_mask;		/* a thread mask */
> +typedef uint32_t thread_mask;		/* a thread mask */
>  
>  typedef struct {
>  	char		*name;
> diff --git a/db/attr.c b/db/attr.c
> index e26ac67..6f56953 100644
> --- a/db/attr.c
> +++ b/db/attr.c
> @@ -77,16 +77,16 @@ const field_t	attr_leaf_entry_flds[] = {
>  	{ "nameidx", FLDT_UINT16D, OI(LEOFF(nameidx)), C1, 0, TYP_NONE },
>  	{ "flags", FLDT_UINT8X, OI(LEOFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
>  	{ "incomplete", FLDT_UINT1,
> -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_INCOMPLETE_BIT - 1), C1,
> +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_INCOMPLETE_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "root", FLDT_UINT1,
> -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
> +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
>  	  TYP_NONE },
>  	{ "secure", FLDT_UINT1,
> -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
> +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
>  	  TYP_NONE },
>  	{ "local", FLDT_UINT1,
> -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_LOCAL_BIT - 1), C1, 0,
> +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_LOCAL_BIT - 1), C1, 0,
>  	  TYP_NONE },
>  	{ "pad2", FLDT_UINT8X, OI(LEOFF(pad2)), C1, FLD_SKIPALL, TYP_NONE },
>  	{ NULL }
> diff --git a/db/attrshort.c b/db/attrshort.c
> index d82559c..2ef358f 100644
> --- a/db/attrshort.c
> +++ b/db/attrshort.c
> @@ -51,10 +51,10 @@ const field_t	attr_sf_entry_flds[] = {
>  	{ "valuelen", FLDT_UINT8D, OI(EOFF(valuelen)), C1, 0, TYP_NONE },
>  	{ "flags", FLDT_UINT8X, OI(EOFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
>  	{ "root", FLDT_UINT1,
> -	  OI(EOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
> +	  OI(EOFF(flags) + bitsz(uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
>  	  TYP_NONE },
>  	{ "secure", FLDT_UINT1,
> -	  OI(EOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
> +	  OI(EOFF(flags) + bitsz(uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
>  	  TYP_NONE },
>  	{ "name", FLDT_CHARNS, OI(EOFF(nameval)), attr_sf_entry_name_count,
>  	  FLD_COUNT, TYP_NONE },
> diff --git a/db/bit.c b/db/bit.c
> index 24872bf..f5ebf68 100644
> --- a/db/bit.c
> +++ b/db/bit.c
> @@ -60,7 +60,7 @@ setbit(
>  	}
>  }
>  
> -__int64_t
> +int64_t
>  getbitval(
>  	void		*obj,
>  	int		bitoff,
> @@ -70,7 +70,7 @@ getbitval(
>  	int		bit;
>  	int		i;
>  	char		*p;
> -	__int64_t	rval;
> +	int64_t		rval;
>  	int		signext;
>  	int		z1, z2, z3, z4;
>  
> diff --git a/db/bit.h b/db/bit.h
> index 80ba24c..9fd71f4 100644
> --- a/db/bit.h
> +++ b/db/bit.h
> @@ -25,5 +25,5 @@
>  #define	BVUNSIGNED	0
>  #define	BVSIGNED	1
>  
> -extern __int64_t	getbitval(void *obj, int bitoff, int nbits, int flags);
> +extern int64_t		getbitval(void *obj, int bitoff, int nbits, int flags);
>  extern void             setbitval(void *obuf, int bitoff, int nbits, void *ibuf);
> diff --git a/db/block.c b/db/block.c
> index 4a357ce..5ecd687 100644
> --- a/db/block.c
> +++ b/db/block.c
> @@ -98,7 +98,7 @@ ablock_f(
>  	}
>  	dfsbno = bm.startblock + (bno - bm.startoff);
>  	ASSERT(typtab[TYP_ATTR].typnm == TYP_ATTR);
> -	set_cur(&typtab[TYP_ATTR], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> +	set_cur(&typtab[TYP_ATTR], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
>  		blkbb, DB_RING_ADD, NULL);
>  	return 0;
>  }
> @@ -128,14 +128,14 @@ daddr_f(
>  	int		argc,
>  	char		**argv)
>  {
> -	__int64_t	d;
> +	int64_t		d;
>  	char		*p;
>  
>  	if (argc == 1) {
>  		dbprintf(_("current daddr is %lld\n"), iocur_top->off >> BBSHIFT);
>  		return 0;
>  	}
> -	d = (__int64_t)strtoull(argv[1], &p, 0);
> +	d = (int64_t)strtoull(argv[1], &p, 0);
>  	if (*p != '\0' ||
>  	    d >= mp->m_sb.sb_dblocks << (mp->m_sb.sb_blocklog - BBSHIFT)) {
>  		dbprintf(_("bad daddr %s\n"), argv[1]);
> @@ -197,7 +197,7 @@ dblock_f(
>  	ASSERT(typtab[type].typnm == type);
>  	if (nex > 1)
>  		make_bbmap(&bbmap, nex, bmp);
> -	set_cur(&typtab[type], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> +	set_cur(&typtab[type], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
>  		nb * blkbb, DB_RING_ADD, nex > 1 ? &bbmap : NULL);
>  	free(bmp);
>  	return 0;
> diff --git a/db/check.c b/db/check.c
> index 8e618a2..81ba63a 100644
> --- a/db/check.c
> +++ b/db/check.c
> @@ -114,8 +114,8 @@ typedef struct dirhash {
>  
>  static xfs_extlen_t	agffreeblks;
>  static xfs_extlen_t	agflongest;
> -static __uint64_t	agf_aggr_freeblks;	/* aggregate count over all */
> -static __uint32_t	agfbtreeblks;
> +static uint64_t	agf_aggr_freeblks;	/* aggregate count over all */
> +static uint32_t	agfbtreeblks;
>  static int		lazycount;
>  static xfs_agino_t	agicount;
>  static xfs_agino_t	agifreecount;
> @@ -124,10 +124,10 @@ static int		blist_size;
>  static char		**dbmap;	/* really dbm_t:8 */
>  static dirhash_t	**dirhash;
>  static int		error;
> -static __uint64_t	fdblocks;
> -static __uint64_t	frextents;
> -static __uint64_t	icount;
> -static __uint64_t	ifree;
> +static uint64_t	fdblocks;
> +static uint64_t	frextents;
> +static uint64_t	icount;
> +static uint64_t	ifree;
>  static inodata_t	***inodata;
>  static int		inodata_hash_size;
>  static inodata_t	***inomap;
> @@ -1187,7 +1187,7 @@ blocktrash_f(
>  		goto out;
>  	}
>  	for (i = 0; i < count; i++) {
> -		randb = (xfs_rfsblock_t)((((__int64_t)random() << 32) |
> +		randb = (xfs_rfsblock_t)((((int64_t)random() << 32) |
>  					 random()) % blocks);
>  		for (bi = 0, agno = 0, done = 0;
>  		     !done && agno < mp->m_sb.sb_agcount;
> @@ -3032,7 +3032,7 @@ process_leaf_node_dir_v2(
>  		}
>  		if (v)
>  			dbprintf(_("dir inode %lld block %u=%llu\n"), id->ino,
> -				(__uint32_t)dbno,
> +				(uint32_t)dbno,
>  				(xfs_fsblock_t)bmp->startblock);
>  		push_cur();
>  		if (nex > 1)
> @@ -3045,7 +3045,7 @@ process_leaf_node_dir_v2(
>  			if (!sflag || v)
>  				dbprintf(_("can't read block %u for directory "
>  					 "inode %lld\n"),
> -					(__uint32_t)dbno, id->ino);
> +					(uint32_t)dbno, id->ino);
>  			error++;
>  			pop_cur();
>  			dbno += mp->m_dir_geo->fsbcount - 1;
> diff --git a/db/convert.c b/db/convert.c
> index a337abe..fa4f962 100644
> --- a/db/convert.c
> +++ b/db/convert.c
> @@ -24,13 +24,13 @@
>  
>  #define	M(A)	(1 << CT_ ## A)
>  #define	agblock_to_bytes(x)	\
> -	((__uint64_t)(x) << mp->m_sb.sb_blocklog)
> +	((uint64_t)(x) << mp->m_sb.sb_blocklog)
>  #define	agino_to_bytes(x)	\
> -	((__uint64_t)(x) << mp->m_sb.sb_inodelog)
> +	((uint64_t)(x) << mp->m_sb.sb_inodelog)
>  #define	agnumber_to_bytes(x)	\
> -	agblock_to_bytes((__uint64_t)(x) * mp->m_sb.sb_agblocks)
> +	agblock_to_bytes((uint64_t)(x) * mp->m_sb.sb_agblocks)
>  #define	daddr_to_bytes(x)	\
> -	((__uint64_t)(x) << BBSHIFT)
> +	((uint64_t)(x) << BBSHIFT)
>  #define	fsblock_to_bytes(x)	\
>  	(agnumber_to_bytes(XFS_FSB_TO_AGNO(mp, (x))) + \
>  	 agblock_to_bytes(XFS_FSB_TO_AGBNO(mp, (x))))
> @@ -38,7 +38,7 @@
>  	(agnumber_to_bytes(XFS_INO_TO_AGNO(mp, (x))) + \
>  	 agino_to_bytes(XFS_INO_TO_AGINO(mp, (x))))
>  #define	inoidx_to_bytes(x)	\
> -	((__uint64_t)(x) << mp->m_sb.sb_inodelog)
> +	((uint64_t)(x) << mp->m_sb.sb_inodelog)
>  
>  typedef enum {
>  	CT_NONE = -1,
> @@ -68,7 +68,7 @@ typedef union {
>  	xfs_agnumber_t	agnumber;
>  	int		bboff;
>  	int		blkoff;
> -	__uint64_t	byte;
> +	uint64_t	byte;
>  	xfs_daddr_t	daddr;
>  	xfs_fsblock_t	fsblock;
>  	xfs_ino_t	ino;
> @@ -76,7 +76,7 @@ typedef union {
>  	int		inooff;
>  } cval_t;
>  
> -static __uint64_t		bytevalue(ctype_t ctype, cval_t *val);
> +static uint64_t		bytevalue(ctype_t ctype, cval_t *val);
>  static int		convert_f(int argc, char **argv);
>  static int		getvalue(char *s, ctype_t ctype, cval_t *val);
>  static ctype_t		lookupcty(char *ctyname);
> @@ -118,7 +118,7 @@ static const cmdinfo_t	convert_cmd =
>  	{ "convert", NULL, convert_f, 3, 9, 0, "type num [type num]... type",
>  	  "convert from one address form to another", NULL };
>  
> -static __uint64_t
> +static uint64_t
>  bytevalue(ctype_t ctype, cval_t *val)
>  {
>  	switch (ctype) {
> @@ -129,9 +129,9 @@ bytevalue(ctype_t ctype, cval_t *val)
>  	case CT_AGNUMBER:
>  		return agnumber_to_bytes(val->agnumber);
>  	case CT_BBOFF:
> -		return (__uint64_t)val->bboff;
> +		return (uint64_t)val->bboff;
>  	case CT_BLKOFF:
> -		return (__uint64_t)val->blkoff;
> +		return (uint64_t)val->blkoff;
>  	case CT_BYTE:
>  		return val->byte;
>  	case CT_DADDR:
> @@ -143,7 +143,7 @@ bytevalue(ctype_t ctype, cval_t *val)
>  	case CT_INOIDX:
>  		return inoidx_to_bytes(val->inoidx);
>  	case CT_INOOFF:
> -		return (__uint64_t)val->inooff;
> +		return (uint64_t)val->inooff;
>  	case CT_NONE:
>  	case NCTS:
>  		break;
> @@ -160,7 +160,7 @@ convert_f(int argc, char **argv)
>  	cval_t		cvals[NCTS] = {};
>  	int		i;
>  	int		mask;
> -	__uint64_t	v;
> +	uint64_t	v;
>  	ctype_t		wtype;
>  
>  	/* move past the "convert" command */
> @@ -262,7 +262,7 @@ static int
>  getvalue(char *s, ctype_t ctype, cval_t *val)
>  {
>  	char		*p;
> -	__uint64_t	v;
> +	uint64_t	v;
>  
>  	v = strtoull(s, &p, 0);
>  	if (*p != '\0') {
> @@ -286,7 +286,7 @@ getvalue(char *s, ctype_t ctype, cval_t *val)
>  		val->blkoff = (int)v;
>  		break;
>  	case CT_BYTE:
> -		val->byte = (__uint64_t)v;
> +		val->byte = (uint64_t)v;
>  		break;
>  	case CT_DADDR:
>  		val->daddr = (xfs_daddr_t)v;
> diff --git a/db/faddr.c b/db/faddr.c
> index 877200b..5620764 100644
> --- a/db/faddr.c
> +++ b/db/faddr.c
> @@ -79,11 +79,11 @@ fa_attrblock(
>  	typnm_t		next)
>  {
>  	bmap_ext_t	bm;
> -	__uint32_t	bno;
> +	uint32_t	bno;
>  	xfs_fsblock_t	dfsbno;
>  	int		nex;
>  
> -	bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
> +	bno = (uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
>  	if (bno == 0) {
>  		dbprintf(_("null attribute block number, cannot set new addr\n"));
>  		return;
> @@ -96,7 +96,7 @@ fa_attrblock(
>  	}
>  	dfsbno = bm.startblock + (bno - bm.startoff);
>  	ASSERT(typtab[next].typnm == next);
> -	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno), blkbb,
> +	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno), blkbb,
>  		DB_RING_ADD, NULL);
>  }
>  
> @@ -276,11 +276,11 @@ fa_dirblock(
>  {
>  	bbmap_t		bbmap;
>  	bmap_ext_t	*bmp;
> -	__uint32_t	bno;
> +	uint32_t	bno;
>  	xfs_fsblock_t	dfsbno;
>  	int		nex;
>  
> -	bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
> +	bno = (uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
>  	if (bno == 0) {
>  		dbprintf(_("null directory block number, cannot set new addr\n"));
>  		return;
> @@ -297,7 +297,7 @@ fa_dirblock(
>  	ASSERT(typtab[next].typnm == next);
>  	if (nex > 1)
>  		make_bbmap(&bbmap, nex, bmp);
> -	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> +	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
>  		XFS_FSB_TO_BB(mp, mp->m_dir_geo->fsbcount), DB_RING_ADD,
>  		nex > 1 ? &bbmap : NULL);
>  	free(bmp);
> @@ -317,7 +317,7 @@ fa_drfsbno(
>  		return;
>  	}
>  	ASSERT(typtab[next].typnm == next);
> -	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_BB(mp, bno), blkbb,
> +	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_BB(mp, bno), blkbb,
>  		DB_RING_ADD, NULL);
>  }
>  
> diff --git a/db/field.c b/db/field.c
> index 1968dd5..2a2197a 100644
> --- a/db/field.c
> +++ b/db/field.c
> @@ -83,7 +83,7 @@ const ftattr_t	ftattrtab[] = {
>  	  attr_sf_entry_size, FTARG_SIZE, NULL, attr_sf_entry_flds },
>  	{ FLDT_ATTR_SF_HDR, "attr_sf_hdr", NULL, (char *)attr_sf_hdr_flds,
>  	  SI(bitsz(struct xfs_attr_sf_hdr)), 0, NULL, attr_sf_hdr_flds },
> -	{ FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
> +	{ FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
>  	  fa_attrblock, NULL },
>  	{ FLDT_ATTRSHORT, "attrshort", NULL, (char *)attr_shortform_flds,
>  	  attrshort_size, FTARG_SIZE, NULL, attr_shortform_flds },
> @@ -197,7 +197,7 @@ const ftattr_t	ftattrtab[] = {
>  	  SI(bitsz(struct xfs_refcount_rec)), 0, NULL, refcbt_rec_flds },
>  
>  /* CRC field */
> -	{ FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(__uint32_t)),
> +	{ FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(uint32_t)),
>  	  0, NULL, NULL },
>  
>  	{ FLDT_DEV, "dev", fp_num, "%#x", SI(bitsz(xfs_dev_t)), 0, NULL, NULL },
> @@ -212,7 +212,7 @@ const ftattr_t	ftattrtab[] = {
>  	{ FLDT_DINODE_CORE, "dinode_core", NULL, (char *)inode_core_flds,
>  	  SI(bitsz(xfs_dinode_t)), 0, NULL, inode_core_flds },
>  	{ FLDT_DINODE_FMT, "dinode_fmt", fp_dinode_fmt, NULL,
> -	  SI(bitsz(__int8_t)), 0, NULL, NULL },
> +	  SI(bitsz(int8_t)), 0, NULL, NULL },
>  	{ FLDT_DINODE_U, "dinode_u", NULL, (char *)inode_u_flds, inode_u_size,
>  	  FTARG_SIZE|FTARG_OKEMPTY, NULL, inode_u_flds },
>  	{ FLDT_DINODE_V3, "dinode_v3", NULL, (char *)inode_v3_flds,
> @@ -293,7 +293,7 @@ const ftattr_t	ftattrtab[] = {
>  	{ FLDT_DA3_NODE_HDR, "dir_node_hdr", NULL, (char *)da3_node_hdr_flds,
>  	  SI(bitsz(struct xfs_da3_node_hdr)), 0, NULL, da3_node_hdr_flds },
>  
> -	{ FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
> +	{ FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
>  	  fa_dirblock, NULL },
>  	{ FLDT_DISK_DQUOT, "disk_dquot", NULL, (char *)disk_dquot_flds,
>  	  SI(bitsz(xfs_disk_dquot_t)), 0, NULL, disk_dquot_flds },
> @@ -333,15 +333,15 @@ const ftattr_t	ftattrtab[] = {
>  	  FTARG_SIZE, NULL, inode_crc_flds },
>  	{ FLDT_INOFREE, "inofree", fp_num, "%#llx", SI(bitsz(xfs_inofree_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(__int16_t)),
> +	{ FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(int16_t)),
>  	  FTARG_SIGNED, NULL, NULL },
> -	{ FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(__int32_t)),
> +	{ FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(int32_t)),
>  	  FTARG_SIGNED, NULL, NULL },
> -	{ FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(__int64_t)),
> +	{ FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(int64_t)),
>  	  FTARG_SIGNED, NULL, NULL },
> -	{ FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(__int8_t)), FTARG_SIGNED,
> +	{ FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(int8_t)), FTARG_SIGNED,
>  	  NULL, NULL },
> -	{ FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(__int32_t)), FTARG_SIGNED,
> +	{ FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(int32_t)), FTARG_SIGNED,
>  	  NULL, NULL },
>  	{ FLDT_QCNT, "qcnt", fp_num, "%llu", SI(bitsz(xfs_qcnt_t)), 0, NULL,
>  	  NULL },
> @@ -354,34 +354,34 @@ const ftattr_t	ftattrtab[] = {
>  	{ FLDT_SYMLINK_CRC, "symlink", NULL, (char *)symlink_crc_flds,
>  	  symlink_size, FTARG_SIZE, NULL, symlink_crc_flds },
>  
> -	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(__int32_t)), FTARG_SIGNED,
> +	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(int32_t)), FTARG_SIGNED,
>  	  NULL, NULL },
>  	{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
>  	  SI(bitsz(xfs_timestamp_t)), 0, NULL, timestamp_flds },
>  	{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
> -	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(__uint16_t)), 0, NULL,
> +	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
>  	  NULL },
> -	{ FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(__uint16_t)), 0,
> +	{ FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(uint16_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(__uint16_t)), 0,
> +	{ FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(uint16_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(__uint32_t)), 0, NULL,
> +	{ FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(uint32_t)), 0, NULL,
>  	  NULL },
> -	{ FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(__uint32_t)), 0,
> +	{ FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(uint32_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(__uint32_t)), 0,
> +	{ FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(uint32_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(__uint64_t)), 0,
> +	{ FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(uint64_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(__uint64_t)), 0,
> +	{ FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(uint64_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(__uint64_t)), 0,
> +	{ FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(uint64_t)), 0,
>  	  NULL, NULL },
> -	{ FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(__uint8_t)), 0, NULL,
> +	{ FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(uint8_t)), 0, NULL,
>  	  NULL },
> -	{ FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(__uint8_t)), 0, NULL,
> +	{ FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(uint8_t)), 0, NULL,
>  	  NULL },
> -	{ FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(__uint8_t)), 0, NULL,
> +	{ FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(uint8_t)), 0, NULL,
>  	  NULL },
>  	{ FLDT_UUID, "uuid", fp_uuid, NULL, SI(bitsz(uuid_t)), 0, NULL, NULL },
>  	{ FLDT_ZZZ, NULL }
> diff --git a/db/fprint.c b/db/fprint.c
> index fd7e7f4..261a31e 100644
> --- a/db/fprint.c
> +++ b/db/fprint.c
> @@ -80,7 +80,7 @@ fp_num(
>  	int		bitpos;
>  	int		i;
>  	int		isnull;
> -	__int64_t	val;
> +	int64_t		val;
>  
>  	for (i = 0, bitpos = bit;
>  	     i < count && !seenint();
> @@ -100,7 +100,7 @@ fp_num(
>  		else if (size > 32)
>  			dbprintf(fmtstr, val);
>  		else
> -			dbprintf(fmtstr, (__int32_t)val);
> +			dbprintf(fmtstr, (int32_t)val);
>  		if (i < count - 1)
>  			dbprintf(" ");
>  	}
> @@ -203,7 +203,7 @@ fp_crc(
>  {
>  	int		bitpos;
>  	int		i;
> -	__int64_t	val;
> +	int64_t		val;
>  	char		*ok;
>  
>  	switch (iocur_crc_valid()) {
> @@ -230,7 +230,7 @@ fp_crc(
>  		if (size > 32)
>  			dbprintf(fmtstr, val, ok);
>  		else
> -			dbprintf(fmtstr, (__int32_t)val, ok);
> +			dbprintf(fmtstr, (int32_t)val, ok);
>  		if (i < count - 1)
>  			dbprintf(" ");
>  	}
> diff --git a/db/frag.c b/db/frag.c
> index 8005e45..d224f0c 100644
> --- a/db/frag.c
> +++ b/db/frag.c
> @@ -42,8 +42,8 @@ typedef	struct extmap {
>  
>  static int		aflag;
>  static int		dflag;
> -static __uint64_t	extcount_actual;
> -static __uint64_t	extcount_ideal;
> +static uint64_t	extcount_actual;
> +static uint64_t	extcount_ideal;
>  static int		fflag;
>  static int		lflag;
>  static int		qflag;
> @@ -310,8 +310,8 @@ process_inode(
>  	xfs_agino_t		agino,
>  	xfs_dinode_t		*dip)
>  {
> -	__uint64_t		actual;
> -	__uint64_t		ideal;
> +	uint64_t		actual;
> +	uint64_t		ideal;
>  	xfs_ino_t		ino;
>  	int			skipa;
>  	int			skipd;
> diff --git a/db/inode.c b/db/inode.c
> index 8b7a41e..7538ee0 100644
> --- a/db/inode.c
> +++ b/db/inode.c
> @@ -119,49 +119,49 @@ const field_t	inode_core_flds[] = {
>  	{ "dmstate", FLDT_UINT16D, OI(COFF(dmstate)), C1, 0, TYP_NONE },
>  	{ "flags", FLDT_UINT16X, OI(COFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
>  	{ "newrtbm", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NEWRTBM_BIT - 1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NEWRTBM_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "prealloc", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_PREALLOC_BIT - 1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_PREALLOC_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "realtime", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_REALTIME_BIT - 1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_REALTIME_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "immutable", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_IMMUTABLE_BIT-1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_IMMUTABLE_BIT-1), C1,
>  	  0, TYP_NONE },
>  	{ "append", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_APPEND_BIT - 1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_APPEND_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "sync", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_SYNC_BIT - 1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_SYNC_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "noatime", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NOATIME_BIT - 1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NOATIME_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "nodump", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NODUMP_BIT - 1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NODUMP_BIT - 1), C1,
>  	  0, TYP_NONE },
>  	{ "rtinherit", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_RTINHERIT_BIT-1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_RTINHERIT_BIT-1), C1,
>  	  0, TYP_NONE },
>  	{ "projinherit", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT-1),C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT-1),C1,
>  	  0, TYP_NONE },
>  	{ "nosymlinks", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT-1), C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT-1), C1,
>  	  0, TYP_NONE },
>  	{ "extsz", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_EXTSIZE_BIT-1),C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_EXTSIZE_BIT-1),C1,
>  	  0, TYP_NONE },
>  	{ "extszinherit", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT-1),C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT-1),C1,
>  	  0, TYP_NONE },
>  	{ "nodefrag", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NODEFRAG_BIT-1),C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NODEFRAG_BIT-1),C1,
>  	  0, TYP_NONE },
>  	{ "filestream", FLDT_UINT1,
> -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_FILESTREAM_BIT-1),C1,
> +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_FILESTREAM_BIT-1),C1,
>  	  0, TYP_NONE },
>  	{ "gen", FLDT_UINT32D, OI(COFF(gen)), C1, 0, TYP_NONE },
>  	{ NULL }
> @@ -177,10 +177,10 @@ const field_t	inode_v3_flds[] = {
>  	{ "inumber", FLDT_INO, OI(COFF(ino)), C1, 0, TYP_NONE },
>  	{ "uuid", FLDT_UUID, OI(COFF(uuid)), C1, 0, TYP_NONE },
>  	{ "reflink", FLDT_UINT1,
> -	  OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
> +	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
>  	  0, TYP_NONE },
>  	{ "cowextsz", FLDT_UINT1,
> -	  OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
> +	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
>  	  0, TYP_NONE },
>  	{ NULL }
>  };
> diff --git a/db/io.c b/db/io.c
> index 9918a51..f93c8af 100644
> --- a/db/io.c
> +++ b/db/io.c
> @@ -536,7 +536,7 @@ write_cur(void)
>  void
>  set_cur(
>  	const typ_t	*t,
> -	__int64_t	d,
> +	int64_t		d,
>  	int		c,
>  	int		ring_flag,
>  	bbmap_t		*bbmap)
> @@ -544,7 +544,7 @@ set_cur(
>  	struct xfs_buf	*bp;
>  	xfs_ino_t	dirino;
>  	xfs_ino_t	ino;
> -	__uint16_t	mode;
> +	uint16_t	mode;
>  	const struct xfs_buf_ops *ops = t ? t->bops : NULL;
>  
>  	if (iocur_sp < 0) {
> diff --git a/db/io.h b/db/io.h
> index b415b82..0b3cba4 100644
> --- a/db/io.h
> +++ b/db/io.h
> @@ -25,7 +25,7 @@ typedef struct bbmap {
>  } bbmap_t;
>  
>  typedef struct iocur {
> -	__int64_t		bb;	/* BB number in filesystem of buf */
> +	int64_t			bb;	/* BB number in filesystem of buf */
>  	int			blen;	/* length of "buf", bb's */
>  	int			boff;	/* data - buf */
>  	void			*buf;	/* base address of buffer */
> @@ -33,7 +33,7 @@ typedef struct iocur {
>  	xfs_ino_t		dirino;	/* current directory inode number */
>  	xfs_ino_t		ino;	/* current inode number */
>  	int			len;	/* length of "data", bytes */
> -	__uint16_t		mode;	/* current inode's mode */
> +	uint16_t		mode;	/* current inode's mode */
>  	xfs_off_t		off;	/* fs offset of "data" in bytes */
>  	const struct typ	*typ;	/* type of "data" */
>  	bbmap_t			*bbmap;	/* map daddr if fragmented */
> @@ -57,9 +57,9 @@ extern void	off_cur(int off, int len);
>  extern void	pop_cur(void);
>  extern void	print_iocur(char *tag, iocur_t *ioc);
>  extern void	push_cur(void);
> -extern int	read_buf(__int64_t daddr, int count, void *bufp);
> +extern int	read_buf(int64_t daddr, int count, void *bufp);
>  extern void     write_cur(void);
> -extern void	set_cur(const struct typ *t, __int64_t d, int c, int ring_add,
> +extern void	set_cur(const struct typ *t, int64_t d, int c, int ring_add,
>  			bbmap_t *bbmap);
>  extern void     ring_add(void);
>  extern void	set_iocur_type(const struct typ *t);
> diff --git a/db/metadump.c b/db/metadump.c
> index 66952f6..06da7c6 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -175,7 +175,7 @@ write_index(void)
>  static int
>  write_buf_segment(
>  	char		*data,
> -	__int64_t	off,
> +	int64_t		off,
>  	int		len)
>  {
>  	int		i;
> @@ -1256,7 +1256,7 @@ process_sf_dir(
>  {
>  	struct xfs_dir2_sf_hdr	*sfp;
>  	xfs_dir2_sf_entry_t	*sfep;
> -	__uint64_t		ino_dir_size;
> +	uint64_t		ino_dir_size;
>  	int			i;
>  
>  	sfp = (struct xfs_dir2_sf_hdr *)XFS_DFORK_DPTR(dip);
> @@ -1322,7 +1322,7 @@ process_sf_dir(
>  static void
>  obfuscate_path_components(
>  	char			*buf,
> -	__uint64_t		len)
> +	uint64_t		len)
>  {
>  	unsigned char		*comp = (unsigned char *)buf;
>  	unsigned char		*end = comp + len;
> @@ -1359,7 +1359,7 @@ static void
>  process_sf_symlink(
>  	xfs_dinode_t		*dip)
>  {
> -	__uint64_t		len;
> +	uint64_t		len;
>  	char			*buf;
>  
>  	len = be64_to_cpu(dip->di_size);
> @@ -1631,7 +1631,7 @@ process_attr_block(
>  	xfs_attr_leaf_entry_t 		*entry;
>  	xfs_attr_leaf_name_local_t 	*local;
>  	xfs_attr_leaf_name_remote_t 	*remote;
> -	__uint32_t			bs = mp->m_sb.sb_blocksize;
> +	uint32_t			bs = mp->m_sb.sb_blocksize;
>  	char				*first_name;
>  
>  
> @@ -2270,7 +2270,7 @@ process_inode(
>  	return success;
>  }
>  
> -static __uint32_t	inodes_copied = 0;
> +static uint32_t	inodes_copied = 0;
>  
>  static int
>  copy_inode_chunk(
> diff --git a/db/sb.c b/db/sb.c
> index 8e7722c..f19248d 100644
> --- a/db/sb.c
> +++ b/db/sb.c
> @@ -606,7 +606,7 @@ version_help(void)
>  }
>  
>  static int
> -do_version(xfs_agnumber_t agno, __uint16_t version, __uint32_t features)
> +do_version(xfs_agnumber_t agno, uint16_t version, uint32_t features)
>  {
>  	xfs_sb_t	tsb;
>  
> @@ -710,8 +710,8 @@ version_f(
>  	int		argc,
>  	char		**argv)
>  {
> -	__uint16_t	version = 0;
> -	__uint32_t	features = 0;
> +	uint16_t	version = 0;
> +	uint32_t	features = 0;
>  	xfs_agnumber_t	ag;
>  
>  	if (argc == 2) {	/* WRITE VERSION */
> diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
> index 517b75f..d4846a3 100644
> --- a/fsr/xfs_fsr.c
> +++ b/fsr/xfs_fsr.c
> @@ -54,7 +54,7 @@ struct getbmap  *outmap = NULL;
>  int             outmap_size = 0;
>  int		RealUid;
>  int		tmp_agi;
> -static __int64_t	minimumfree = 2048;
> +static int64_t		minimumfree = 2048;
>  
>  #define MNTTYPE_XFS             "xfs"
>  
> diff --git a/include/darwin.h b/include/darwin.h
> index 7bbd576..51031c4 100644
> --- a/include/darwin.h
> +++ b/include/darwin.h
> @@ -125,15 +125,15 @@ typedef signed int		__s32;
>  typedef unsigned long long int	__u64;
>  typedef signed long long int	__s64;
>  
> -#define __int8_t	int8_t
> -#define __int16_t	int16_t
> -#define __int32_t	int32_t
> -#define __int32_t	int32_t
> -#define __int64_t	int64_t
> -#define __uint8_t	u_int8_t
> -#define __uint16_t	u_int16_t
> -#define __uint32_t	u_int32_t
> -#define __uint64_t	u_int64_t
> +#define int8_t		int8_t
> +#define int16_t		int16_t
> +#define int32_t		int32_t
> +#define int32_t		int32_t
> +#define int64_t		int64_t
> +#define uint8_t		u_int8_t
> +#define uint16_t	u_int16_t
> +#define uint32_t	u_int32_t
> +#define uint64_t	u_int64_t
>  
>  typedef off_t		xfs_off_t;
>  typedef u_int64_t	xfs_ino_t;
> diff --git a/include/freebsd.h b/include/freebsd.h
> index fb318b8..f52ed0a 100644
> --- a/include/freebsd.h
> +++ b/include/freebsd.h
> @@ -50,9 +50,9 @@ typedef unsigned long long int	__u64;
>  typedef signed long long int	__s64;
>  
>  typedef off_t		xfs_off_t;
> -typedef __uint64_t	xfs_ino_t;
> -typedef __uint32_t	xfs_dev_t;
> -typedef __int64_t	xfs_daddr_t;
> +typedef uint64_t	xfs_ino_t;
> +typedef uint32_t	xfs_dev_t;
> +typedef int64_t		xfs_daddr_t;
>  typedef __u32		xfs_nlink_t;
>  
>  #define	O_LARGEFILE	0
> diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
> index 6916e65..1db3f4f 100644
> --- a/include/gnukfreebsd.h
> +++ b/include/gnukfreebsd.h
> @@ -46,9 +46,9 @@ typedef unsigned long long int	__u64;
>  typedef signed long long int	__s64;
>  
>  typedef off_t		xfs_off_t;
> -typedef __uint64_t	xfs_ino_t;
> -typedef __uint32_t	xfs_dev_t;
> -typedef __int64_t	xfs_daddr_t;
> +typedef uint64_t	xfs_ino_t;
> +typedef uint32_t	xfs_dev_t;
> +typedef int64_t		xfs_daddr_t;
>  typedef __u32		xfs_nlink_t;
>  
>  #define HAVE_FID	1
> diff --git a/include/libxcmd.h b/include/libxcmd.h
> index e8d2ffc..6806380 100644
> --- a/include/libxcmd.h
> +++ b/include/libxcmd.h
> @@ -42,10 +42,10 @@ get_topology(
>  extern void
>  calc_default_ag_geometry(
>  	int		blocklog,
> -	__uint64_t	dblocks,
> +	uint64_t	dblocks,
>  	int		multidisk,
> -	__uint64_t	*agsize,
> -	__uint64_t	*agcount);
> +	uint64_t	*agsize,
> +	uint64_t	*agcount);
>  
>  extern int
>  check_overwrite(
> diff --git a/include/linux.h b/include/linux.h
> index 181d25c..4726915 100644
> --- a/include/linux.h
> +++ b/include/linux.h
> @@ -140,7 +140,7 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
>  static __inline__ int
>  platform_discard_blocks(int fd, uint64_t start, uint64_t len)
>  {
> -	__uint64_t range[2] = { start, len };
> +	uint64_t range[2] = { start, len };
>  
>  	if (ioctl(fd, BLKDISCARD, &range) < 0)
>  		return errno;
> @@ -152,9 +152,9 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
>  #define EFSBADCRC	EBADMSG	/* Bad CRC detected */
>  
>  typedef off_t		xfs_off_t;
> -typedef __uint64_t	xfs_ino_t;
> -typedef __uint32_t	xfs_dev_t;
> -typedef __int64_t	xfs_daddr_t;
> +typedef uint64_t	xfs_ino_t;
> +typedef uint32_t	xfs_dev_t;
> +typedef int64_t		xfs_daddr_t;
>  typedef __u32		xfs_nlink_t;
>  
>  /**
> diff --git a/include/xfs_arch.h b/include/xfs_arch.h
> index 12cd43e..186cadb 100644
> --- a/include/xfs_arch.h
> +++ b/include/xfs_arch.h
> @@ -244,39 +244,39 @@ static inline void be64_add_cpu(__be64 *a, __s64 b)
>  	*a = cpu_to_be64(be64_to_cpu(*a) + b);
>  }
>  
> -static inline __uint16_t get_unaligned_be16(void *p)
> +static inline uint16_t get_unaligned_be16(void *p)
>  {
> -	__uint8_t *__p = p;
> +	uint8_t *__p = p;
>  	return __p[0] << 8 | __p[1];
>  }
>  
> -static inline __uint32_t get_unaligned_be32(void *p)
> +static inline uint32_t get_unaligned_be32(void *p)
>  {
> -	__uint8_t *__p = p;
> +	uint8_t *__p = p;
>          return __p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3];
>  }
>  
> -static inline __uint64_t get_unaligned_be64(void *p)
> +static inline uint64_t get_unaligned_be64(void *p)
>  {
> -	return (__uint64_t)get_unaligned_be32(p) << 32 |
> +	return (uint64_t)get_unaligned_be32(p) << 32 |
>  			   get_unaligned_be32(p + 4);
>  }
>  
> -static inline void put_unaligned_be16(__uint16_t val, void *p)
> +static inline void put_unaligned_be16(uint16_t val, void *p)
>  {
> -	__uint8_t *__p = p;
> +	uint8_t *__p = p;
>  	*__p++ = val >> 8;
>  	*__p++ = val;
>  }
>  
> -static inline void put_unaligned_be32(__uint32_t val, void *p)
> +static inline void put_unaligned_be32(uint32_t val, void *p)
>  {
> -	__uint8_t *__p = p;
> +	uint8_t *__p = p;
>  	put_unaligned_be16(val >> 16, __p);
>  	put_unaligned_be16(val, __p + 2);
>  }
>  
> -static inline void put_unaligned_be64(__uint64_t val, void *p)
> +static inline void put_unaligned_be64(uint64_t val, void *p)
>  {
>  	put_unaligned_be32(val >> 32, p);
>  	put_unaligned_be32(val, p + 4);
> diff --git a/include/xfs_inode.h b/include/xfs_inode.h
> index fb6b542..8766024 100644
> --- a/include/xfs_inode.h
> +++ b/include/xfs_inode.h
> @@ -123,8 +123,8 @@ xfs_get_projid(struct xfs_icdinode *id)
>  static inline void
>  xfs_set_projid(struct xfs_icdinode *id, prid_t projid)
>  {
> -	id->di_projid_hi = (__uint16_t) (projid >> 16);
> -	id->di_projid_lo = (__uint16_t) (projid & 0xffff);
> +	id->di_projid_hi = (uint16_t) (projid >> 16);
> +	id->di_projid_lo = (uint16_t) (projid & 0xffff);
>  }
>  
>  static inline bool xfs_is_reflink_inode(struct xfs_inode *ip)
> diff --git a/include/xfs_log_recover.h b/include/xfs_log_recover.h
> index 7582676..0d09862 100644
> --- a/include/xfs_log_recover.h
> +++ b/include/xfs_log_recover.h
> @@ -26,7 +26,7 @@
>  #define XLOG_RHASH_SIZE	16
>  #define XLOG_RHASH_SHIFT 2
>  #define XLOG_RHASH(tid)	\
> -	((((__uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
> +	((((uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
>  
>  #define XLOG_MAX_REGIONS_IN_ITEM   (XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK / 2 + 1)
>  
> diff --git a/include/xfs_metadump.h b/include/xfs_metadump.h
> index f4be51b..90d6cb1 100644
> --- a/include/xfs_metadump.h
> +++ b/include/xfs_metadump.h
> @@ -24,8 +24,8 @@
>  typedef struct xfs_metablock {
>  	__be32		mb_magic;
>  	__be16		mb_count;
> -	__uint8_t	mb_blocklog;
> -	__uint8_t	mb_reserved;
> +	uint8_t		mb_blocklog;
> +	uint8_t		mb_reserved;
>  	/* followed by an array of xfs_daddr_t */
>  } xfs_metablock_t;
>  
> diff --git a/include/xfs_mount.h b/include/xfs_mount.h
> index 5ff24eb..5b323bb 100644
> --- a/include/xfs_mount.h
> +++ b/include/xfs_mount.h
> @@ -48,12 +48,12 @@ typedef struct xfs_mount {
>  #define m_dev		m_ddev_targp
>  #define m_logdev	m_logdev_targp
>  #define m_rtdev		m_rtdev_targp
> -	__uint8_t		m_dircook_elog;	/* log d-cookie entry bits */
> -	__uint8_t		m_blkbit_log;	/* blocklog + NBBY */
> -	__uint8_t		m_blkbb_log;	/* blocklog - BBSHIFT */
> -	__uint8_t		m_sectbb_log;	/* sectorlog - BBSHIFT */
> -	__uint8_t		m_agno_log;	/* log #ag's */
> -	__uint8_t		m_agino_log;	/* #bits for agino in inum */
> +	uint8_t			m_dircook_elog;	/* log d-cookie entry bits */
> +	uint8_t			m_blkbit_log;	/* blocklog + NBBY */
> +	uint8_t			m_blkbb_log;	/* blocklog - BBSHIFT */
> +	uint8_t			m_sectbb_log;	/* sectorlog - BBSHIFT */
> +	uint8_t			m_agno_log;	/* log #ag's */
> +	uint8_t			m_agino_log;	/* #bits for agino in inum */
>  	uint			m_inode_cluster_size;/* min inode buf size */
>  	uint			m_blockmask;	/* sb_blocksize-1 */
>  	uint			m_blockwsize;	/* sb_blocksize in words */
> @@ -88,7 +88,7 @@ typedef struct xfs_mount {
>  	int			m_litino;	/* size of inode union area */
>  	int			m_inoalign_mask;/* mask sb_inoalignmt if used */
>  	struct xfs_trans_resv	m_resv;		/* precomputed res values */
> -	__uint64_t		m_maxicount;	/* maximum inode count */
> +	uint64_t		m_maxicount;	/* maximum inode count */
>  	int			m_dalign;	/* stripe unit */
>  	int			m_swidth;	/* stripe width */
>  	int			m_sinoalign;	/* stripe unit inode alignmnt */
> @@ -144,12 +144,12 @@ typedef struct xfs_perag {
>  	char		pagi_init;	/* this agi's entry is initialized */
>  	char		pagf_metadata;	/* the agf is preferred to be metadata */
>  	char		pagi_inodeok;	/* The agi is ok for inodes */
> -	__uint8_t	pagf_levels[XFS_BTNUM_AGF];
> +	uint8_t		pagf_levels[XFS_BTNUM_AGF];
>  					/* # of levels in bno & cnt btree */
> -	__uint32_t	pagf_flcount;	/* count of blocks in freelist */
> +	uint32_t	pagf_flcount;	/* count of blocks in freelist */
>  	xfs_extlen_t	pagf_freeblks;	/* total free blocks */
>  	xfs_extlen_t	pagf_longest;	/* longest free space */
> -	__uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
> +	uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
>  	xfs_agino_t	pagi_freecount;	/* number of free inodes */
>  	xfs_agino_t	pagi_count;	/* number of allocated inodes */
>  
> @@ -169,7 +169,7 @@ typedef struct xfs_perag {
>  	struct xfs_ag_resv	pag_agfl_resv;
>  
>  	/* reference count */
> -	__uint8_t	pagf_refcount_level;
> +	uint8_t		pagf_refcount_level;
>  } xfs_perag_t;
>  
>  static inline struct xfs_ag_resv *
> diff --git a/libhandle/handle.c b/libhandle/handle.c
> index 236ed22..00127b3 100644
> --- a/libhandle/handle.c
> +++ b/libhandle/handle.c
> @@ -232,7 +232,7 @@ obj_to_handle(
>  {
>  	char		hbuf [MAXHANSIZ];
>  	int		ret;
> -	__uint32_t	handlen;
> +	uint32_t	handlen;
>  	xfs_fsop_handlereq_t hreq;
>  
>  	if (opcode == XFS_IOC_FD_TO_HANDLE) {
> diff --git a/libhandle/jdm.c b/libhandle/jdm.c
> index e52f5d8..821061b 100644
> --- a/libhandle/jdm.c
> +++ b/libhandle/jdm.c
> @@ -36,7 +36,7 @@ typedef struct filehandle {
>  	fshandle_t fh_fshandle;		/* handle of fs containing this inode */
>  	int16_t fh_sz_following;	/* bytes in handle after this member */
>  	char fh_pad[FILEHANDLE_SZ_PAD];	/* padding, must be zeroed */
> -	__uint32_t fh_gen;		/* generation count */
> +	uint32_t fh_gen;		/* generation count */
>  	xfs_ino_t fh_ino;		/* 64 bit ino */
>  } filehandle_t;
>  
> diff --git a/libxcmd/topology.c b/libxcmd/topology.c
> index 8b0276a..f66dd1b 100644
> --- a/libxcmd/topology.c
> +++ b/libxcmd/topology.c
> @@ -23,19 +23,19 @@
>  #endif /* ENABLE_BLKID */
>  #include "xfs_multidisk.h"
>  
> -#define TERABYTES(count, blog)	((__uint64_t)(count) << (40 - (blog)))
> -#define GIGABYTES(count, blog)	((__uint64_t)(count) << (30 - (blog)))
> -#define MEGABYTES(count, blog)	((__uint64_t)(count) << (20 - (blog)))
> +#define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
> +#define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
> +#define MEGABYTES(count, blog)	((uint64_t)(count) << (20 - (blog)))
>  
>  void
>  calc_default_ag_geometry(
>  	int		blocklog,
> -	__uint64_t	dblocks,
> +	uint64_t	dblocks,
>  	int		multidisk,
> -	__uint64_t	*agsize,
> -	__uint64_t	*agcount)
> +	uint64_t	*agsize,
> +	uint64_t	*agcount)
>  {
> -	__uint64_t	blocks = 0;
> +	uint64_t	blocks = 0;
>  	int		shift = 0;
>  
>  	/*
> diff --git a/libxfs/darwin.c b/libxfs/darwin.c
> index 74507e8..16d2c35 100644
> --- a/libxfs/darwin.c
> +++ b/libxfs/darwin.c
> @@ -68,7 +68,7 @@ platform_flush_device(int fd, dev_t device)
>  void
>  platform_findsizes(char *path, int fd, long long *sz, int *bsz)
>  {
> -	__uint64_t	size;
> +	uint64_t	size;
>  	struct stat	st;
>  
>  	if (fstat(fd, &st) < 0) {
> diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c
> index 4667d1f..d7bca14 100644
> --- a/libxfs/freebsd.c
> +++ b/libxfs/freebsd.c
> @@ -109,7 +109,7 @@ void
>  platform_findsizes(char *path, int fd, long long *sz, int *bsz)
>  {
>  	struct stat	st;
> -	__int64_t	size;
> +	int64_t		size;
>  	u_int		ssize;
>  
>  	if (fstat(fd, &st) < 0) {
> diff --git a/libxfs/init.c b/libxfs/init.c
> index 85e0d15..27a7600 100644
> --- a/libxfs/init.c
> +++ b/libxfs/init.c
> @@ -546,7 +546,7 @@ libxfs_initialize_perag(
>  		 * the max inode percentage.
>  		 */
>  		if (mp->m_maxicount) {
> -			__uint64_t	icount;
> +			uint64_t	icount;
>  
>  			icount = sbp->sb_dblocks * sbp->sb_imax_pct;
>  			do_div(icount, 100);
> diff --git a/libxfs/irix.c b/libxfs/irix.c
> index 32fcb3e..0f14aec 100644
> --- a/libxfs/irix.c
> +++ b/libxfs/irix.c
> @@ -22,7 +22,7 @@
>  
>  int platform_has_uuid = 0;
>  extern char *progname;
> -extern __int64_t findsize(char *);
> +extern int64_t findsize(char *);
>  
>  int
>  platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
> diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
> index 0b4c489..a3912e7 100644
> --- a/libxfs/libxfs_priv.h
> +++ b/libxfs/libxfs_priv.h
> @@ -296,8 +296,8 @@ roundup_pow_of_two(uint v)
>  	return 0;
>  }
>  
> -static inline __uint64_t
> -roundup_64(__uint64_t x, __uint32_t y)
> +static inline uint64_t
> +roundup_64(uint64_t x, uint32_t y)
>  {
>  	x += y - 1;
>  	do_div(x, y);
> diff --git a/libxfs/linux.c b/libxfs/linux.c
> index 69f04ad..0bace3e 100644
> --- a/libxfs/linux.c
> +++ b/libxfs/linux.c
> @@ -163,7 +163,7 @@ void
>  platform_findsizes(char *path, int fd, long long *sz, int *bsz)
>  {
>  	struct stat	st;
> -	__uint64_t	size;
> +	uint64_t	size;
>  	int		error;
>  
>  	if (fstat(fd, &st) < 0) {
> diff --git a/libxfs/logitem.c b/libxfs/logitem.c
> index 7e93f60..466b442 100644
> --- a/libxfs/logitem.c
> +++ b/libxfs/logitem.c
> @@ -121,7 +121,7 @@ xfs_buf_item_init(
>  	bip->bli_item.li_mountp = mp;
>  	bip->bli_buf = bp;
>  	bip->bli_format.blf_type = XFS_LI_BUF;
> -	bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp);
> +	bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
>  	bip->bli_format.blf_len = (unsigned short)BTOBB(XFS_BUF_COUNT(bp));
>  	XFS_BUF_SET_FSPRIVATE(bp, bip);
>  }
> diff --git a/libxfs/radix-tree.c b/libxfs/radix-tree.c
> index eef9c36..3f0257f 100644
> --- a/libxfs/radix-tree.c
> +++ b/libxfs/radix-tree.c
> @@ -66,21 +66,21 @@ static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH];
>  static inline void tag_set(struct radix_tree_node *node, unsigned int tag,
>  		int offset)
>  {
> -	*((__uint32_t *)node->tags[tag] + (offset >> 5)) |= (1 << (offset & 31));
> +	*((uint32_t *)node->tags[tag] + (offset >> 5)) |= (1 << (offset & 31));
>  }
>  
>  static inline void tag_clear(struct radix_tree_node *node, unsigned int tag,
>  		int offset)
>  {
> -	__uint32_t 	*p = (__uint32_t*)node->tags[tag] + (offset >> 5);
> -	__uint32_t 	m = 1 << (offset & 31);
> +	uint32_t 	*p = (uint32_t*)node->tags[tag] + (offset >> 5);
> +	uint32_t 	m = 1 << (offset & 31);
>  	*p &= ~m;
>  }
>  
>  static inline int tag_get(struct radix_tree_node *node, unsigned int tag,
>  		int offset)
>  {
> -	return 1 & (((const __uint32_t *)node->tags[tag])[offset >> 5] >> (offset & 31));
> +	return 1 & (((const uint32_t *)node->tags[tag])[offset >> 5] >> (offset & 31));
>  }
>  
>  /*
> diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> index 6c8a192..43b4f1d 100644
> --- a/libxfs/rdwr.c
> +++ b/libxfs/rdwr.c
> @@ -118,9 +118,9 @@ static void unmount_record(void *p)
>  	xlog_op_header_t	*op = (xlog_op_header_t *)p;
>  	/* the data section must be 32 bit size aligned */
>  	struct {
> -	    __uint16_t magic;
> -	    __uint16_t pad1;
> -	    __uint32_t pad2; /* may as well make it 64 bits */
> +	    uint16_t magic;
> +	    uint16_t pad1;
> +	    uint32_t pad2; /* may as well make it 64 bits */
>  	} magic = { XLOG_UNMOUNT_TYPE, 0, 0 };
>  
>  	memset(p, 0, BBSIZE);
> diff --git a/libxfs/util.c b/libxfs/util.c
> index dcfca39..7938e31 100644
> --- a/libxfs/util.c
> +++ b/libxfs/util.c
> @@ -170,8 +170,8 @@ libxfs_trans_ichgtime(
>  	if (flags & XFS_ICHGTIME_CHG)
>  		VFS_I(ip)->i_ctime = tv;
>  	if (flags & XFS_ICHGTIME_CREATE) {
> -		ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec;
> -		ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec;
> +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
> +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
>  	}
>  }
>  
> @@ -261,8 +261,8 @@ libxfs_ialloc(
>  		ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid));
>  		VFS_I(ip)->i_version = 1;
>  		ip->i_d.di_flags2 = 0;
> -		ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec;
> -		ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec;
> +		ip->i_d.di_crtime.t_sec = (int32_t)VFS_I(ip)->i_mtime.tv_sec;
> +		ip->i_d.di_crtime.t_nsec = (int32_t)VFS_I(ip)->i_mtime.tv_nsec;
>  	}
>  
>  	flags = XFS_ILOG_CORE;
> diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c
> index e11d89a..8e77e6e 100644
> --- a/libxfs/xfs_alloc_btree.c
> +++ b/libxfs/xfs_alloc_btree.c
> @@ -251,7 +251,7 @@ xfs_allocbt_init_ptr_from_cur(
>  	ptr->s = agf->agf_roots[cur->bc_btnum];
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_bnobt_key_diff(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*key)
> @@ -259,42 +259,42 @@ xfs_bnobt_key_diff(
>  	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
>  	xfs_alloc_key_t		*kp = &key->alloc;
>  
> -	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
> +	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_cntbt_key_diff(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*key)
>  {
>  	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
>  	xfs_alloc_key_t		*kp = &key->alloc;
> -	__int64_t		diff;
> +	int64_t			diff;
>  
> -	diff = (__int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
> +	diff = (int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
>  	if (diff)
>  		return diff;
>  
> -	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
> +	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_bnobt_diff_two_keys(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*k1,
>  	union xfs_btree_key	*k2)
>  {
> -	return (__int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
> +	return (int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
>  			  be32_to_cpu(k2->alloc.ar_startblock);
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_cntbt_diff_two_keys(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*k1,
>  	union xfs_btree_key	*k2)
>  {
> -	__int64_t		diff;
> +	int64_t			diff;
>  
>  	diff =  be32_to_cpu(k1->alloc.ar_blockcount) -
>  		be32_to_cpu(k2->alloc.ar_blockcount);
> diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c
> index abe1705..1f25e36 100644
> --- a/libxfs/xfs_attr_remote.c
> +++ b/libxfs/xfs_attr_remote.c
> @@ -248,7 +248,7 @@ xfs_attr_rmtval_copyout(
>  	xfs_ino_t	ino,
>  	int		*offset,
>  	int		*valuelen,
> -	__uint8_t	**dst)
> +	uint8_t		**dst)
>  {
>  	char		*src = bp->b_addr;
>  	xfs_daddr_t	bno = bp->b_bn;
> @@ -296,7 +296,7 @@ xfs_attr_rmtval_copyin(
>  	xfs_ino_t	ino,
>  	int		*offset,
>  	int		*valuelen,
> -	__uint8_t	**src)
> +	uint8_t		**src)
>  {
>  	char		*dst = bp->b_addr;
>  	xfs_daddr_t	bno = bp->b_bn;
> @@ -350,7 +350,7 @@ xfs_attr_rmtval_get(
>  	struct xfs_mount	*mp = args->dp->i_mount;
>  	struct xfs_buf		*bp;
>  	xfs_dablk_t		lblkno = args->rmtblkno;
> -	__uint8_t		*dst = args->value;
> +	uint8_t			*dst = args->value;
>  	int			valuelen;
>  	int			nmap;
>  	int			error;
> @@ -416,7 +416,7 @@ xfs_attr_rmtval_set(
>  	struct xfs_bmbt_irec	map;
>  	xfs_dablk_t		lblkno;
>  	xfs_fileoff_t		lfileoff = 0;
> -	__uint8_t		*src = args->value;
> +	uint8_t			*src = args->value;
>  	int			blkcnt;
>  	int			valuelen;
>  	int			nmap;
> diff --git a/libxfs/xfs_attr_sf.h b/libxfs/xfs_attr_sf.h
> index 90928bb..afd684a 100644
> --- a/libxfs/xfs_attr_sf.h
> +++ b/libxfs/xfs_attr_sf.h
> @@ -31,10 +31,10 @@ typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t;
>   * We generate this then sort it, attr_list() must return things in hash-order.
>   */
>  typedef struct xfs_attr_sf_sort {
> -	__uint8_t	entno;		/* entry number in original list */
> -	__uint8_t	namelen;	/* length of name value (no null) */
> -	__uint8_t	valuelen;	/* length of value */
> -	__uint8_t	flags;		/* flags bits (see xfs_attr_leaf.h) */
> +	uint8_t		entno;		/* entry number in original list */
> +	uint8_t		namelen;	/* length of name value (no null) */
> +	uint8_t		valuelen;	/* length of value */
> +	uint8_t		flags;		/* flags bits (see xfs_attr_leaf.h) */
>  	xfs_dahash_t	hash;		/* this entry's hash value */
>  	unsigned char	*name;		/* name value, pointer into buffer */
>  } xfs_attr_sf_sort_t;
> @@ -42,7 +42,7 @@ typedef struct xfs_attr_sf_sort {
>  #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen)	/* space name/value uses */ \
>  	(((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen)))
>  #define XFS_ATTR_SF_ENTSIZE_MAX			/* max space for name&value */ \
> -	((1 << (NBBY*(int)sizeof(__uint8_t))) - 1)
> +	((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
>  #define XFS_ATTR_SF_ENTSIZE(sfep)		/* space an entry uses */ \
>  	((int)sizeof(xfs_attr_sf_entry_t)-1 + (sfep)->namelen+(sfep)->valuelen)
>  #define XFS_ATTR_SF_NEXTENTRY(sfep)		/* next entry in struct */ \
> diff --git a/libxfs/xfs_bit.h b/libxfs/xfs_bit.h
> index e1649c0..61c6b20 100644
> --- a/libxfs/xfs_bit.h
> +++ b/libxfs/xfs_bit.h
> @@ -25,47 +25,47 @@
>  /*
>   * masks with n high/low bits set, 64-bit values
>   */
> -static inline __uint64_t xfs_mask64hi(int n)
> +static inline uint64_t xfs_mask64hi(int n)
>  {
> -	return (__uint64_t)-1 << (64 - (n));
> +	return (uint64_t)-1 << (64 - (n));
>  }
> -static inline __uint32_t xfs_mask32lo(int n)
> +static inline uint32_t xfs_mask32lo(int n)
>  {
> -	return ((__uint32_t)1 << (n)) - 1;
> +	return ((uint32_t)1 << (n)) - 1;
>  }
> -static inline __uint64_t xfs_mask64lo(int n)
> +static inline uint64_t xfs_mask64lo(int n)
>  {
> -	return ((__uint64_t)1 << (n)) - 1;
> +	return ((uint64_t)1 << (n)) - 1;
>  }
>  
>  /* Get high bit set out of 32-bit argument, -1 if none set */
> -static inline int xfs_highbit32(__uint32_t v)
> +static inline int xfs_highbit32(uint32_t v)
>  {
>  	return fls(v) - 1;
>  }
>  
>  /* Get high bit set out of 64-bit argument, -1 if none set */
> -static inline int xfs_highbit64(__uint64_t v)
> +static inline int xfs_highbit64(uint64_t v)
>  {
>  	return fls64(v) - 1;
>  }
>  
>  /* Get low bit set out of 32-bit argument, -1 if none set */
> -static inline int xfs_lowbit32(__uint32_t v)
> +static inline int xfs_lowbit32(uint32_t v)
>  {
>  	return ffs(v) - 1;
>  }
>  
>  /* Get low bit set out of 64-bit argument, -1 if none set */
> -static inline int xfs_lowbit64(__uint64_t v)
> +static inline int xfs_lowbit64(uint64_t v)
>  {
> -	__uint32_t	w = (__uint32_t)v;
> +	uint32_t	w = (uint32_t)v;
>  	int		n = 0;
>  
>  	if (w) {	/* lower bits */
>  		n = ffs(w);
>  	} else {	/* upper bits */
> -		w = (__uint32_t)(v >> 32);
> +		w = (uint32_t)(v >> 32);
>  		if (w) {
>  			n = ffs(w);
>  			if (n)
> diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c
> index c48cbec..9ee40d8 100644
> --- a/libxfs/xfs_bmap_btree.c
> +++ b/libxfs/xfs_bmap_btree.c
> @@ -91,8 +91,8 @@ xfs_bmdr_to_bmbt(
>   */
>  STATIC void
>  __xfs_bmbt_get_all(
> -		__uint64_t l0,
> -		__uint64_t l1,
> +		uint64_t l0,
> +		uint64_t l1,
>  		xfs_bmbt_irec_t *s)
>  {
>  	int	ext_flag;
> @@ -585,12 +585,12 @@ xfs_bmbt_init_ptr_from_cur(
>  	ptr->l = 0;
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_bmbt_key_diff(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*key)
>  {
> -	return (__int64_t)be64_to_cpu(key->bmbt.br_startoff) -
> +	return (int64_t)be64_to_cpu(key->bmbt.br_startoff) -
>  				      cur->bc_rec.b.br_startoff;
>  }
>  
> diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
> index a9e1fa8..646f2bf 100644
> --- a/libxfs/xfs_btree.c
> +++ b/libxfs/xfs_btree.c
> @@ -39,7 +39,7 @@ kmem_zone_t	*xfs_btree_cur_zone;
>  /*
>   * Btree magic numbers.
>   */
> -static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
> +static const uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
>  	{ XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, 0, XFS_BMAP_MAGIC, XFS_IBT_MAGIC,
>  	  XFS_FIBT_MAGIC, 0 },
>  	{ XFS_ABTB_CRC_MAGIC, XFS_ABTC_CRC_MAGIC, XFS_RMAP_CRC_MAGIC,
> @@ -47,12 +47,12 @@ static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
>  	  XFS_REFC_CRC_MAGIC }
>  };
>  
> -__uint32_t
> +uint32_t
>  xfs_btree_magic(
>  	int			crc,
>  	xfs_btnum_t		btnum)
>  {
> -	__uint32_t		magic = xfs_magics[crc][btnum];
> +	uint32_t		magic = xfs_magics[crc][btnum];
>  
>  	/* Ensure we asked for crc for crc-only magics. */
>  	ASSERT(magic != 0);
> @@ -774,14 +774,14 @@ xfs_btree_lastrec(
>   */
>  void
>  xfs_btree_offsets(
> -	__int64_t	fields,		/* bitmask of fields */
> +	int64_t		fields,		/* bitmask of fields */
>  	const short	*offsets,	/* table of field offsets */
>  	int		nbits,		/* number of bits to inspect */
>  	int		*first,		/* output: first byte offset */
>  	int		*last)		/* output: last byte offset */
>  {
>  	int		i;		/* current bit number */
> -	__int64_t	imask;		/* mask for current bit number */
> +	int64_t		imask;		/* mask for current bit number */
>  
>  	ASSERT(fields != 0);
>  	/*
> @@ -1842,7 +1842,7 @@ xfs_btree_lookup(
>  	int			*stat)	/* success/failure */
>  {
>  	struct xfs_btree_block	*block;	/* current btree block */
> -	__int64_t		diff;	/* difference for the current key */
> +	int64_t			diff;	/* difference for the current key */
>  	int			error;	/* error return value */
>  	int			keyno;	/* current key number */
>  	int			level;	/* level in the btree */
> @@ -4435,7 +4435,7 @@ xfs_btree_visit_blocks(
>   * recovery completion writes the changes to disk.
>   */
>  struct xfs_btree_block_change_owner_info {
> -	__uint64_t		new_owner;
> +	uint64_t		new_owner;
>  	struct list_head	*buffer_list;
>  };
>  
> @@ -4481,7 +4481,7 @@ xfs_btree_block_change_owner(
>  int
>  xfs_btree_change_owner(
>  	struct xfs_btree_cur	*cur,
> -	__uint64_t		new_owner,
> +	uint64_t		new_owner,
>  	struct list_head	*buffer_list)
>  {
>  	struct xfs_btree_block_change_owner_info	bbcoi;
> @@ -4585,7 +4585,7 @@ xfs_btree_simple_query_range(
>  {
>  	union xfs_btree_rec		*recp;
>  	union xfs_btree_key		rec_key;
> -	__int64_t			diff;
> +	int64_t				diff;
>  	int				stat;
>  	bool				firstrec = true;
>  	int				error;
> @@ -4682,8 +4682,8 @@ xfs_btree_overlapped_query_range(
>  	union xfs_btree_key		*hkp;
>  	union xfs_btree_rec		*recp;
>  	struct xfs_btree_block		*block;
> -	__int64_t			ldiff;
> -	__int64_t			hdiff;
> +	int64_t				ldiff;
> +	int64_t				hdiff;
>  	int				level;
>  	struct xfs_buf			*bp;
>  	int				i;
> diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h
> index 05cf35b..3c1fed2 100644
> --- a/libxfs/xfs_btree.h
> +++ b/libxfs/xfs_btree.h
> @@ -76,7 +76,7 @@ union xfs_btree_rec {
>  #define	XFS_BTNUM_RMAP	((xfs_btnum_t)XFS_BTNUM_RMAPi)
>  #define	XFS_BTNUM_REFC	((xfs_btnum_t)XFS_BTNUM_REFCi)
>  
> -__uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
> +uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
>  
>  /*
>   * For logging record fields.
> @@ -150,14 +150,14 @@ struct xfs_btree_ops {
>  					  union xfs_btree_rec *rec);
>  
>  	/* difference between key value and cursor value */
> -	__int64_t (*key_diff)(struct xfs_btree_cur *cur,
> +	int64_t (*key_diff)(struct xfs_btree_cur *cur,
>  			      union xfs_btree_key *key);
>  
>  	/*
>  	 * Difference between key2 and key1 -- positive if key1 > key2,
>  	 * negative if key1 < key2, and zero if equal.
>  	 */
> -	__int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
> +	int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
>  				   union xfs_btree_key *key1,
>  				   union xfs_btree_key *key2);
>  
> @@ -213,11 +213,11 @@ typedef struct xfs_btree_cur
>  	union xfs_btree_irec	bc_rec;	/* current insert/search record value */
>  	struct xfs_buf	*bc_bufs[XFS_BTREE_MAXLEVELS];	/* buf ptr per level */
>  	int		bc_ptrs[XFS_BTREE_MAXLEVELS];	/* key/record # */
> -	__uint8_t	bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
> +	uint8_t		bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
>  #define	XFS_BTCUR_LEFTRA	1	/* left sibling has been read-ahead */
>  #define	XFS_BTCUR_RIGHTRA	2	/* right sibling has been read-ahead */
> -	__uint8_t	bc_nlevels;	/* number of levels in the tree */
> -	__uint8_t	bc_blocklog;	/* log2(blocksize) of btree blocks */
> +	uint8_t		bc_nlevels;	/* number of levels in the tree */
> +	uint8_t		bc_blocklog;	/* log2(blocksize) of btree blocks */
>  	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
>  	int		bc_statoff;	/* offset of btre stats array */
>  	union {
> @@ -330,7 +330,7 @@ xfs_btree_islastblock(
>   */
>  void
>  xfs_btree_offsets(
> -	__int64_t		fields,	/* bitmask of fields */
> +	int64_t			fields,	/* bitmask of fields */
>  	const short		*offsets,/* table of field offsets */
>  	int			nbits,	/* number of bits to inspect */
>  	int			*first,	/* output: first byte offset */
> @@ -408,7 +408,7 @@ int xfs_btree_new_iroot(struct xfs_btree_cur *, int *, int *);
>  int xfs_btree_insert(struct xfs_btree_cur *, int *);
>  int xfs_btree_delete(struct xfs_btree_cur *, int *);
>  int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *);
> -int xfs_btree_change_owner(struct xfs_btree_cur *cur, __uint64_t new_owner,
> +int xfs_btree_change_owner(struct xfs_btree_cur *cur, uint64_t new_owner,
>  			   struct list_head *buffer_list);
>  
>  /*
> @@ -434,7 +434,7 @@ static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block)
>  }
>  
>  static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block,
> -		__uint16_t numrecs)
> +		uint16_t numrecs)
>  {
>  	block->bb_numrecs = cpu_to_be16(numrecs);
>  }
> diff --git a/libxfs/xfs_cksum.h b/libxfs/xfs_cksum.h
> index a416c7c..8211f48 100644
> --- a/libxfs/xfs_cksum.h
> +++ b/libxfs/xfs_cksum.h
> @@ -1,7 +1,7 @@
>  #ifndef _XFS_CKSUM_H
>  #define _XFS_CKSUM_H 1
>  
> -#define XFS_CRC_SEED	(~(__uint32_t)0)
> +#define XFS_CRC_SEED	(~(uint32_t)0)
>  
>  /*
>   * Calculate the intermediate checksum for a buffer that has the CRC field
> @@ -9,11 +9,11 @@
>   * cksum_offset parameter. We do not modify the buffer during verification,
>   * hence we have to split the CRC calculation across the cksum_offset.
>   */
> -static inline __uint32_t
> +static inline uint32_t
>  xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
>  {
> -	__uint32_t zero = 0;
> -	__uint32_t crc;
> +	uint32_t zero = 0;
> +	uint32_t crc;
>  
>  	/* Calculate CRC up to the checksum. */
>  	crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset);
> @@ -30,7 +30,7 @@ xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
>   * Fast CRC method where the buffer is modified. Callers must have exclusive
>   * access to the buffer while the calculation takes place.
>   */
> -static inline __uint32_t
> +static inline uint32_t
>  xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
>  {
>  	/* zero the CRC field */
> @@ -48,7 +48,7 @@ xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
>   * so that it is consistent on disk.
>   */
>  static inline __le32
> -xfs_end_cksum(__uint32_t crc)
> +xfs_end_cksum(uint32_t crc)
>  {
>  	return ~cpu_to_le32(crc);
>  }
> @@ -62,7 +62,7 @@ xfs_end_cksum(__uint32_t crc)
>  static inline void
>  xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
>  {
> -	__uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
> +	uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
>  
>  	*(__le32 *)(buffer + cksum_offset) = xfs_end_cksum(crc);
>  }
> @@ -73,7 +73,7 @@ xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
>  static inline int
>  xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
>  {
> -	__uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
> +	uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
>  
>  	return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc);
>  }
> diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
> index bc12f58..08447be 100644
> --- a/libxfs/xfs_da_btree.c
> +++ b/libxfs/xfs_da_btree.c
> @@ -1947,7 +1947,7 @@ xfs_da3_path_shift(
>   * This is implemented with some source-level loop unrolling.
>   */
>  xfs_dahash_t
> -xfs_da_hashname(const __uint8_t *name, int namelen)
> +xfs_da_hashname(const uint8_t *name, int namelen)
>  {
>  	xfs_dahash_t hash;
>  
> diff --git a/libxfs/xfs_da_btree.h b/libxfs/xfs_da_btree.h
> index 4e29cb6..ae6de17 100644
> --- a/libxfs/xfs_da_btree.h
> +++ b/libxfs/xfs_da_btree.h
> @@ -60,10 +60,10 @@ enum xfs_dacmp {
>   */
>  typedef struct xfs_da_args {
>  	struct xfs_da_geometry *geo;	/* da block geometry */
> -	const __uint8_t	*name;		/* string (maybe not NULL terminated) */
> +	const uint8_t		*name;		/* string (maybe not NULL terminated) */
>  	int		namelen;	/* length of string (maybe no NULL) */
> -	__uint8_t	filetype;	/* filetype of inode for directories */
> -	__uint8_t	*value;		/* set of bytes (maybe contain NULLs) */
> +	uint8_t		filetype;	/* filetype of inode for directories */
> +	uint8_t		*value;		/* set of bytes (maybe contain NULLs) */
>  	int		valuelen;	/* length of value */
>  	int		flags;		/* argument flags (eg: ATTR_NOCREATE) */
>  	xfs_dahash_t	hashval;	/* hash value of name */
> @@ -207,7 +207,7 @@ int	xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
>  int	xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
>  					  struct xfs_buf *dead_buf);
>  
> -uint xfs_da_hashname(const __uint8_t *name_string, int name_length);
> +uint xfs_da_hashname(const uint8_t *name_string, int name_length);
>  enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
>  				const unsigned char *name, int len);
>  
> diff --git a/libxfs/xfs_da_format.c b/libxfs/xfs_da_format.c
> index 2b732b3..f30004f 100644
> --- a/libxfs/xfs_da_format.c
> +++ b/libxfs/xfs_da_format.c
> @@ -49,7 +49,7 @@ xfs_dir3_sf_entsize(
>  	struct xfs_dir2_sf_hdr	*hdr,
>  	int			len)
>  {
> -	return xfs_dir2_sf_entsize(hdr, len) + sizeof(__uint8_t);
> +	return xfs_dir2_sf_entsize(hdr, len) + sizeof(uint8_t);
>  }
>  
>  static struct xfs_dir2_sf_entry *
> @@ -77,7 +77,7 @@ xfs_dir3_sf_nextentry(
>   * not necessary. For non-filetype enable directories, the type is always
>   * unknown and we never store the value.
>   */
> -static __uint8_t
> +static uint8_t
>  xfs_dir2_sfe_get_ftype(
>  	struct xfs_dir2_sf_entry *sfep)
>  {
> @@ -87,16 +87,16 @@ xfs_dir2_sfe_get_ftype(
>  static void
>  xfs_dir2_sfe_put_ftype(
>  	struct xfs_dir2_sf_entry *sfep,
> -	__uint8_t		ftype)
> +	uint8_t			ftype)
>  {
>  	ASSERT(ftype < XFS_DIR3_FT_MAX);
>  }
>  
> -static __uint8_t
> +static uint8_t
>  xfs_dir3_sfe_get_ftype(
>  	struct xfs_dir2_sf_entry *sfep)
>  {
> -	__uint8_t	ftype;
> +	uint8_t		ftype;
>  
>  	ftype = sfep->name[sfep->namelen];
>  	if (ftype >= XFS_DIR3_FT_MAX)
> @@ -107,7 +107,7 @@ xfs_dir3_sfe_get_ftype(
>  static void
>  xfs_dir3_sfe_put_ftype(
>  	struct xfs_dir2_sf_entry *sfep,
> -	__uint8_t		ftype)
> +	uint8_t			ftype)
>  {
>  	ASSERT(ftype < XFS_DIR3_FT_MAX);
>  
> @@ -124,7 +124,7 @@ xfs_dir3_sfe_put_ftype(
>  static xfs_ino_t
>  xfs_dir2_sf_get_ino(
>  	struct xfs_dir2_sf_hdr	*hdr,
> -	__uint8_t		*from)
> +	uint8_t			*from)
>  {
>  	if (hdr->i8count)
>  		return get_unaligned_be64(from) & 0x00ffffffffffffffULL;
> @@ -135,7 +135,7 @@ xfs_dir2_sf_get_ino(
>  static void
>  xfs_dir2_sf_put_ino(
>  	struct xfs_dir2_sf_hdr	*hdr,
> -	__uint8_t		*to,
> +	uint8_t			*to,
>  	xfs_ino_t		ino)
>  {
>  	ASSERT((ino & 0xff00000000000000ULL) == 0);
> @@ -225,7 +225,7 @@ xfs_dir3_sfe_put_ino(
>  
>  #define XFS_DIR3_DATA_ENTSIZE(n)					\
>  	round_up((offsetof(struct xfs_dir2_data_entry, name[0]) + (n) +	\
> -		 sizeof(xfs_dir2_data_off_t) + sizeof(__uint8_t)),	\
> +		 sizeof(xfs_dir2_data_off_t) + sizeof(uint8_t)),	\
>  		XFS_DIR2_DATA_ALIGN)
>  
>  static int
> @@ -242,7 +242,7 @@ xfs_dir3_data_entsize(
>  	return XFS_DIR3_DATA_ENTSIZE(n);
>  }
>  
> -static __uint8_t
> +static uint8_t
>  xfs_dir2_data_get_ftype(
>  	struct xfs_dir2_data_entry *dep)
>  {
> @@ -252,16 +252,16 @@ xfs_dir2_data_get_ftype(
>  static void
>  xfs_dir2_data_put_ftype(
>  	struct xfs_dir2_data_entry *dep,
> -	__uint8_t		ftype)
> +	uint8_t			ftype)
>  {
>  	ASSERT(ftype < XFS_DIR3_FT_MAX);
>  }
>  
> -static __uint8_t
> +static uint8_t
>  xfs_dir3_data_get_ftype(
>  	struct xfs_dir2_data_entry *dep)
>  {
> -	__uint8_t	ftype = dep->name[dep->namelen];
> +	uint8_t		ftype = dep->name[dep->namelen];
>  
>  	if (ftype >= XFS_DIR3_FT_MAX)
>  		return XFS_DIR3_FT_UNKNOWN;
> @@ -271,7 +271,7 @@ xfs_dir3_data_get_ftype(
>  static void
>  xfs_dir3_data_put_ftype(
>  	struct xfs_dir2_data_entry *dep,
> -	__uint8_t		type)
> +	uint8_t			type)
>  {
>  	ASSERT(type < XFS_DIR3_FT_MAX);
>  	ASSERT(dep->namelen != 0);
> diff --git a/libxfs/xfs_da_format.h b/libxfs/xfs_da_format.h
> index 9a492a9..3771edc 100644
> --- a/libxfs/xfs_da_format.h
> +++ b/libxfs/xfs_da_format.h
> @@ -111,11 +111,11 @@ struct xfs_da3_intnode {
>   * appropriate.
>   */
>  struct xfs_da3_icnode_hdr {
> -	__uint32_t	forw;
> -	__uint32_t	back;
> -	__uint16_t	magic;
> -	__uint16_t	count;
> -	__uint16_t	level;
> +	uint32_t	forw;
> +	uint32_t	back;
> +	uint16_t	magic;
> +	uint16_t	count;
> +	uint16_t	level;
>  };
>  
>  /*
> @@ -187,14 +187,14 @@ struct xfs_da3_icnode_hdr {
>  /*
>   * Byte offset in data block and shortform entry.
>   */
> -typedef	__uint16_t	xfs_dir2_data_off_t;
> +typedef uint16_t	xfs_dir2_data_off_t;
>  #define	NULLDATAOFF	0xffffU
>  typedef uint		xfs_dir2_data_aoff_t;	/* argument form */
>  
>  /*
>   * Offset in data space of a data entry.
>   */
> -typedef	__uint32_t	xfs_dir2_dataptr_t;
> +typedef uint32_t	xfs_dir2_dataptr_t;
>  #define	XFS_DIR2_MAX_DATAPTR	((xfs_dir2_dataptr_t)0xffffffff)
>  #define	XFS_DIR2_NULL_DATAPTR	((xfs_dir2_dataptr_t)0)
>  
> @@ -206,7 +206,7 @@ typedef	xfs_off_t	xfs_dir2_off_t;
>  /*
>   * Directory block number (logical dirblk in file)
>   */
> -typedef	__uint32_t	xfs_dir2_db_t;
> +typedef uint32_t	xfs_dir2_db_t;
>  
>  #define XFS_INO32_SIZE	4
>  #define XFS_INO64_SIZE	8
> @@ -226,9 +226,9 @@ typedef	__uint32_t	xfs_dir2_db_t;
>   * over them.
>   */
>  typedef struct xfs_dir2_sf_hdr {
> -	__uint8_t		count;		/* count of entries */
> -	__uint8_t		i8count;	/* count of 8-byte inode #s */
> -	__uint8_t		parent[8];	/* parent dir inode number */
> +	uint8_t			count;		/* count of entries */
> +	uint8_t			i8count;	/* count of 8-byte inode #s */
> +	uint8_t			parent[8];	/* parent dir inode number */
>  } __packed xfs_dir2_sf_hdr_t;
>  
>  typedef struct xfs_dir2_sf_entry {
> @@ -447,11 +447,11 @@ struct xfs_dir3_leaf_hdr {
>  };
>  
>  struct xfs_dir3_icleaf_hdr {
> -	__uint32_t		forw;
> -	__uint32_t		back;
> -	__uint16_t		magic;
> -	__uint16_t		count;
> -	__uint16_t		stale;
> +	uint32_t		forw;
> +	uint32_t		back;
> +	uint16_t		magic;
> +	uint16_t		count;
> +	uint16_t		stale;
>  };
>  
>  /*
> @@ -538,10 +538,10 @@ struct xfs_dir3_free {
>   * xfs_dir3_free_hdr_from_disk/xfs_dir3_free_hdr_to_disk.
>   */
>  struct xfs_dir3_icfree_hdr {
> -	__uint32_t	magic;
> -	__uint32_t	firstdb;
> -	__uint32_t	nvalid;
> -	__uint32_t	nused;
> +	uint32_t	magic;
> +	uint32_t	firstdb;
> +	uint32_t	nvalid;
> +	uint32_t	nused;
>  
>  };
>  
> @@ -632,10 +632,10 @@ typedef struct xfs_attr_shortform {
>  		__u8	padding;
>  	} hdr;
>  	struct xfs_attr_sf_entry {
> -		__uint8_t namelen;	/* actual length of name (no NULL) */
> -		__uint8_t valuelen;	/* actual length of value (no NULL) */
> -		__uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
> -		__uint8_t nameval[1];	/* name & value bytes concatenated */
> +		uint8_t namelen;	/* actual length of name (no NULL) */
> +		uint8_t valuelen;	/* actual length of value (no NULL) */
> +		uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
> +		uint8_t nameval[1];	/* name & value bytes concatenated */
>  	} list[1];			/* variable sized array */
>  } xfs_attr_shortform_t;
>  
> @@ -725,22 +725,22 @@ struct xfs_attr3_leafblock {
>   * incore, neutral version of the attribute leaf header
>   */
>  struct xfs_attr3_icleaf_hdr {
> -	__uint32_t	forw;
> -	__uint32_t	back;
> -	__uint16_t	magic;
> -	__uint16_t	count;
> -	__uint16_t	usedbytes;
> +	uint32_t	forw;
> +	uint32_t	back;
> +	uint16_t	magic;
> +	uint16_t	count;
> +	uint16_t	usedbytes;
>  	/*
>  	 * firstused is 32-bit here instead of 16-bit like the on-disk variant
>  	 * to support maximum fsb size of 64k without overflow issues throughout
>  	 * the attr code. Instead, the overflow condition is handled on
>  	 * conversion to/from disk.
>  	 */
> -	__uint32_t	firstused;
> +	uint32_t	firstused;
>  	__u8		holes;
>  	struct {
> -		__uint16_t	base;
> -		__uint16_t	size;
> +		uint16_t	base;
> +		uint16_t	size;
>  	} freemap[XFS_ATTR_LEAF_MAPSIZE];
>  };
>  
> diff --git a/libxfs/xfs_dir2.h b/libxfs/xfs_dir2.h
> index d6e6d9d..21c8f8b 100644
> --- a/libxfs/xfs_dir2.h
> +++ b/libxfs/xfs_dir2.h
> @@ -47,9 +47,9 @@ struct xfs_dir_ops {
>  	struct xfs_dir2_sf_entry *
>  		(*sf_nextentry)(struct xfs_dir2_sf_hdr *hdr,
>  				struct xfs_dir2_sf_entry *sfep);
> -	__uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
> +	uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
>  	void	(*sf_put_ftype)(struct xfs_dir2_sf_entry *sfep,
> -				__uint8_t ftype);
> +				uint8_t ftype);
>  	xfs_ino_t (*sf_get_ino)(struct xfs_dir2_sf_hdr *hdr,
>  				struct xfs_dir2_sf_entry *sfep);
>  	void	(*sf_put_ino)(struct xfs_dir2_sf_hdr *hdr,
> @@ -60,9 +60,9 @@ struct xfs_dir_ops {
>  				     xfs_ino_t ino);
>  
>  	int	(*data_entsize)(int len);
> -	__uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
> +	uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
>  	void	(*data_put_ftype)(struct xfs_dir2_data_entry *dep,
> -				__uint8_t ftype);
> +				uint8_t ftype);
>  	__be16 * (*data_entry_tag_p)(struct xfs_dir2_data_entry *dep);
>  	struct xfs_dir2_data_free *
>  		(*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr);
> diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c
> index f80d91f..40a35b8 100644
> --- a/libxfs/xfs_dir2_leaf.c
> +++ b/libxfs/xfs_dir2_leaf.c
> @@ -142,7 +142,7 @@ xfs_dir3_leaf_check_int(
>  static bool
>  xfs_dir3_leaf_verify(
>  	struct xfs_buf		*bp,
> -	__uint16_t		magic)
> +	uint16_t		magic)
>  {
>  	struct xfs_mount	*mp = bp->b_target->bt_mount;
>  	struct xfs_dir2_leaf	*leaf = bp->b_addr;
> @@ -151,7 +151,7 @@ xfs_dir3_leaf_verify(
>  
>  	if (xfs_sb_version_hascrc(&mp->m_sb)) {
>  		struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
> -		__uint16_t		magic3;
> +		uint16_t		magic3;
>  
>  		magic3 = (magic == XFS_DIR2_LEAF1_MAGIC) ? XFS_DIR3_LEAF1_MAGIC
>  							 : XFS_DIR3_LEAFN_MAGIC;
> @@ -175,7 +175,7 @@ xfs_dir3_leaf_verify(
>  static void
>  __read_verify(
>  	struct xfs_buf  *bp,
> -	__uint16_t	magic)
> +	uint16_t	magic)
>  {
>  	struct xfs_mount	*mp = bp->b_target->bt_mount;
>  
> @@ -192,7 +192,7 @@ __read_verify(
>  static void
>  __write_verify(
>  	struct xfs_buf  *bp,
> -	__uint16_t	magic)
> +	uint16_t	magic)
>  {
>  	struct xfs_mount	*mp = bp->b_target->bt_mount;
>  	struct xfs_buf_log_item	*bip = bp->b_fspriv;
> @@ -296,7 +296,7 @@ xfs_dir3_leaf_init(
>  	struct xfs_trans	*tp,
>  	struct xfs_buf		*bp,
>  	xfs_ino_t		owner,
> -	__uint16_t		type)
> +	uint16_t		type)
>  {
>  	struct xfs_dir2_leaf	*leaf = bp->b_addr;
>  
> @@ -340,7 +340,7 @@ xfs_dir3_leaf_get_buf(
>  	xfs_da_args_t		*args,
>  	xfs_dir2_db_t		bno,
>  	struct xfs_buf		**bpp,
> -	__uint16_t		magic)
> +	uint16_t		magic)
>  {
>  	struct xfs_inode	*dp = args->dp;
>  	struct xfs_trans	*tp = args->trans;
> diff --git a/libxfs/xfs_dir2_priv.h b/libxfs/xfs_dir2_priv.h
> index 39f8604..011df4d 100644
> --- a/libxfs/xfs_dir2_priv.h
> +++ b/libxfs/xfs_dir2_priv.h
> @@ -69,7 +69,7 @@ extern void xfs_dir3_leaf_compact_x1(struct xfs_dir3_icleaf_hdr *leafhdr,
>  		struct xfs_dir2_leaf_entry *ents, int *indexp,
>  		int *lowstalep, int *highstalep, int *lowlogp, int *highlogp);
>  extern int xfs_dir3_leaf_get_buf(struct xfs_da_args *args, xfs_dir2_db_t bno,
> -		struct xfs_buf **bpp, __uint16_t magic);
> +		struct xfs_buf **bpp, uint16_t magic);
>  extern void xfs_dir3_leaf_log_ents(struct xfs_da_args *args,
>  		struct xfs_buf *bp, int first, int last);
>  extern void xfs_dir3_leaf_log_header(struct xfs_da_args *args,
> diff --git a/libxfs/xfs_dir2_sf.c b/libxfs/xfs_dir2_sf.c
> index 195f816..fdbe5e1 100644
> --- a/libxfs/xfs_dir2_sf.c
> +++ b/libxfs/xfs_dir2_sf.c
> @@ -645,7 +645,7 @@ xfs_dir2_sf_verify(
>  	int				offset;
>  	int				size;
>  	int				error;
> -	__uint8_t			filetype;
> +	uint8_t				filetype;
>  
>  	ASSERT(ip->i_d.di_format == XFS_DINODE_FMT_LOCAL);
>  	/*
> diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
> index 4c3ed1f..a53f035 100644
> --- a/libxfs/xfs_format.h
> +++ b/libxfs/xfs_format.h
> @@ -103,8 +103,8 @@ struct xfs_ifork;
>   * Must be padded to 64 bit alignment.
>   */
>  typedef struct xfs_sb {
> -	__uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
> -	__uint32_t	sb_blocksize;	/* logical block size, bytes */
> +	uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
> +	uint32_t	sb_blocksize;	/* logical block size, bytes */
>  	xfs_rfsblock_t	sb_dblocks;	/* number of data blocks */
>  	xfs_rfsblock_t	sb_rblocks;	/* number of realtime blocks */
>  	xfs_rtblock_t	sb_rextents;	/* number of realtime extents */
> @@ -118,45 +118,45 @@ typedef struct xfs_sb {
>  	xfs_agnumber_t	sb_agcount;	/* number of allocation groups */
>  	xfs_extlen_t	sb_rbmblocks;	/* number of rt bitmap blocks */
>  	xfs_extlen_t	sb_logblocks;	/* number of log blocks */
> -	__uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
> -	__uint16_t	sb_sectsize;	/* volume sector size, bytes */
> -	__uint16_t	sb_inodesize;	/* inode size, bytes */
> -	__uint16_t	sb_inopblock;	/* inodes per block */
> +	uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
> +	uint16_t	sb_sectsize;	/* volume sector size, bytes */
> +	uint16_t	sb_inodesize;	/* inode size, bytes */
> +	uint16_t	sb_inopblock;	/* inodes per block */
>  	char		sb_fname[12];	/* file system name */
> -	__uint8_t	sb_blocklog;	/* log2 of sb_blocksize */
> -	__uint8_t	sb_sectlog;	/* log2 of sb_sectsize */
> -	__uint8_t	sb_inodelog;	/* log2 of sb_inodesize */
> -	__uint8_t	sb_inopblog;	/* log2 of sb_inopblock */
> -	__uint8_t	sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
> -	__uint8_t	sb_rextslog;	/* log2 of sb_rextents */
> -	__uint8_t	sb_inprogress;	/* mkfs is in progress, don't mount */
> -	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
> +	uint8_t		sb_blocklog;	/* log2 of sb_blocksize */
> +	uint8_t		sb_sectlog;	/* log2 of sb_sectsize */
> +	uint8_t		sb_inodelog;	/* log2 of sb_inodesize */
> +	uint8_t		sb_inopblog;	/* log2 of sb_inopblock */
> +	uint8_t		sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
> +	uint8_t		sb_rextslog;	/* log2 of sb_rextents */
> +	uint8_t		sb_inprogress;	/* mkfs is in progress, don't mount */
> +	uint8_t		sb_imax_pct;	/* max % of fs for inode space */
>  					/* statistics */
>  	/*
>  	 * These fields must remain contiguous.  If you really
>  	 * want to change their layout, make sure you fix the
>  	 * code in xfs_trans_apply_sb_deltas().
>  	 */
> -	__uint64_t	sb_icount;	/* allocated inodes */
> -	__uint64_t	sb_ifree;	/* free inodes */
> -	__uint64_t	sb_fdblocks;	/* free data blocks */
> -	__uint64_t	sb_frextents;	/* free realtime extents */
> +	uint64_t	sb_icount;	/* allocated inodes */
> +	uint64_t	sb_ifree;	/* free inodes */
> +	uint64_t	sb_fdblocks;	/* free data blocks */
> +	uint64_t	sb_frextents;	/* free realtime extents */
>  	/*
>  	 * End contiguous fields.
>  	 */
>  	xfs_ino_t	sb_uquotino;	/* user quota inode */
>  	xfs_ino_t	sb_gquotino;	/* group quota inode */
> -	__uint16_t	sb_qflags;	/* quota flags */
> -	__uint8_t	sb_flags;	/* misc. flags */
> -	__uint8_t	sb_shared_vn;	/* shared version number */
> +	uint16_t	sb_qflags;	/* quota flags */
> +	uint8_t		sb_flags;	/* misc. flags */
> +	uint8_t		sb_shared_vn;	/* shared version number */
>  	xfs_extlen_t	sb_inoalignmt;	/* inode chunk alignment, fsblocks */
> -	__uint32_t	sb_unit;	/* stripe or raid unit */
> -	__uint32_t	sb_width;	/* stripe or raid width */
> -	__uint8_t	sb_dirblklog;	/* log2 of dir block size (fsbs) */
> -	__uint8_t	sb_logsectlog;	/* log2 of the log sector size */
> -	__uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
> -	__uint32_t	sb_logsunit;	/* stripe unit size for the log */
> -	__uint32_t	sb_features2;	/* additional feature bits */
> +	uint32_t	sb_unit;	/* stripe or raid unit */
> +	uint32_t	sb_width;	/* stripe or raid width */
> +	uint8_t		sb_dirblklog;	/* log2 of dir block size (fsbs) */
> +	uint8_t		sb_logsectlog;	/* log2 of the log sector size */
> +	uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
> +	uint32_t	sb_logsunit;	/* stripe unit size for the log */
> +	uint32_t	sb_features2;	/* additional feature bits */
>  
>  	/*
>  	 * bad features2 field as a result of failing to pad the sb structure to
> @@ -167,17 +167,17 @@ typedef struct xfs_sb {
>  	 * the value in sb_features2 when formatting the incore superblock to
>  	 * the disk buffer.
>  	 */
> -	__uint32_t	sb_bad_features2;
> +	uint32_t	sb_bad_features2;
>  
>  	/* version 5 superblock fields start here */
>  
>  	/* feature masks */
> -	__uint32_t	sb_features_compat;
> -	__uint32_t	sb_features_ro_compat;
> -	__uint32_t	sb_features_incompat;
> -	__uint32_t	sb_features_log_incompat;
> +	uint32_t	sb_features_compat;
> +	uint32_t	sb_features_ro_compat;
> +	uint32_t	sb_features_incompat;
> +	uint32_t	sb_features_log_incompat;
>  
> -	__uint32_t	sb_crc;		/* superblock crc */
> +	uint32_t	sb_crc;		/* superblock crc */
>  	xfs_extlen_t	sb_spino_align;	/* sparse inode chunk alignment */
>  
>  	xfs_ino_t	sb_pquotino;	/* project quota inode */
> @@ -449,7 +449,7 @@ static inline void xfs_sb_version_addprojid32bit(struct xfs_sb *sbp)
>  static inline bool
>  xfs_sb_has_compat_feature(
>  	struct xfs_sb	*sbp,
> -	__uint32_t	feature)
> +	uint32_t	feature)
>  {
>  	return (sbp->sb_features_compat & feature) != 0;
>  }
> @@ -465,7 +465,7 @@ xfs_sb_has_compat_feature(
>  static inline bool
>  xfs_sb_has_ro_compat_feature(
>  	struct xfs_sb	*sbp,
> -	__uint32_t	feature)
> +	uint32_t	feature)
>  {
>  	return (sbp->sb_features_ro_compat & feature) != 0;
>  }
> @@ -482,7 +482,7 @@ xfs_sb_has_ro_compat_feature(
>  static inline bool
>  xfs_sb_has_incompat_feature(
>  	struct xfs_sb	*sbp,
> -	__uint32_t	feature)
> +	uint32_t	feature)
>  {
>  	return (sbp->sb_features_incompat & feature) != 0;
>  }
> @@ -492,7 +492,7 @@ xfs_sb_has_incompat_feature(
>  static inline bool
>  xfs_sb_has_incompat_log_feature(
>  	struct xfs_sb	*sbp,
> -	__uint32_t	feature)
> +	uint32_t	feature)
>  {
>  	return (sbp->sb_features_log_incompat & feature) != 0;
>  }
> @@ -594,8 +594,8 @@ xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
>   */
>  #define XFS_FSB_TO_B(mp,fsbno)	((xfs_fsize_t)(fsbno) << (mp)->m_sb.sb_blocklog)
>  #define XFS_B_TO_FSB(mp,b)	\
> -	((((__uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
> -#define XFS_B_TO_FSBT(mp,b)	(((__uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
> +	((((uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
> +#define XFS_B_TO_FSBT(mp,b)	(((uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
>  #define XFS_B_FSB_OFFSET(mp,b)	((b) & (mp)->m_blockmask)
>  
>  /*
> @@ -1072,7 +1072,7 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
>   * next agno_log bits - ag number
>   * high agno_log-agblklog-inopblog bits - 0
>   */
> -#define	XFS_INO_MASK(k)			(__uint32_t)((1ULL << (k)) - 1)
> +#define	XFS_INO_MASK(k)			(uint32_t)((1ULL << (k)) - 1)
>  #define	XFS_INO_OFFSET_BITS(mp)		(mp)->m_sb.sb_inopblog
>  #define	XFS_INO_AGBNO_BITS(mp)		(mp)->m_sb.sb_agblklog
>  #define	XFS_INO_AGINO_BITS(mp)		(mp)->m_agino_log
> @@ -1269,16 +1269,16 @@ typedef __be32 xfs_alloc_ptr_t;
>  #define	XFS_FIBT_MAGIC		0x46494254	/* 'FIBT' */
>  #define	XFS_FIBT_CRC_MAGIC	0x46494233	/* 'FIB3' */
>  
> -typedef	__uint64_t	xfs_inofree_t;
> +typedef uint64_t	xfs_inofree_t;
>  #define	XFS_INODES_PER_CHUNK		(NBBY * sizeof(xfs_inofree_t))
>  #define	XFS_INODES_PER_CHUNK_LOG	(XFS_NBBYLOG + 3)
>  #define	XFS_INOBT_ALL_FREE		((xfs_inofree_t)-1)
>  #define	XFS_INOBT_MASK(i)		((xfs_inofree_t)1 << (i))
>  
>  #define XFS_INOBT_HOLEMASK_FULL		0	/* holemask for full chunk */
> -#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(__uint16_t))
> +#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(uint16_t))
>  #define XFS_INODES_PER_HOLEMASK_BIT	\
> -	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(__uint16_t)))
> +	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(uint16_t)))
>  
>  static inline xfs_inofree_t xfs_inobt_maskn(int i, int n)
>  {
> @@ -1312,9 +1312,9 @@ typedef struct xfs_inobt_rec {
>  
>  typedef struct xfs_inobt_rec_incore {
>  	xfs_agino_t	ir_startino;	/* starting inode number */
> -	__uint16_t	ir_holemask;	/* hole mask for sparse chunks */
> -	__uint8_t	ir_count;	/* total inode count */
> -	__uint8_t	ir_freecount;	/* count of free inodes (set bits) */
> +	uint16_t	ir_holemask;	/* hole mask for sparse chunks */
> +	uint8_t		ir_count;	/* total inode count */
> +	uint8_t		ir_freecount;	/* count of free inodes (set bits) */
>  	xfs_inofree_t	ir_free;	/* free inode mask */
>  } xfs_inobt_rec_incore_t;
>  
> @@ -1397,15 +1397,15 @@ struct xfs_rmap_rec {
>   *  rm_offset:54-60 aren't used and should be zero
>   *  rm_offset:0-53 is the block offset within the inode
>   */
> -#define XFS_RMAP_OFF_ATTR_FORK	((__uint64_t)1ULL << 63)
> -#define XFS_RMAP_OFF_BMBT_BLOCK	((__uint64_t)1ULL << 62)
> -#define XFS_RMAP_OFF_UNWRITTEN	((__uint64_t)1ULL << 61)
> +#define XFS_RMAP_OFF_ATTR_FORK	((uint64_t)1ULL << 63)
> +#define XFS_RMAP_OFF_BMBT_BLOCK	((uint64_t)1ULL << 62)
> +#define XFS_RMAP_OFF_UNWRITTEN	((uint64_t)1ULL << 61)
>  
> -#define XFS_RMAP_LEN_MAX	((__uint32_t)~0U)
> +#define XFS_RMAP_LEN_MAX	((uint32_t)~0U)
>  #define XFS_RMAP_OFF_FLAGS	(XFS_RMAP_OFF_ATTR_FORK | \
>  				 XFS_RMAP_OFF_BMBT_BLOCK | \
>  				 XFS_RMAP_OFF_UNWRITTEN)
> -#define XFS_RMAP_OFF_MASK	((__uint64_t)0x3FFFFFFFFFFFFFULL)
> +#define XFS_RMAP_OFF_MASK	((uint64_t)0x3FFFFFFFFFFFFFULL)
>  
>  #define XFS_RMAP_OFF(off)		((off) & XFS_RMAP_OFF_MASK)
>  
> @@ -1431,8 +1431,8 @@ struct xfs_rmap_rec {
>  struct xfs_rmap_irec {
>  	xfs_agblock_t	rm_startblock;	/* extent start block */
>  	xfs_extlen_t	rm_blockcount;	/* extent length */
> -	__uint64_t	rm_owner;	/* extent owner */
> -	__uint64_t	rm_offset;	/* offset within the owner */
> +	uint64_t	rm_owner;	/* extent owner */
> +	uint64_t	rm_offset;	/* offset within the owner */
>  	unsigned int	rm_flags;	/* state flags */
>  };
>  
> @@ -1544,11 +1544,11 @@ typedef struct xfs_bmbt_rec {
>  	__be64			l0, l1;
>  } xfs_bmbt_rec_t;
>  
> -typedef __uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
> +typedef uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
>  typedef xfs_bmbt_rec_t xfs_bmdr_rec_t;
>  
>  typedef struct xfs_bmbt_rec_host {
> -	__uint64_t		l0, l1;
> +	uint64_t		l0, l1;
>  } xfs_bmbt_rec_host_t;
>  
>  /*
> diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
> index 1831cff..2d28332 100644
> --- a/libxfs/xfs_fs.h
> +++ b/libxfs/xfs_fs.h
> @@ -323,10 +323,10 @@ typedef struct xfs_bstat {
>   * and using two 16bit values to hold new 32bit projid was choosen
>   * to retain compatibility with "old" filesystems).
>   */
> -static inline __uint32_t
> +static inline uint32_t
>  bstat_get_projid(struct xfs_bstat *bs)
>  {
> -	return (__uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
> +	return (uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
>  }
>  
>  /*
> @@ -476,10 +476,10 @@ typedef struct xfs_handle {
>   */
>  typedef struct xfs_swapext
>  {
> -	__int64_t	sx_version;	/* version */
> +	int64_t		sx_version;	/* version */
>  #define XFS_SX_VERSION		0
> -	__int64_t	sx_fdtarget;	/* fd of target file */
> -	__int64_t	sx_fdtmp;	/* fd of tmp file */
> +	int64_t		sx_fdtarget;	/* fd of target file */
> +	int64_t		sx_fdtmp;	/* fd of tmp file */
>  	xfs_off_t	sx_offset;	/* offset into file */
>  	xfs_off_t	sx_length;	/* leng from offset */
>  	char		sx_pad[16];	/* pad space, unused */
> @@ -566,7 +566,7 @@ typedef struct xfs_swapext
>  #define XFS_IOC_ATTRLIST_BY_HANDLE   _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
>  #define XFS_IOC_ATTRMULTI_BY_HANDLE  _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
>  #define XFS_IOC_FSGEOMETRY	     _IOR ('X', 124, struct xfs_fsop_geom)
> -#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, __uint32_t)
> +#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, uint32_t)
>  /*	XFS_IOC_GETFSUUID ---------- deprecated 140	 */
>  
>  /* reflink ioctls; these MUST match the btrfs ioctl definitions */
> diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
> index 55cc450..8d24518 100644
> --- a/libxfs/xfs_ialloc.c
> +++ b/libxfs/xfs_ialloc.c
> @@ -134,9 +134,9 @@ xfs_inobt_get_rec(
>  STATIC int
>  xfs_inobt_insert_rec(
>  	struct xfs_btree_cur	*cur,
> -	__uint16_t		holemask,
> -	__uint8_t		count,
> -	__int32_t		freecount,
> +	uint16_t		holemask,
> +	uint8_t			count,
> +	int32_t			freecount,
>  	xfs_inofree_t		free,
>  	int			*stat)
>  {
> diff --git a/libxfs/xfs_ialloc_btree.c b/libxfs/xfs_ialloc_btree.c
> index 7b4be76..5b28105 100644
> --- a/libxfs/xfs_ialloc_btree.c
> +++ b/libxfs/xfs_ialloc_btree.c
> @@ -218,12 +218,12 @@ xfs_finobt_init_ptr_from_cur(
>  	ptr->s = agi->agi_free_root;
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_inobt_key_diff(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*key)
>  {
> -	return (__int64_t)be32_to_cpu(key->inobt.ir_startino) -
> +	return (int64_t)be32_to_cpu(key->inobt.ir_startino) -
>  			  cur->bc_rec.i.ir_startino;
>  }
>  
> diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
> index 2972701..fcc6fb8 100644
> --- a/libxfs/xfs_inode_buf.c
> +++ b/libxfs/xfs_inode_buf.c
> @@ -442,7 +442,7 @@ xfs_dinode_calc_crc(
>  	struct xfs_mount	*mp,
>  	struct xfs_dinode	*dip)
>  {
> -	__uint32_t		crc;
> +	uint32_t		crc;
>  
>  	if (dip->di_version < 3)
>  		return;
> diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
> index 6848a0a..0827d7d 100644
> --- a/libxfs/xfs_inode_buf.h
> +++ b/libxfs/xfs_inode_buf.h
> @@ -28,26 +28,26 @@ struct xfs_dinode;
>   * format specific structures at the appropriate time.
>   */
>  struct xfs_icdinode {
> -	__int8_t	di_version;	/* inode version */
> -	__int8_t	di_format;	/* format of di_c data */
> -	__uint16_t	di_flushiter;	/* incremented on flush */
> -	__uint32_t	di_uid;		/* owner's user id */
> -	__uint32_t	di_gid;		/* owner's group id */
> -	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
> -	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
> +	int8_t		di_version;	/* inode version */
> +	int8_t		di_format;	/* format of di_c data */
> +	uint16_t	di_flushiter;	/* incremented on flush */
> +	uint32_t	di_uid;		/* owner's user id */
> +	uint32_t	di_gid;		/* owner's group id */
> +	uint16_t	di_projid_lo;	/* lower part of owner's project id */
> +	uint16_t	di_projid_hi;	/* higher part of owner's project id */
>  	xfs_fsize_t	di_size;	/* number of bytes in file */
>  	xfs_rfsblock_t	di_nblocks;	/* # of direct & btree blocks used */
>  	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
>  	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
>  	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
> -	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
> -	__int8_t	di_aformat;	/* format of attr fork's data */
> -	__uint32_t	di_dmevmask;	/* DMIG event mask */
> -	__uint16_t	di_dmstate;	/* DMIG state info */
> -	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
> +	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
> +	int8_t		di_aformat;	/* format of attr fork's data */
> +	uint32_t	di_dmevmask;	/* DMIG event mask */
> +	uint16_t	di_dmstate;	/* DMIG state info */
> +	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
>  
> -	__uint64_t	di_flags2;	/* more random flags */
> -	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
> +	uint64_t	di_flags2;	/* more random flags */
> +	uint32_t	di_cowextsize;	/* basic cow extent size for file */
>  
>  	xfs_ictimestamp_t di_crtime;	/* time created */
>  };
> diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
> index 7ae571f..8372e9b 100644
> --- a/libxfs/xfs_log_format.h
> +++ b/libxfs/xfs_log_format.h
> @@ -31,7 +31,7 @@ struct xfs_trans_res;
>   * through all the log items definitions and everything they encode into the
>   * log.
>   */
> -typedef __uint32_t xlog_tid_t;
> +typedef uint32_t xlog_tid_t;
>  
>  #define XLOG_MIN_ICLOGS		2
>  #define XLOG_MAX_ICLOGS		8
> @@ -211,7 +211,7 @@ typedef struct xfs_log_iovec {
>  typedef struct xfs_trans_header {
>  	uint		th_magic;		/* magic number */
>  	uint		th_type;		/* transaction type */
> -	__int32_t	th_tid;			/* transaction id (unused) */
> +	int32_t		th_tid;			/* transaction id (unused) */
>  	uint		th_num_items;		/* num items logged by trans */
>  } xfs_trans_header_t;
>  
> @@ -265,52 +265,52 @@ typedef struct xfs_trans_header {
>   * must be added on to the end.
>   */
>  typedef struct xfs_inode_log_format {
> -	__uint16_t		ilf_type;	/* inode log item type */
> -	__uint16_t		ilf_size;	/* size of this item */
> -	__uint32_t		ilf_fields;	/* flags for fields logged */
> -	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
> -	__uint16_t		ilf_dsize;	/* size of data/ext/root */
> -	__uint64_t		ilf_ino;	/* inode number */
> +	uint16_t		ilf_type;	/* inode log item type */
> +	uint16_t		ilf_size;	/* size of this item */
> +	uint32_t		ilf_fields;	/* flags for fields logged */
> +	uint16_t		ilf_asize;	/* size of attr d/ext/root */
> +	uint16_t		ilf_dsize;	/* size of data/ext/root */
> +	uint64_t		ilf_ino;	/* inode number */
>  	union {
> -		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> +		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
>  		uuid_t		ilfu_uuid;	/* mount point value */
>  	} ilf_u;
> -	__int64_t		ilf_blkno;	/* blkno of inode buffer */
> -	__int32_t		ilf_len;	/* len of inode buffer */
> -	__int32_t		ilf_boffset;	/* off of inode in buffer */
> +	int64_t			ilf_blkno;	/* blkno of inode buffer */
> +	int32_t			ilf_len;	/* len of inode buffer */
> +	int32_t			ilf_boffset;	/* off of inode in buffer */
>  } xfs_inode_log_format_t;
>  
>  typedef struct xfs_inode_log_format_32 {
> -	__uint16_t		ilf_type;	/* inode log item type */
> -	__uint16_t		ilf_size;	/* size of this item */
> -	__uint32_t		ilf_fields;	/* flags for fields logged */
> -	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
> -	__uint16_t		ilf_dsize;	/* size of data/ext/root */
> -	__uint64_t		ilf_ino;	/* inode number */
> +	uint16_t		ilf_type;	/* inode log item type */
> +	uint16_t		ilf_size;	/* size of this item */
> +	uint32_t		ilf_fields;	/* flags for fields logged */
> +	uint16_t		ilf_asize;	/* size of attr d/ext/root */
> +	uint16_t		ilf_dsize;	/* size of data/ext/root */
> +	uint64_t		ilf_ino;	/* inode number */
>  	union {
> -		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> +		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
>  		uuid_t		ilfu_uuid;	/* mount point value */
>  	} ilf_u;
> -	__int64_t		ilf_blkno;	/* blkno of inode buffer */
> -	__int32_t		ilf_len;	/* len of inode buffer */
> -	__int32_t		ilf_boffset;	/* off of inode in buffer */
> +	int64_t			ilf_blkno;	/* blkno of inode buffer */
> +	int32_t			ilf_len;	/* len of inode buffer */
> +	int32_t			ilf_boffset;	/* off of inode in buffer */
>  } __attribute__((packed)) xfs_inode_log_format_32_t;
>  
>  typedef struct xfs_inode_log_format_64 {
> -	__uint16_t		ilf_type;	/* inode log item type */
> -	__uint16_t		ilf_size;	/* size of this item */
> -	__uint32_t		ilf_fields;	/* flags for fields logged */
> -	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
> -	__uint16_t		ilf_dsize;	/* size of data/ext/root */
> -	__uint32_t		ilf_pad;	/* pad for 64 bit boundary */
> -	__uint64_t		ilf_ino;	/* inode number */
> +	uint16_t		ilf_type;	/* inode log item type */
> +	uint16_t		ilf_size;	/* size of this item */
> +	uint32_t		ilf_fields;	/* flags for fields logged */
> +	uint16_t		ilf_asize;	/* size of attr d/ext/root */
> +	uint16_t		ilf_dsize;	/* size of data/ext/root */
> +	uint32_t		ilf_pad;	/* pad for 64 bit boundary */
> +	uint64_t		ilf_ino;	/* inode number */
>  	union {
> -		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> +		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
>  		uuid_t		ilfu_uuid;	/* mount point value */
>  	} ilf_u;
> -	__int64_t		ilf_blkno;	/* blkno of inode buffer */
> -	__int32_t		ilf_len;	/* len of inode buffer */
> -	__int32_t		ilf_boffset;	/* off of inode in buffer */
> +	int64_t			ilf_blkno;	/* blkno of inode buffer */
> +	int32_t			ilf_len;	/* len of inode buffer */
> +	int32_t			ilf_boffset;	/* off of inode in buffer */
>  } xfs_inode_log_format_64_t;
>  
>  
> @@ -379,8 +379,8 @@ static inline int xfs_ilog_fdata(int w)
>   * information.
>   */
>  typedef struct xfs_ictimestamp {
> -	__int32_t	t_sec;		/* timestamp seconds */
> -	__int32_t	t_nsec;		/* timestamp nanoseconds */
> +	int32_t		t_sec;		/* timestamp seconds */
> +	int32_t		t_nsec;		/* timestamp nanoseconds */
>  } xfs_ictimestamp_t;
>  
>  /*
> @@ -388,18 +388,18 @@ typedef struct xfs_ictimestamp {
>   * kept identical to struct xfs_dinode except for the endianness annotations.
>   */
>  struct xfs_log_dinode {
> -	__uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
> -	__uint16_t	di_mode;	/* mode and type of file */
> -	__int8_t	di_version;	/* inode version */
> -	__int8_t	di_format;	/* format of di_c data */
> -	__uint8_t	di_pad3[2];	/* unused in v2/3 inodes */
> -	__uint32_t	di_uid;		/* owner's user id */
> -	__uint32_t	di_gid;		/* owner's group id */
> -	__uint32_t	di_nlink;	/* number of links to file */
> -	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
> -	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
> -	__uint8_t	di_pad[6];	/* unused, zeroed space */
> -	__uint16_t	di_flushiter;	/* incremented on flush */
> +	uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
> +	uint16_t	di_mode;	/* mode and type of file */
> +	int8_t		di_version;	/* inode version */
> +	int8_t		di_format;	/* format of di_c data */
> +	uint8_t		di_pad3[2];	/* unused in v2/3 inodes */
> +	uint32_t	di_uid;		/* owner's user id */
> +	uint32_t	di_gid;		/* owner's group id */
> +	uint32_t	di_nlink;	/* number of links to file */
> +	uint16_t	di_projid_lo;	/* lower part of owner's project id */
> +	uint16_t	di_projid_hi;	/* higher part of owner's project id */
> +	uint8_t		di_pad[6];	/* unused, zeroed space */
> +	uint16_t	di_flushiter;	/* incremented on flush */
>  	xfs_ictimestamp_t di_atime;	/* time last accessed */
>  	xfs_ictimestamp_t di_mtime;	/* time last modified */
>  	xfs_ictimestamp_t di_ctime;	/* time created/inode modified */
> @@ -408,23 +408,23 @@ struct xfs_log_dinode {
>  	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
>  	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
>  	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
> -	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
> -	__int8_t	di_aformat;	/* format of attr fork's data */
> -	__uint32_t	di_dmevmask;	/* DMIG event mask */
> -	__uint16_t	di_dmstate;	/* DMIG state info */
> -	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
> -	__uint32_t	di_gen;		/* generation number */
> +	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
> +	int8_t		di_aformat;	/* format of attr fork's data */
> +	uint32_t	di_dmevmask;	/* DMIG event mask */
> +	uint16_t	di_dmstate;	/* DMIG state info */
> +	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
> +	uint32_t	di_gen;		/* generation number */
>  
>  	/* di_next_unlinked is the only non-core field in the old dinode */
>  	xfs_agino_t	di_next_unlinked;/* agi unlinked list ptr */
>  
>  	/* start of the extended dinode, writable fields */
> -	__uint32_t	di_crc;		/* CRC of the inode */
> -	__uint64_t	di_changecount;	/* number of attribute changes */
> +	uint32_t	di_crc;		/* CRC of the inode */
> +	uint64_t	di_changecount;	/* number of attribute changes */
>  	xfs_lsn_t	di_lsn;		/* flush sequence */
> -	__uint64_t	di_flags2;	/* more random flags */
> -	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
> -	__uint8_t	di_pad2[12];	/* more padding for future expansion */
> +	uint64_t	di_flags2;	/* more random flags */
> +	uint32_t	di_cowextsize;	/* basic cow extent size for file */
> +	uint8_t		di_pad2[12];	/* more padding for future expansion */
>  
>  	/* fields only written to during inode creation */
>  	xfs_ictimestamp_t di_crtime;	/* time created */
> @@ -483,7 +483,7 @@ typedef struct xfs_buf_log_format {
>  	unsigned short	blf_size;	/* size of this item */
>  	unsigned short	blf_flags;	/* misc state */
>  	unsigned short	blf_len;	/* number of blocks in this buf */
> -	__int64_t	blf_blkno;	/* starting blkno of this buf */
> +	int64_t		blf_blkno;	/* starting blkno of this buf */
>  	unsigned int	blf_map_size;	/* used size of data bitmap in words */
>  	unsigned int	blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
>  } xfs_buf_log_format_t;
> @@ -533,7 +533,7 @@ xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
>  	blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
>  }
>  
> -static inline __uint16_t
> +static inline uint16_t
>  xfs_blft_from_flags(struct xfs_buf_log_format *blf)
>  {
>  	return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
> @@ -554,14 +554,14 @@ typedef struct xfs_extent {
>   * conversion routine.
>   */
>  typedef struct xfs_extent_32 {
> -	__uint64_t	ext_start;
> -	__uint32_t	ext_len;
> +	uint64_t	ext_start;
> +	uint32_t	ext_len;
>  } __attribute__((packed)) xfs_extent_32_t;
>  
>  typedef struct xfs_extent_64 {
> -	__uint64_t	ext_start;
> -	__uint32_t	ext_len;
> -	__uint32_t	ext_pad;
> +	uint64_t	ext_start;
> +	uint32_t	ext_len;
> +	uint32_t	ext_pad;
>  } xfs_extent_64_t;
>  
>  /*
> @@ -570,26 +570,26 @@ typedef struct xfs_extent_64 {
>   * size is given by efi_nextents.
>   */
>  typedef struct xfs_efi_log_format {
> -	__uint16_t		efi_type;	/* efi log item type */
> -	__uint16_t		efi_size;	/* size of this item */
> -	__uint32_t		efi_nextents;	/* # extents to free */
> -	__uint64_t		efi_id;		/* efi identifier */
> +	uint16_t		efi_type;	/* efi log item type */
> +	uint16_t		efi_size;	/* size of this item */
> +	uint32_t		efi_nextents;	/* # extents to free */
> +	uint64_t		efi_id;		/* efi identifier */
>  	xfs_extent_t		efi_extents[1];	/* array of extents to free */
>  } xfs_efi_log_format_t;
>  
>  typedef struct xfs_efi_log_format_32 {
> -	__uint16_t		efi_type;	/* efi log item type */
> -	__uint16_t		efi_size;	/* size of this item */
> -	__uint32_t		efi_nextents;	/* # extents to free */
> -	__uint64_t		efi_id;		/* efi identifier */
> +	uint16_t		efi_type;	/* efi log item type */
> +	uint16_t		efi_size;	/* size of this item */
> +	uint32_t		efi_nextents;	/* # extents to free */
> +	uint64_t		efi_id;		/* efi identifier */
>  	xfs_extent_32_t		efi_extents[1];	/* array of extents to free */
>  } __attribute__((packed)) xfs_efi_log_format_32_t;
>  
>  typedef struct xfs_efi_log_format_64 {
> -	__uint16_t		efi_type;	/* efi log item type */
> -	__uint16_t		efi_size;	/* size of this item */
> -	__uint32_t		efi_nextents;	/* # extents to free */
> -	__uint64_t		efi_id;		/* efi identifier */
> +	uint16_t		efi_type;	/* efi log item type */
> +	uint16_t		efi_size;	/* size of this item */
> +	uint32_t		efi_nextents;	/* # extents to free */
> +	uint64_t		efi_id;		/* efi identifier */
>  	xfs_extent_64_t		efi_extents[1];	/* array of extents to free */
>  } xfs_efi_log_format_64_t;
>  
> @@ -599,26 +599,26 @@ typedef struct xfs_efi_log_format_64 {
>   * size is given by efd_nextents;
>   */
>  typedef struct xfs_efd_log_format {
> -	__uint16_t		efd_type;	/* efd log item type */
> -	__uint16_t		efd_size;	/* size of this item */
> -	__uint32_t		efd_nextents;	/* # of extents freed */
> -	__uint64_t		efd_efi_id;	/* id of corresponding efi */
> +	uint16_t		efd_type;	/* efd log item type */
> +	uint16_t		efd_size;	/* size of this item */
> +	uint32_t		efd_nextents;	/* # of extents freed */
> +	uint64_t		efd_efi_id;	/* id of corresponding efi */
>  	xfs_extent_t		efd_extents[1];	/* array of extents freed */
>  } xfs_efd_log_format_t;
>  
>  typedef struct xfs_efd_log_format_32 {
> -	__uint16_t		efd_type;	/* efd log item type */
> -	__uint16_t		efd_size;	/* size of this item */
> -	__uint32_t		efd_nextents;	/* # of extents freed */
> -	__uint64_t		efd_efi_id;	/* id of corresponding efi */
> +	uint16_t		efd_type;	/* efd log item type */
> +	uint16_t		efd_size;	/* size of this item */
> +	uint32_t		efd_nextents;	/* # of extents freed */
> +	uint64_t		efd_efi_id;	/* id of corresponding efi */
>  	xfs_extent_32_t		efd_extents[1];	/* array of extents freed */
>  } __attribute__((packed)) xfs_efd_log_format_32_t;
>  
>  typedef struct xfs_efd_log_format_64 {
> -	__uint16_t		efd_type;	/* efd log item type */
> -	__uint16_t		efd_size;	/* size of this item */
> -	__uint32_t		efd_nextents;	/* # of extents freed */
> -	__uint64_t		efd_efi_id;	/* id of corresponding efi */
> +	uint16_t		efd_type;	/* efd log item type */
> +	uint16_t		efd_size;	/* size of this item */
> +	uint32_t		efd_nextents;	/* # of extents freed */
> +	uint64_t		efd_efi_id;	/* id of corresponding efi */
>  	xfs_extent_64_t		efd_extents[1];	/* array of extents freed */
>  } xfs_efd_log_format_64_t;
>  
> @@ -626,11 +626,11 @@ typedef struct xfs_efd_log_format_64 {
>   * RUI/RUD (reverse mapping) log format definitions
>   */
>  struct xfs_map_extent {
> -	__uint64_t		me_owner;
> -	__uint64_t		me_startblock;
> -	__uint64_t		me_startoff;
> -	__uint32_t		me_len;
> -	__uint32_t		me_flags;
> +	uint64_t		me_owner;
> +	uint64_t		me_startblock;
> +	uint64_t		me_startoff;
> +	uint32_t		me_len;
> +	uint32_t		me_flags;
>  };
>  
>  /* rmap me_flags: upper bits are flags, lower byte is type code */
> @@ -659,10 +659,10 @@ struct xfs_map_extent {
>   * size is given by rui_nextents.
>   */
>  struct xfs_rui_log_format {
> -	__uint16_t		rui_type;	/* rui log item type */
> -	__uint16_t		rui_size;	/* size of this item */
> -	__uint32_t		rui_nextents;	/* # extents to free */
> -	__uint64_t		rui_id;		/* rui identifier */
> +	uint16_t		rui_type;	/* rui log item type */
> +	uint16_t		rui_size;	/* size of this item */
> +	uint32_t		rui_nextents;	/* # extents to free */
> +	uint64_t		rui_id;		/* rui identifier */
>  	struct xfs_map_extent	rui_extents[];	/* array of extents to rmap */
>  };
>  
> @@ -680,19 +680,19 @@ xfs_rui_log_format_sizeof(
>   * size is given by rud_nextents;
>   */
>  struct xfs_rud_log_format {
> -	__uint16_t		rud_type;	/* rud log item type */
> -	__uint16_t		rud_size;	/* size of this item */
> -	__uint32_t		__pad;
> -	__uint64_t		rud_rui_id;	/* id of corresponding rui */
> +	uint16_t		rud_type;	/* rud log item type */
> +	uint16_t		rud_size;	/* size of this item */
> +	uint32_t		__pad;
> +	uint64_t		rud_rui_id;	/* id of corresponding rui */
>  };
>  
>  /*
>   * CUI/CUD (refcount update) log format definitions
>   */
>  struct xfs_phys_extent {
> -	__uint64_t		pe_startblock;
> -	__uint32_t		pe_len;
> -	__uint32_t		pe_flags;
> +	uint64_t		pe_startblock;
> +	uint32_t		pe_len;
> +	uint32_t		pe_flags;
>  };
>  
>  /* refcount pe_flags: upper bits are flags, lower byte is type code */
> @@ -707,10 +707,10 @@ struct xfs_phys_extent {
>   * size is given by cui_nextents.
>   */
>  struct xfs_cui_log_format {
> -	__uint16_t		cui_type;	/* cui log item type */
> -	__uint16_t		cui_size;	/* size of this item */
> -	__uint32_t		cui_nextents;	/* # extents to free */
> -	__uint64_t		cui_id;		/* cui identifier */
> +	uint16_t		cui_type;	/* cui log item type */
> +	uint16_t		cui_size;	/* size of this item */
> +	uint32_t		cui_nextents;	/* # extents to free */
> +	uint64_t		cui_id;		/* cui identifier */
>  	struct xfs_phys_extent	cui_extents[];	/* array of extents */
>  };
>  
> @@ -728,10 +728,10 @@ xfs_cui_log_format_sizeof(
>   * size is given by cud_nextents;
>   */
>  struct xfs_cud_log_format {
> -	__uint16_t		cud_type;	/* cud log item type */
> -	__uint16_t		cud_size;	/* size of this item */
> -	__uint32_t		__pad;
> -	__uint64_t		cud_cui_id;	/* id of corresponding cui */
> +	uint16_t		cud_type;	/* cud log item type */
> +	uint16_t		cud_size;	/* size of this item */
> +	uint32_t		__pad;
> +	uint64_t		cud_cui_id;	/* id of corresponding cui */
>  };
>  
>  /*
> @@ -755,10 +755,10 @@ struct xfs_cud_log_format {
>   * size is given by bui_nextents.
>   */
>  struct xfs_bui_log_format {
> -	__uint16_t		bui_type;	/* bui log item type */
> -	__uint16_t		bui_size;	/* size of this item */
> -	__uint32_t		bui_nextents;	/* # extents to free */
> -	__uint64_t		bui_id;		/* bui identifier */
> +	uint16_t		bui_type;	/* bui log item type */
> +	uint16_t		bui_size;	/* size of this item */
> +	uint32_t		bui_nextents;	/* # extents to free */
> +	uint64_t		bui_id;		/* bui identifier */
>  	struct xfs_map_extent	bui_extents[];	/* array of extents to bmap */
>  };
>  
> @@ -776,10 +776,10 @@ xfs_bui_log_format_sizeof(
>   * size is given by bud_nextents;
>   */
>  struct xfs_bud_log_format {
> -	__uint16_t		bud_type;	/* bud log item type */
> -	__uint16_t		bud_size;	/* size of this item */
> -	__uint32_t		__pad;
> -	__uint64_t		bud_bui_id;	/* id of corresponding bui */
> +	uint16_t		bud_type;	/* bud log item type */
> +	uint16_t		bud_size;	/* size of this item */
> +	uint32_t		__pad;
> +	uint64_t		bud_bui_id;	/* id of corresponding bui */
>  };
>  
>  /*
> @@ -789,12 +789,12 @@ struct xfs_bud_log_format {
>   * 32 bits : log_recovery code assumes that.
>   */
>  typedef struct xfs_dq_logformat {
> -	__uint16_t		qlf_type;      /* dquot log item type */
> -	__uint16_t		qlf_size;      /* size of this item */
> +	uint16_t		qlf_type;      /* dquot log item type */
> +	uint16_t		qlf_size;      /* size of this item */
>  	xfs_dqid_t		qlf_id;	       /* usr/grp/proj id : 32 bits */
> -	__int64_t		qlf_blkno;     /* blkno of dquot buffer */
> -	__int32_t		qlf_len;       /* len of dquot buffer */
> -	__uint32_t		qlf_boffset;   /* off of dquot in buffer */
> +	int64_t			qlf_blkno;     /* blkno of dquot buffer */
> +	int32_t			qlf_len;       /* len of dquot buffer */
> +	uint32_t		qlf_boffset;   /* off of dquot in buffer */
>  } xfs_dq_logformat_t;
>  
>  /*
> @@ -853,8 +853,8 @@ typedef struct xfs_qoff_logformat {
>   * decoding can be done correctly.
>   */
>  struct xfs_icreate_log {
> -	__uint16_t	icl_type;	/* type of log format structure */
> -	__uint16_t	icl_size;	/* size of log format structure */
> +	uint16_t	icl_type;	/* type of log format structure */
> +	uint16_t	icl_size;	/* size of log format structure */
>  	__be32		icl_ag;		/* ag being allocated in */
>  	__be32		icl_agbno;	/* start block of inode range */
>  	__be32		icl_count;	/* number of inodes to initialise */
> diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h
> index 8eed512..d69c772 100644
> --- a/libxfs/xfs_quota_defs.h
> +++ b/libxfs/xfs_quota_defs.h
> @@ -27,8 +27,8 @@
>   * they may need 64-bit accounting. Hence, 64-bit quota-counters,
>   * and quota-limits. This is a waste in the common case, but hey ...
>   */
> -typedef __uint64_t	xfs_qcnt_t;
> -typedef __uint16_t	xfs_qwarncnt_t;
> +typedef uint64_t	xfs_qcnt_t;
> +typedef uint16_t	xfs_qwarncnt_t;
>  
>  /*
>   * flags for q_flags field in the dquot.
> diff --git a/libxfs/xfs_refcount_btree.c b/libxfs/xfs_refcount_btree.c
> index 2814f94..bd1a8f2 100644
> --- a/libxfs/xfs_refcount_btree.c
> +++ b/libxfs/xfs_refcount_btree.c
> @@ -201,7 +201,7 @@ xfs_refcountbt_init_ptr_from_cur(
>  	ptr->s = agf->agf_refcount_root;
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_refcountbt_key_diff(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*key)
> @@ -209,16 +209,16 @@ xfs_refcountbt_key_diff(
>  	struct xfs_refcount_irec	*rec = &cur->bc_rec.rc;
>  	struct xfs_refcount_key		*kp = &key->refc;
>  
> -	return (__int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
> +	return (int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_refcountbt_diff_two_keys(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*k1,
>  	union xfs_btree_key	*k2)
>  {
> -	return (__int64_t)be32_to_cpu(k1->refc.rc_startblock) -
> +	return (int64_t)be32_to_cpu(k1->refc.rc_startblock) -
>  			  be32_to_cpu(k2->refc.rc_startblock);
>  }
>  
> diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c
> index f78771d..0d6b5d4 100644
> --- a/libxfs/xfs_rmap.c
> +++ b/libxfs/xfs_rmap.c
> @@ -2059,7 +2059,7 @@ int
>  xfs_rmap_finish_one(
>  	struct xfs_trans		*tp,
>  	enum xfs_rmap_intent_type	type,
> -	__uint64_t			owner,
> +	uint64_t			owner,
>  	int				whichfork,
>  	xfs_fileoff_t			startoff,
>  	xfs_fsblock_t			startblock,
> @@ -2180,7 +2180,7 @@ __xfs_rmap_add(
>  	struct xfs_mount		*mp,
>  	struct xfs_defer_ops		*dfops,
>  	enum xfs_rmap_intent_type	type,
> -	__uint64_t			owner,
> +	uint64_t			owner,
>  	int				whichfork,
>  	struct xfs_bmbt_irec		*bmap)
>  {
> @@ -2264,7 +2264,7 @@ xfs_rmap_alloc_extent(
>  	xfs_agnumber_t		agno,
>  	xfs_agblock_t		bno,
>  	xfs_extlen_t		len,
> -	__uint64_t		owner)
> +	uint64_t		owner)
>  {
>  	struct xfs_bmbt_irec	bmap;
>  
> @@ -2288,7 +2288,7 @@ xfs_rmap_free_extent(
>  	xfs_agnumber_t		agno,
>  	xfs_agblock_t		bno,
>  	xfs_extlen_t		len,
> -	__uint64_t		owner)
> +	uint64_t		owner)
>  {
>  	struct xfs_bmbt_irec	bmap;
>  
> diff --git a/libxfs/xfs_rmap.h b/libxfs/xfs_rmap.h
> index 98f908f..265116d 100644
> --- a/libxfs/xfs_rmap.h
> +++ b/libxfs/xfs_rmap.h
> @@ -179,7 +179,7 @@ enum xfs_rmap_intent_type {
>  struct xfs_rmap_intent {
>  	struct list_head			ri_list;
>  	enum xfs_rmap_intent_type		ri_type;
> -	__uint64_t				ri_owner;
> +	uint64_t				ri_owner;
>  	int					ri_whichfork;
>  	struct xfs_bmbt_irec			ri_bmap;
>  };
> @@ -196,15 +196,15 @@ int xfs_rmap_convert_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
>  		struct xfs_bmbt_irec *imap);
>  int xfs_rmap_alloc_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
>  		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
> -		__uint64_t owner);
> +		uint64_t owner);
>  int xfs_rmap_free_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
>  		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
> -		__uint64_t owner);
> +		uint64_t owner);
>  
>  void xfs_rmap_finish_one_cleanup(struct xfs_trans *tp,
>  		struct xfs_btree_cur *rcur, int error);
>  int xfs_rmap_finish_one(struct xfs_trans *tp, enum xfs_rmap_intent_type type,
> -		__uint64_t owner, int whichfork, xfs_fileoff_t startoff,
> +		uint64_t owner, int whichfork, xfs_fileoff_t startoff,
>  		xfs_fsblock_t startblock, xfs_filblks_t blockcount,
>  		xfs_exntst_t state, struct xfs_btree_cur **pcur);
>  
> diff --git a/libxfs/xfs_rmap_btree.c b/libxfs/xfs_rmap_btree.c
> index a186c87..45ac436 100644
> --- a/libxfs/xfs_rmap_btree.c
> +++ b/libxfs/xfs_rmap_btree.c
> @@ -197,7 +197,7 @@ xfs_rmapbt_init_high_key_from_rec(
>  	union xfs_btree_key	*key,
>  	union xfs_btree_rec	*rec)
>  {
> -	__uint64_t		off;
> +	uint64_t		off;
>  	int			adj;
>  
>  	adj = be32_to_cpu(rec->rmap.rm_blockcount) - 1;
> @@ -239,7 +239,7 @@ xfs_rmapbt_init_ptr_from_cur(
>  	ptr->s = agf->agf_roots[cur->bc_btnum];
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_rmapbt_key_diff(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*key)
> @@ -247,9 +247,9 @@ xfs_rmapbt_key_diff(
>  	struct xfs_rmap_irec	*rec = &cur->bc_rec.r;
>  	struct xfs_rmap_key	*kp = &key->rmap;
>  	__u64			x, y;
> -	__int64_t		d;
> +	int64_t			d;
>  
> -	d = (__int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
> +	d = (int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
>  	if (d)
>  		return d;
>  
> @@ -269,7 +269,7 @@ xfs_rmapbt_key_diff(
>  	return 0;
>  }
>  
> -STATIC __int64_t
> +STATIC int64_t
>  xfs_rmapbt_diff_two_keys(
>  	struct xfs_btree_cur	*cur,
>  	union xfs_btree_key	*k1,
> @@ -277,10 +277,10 @@ xfs_rmapbt_diff_two_keys(
>  {
>  	struct xfs_rmap_key	*kp1 = &k1->rmap;
>  	struct xfs_rmap_key	*kp2 = &k2->rmap;
> -	__int64_t		d;
> +	int64_t			d;
>  	__u64			x, y;
>  
> -	d = (__int64_t)be32_to_cpu(kp1->rm_startblock) -
> +	d = (int64_t)be32_to_cpu(kp1->rm_startblock) -
>  		       be32_to_cpu(kp2->rm_startblock);
>  	if (d)
>  		return d;
> @@ -382,10 +382,10 @@ xfs_rmapbt_keys_inorder(
>  	union xfs_btree_key	*k1,
>  	union xfs_btree_key	*k2)
>  {
> -	__uint32_t		x;
> -	__uint32_t		y;
> -	__uint64_t		a;
> -	__uint64_t		b;
> +	uint32_t		x;
> +	uint32_t		y;
> +	uint64_t		a;
> +	uint64_t		b;
>  
>  	x = be32_to_cpu(k1->rmap.rm_startblock);
>  	y = be32_to_cpu(k2->rmap.rm_startblock);
> @@ -412,10 +412,10 @@ xfs_rmapbt_recs_inorder(
>  	union xfs_btree_rec	*r1,
>  	union xfs_btree_rec	*r2)
>  {
> -	__uint32_t		x;
> -	__uint32_t		y;
> -	__uint64_t		a;
> -	__uint64_t		b;
> +	uint32_t		x;
> +	uint32_t		y;
> +	uint64_t		a;
> +	uint64_t		b;
>  
>  	x = be32_to_cpu(r1->rmap.rm_startblock);
>  	y = be32_to_cpu(r2->rmap.rm_startblock);
> diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
> index dbd2f88..8f8a99d 100644
> --- a/libxfs/xfs_rtbitmap.c
> +++ b/libxfs/xfs_rtbitmap.c
> @@ -1006,7 +1006,7 @@ xfs_rtfree_extent(
>  	    mp->m_sb.sb_rextents) {
>  		if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM))
>  			mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM;
> -		*(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
> +		*(uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
>  		xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE);
>  	}
>  	return 0;
> diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
> index 93a1819..51f6970 100644
> --- a/libxfs/xfs_sb.c
> +++ b/libxfs/xfs_sb.c
> @@ -430,7 +430,7 @@ xfs_sb_quota_to_disk(
>  	struct xfs_dsb	*to,
>  	struct xfs_sb	*from)
>  {
> -	__uint16_t	qflags = from->sb_qflags;
> +	uint16_t	qflags = from->sb_qflags;
>  
>  	to->sb_uquotino = cpu_to_be64(from->sb_uquotino);
>  	if (xfs_sb_version_has_pquotino(from)) {
> @@ -738,7 +738,7 @@ xfs_sb_mount_common(
>  	mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2;
>  
>  	mp->m_bsize = XFS_FSB_TO_BB(mp, 1);
> -	mp->m_ialloc_inos = (int)MAX((__uint16_t)XFS_INODES_PER_CHUNK,
> +	mp->m_ialloc_inos = (int)MAX((uint16_t)XFS_INODES_PER_CHUNK,
>  					sbp->sb_inopblock);
>  	mp->m_ialloc_blks = mp->m_ialloc_inos >> sbp->sb_inopblog;
>  
> diff --git a/libxfs/xfs_types.h b/libxfs/xfs_types.h
> index 717909f..0220159 100644
> --- a/libxfs/xfs_types.h
> +++ b/libxfs/xfs_types.h
> @@ -18,34 +18,34 @@
>  #ifndef __XFS_TYPES_H__
>  #define	__XFS_TYPES_H__
>  
> -typedef __uint32_t	prid_t;		/* project ID */
> +typedef uint32_t	prid_t;		/* project ID */
>  
> -typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
> -typedef	__uint32_t	xfs_agino_t;	/* inode # within allocation grp */
> -typedef	__uint32_t	xfs_extlen_t;	/* extent length in blocks */
> -typedef	__uint32_t	xfs_agnumber_t;	/* allocation group number */
> -typedef __int32_t	xfs_extnum_t;	/* # of extents in a file */
> -typedef __int16_t	xfs_aextnum_t;	/* # extents in an attribute fork */
> -typedef	__int64_t	xfs_fsize_t;	/* bytes in a file */
> -typedef __uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
> +typedef uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
> +typedef uint32_t	xfs_agino_t;	/* inode # within allocation grp */
> +typedef uint32_t	xfs_extlen_t;	/* extent length in blocks */
> +typedef uint32_t	xfs_agnumber_t;	/* allocation group number */
> +typedef int32_t		xfs_extnum_t;	/* # of extents in a file */
> +typedef int16_t		xfs_aextnum_t;	/* # extents in an attribute fork */
> +typedef int64_t		xfs_fsize_t;	/* bytes in a file */
> +typedef uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
>  
> -typedef	__int32_t	xfs_suminfo_t;	/* type of bitmap summary info */
> -typedef	__int32_t	xfs_rtword_t;	/* word type for bitmap manipulations */
> +typedef int32_t		xfs_suminfo_t;	/* type of bitmap summary info */
> +typedef int32_t		xfs_rtword_t;	/* word type for bitmap manipulations */
>  
> -typedef	__int64_t	xfs_lsn_t;	/* log sequence number */
> -typedef	__int32_t	xfs_tid_t;	/* transaction identifier */
> +typedef int64_t		xfs_lsn_t;	/* log sequence number */
> +typedef int32_t		xfs_tid_t;	/* transaction identifier */
>  
> -typedef	__uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
> -typedef	__uint32_t	xfs_dahash_t;	/* dir/attr hash value */
> +typedef uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
> +typedef uint32_t	xfs_dahash_t;	/* dir/attr hash value */
>  
> -typedef	__uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
> -typedef __uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
> -typedef __uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
> -typedef __uint64_t	xfs_fileoff_t;	/* block number in a file */
> -typedef __uint64_t	xfs_filblks_t;	/* number of blocks in a file */
> +typedef uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
> +typedef uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
> +typedef uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
> +typedef uint64_t	xfs_fileoff_t;	/* block number in a file */
> +typedef uint64_t	xfs_filblks_t;	/* number of blocks in a file */
>  
> -typedef	__int64_t	xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
> -typedef __int64_t	xfs_sfiloff_t;	/* signed block number in a file */
> +typedef int64_t		xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
> +typedef int64_t		xfs_sfiloff_t;	/* signed block number in a file */
>  
>  /*
>   * Null values for the types.
> @@ -125,7 +125,7 @@ struct xfs_name {
>   * uid_t and gid_t are hard-coded to 32 bits in the inode.
>   * Hence, an 'id' in a dquot is 32 bits..
>   */
> -typedef __uint32_t	xfs_dqid_t;
> +typedef uint32_t	xfs_dqid_t;
>  
>  /*
>   * Constants for bit manipulations.
> diff --git a/logprint/log_misc.c b/logprint/log_misc.c
> index 0dfcfd1..fe27f15 100644
> --- a/logprint/log_misc.c
> +++ b/logprint/log_misc.c
> @@ -166,12 +166,12 @@ xlog_print_trans_header(char **ptr, int len)
>  {
>      xfs_trans_header_t  *h;
>      char		*cptr = *ptr;
> -    __uint32_t          magic;
> +    uint32_t          magic;
>      char                *magic_c = (char *)&magic;
>  
>      *ptr += len;
>  
> -    magic=*(__uint32_t*)cptr; /* XXX be32_to_cpu soon */
> +    magic=*(uint32_t*)cptr; /* XXX be32_to_cpu soon */
>  
>      if (len >= 4) {
>  #if __BYTE_ORDER == __LITTLE_ENDIAN
> @@ -201,7 +201,7 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
>      int			 num, skip;
>      int			 super_block = 0;
>      int			 bucket, col, buckets;
> -    __int64_t		 blkno;
> +    int64_t			 blkno;
>      xfs_buf_log_format_t lbuf;
>      int			 size, blen, map_size, struct_size;
>      __be64		 x, y;
> diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
> index 0d399f1..0667e39 100644
> --- a/mdrestore/xfs_mdrestore.c
> +++ b/mdrestore/xfs_mdrestore.c
> @@ -65,7 +65,7 @@ perform_restore(
>  	int			mb_count;
>  	xfs_metablock_t		tmb;
>  	xfs_sb_t		sb;
> -	__int64_t		bytes_read;
> +	int64_t			bytes_read;
>  
>  	/*
>  	 * read in first blocks (superblock 0), set "inprogress" flag for it,
> diff --git a/mkfs/proto.c b/mkfs/proto.c
> index 89cd237..cf8cc39 100644
> --- a/mkfs/proto.c
> +++ b/mkfs/proto.c
> @@ -667,7 +667,7 @@ rtinit(
>  	mp->m_sb.sb_rbmino = rbmip->i_ino;
>  	rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
>  	rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
> -	*(__uint64_t *)&VFS_I(rbmip)->i_atime = 0;
> +	*(uint64_t *)&VFS_I(rbmip)->i_atime = 0;
>  	libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
>  	libxfs_log_sb(tp);
>  	mp->m_rbmip = rbmip;
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 930f3d2..45ab83c 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -708,9 +708,9 @@ struct opt_params mopts = {
>  	},
>  };
>  
> -#define TERABYTES(count, blog)	((__uint64_t)(count) << (40 - (blog)))
> -#define GIGABYTES(count, blog)	((__uint64_t)(count) << (30 - (blog)))
> -#define MEGABYTES(count, blog)	((__uint64_t)(count) << (20 - (blog)))
> +#define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
> +#define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
> +#define MEGABYTES(count, blog)	((uint64_t)(count) << (20 - (blog)))
>  
>  /*
>   * Use this macro before we have superblock and mount structure
> @@ -881,7 +881,7 @@ fixup_log_stripe_unit(
>  	xfs_rfsblock_t	*logblocks,
>  	int		blocklog)
>  {
> -	__uint64_t	tmp_logblocks;
> +	uint64_t	tmp_logblocks;
>  
>  	/*
>  	 * Make sure that the log size is a multiple of the stripe unit
> @@ -913,7 +913,7 @@ fixup_internal_log_stripe(
>  	xfs_mount_t	*mp,
>  	int		lsflag,
>  	xfs_fsblock_t	logstart,
> -	__uint64_t	agsize,
> +	uint64_t	agsize,
>  	int		sunit,
>  	xfs_rfsblock_t	*logblocks,
>  	int		blocklog,
> @@ -937,7 +937,7 @@ fixup_internal_log_stripe(
>  }
>  
>  void
> -validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks)
> +validate_log_size(uint64_t logblocks, int blocklog, int min_logblocks)
>  {
>  	if (logblocks < min_logblocks) {
>  		fprintf(stderr,
> @@ -962,7 +962,7 @@ validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks)
>  static int
>  calc_default_imaxpct(
>  	int		blocklog,
> -	__uint64_t	dblocks)
> +	uint64_t	dblocks)
>  {
>  	/*
>  	 * This returns the % of the disk space that is used for
> @@ -984,9 +984,9 @@ calc_default_imaxpct(
>  static void
>  validate_ag_geometry(
>  	int		blocklog,
> -	__uint64_t	dblocks,
> -	__uint64_t	agsize,
> -	__uint64_t	agcount)
> +	uint64_t	dblocks,
> +	uint64_t	agsize,
> +	uint64_t	agcount)
>  {
>  	if (agsize < XFS_AG_MIN_BLOCKS(blocklog)) {
>  		fprintf(stderr,
> @@ -1062,7 +1062,7 @@ zero_old_xfs_structures(
>  {
>  	void 			*buf;
>  	xfs_sb_t 		sb;
> -	__uint32_t		bsize;
> +	uint32_t		bsize;
>  	int			i;
>  	xfs_off_t		off;
>  
> @@ -1115,8 +1115,8 @@ zero_old_xfs_structures(
>  			i != sb.sb_blocklog)
>  		goto done;
>  
> -	if (sb.sb_dblocks > ((__uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
> -			sb.sb_dblocks < ((__uint64_t)(sb.sb_agcount - 1) *
> +	if (sb.sb_dblocks > ((uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
> +			sb.sb_dblocks < ((uint64_t)(sb.sb_agcount - 1) *
>  					 sb.sb_agblocks + XFS_MIN_AG_BLOCKS))
>  		goto done;
>  
> @@ -1136,7 +1136,7 @@ zero_old_xfs_structures(
>  }
>  
>  static void
> -discard_blocks(dev_t dev, __uint64_t nsectors)
> +discard_blocks(dev_t dev, uint64_t nsectors)
>  {
>  	int fd;
>  
> @@ -1398,11 +1398,11 @@ main(
>  	int			argc,
>  	char			**argv)
>  {
> -	__uint64_t		agcount;
> +	uint64_t		agcount;
>  	xfs_agf_t		*agf;
>  	xfs_agi_t		*agi;
>  	xfs_agnumber_t		agno;
> -	__uint64_t		agsize;
> +	uint64_t		agsize;
>  	xfs_alloc_rec_t		*arec;
>  	struct xfs_btree_block	*block;
>  	int			blflag;
> @@ -1477,10 +1477,10 @@ main(
>  	char			*rtsize;
>  	xfs_sb_t		*sbp;
>  	int			sectorlog;
> -	__uint64_t		sector_mask;
> +	uint64_t		sector_mask;
>  	int			slflag;
>  	int			ssflag;
> -	__uint64_t		tmp_agsize;
> +	uint64_t		tmp_agsize;
>  	uuid_t			uuid;
>  	int			worst_freelist;
>  	libxfs_init_t		xi;
> @@ -2165,7 +2165,7 @@ _("rmapbt not supported with realtime devices\n"));
>  
>  
>  	if (dsize) {
> -		__uint64_t dbytes;
> +		uint64_t dbytes;
>  
>  		dbytes = getnum(dsize, &dopts, D_SIZE);
>  		if (dbytes % XFS_MIN_BLOCKSIZE) {
> @@ -2197,7 +2197,7 @@ _("rmapbt not supported with realtime devices\n"));
>  	}
>  
>  	if (logsize) {
> -		__uint64_t logbytes;
> +		uint64_t logbytes;
>  
>  		logbytes = getnum(logsize, &lopts, L_SIZE);
>  		if (logbytes % XFS_MIN_BLOCKSIZE) {
> @@ -2214,7 +2214,7 @@ _("rmapbt not supported with realtime devices\n"));
>  				(long long)(logblocks << blocklog));
>  	}
>  	if (rtsize) {
> -		__uint64_t rtbytes;
> +		uint64_t rtbytes;
>  
>  		rtbytes = getnum(rtsize, &ropts, R_SIZE);
>  		if (rtbytes % XFS_MIN_BLOCKSIZE) {
> @@ -2234,7 +2234,7 @@ _("rmapbt not supported with realtime devices\n"));
>  	 * If specified, check rt extent size against its constraints.
>  	 */
>  	if (rtextsize) {
> -		__uint64_t rtextbytes;
> +		uint64_t rtextbytes;
>  
>  		rtextbytes = getnum(rtextsize, &ropts, R_EXTSIZE);
>  		if (rtextbytes % blocksize) {
> @@ -2250,8 +2250,8 @@ _("rmapbt not supported with realtime devices\n"));
>  		 * and the underlying volume is striped, then set rtextblocks
>  		 * to the stripe width.
>  		 */
> -		__uint64_t	rswidth;
> -		__uint64_t	rtextbytes;
> +		uint64_t	rswidth;
> +		uint64_t	rtextbytes;
>  
>  		if (!norsflag && !xi.risfile && !(!rtsize && xi.disfile))
>  			rswidth = ft.rtswidth;
> @@ -2329,10 +2329,10 @@ _("rmapbt not supported with realtime devices\n"));
>  	 * multiple of the sector size, or 1024, whichever is larger.
>  	 */
>  
> -	sector_mask = (__uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
> +	sector_mask = (uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
>  	xi.dsize &= sector_mask;
>  	xi.rtsize &= sector_mask;
> -	xi.logBBsize &= (__uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
> +	xi.logBBsize &= (uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
>  
>  
>  	/* don't do discards on print-only runs or on files */
> @@ -2689,9 +2689,9 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
>  	mp = &mbuf;
>  	sbp = &mp->m_sb;
>  	memset(mp, 0, sizeof(xfs_mount_t));
> -	sbp->sb_blocklog = (__uint8_t)blocklog;
> -	sbp->sb_sectlog = (__uint8_t)sectorlog;
> -	sbp->sb_agblklog = (__uint8_t)libxfs_log2_roundup((unsigned int)agsize);
> +	sbp->sb_blocklog = (uint8_t)blocklog;
> +	sbp->sb_sectlog = (uint8_t)sectorlog;
> +	sbp->sb_agblklog = (uint8_t)libxfs_log2_roundup((unsigned int)agsize);
>  	sbp->sb_agblocks = (xfs_agblock_t)agsize;
>  	mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
>  	mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
> @@ -2798,14 +2798,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
>  	sbp->sb_agcount = (xfs_agnumber_t)agcount;
>  	sbp->sb_rbmblocks = nbmblocks;
>  	sbp->sb_logblocks = (xfs_extlen_t)logblocks;
> -	sbp->sb_sectsize = (__uint16_t)sectorsize;
> -	sbp->sb_inodesize = (__uint16_t)isize;
> -	sbp->sb_inopblock = (__uint16_t)(blocksize / isize);
> -	sbp->sb_sectlog = (__uint8_t)sectorlog;
> -	sbp->sb_inodelog = (__uint8_t)inodelog;
> -	sbp->sb_inopblog = (__uint8_t)(blocklog - inodelog);
> +	sbp->sb_sectsize = (uint16_t)sectorsize;
> +	sbp->sb_inodesize = (uint16_t)isize;
> +	sbp->sb_inopblock = (uint16_t)(blocksize / isize);
> +	sbp->sb_sectlog = (uint8_t)sectorlog;
> +	sbp->sb_inodelog = (uint8_t)inodelog;
> +	sbp->sb_inopblog = (uint8_t)(blocklog - inodelog);
>  	sbp->sb_rextslog =
> -		(__uint8_t)(rtextents ?
> +		(uint8_t)(rtextents ?
>  			libxfs_highbit32((unsigned int)rtextents) : 0);
>  	sbp->sb_inprogress = 1;	/* mkfs is in progress */
>  	sbp->sb_imax_pct = imaxpct;
> @@ -2833,8 +2833,8 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
>  	} else
>  		sbp->sb_inoalignmt = 0;
>  	if (lsectorsize != BBSIZE || sectorsize != BBSIZE) {
> -		sbp->sb_logsectlog = (__uint8_t)lsectorlog;
> -		sbp->sb_logsectsize = (__uint16_t)lsectorsize;
> +		sbp->sb_logsectlog = (uint8_t)lsectorlog;
> +		sbp->sb_logsectsize = (uint16_t)lsectorsize;
>  	} else {
>  		sbp->sb_logsectlog = 0;
>  		sbp->sb_logsectsize = 0;
> diff --git a/quota/edit.c b/quota/edit.c
> index 36b327a..8418e85 100644
> --- a/quota/edit.c
> +++ b/quota/edit.c
> @@ -115,16 +115,16 @@ warn_help(void)
>  
>  static void
>  set_limits(
> -	__uint32_t	id,
> +	uint32_t	id,
>  	uint		type,
>  	uint		mask,
>  	char		*dev,
> -	__uint64_t	*bsoft,
> -	__uint64_t	*bhard,
> -	__uint64_t	*isoft,
> -	__uint64_t	*ihard,
> -	__uint64_t	*rtbsoft,
> -	__uint64_t	*rtbhard)
> +	uint64_t	*bsoft,
> +	uint64_t	*bhard,
> +	uint64_t	*isoft,
> +	uint64_t	*ihard,
> +	uint64_t	*rtbsoft,
> +	uint64_t	*rtbhard)
>  {
>  	fs_disk_quota_t	d;
>  
> @@ -152,12 +152,12 @@ set_user_limits(
>  	char		*name,
>  	uint		type,
>  	uint		mask,
> -	__uint64_t	*bsoft,
> -	__uint64_t	*bhard,
> -	__uint64_t	*isoft,
> -	__uint64_t	*ihard,
> -	__uint64_t	*rtbsoft,
> -	__uint64_t	*rtbhard)
> +	uint64_t	*bsoft,
> +	uint64_t	*bhard,
> +	uint64_t	*isoft,
> +	uint64_t	*ihard,
> +	uint64_t	*rtbsoft,
> +	uint64_t	*rtbhard)
>  {
>  	uid_t		uid = uid_from_string(name);
>  
> @@ -175,12 +175,12 @@ set_group_limits(
>  	char		*name,
>  	uint		type,
>  	uint		mask,
> -	__uint64_t	*bsoft,
> -	__uint64_t	*bhard,
> -	__uint64_t	*isoft,
> -	__uint64_t	*ihard,
> -	__uint64_t	*rtbsoft,
> -	__uint64_t	*rtbhard)
> +	uint64_t	*bsoft,
> +	uint64_t	*bhard,
> +	uint64_t	*isoft,
> +	uint64_t	*ihard,
> +	uint64_t	*rtbsoft,
> +	uint64_t	*rtbhard)
>  {
>  	gid_t		gid = gid_from_string(name);
>  
> @@ -198,12 +198,12 @@ set_project_limits(
>  	char		*name,
>  	uint		type,
>  	uint		mask,
> -	__uint64_t	*bsoft,
> -	__uint64_t	*bhard,
> -	__uint64_t	*isoft,
> -	__uint64_t	*ihard,
> -	__uint64_t	*rtbsoft,
> -	__uint64_t	*rtbhard)
> +	uint64_t	*bsoft,
> +	uint64_t	*bhard,
> +	uint64_t	*isoft,
> +	uint64_t	*ihard,
> +	uint64_t	*rtbsoft,
> +	uint64_t	*rtbhard)
>  {
>  	prid_t		prid = prid_from_string(name);
>  
> @@ -224,7 +224,7 @@ extractb(
>  	int		length,
>  	uint		blocksize,
>  	uint		sectorsize,
> -	__uint64_t	*value)
> +	uint64_t	*value)
>  {
>  	long long	v;
>  	char		*s = string;
> @@ -238,7 +238,7 @@ extractb(
>  				progname, s);
>  			return 0;
>  		}
> -		*value = (__uint64_t)v >> 9;	/* syscalls use basic blocks */
> +		*value = (uint64_t)v >> 9;	/* syscalls use basic blocks */
>  		if (v > 0 && *value == 0)
>  			fprintf(stderr, _("%s: Warning: `%s' in quota blocks is 0 (unlimited).\n"), progname, s);
>  		return 1;
> @@ -252,7 +252,7 @@ extracti(
>  	char		*string,
>  	const char	*prefix,
>  	int		length,
> -	__uint64_t	*value)
> +	uint64_t	*value)
>  {
>  	char		*sp, *s = string;
>  
> @@ -270,7 +270,7 @@ limit_f(
>  	char		**argv)
>  {
>  	char		*name;
> -	__uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
> +	uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
>  	int		c, type = 0, mask = 0, flags = 0;
>  	uint		bsize, ssize, endoptions;
>  
> @@ -384,8 +384,8 @@ restore_file(
>  	char		*dev = NULL;
>  	uint		mask;
>  	int		cnt;
> -	__uint32_t	id;
> -	__uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
> +	uint32_t	id;
> +	uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
>  
>  	while (fgets(buffer, sizeof(buffer), fp) != NULL) {
>  		if (strncmp("fs = ", buffer, 5) == 0) {
> @@ -546,7 +546,7 @@ timer_f(
>  
>  static void
>  set_warnings(
> -	__uint32_t	id,
> +	uint32_t	id,
>  	uint		type,
>  	uint		mask,
>  	char		*dev,
> diff --git a/quota/free.c b/quota/free.c
> index cee15ee..1f8378d 100644
> --- a/quota/free.c
> +++ b/quota/free.c
> @@ -49,20 +49,20 @@ free_help(void)
>  static int
>  mount_free_space_data(
>  	struct fs_path		*mount,
> -	__uint64_t		*bcount,
> -	__uint64_t		*bused,
> -	__uint64_t		*bfree,
> -	__uint64_t		*icount,
> -	__uint64_t		*iused,
> -	__uint64_t		*ifree,
> -	__uint64_t		*rcount,
> -	__uint64_t		*rused,
> -	__uint64_t		*rfree)
> +	uint64_t		*bcount,
> +	uint64_t		*bused,
> +	uint64_t		*bfree,
> +	uint64_t		*icount,
> +	uint64_t		*iused,
> +	uint64_t		*ifree,
> +	uint64_t		*rcount,
> +	uint64_t		*rused,
> +	uint64_t		*rfree)
>  {
>  	struct xfs_fsop_counts	fscounts;
>  	struct xfs_fsop_geom	fsgeo;
>  	struct statfs		st;
> -	__uint64_t		logsize, count, free;
> +	uint64_t		logsize, count, free;
>  	int			fd;
>  
>  	if ((fd = open(mount->fs_dir, O_RDONLY)) < 0) {
> @@ -132,15 +132,15 @@ mount_free_space_data(
>  static int
>  projects_free_space_data(
>  	struct fs_path		*path,
> -	__uint64_t		*bcount,
> -	__uint64_t		*bused,
> -	__uint64_t		*bfree,
> -	__uint64_t		*icount,
> -	__uint64_t		*iused,
> -	__uint64_t		*ifree,
> -	__uint64_t		*rcount,
> -	__uint64_t		*rused,
> -	__uint64_t		*rfree)
> +	uint64_t		*bcount,
> +	uint64_t		*bused,
> +	uint64_t		*bfree,
> +	uint64_t		*icount,
> +	uint64_t		*iused,
> +	uint64_t		*ifree,
> +	uint64_t		*rcount,
> +	uint64_t		*rused,
> +	uint64_t		*rfree)
>  {
>  	fs_quota_stat_t		qfs;
>  	fs_disk_quota_t		d;
> @@ -226,9 +226,9 @@ free_space(
>  	fs_path_t	*path,
>  	uint		flags)
>  {
> -	__uint64_t	bcount, bused, bfree;
> -	__uint64_t	icount, iused, ifree;
> -	__uint64_t	rcount, rused, rfree;
> +	uint64_t	bcount, bused, bfree;
> +	uint64_t	icount, iused, ifree;
> +	uint64_t	rcount, rused, rfree;
>  	char		a[8], s[8], u[8], p[8];
>  	int		count;
>  
> diff --git a/quota/quot.c b/quota/quot.c
> index ccc154f..6378fbb 100644
> --- a/quota/quot.c
> +++ b/quota/quot.c
> @@ -26,17 +26,17 @@
>  
>  typedef struct du {
>  	struct du	*next;
> -	__uint64_t	blocks;
> -	__uint64_t	blocks30;
> -	__uint64_t	blocks60;
> -	__uint64_t	blocks90;
> -	__uint64_t	nfiles;
> -	__uint32_t	id;
> +	uint64_t	blocks;
> +	uint64_t	blocks30;
> +	uint64_t	blocks60;
> +	uint64_t	blocks90;
> +	uint64_t	nfiles;
> +	uint32_t	id;
>  } du_t;
>  
>  #define	TSIZE		500
> -static __uint64_t	sizes[TSIZE];
> -static __uint64_t	overflow;
> +static uint64_t	sizes[TSIZE];
> +static uint64_t	overflow;
>  
>  #define	NDU		60000
>  #define	DUHASH		8209
> @@ -84,8 +84,8 @@ quot_bulkstat_add(
>  {
>  	du_t		*dp;
>  	du_t		**hp;
> -	__uint64_t	size;
> -	__uint32_t	i, id;
> +	uint64_t	size;
> +	uint32_t	i, id;
>  
>  	if ((p->bs_mode & S_IFMT) == 0)
>  		return;
> @@ -203,7 +203,7 @@ qcompare(
>  	return 0;
>  }
>  
> -typedef char *(*idtoname_t)(__uint32_t);
> +typedef char *(*idtoname_t)(uint32_t);
>  
>  static void
>  quot_report_mount_any_type(
> @@ -291,7 +291,7 @@ quot_histogram_mount(
>  	fs_path_t	*mount,
>  	uint		flags)
>  {
> -	__uint64_t	t = 0;
> +	uint64_t	t = 0;
>  	int		i;
>  
>  	fprintf(fp, _("%s (%s):\n"), mount->fs_name, mount->fs_dir);
> diff --git a/quota/quota.c b/quota/quota.c
> index d09e239..479b970 100644
> --- a/quota/quota.c
> +++ b/quota/quota.c
> @@ -52,7 +52,7 @@ quota_help(void)
>  static int
>  quota_mount(
>  	FILE		*fp,
> -	__uint32_t	id,
> +	uint32_t	id,
>  	char		*name,
>  	uint		form,
>  	uint		type,
> @@ -181,7 +181,7 @@ quota_mount(
>  static void
>  quota(
>  	FILE		*fp,
> -	__uint32_t	id,
> +	uint32_t	id,
>  	char		*name,
>  	uint		form,
>  	uint		type,
> diff --git a/quota/quota.h b/quota/quota.h
> index 4bde351..9ed28be 100644
> --- a/quota/quota.h
> +++ b/quota/quota.h
> @@ -53,9 +53,9 @@ enum {
>  extern char *type_to_string(uint __type);
>  extern char *form_to_string(uint __form);
>  extern char *time_to_string(time_t __time, uint __flags);
> -extern char *bbs_to_string(__uint64_t __v, char *__c, uint __size);
> -extern char *num_to_string(__uint64_t __v, char *__c, uint __size);
> -extern char *pct_to_string(__uint64_t __v, __uint64_t __t, char *__c, uint __s);
> +extern char *bbs_to_string(uint64_t __v, char *__c, uint __size);
> +extern char *num_to_string(uint64_t __v, char *__c, uint __size);
> +extern char *pct_to_string(uint64_t __v, uint64_t __t, char *__c, uint __s);
>  
>  extern FILE *fopen_write_secure(char *__filename);
>  
> @@ -81,7 +81,7 @@ enum {
>   * Identifier (uid/gid/prid) cache routines
>   */
>  #define NMAX 32
> -extern char *uid_to_name(__uint32_t __uid);
> -extern char *gid_to_name(__uint32_t __gid);
> -extern char *prid_to_name(__uint32_t __prid);
> +extern char *uid_to_name(uint32_t __uid);
> +extern char *gid_to_name(uint32_t __gid);
> +extern char *prid_to_name(uint32_t __prid);
>  extern bool isdigits_only(const char *);
> diff --git a/quota/report.c b/quota/report.c
> index d0509c2..b2ea3bb 100644
> --- a/quota/report.c
> +++ b/quota/report.c
> @@ -333,9 +333,9 @@ report_header(
>  static int
>  report_mount(
>  	FILE		*fp,
> -	__uint32_t	id,
> +	uint32_t	id,
>  	char		*name,
> -	__uint32_t	*oid,
> +	uint32_t	*oid,
>  	uint		form,
>  	uint		type,
>  	fs_path_t	*mount,
> diff --git a/quota/state.c b/quota/state.c
> index 09dfa70..b08bf50 100644
> --- a/quota/state.c
> +++ b/quota/state.c
> @@ -135,7 +135,7 @@ static void
>  state_timelimit(
>  	FILE		*fp,
>  	uint		form,
> -	__uint32_t	timelimit)
> +	uint32_t	timelimit)
>  {
>  	fprintf(fp, _("%s grace time: %s\n"),
>  		form_to_string(form),
> diff --git a/quota/util.c b/quota/util.c
> index cafd45f..37840a8 100644
> --- a/quota/util.c
> +++ b/quota/util.c
> @@ -94,8 +94,8 @@ round_snprintf(
>  	size_t		size,
>  	const char	*fmt_round,
>  	const char	*fmt_not_round,
> -	__uint64_t	value,
> -	__uint64_t	divisor)
> +	uint64_t	value,
> +	uint64_t	divisor)
>  {
>  	double		v = (double)value / divisor;
>  
> @@ -107,23 +107,23 @@ round_snprintf(
>  }
>  
>  /* Basic blocks (512) bytes are returned from quotactl */
> -#define BBS_TO_EXABYTES(bbs)	((__uint64_t)(bbs)>>51)
> -#define BBS_TO_PETABYTES(bbs)	((__uint64_t)(bbs)>>41)
> -#define BBS_TO_TERABYTES(bbs)	((__uint64_t)(bbs)>>31)
> -#define BBS_TO_GIGABYTES(bbs)	((__uint64_t)(bbs)>>21)
> -#define BBS_TO_MEGABYTES(bbs)	((__uint64_t)(bbs)>>11)
> -#define BBS_TO_KILOBYTES(bbs)	((__uint64_t)(bbs)>>1)
> -
> -#define BBEXABYTE		((__uint64_t)1<<51)
> -#define BBPETABYTE		((__uint64_t)1<<41)
> -#define BBTERABYTE		((__uint64_t)1<<31)
> -#define BBGIGABYTE		((__uint64_t)1<<21)
> -#define BBMEGABYTE		((__uint64_t)1<<11)
> -#define BBKILOBYTE		((__uint64_t)1<< 1)
> +#define BBS_TO_EXABYTES(bbs)	((uint64_t)(bbs)>>51)
> +#define BBS_TO_PETABYTES(bbs)	((uint64_t)(bbs)>>41)
> +#define BBS_TO_TERABYTES(bbs)	((uint64_t)(bbs)>>31)
> +#define BBS_TO_GIGABYTES(bbs)	((uint64_t)(bbs)>>21)
> +#define BBS_TO_MEGABYTES(bbs)	((uint64_t)(bbs)>>11)
> +#define BBS_TO_KILOBYTES(bbs)	((uint64_t)(bbs)>>1)
> +
> +#define BBEXABYTE		((uint64_t)1<<51)
> +#define BBPETABYTE		((uint64_t)1<<41)
> +#define BBTERABYTE		((uint64_t)1<<31)
> +#define BBGIGABYTE		((uint64_t)1<<21)
> +#define BBMEGABYTE		((uint64_t)1<<11)
> +#define BBKILOBYTE		((uint64_t)1<< 1)
>  
>  char *
>  bbs_to_string(
> -	__uint64_t	v,
> +	uint64_t	v,
>  	char		*sp,
>  	uint		size)
>  {
> @@ -146,17 +146,17 @@ bbs_to_string(
>  	return sp;
>  }
>  
> -#define THOUSAND		((__uint64_t)1000)
> -#define MILLION			((__uint64_t)1000*1000)
> -#define BILLION			((__uint64_t)1000*1000*1000)
> -#define TRILLION		((__uint64_t)1000*1000*1000*1000)
> -#define GAZILLION		((__uint64_t)1000*1000*1000*1000*1000)
> -#define RIDICULOUS		((__uint64_t)1000*1000*1000*1000*1000*1000)
> -#define STOPALREADY		((__uint64_t)1000*1000*1000*1000*1000*1000*1000)
> +#define THOUSAND		((uint64_t)1000)
> +#define MILLION			((uint64_t)1000*1000)
> +#define BILLION			((uint64_t)1000*1000*1000)
> +#define TRILLION		((uint64_t)1000*1000*1000*1000)
> +#define GAZILLION		((uint64_t)1000*1000*1000*1000*1000)
> +#define RIDICULOUS		((uint64_t)1000*1000*1000*1000*1000*1000)
> +#define STOPALREADY		((uint64_t)1000*1000*1000*1000*1000*1000*1000)
>  
>  char *
>  num_to_string(
> -	__uint64_t	v,
> +	uint64_t	v,
>  	char		*sp,
>  	uint		size)
>  {
> @@ -183,8 +183,8 @@ num_to_string(
>  
>  char *
>  pct_to_string(
> -	__uint64_t	portion,
> -	__uint64_t	whole,
> +	uint64_t	portion,
> +	uint64_t	whole,
>  	char		*buf,
>  	uint		size)
>  {
> @@ -237,7 +237,7 @@ type_to_string(
>  #define IDMASK		(NID-1)
>  
>  typedef struct {
> -	__uint32_t	id;
> +	uint32_t	id;
>  	char		name[NMAX+1];
>  } idcache_t;
>  
> @@ -250,7 +250,7 @@ static int		pentriesleft = NID;
>  
>  static idcache_t *
>  getnextpwent(
> -	__uint32_t	id,
> +	uint32_t	id,
>  	int		byid)
>  {
>  	struct passwd	*pw;
> @@ -266,7 +266,7 @@ getnextpwent(
>  
>  static idcache_t *
>  getnextgrent(
> -	__uint32_t	id,
> +	uint32_t	id,
>  	int		byid)
>  {
>  	struct group	*gr;
> @@ -281,7 +281,7 @@ getnextgrent(
>  
>  static idcache_t *
>  getnextprent(
> -	__uint32_t	id,
> +	uint32_t	id,
>  	int		byid)
>  {
>  	fs_project_t	*pr;
> @@ -296,7 +296,7 @@ getnextprent(
>  
>  char *
>  uid_to_name(
> -	__uint32_t	id)
> +	uint32_t	id)
>  {
>  	idcache_t	*ncp, *idp;
>  
> @@ -333,7 +333,7 @@ uid_to_name(
>  
>  char *
>  gid_to_name(
> -	__uint32_t	id)
> +	uint32_t	id)
>  {
>  	idcache_t	*ncp, *idp;
>  
> @@ -370,7 +370,7 @@ gid_to_name(
>  
>  char *
>  prid_to_name(
> -	__uint32_t	id)
> +	uint32_t	id)
>  {
>  	idcache_t	*ncp, *idp;
>  
> diff --git a/repair/README b/repair/README
> index 7f168e6..4692463 100644
> --- a/repair/README
> +++ b/repair/README
> @@ -189,7 +189,7 @@ D - 0) look at usage of XFS_MAKE_IPTR().  It does the right
>  
>  
>  D - 0) look at references to XFS_INODES_PER_CHUNK.  change the
> -	ones that really mean sizeof(__uint64_t)*NBBY to
> +	ones that really mean sizeof(uint64_t)*NBBY to
>  	something else (like that only defined as a constant
>  	INOS_PER_IREC. this isn't as important since
>  	XFS_INODES_PER_CHUNK will never chang
> diff --git a/repair/agheader.h b/repair/agheader.h
> index 6b2974c..2f7246d 100644
> --- a/repair/agheader.h
> +++ b/repair/agheader.h
> @@ -20,7 +20,7 @@ typedef struct fs_geometry  {
>  	/*
>  	 * these types should match the superblock types
>  	 */
> -	__uint32_t	sb_blocksize;	/* blocksize (bytes) */
> +	uint32_t	sb_blocksize;	/* blocksize (bytes) */
>  	xfs_rfsblock_t	sb_dblocks;	/* # data blocks */
>  	xfs_rfsblock_t	sb_rblocks;	/* # realtime blocks */
>  	xfs_rtblock_t	sb_rextents;	/* # realtime extents */
> @@ -30,9 +30,9 @@ typedef struct fs_geometry  {
>  	xfs_agnumber_t	sb_agcount;	/* # of ags */
>  	xfs_extlen_t	sb_rbmblocks;	/* # of rt bitmap blocks */
>  	xfs_extlen_t	sb_logblocks;	/* # of log blocks */
> -	__uint16_t	sb_sectsize;	/* volume sector size (bytes) */
> -	__uint16_t	sb_inodesize;	/* inode size (bytes) */
> -	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
> +	uint16_t	sb_sectsize;	/* volume sector size (bytes) */
> +	uint16_t	sb_inodesize;	/* inode size (bytes) */
> +	uint8_t		sb_imax_pct;	/* max % of fs for inode space */
>  
>  	/*
>  	 * these don't have to match the superblock types but are placed
> @@ -49,10 +49,10 @@ typedef struct fs_geometry  {
>  	/*
>  	 * fields after this point have to be checked manually in compare_sb()
>  	 */
> -	__uint8_t	sb_shared_vn;	/* shared version number */
> +	uint8_t		sb_shared_vn;	/* shared version number */
>  	xfs_extlen_t	sb_inoalignmt;	/* inode chunk alignment, fsblocks */
> -	__uint32_t	sb_unit;	/* stripe or raid unit */
> -	__uint32_t	sb_width;	/* stripe or width unit */
> +	uint32_t	sb_unit;	/* stripe or raid unit */
> +	uint32_t	sb_width;	/* stripe or width unit */
>  
>  	/*
>  	 * these don't have to match, they track superblock properties
> diff --git a/repair/attr_repair.h b/repair/attr_repair.h
> index 7010e4f..294fad4 100644
> --- a/repair/attr_repair.h
> +++ b/repair/attr_repair.h
> @@ -32,10 +32,10 @@
>  #define ACL_WRITE	02
>  #define ACL_EXECUTE	01
>  
> -typedef __uint16_t	xfs_acl_perm_t;
> -typedef __int32_t	xfs_acl_type_t;
> -typedef __int32_t	xfs_acl_tag_t;
> -typedef __int32_t	xfs_acl_id_t;
> +typedef uint16_t	xfs_acl_perm_t;
> +typedef int32_t		xfs_acl_type_t;
> +typedef int32_t		xfs_acl_tag_t;
> +typedef int32_t		xfs_acl_id_t;
>  
>  /*
>   * "icacl" = in-core ACL. There is no equivalent in the XFS kernel code,
> @@ -50,7 +50,7 @@ struct xfs_icacl_entry {
>  };
>  
>  struct xfs_icacl {
> -	__int32_t		acl_cnt;
> +	int32_t			acl_cnt;
>  	struct xfs_icacl_entry	acl_entry[0];
>  };
>  
> @@ -59,14 +59,14 @@ struct xfs_icacl {
>   */
>  #define XFS_MAC_MAX_SETS	250
>  typedef struct xfs_mac_label {
> -	__uint8_t       ml_msen_type;	/* MSEN label type */
> -	__uint8_t       ml_mint_type;	/* MINT label type */
> -	__uint8_t       ml_level;	/* Hierarchical level */
> -	__uint8_t       ml_grade;	/* Hierarchical grade */
> -	__uint16_t      ml_catcount;	/* Category count */
> -	__uint16_t      ml_divcount;	/* Division count */
> +	uint8_t       ml_msen_type;	/* MSEN label type */
> +	uint8_t       ml_mint_type;	/* MINT label type */
> +	uint8_t       ml_level;	/* Hierarchical level */
> +	uint8_t       ml_grade;	/* Hierarchical grade */
> +	uint16_t      ml_catcount;	/* Category count */
> +	uint16_t      ml_divcount;	/* Division count */
>  					/* Category set, then Division set */
> -	__uint16_t      ml_list[XFS_MAC_MAX_SETS];
> +	uint16_t      ml_list[XFS_MAC_MAX_SETS];
>  } xfs_mac_label_t;
>  
>  /* MSEN label type names. Choose an upper case ASCII character.  */
> @@ -93,7 +93,7 @@ typedef struct xfs_mac_label {
>  /*
>   * Capabilities (IRIX)
>   */
> -typedef __uint64_t xfs_cap_value_t;
> +typedef uint64_t xfs_cap_value_t;
>  
>  typedef struct xfs_cap_set {
>  	xfs_cap_value_t	cap_effective;  /* use in capability checks */
> diff --git a/repair/avl64.c b/repair/avl64.c
> index 51cd624..8f4a121 100644
> --- a/repair/avl64.c
> +++ b/repair/avl64.c
> @@ -70,8 +70,8 @@ avl64_checktree(
>  	avl64node_t *root)
>  {
>  	avl64node_t *nlast, *nnext, *np;
> -	__uint64_t offset = 0;
> -	__uint64_t end;
> +	uint64_t offset = 0;
> +	uint64_t end;
>  
>  	nlast = nnext = root;
>  
> @@ -583,8 +583,8 @@ avl64_delete(
>  avl64node_t *
>  avl64_findanyrange(
>  	avl64tree_desc_t *tree,
> -	__uint64_t start,
> -	__uint64_t end,
> +	uint64_t start,
> +	uint64_t end,
>  	int	checklen)
>  {
>  	avl64node_t *np = tree->avl_root;
> @@ -655,7 +655,7 @@ avl64_findanyrange(
>  avl64node_t *
>  avl64_findrange(
>  	avl64tree_desc_t *tree,
> -	__uint64_t value)
> +	uint64_t value)
>  {
>  	avl64node_t *np = tree->avl_root;
>  
> @@ -682,10 +682,10 @@ avl64_findrange(
>  avl64node_t *
>  avl64_find(
>  	avl64tree_desc_t *tree,
> -	__uint64_t value)
> +	uint64_t value)
>  {
>  	avl64node_t *np = tree->avl_root;
> -	__uint64_t nvalue;
> +	uint64_t nvalue;
>  
>  	while (np) {
>  		nvalue = AVL_START(tree, np);
> @@ -909,8 +909,8 @@ static
>  avl64node_t *
>  avl64_insert_find_growth(
>  		avl64tree_desc_t *tree,
> -		__uint64_t start,	/* range start at start, */
> -		__uint64_t end,	/* exclusive */
> +		uint64_t start,	/* range start at start, */
> +		uint64_t end,	/* exclusive */
>  		int   *growthp)	/* OUT */
>  {
>  	avl64node_t *root = tree->avl_root;
> @@ -963,7 +963,7 @@ avl64_insert_grow(
>  	int growth)
>  {
>  	avl64node_t *nnext;
> -	__uint64_t start = AVL_START(tree, newnode);
> +	uint64_t start = AVL_START(tree, newnode);
>  
>  	if (growth == AVL_BACK) {
>  
> @@ -1005,8 +1005,8 @@ avl64_insert(
>  	avl64node_t *newnode)
>  {
>  	avl64node_t *np;
> -	__uint64_t start = AVL_START(tree, newnode);
> -	__uint64_t end = AVL_END(tree, newnode);
> +	uint64_t start = AVL_START(tree, newnode);
> +	uint64_t end = AVL_END(tree, newnode);
>  	int growth;
>  
>  	ASSERT(newnode);
> @@ -1159,16 +1159,16 @@ avl64ops_t avl_debug_ops = {
>  	avl_debug_end,
>  }
>  
> -static __uint64_t
> +static uint64_t
>  avl64_debug_start(avl64node_t *node)
>  {
> -	return (__uint64_t)(struct avl_debug_node *)node->avl_start;
> +	return (uint64_t)(struct avl_debug_node *)node->avl_start;
>  }
>  
> -static __uint64_t
> +static uint64_t
>  avl64_debug_end(avl64node_t *node)
>  {
> -	return (__uint64_t)
> +	return (uint64_t)
>  		((struct avl_debug_node *)node->avl_start +
>  		 (struct avl_debug_node *)node->avl_size);
>  }
> @@ -1304,7 +1304,7 @@ main()
>  avl64node_t *
>  avl64_findadjacent(
>  	avl64tree_desc_t *tree,
> -	__uint64_t value,
> +	uint64_t value,
>  	int		dir)
>  {
>  	avl64node_t *np = tree->avl_root;
> @@ -1378,8 +1378,8 @@ avl64_findadjacent(
>  void
>  avl64_findranges(
>  	avl64tree_desc_t *tree,
> -	__uint64_t start,
> -	__uint64_t end,
> +	uint64_t start,
> +	uint64_t end,
>  	avl64node_t	        **startp,
>  	avl64node_t		**endp)
>  {
> diff --git a/repair/avl64.h b/repair/avl64.h
> index fd19321..cd079a0 100644
> --- a/repair/avl64.h
> +++ b/repair/avl64.h
> @@ -32,8 +32,8 @@ typedef struct	avl64node {
>   * avl-tree operations
>   */
>  typedef struct avl64ops {
> -	__uint64_t	(*avl_start)(avl64node_t *);
> -	__uint64_t	(*avl_end)(avl64node_t *);
> +	uint64_t	(*avl_start)(avl64node_t *);
> +	uint64_t	(*avl_end)(avl64node_t *);
>  } avl64ops_t;
>  
>  /*
> @@ -89,32 +89,32 @@ avl64_init_tree(
>  avl64node_t *
>  avl64_findrange(
>  	avl64tree_desc_t *tree,
> -	__uint64_t value);
> +	uint64_t value);
>  
>  avl64node_t *
>  avl64_find(
>  	avl64tree_desc_t *tree,
> -	__uint64_t value);
> +	uint64_t value);
>  
>  avl64node_t *
>  avl64_findanyrange(
>  	avl64tree_desc_t *tree,
> -	__uint64_t	start,
> -	__uint64_t	end,
> +	uint64_t	start,
> +	uint64_t	end,
>  	int     checklen);
>  
>  
>  avl64node_t *
>  avl64_findadjacent(
>  	avl64tree_desc_t *tree,
> -	__uint64_t	value,
> +	uint64_t	value,
>  	int		dir);
>  
>  void
>  avl64_findranges(
>  	avl64tree_desc_t *tree,
> -	__uint64_t	start,
> -	__uint64_t	end,
> +	uint64_t	start,
> +	uint64_t	end,
>  	avl64node_t	        **startp,
>  	avl64node_t		**endp);
>  
> diff --git a/repair/dinode.c b/repair/dinode.c
> index d664f87..da87217 100644
> --- a/repair/dinode.c
> +++ b/repair/dinode.c
> @@ -746,7 +746,7 @@ _("%s fork in ino %" PRIu64 " claims dup extent, "
>  			case XR_E_FREE1:
>  				do_warn(
>  _("%s fork in ino %" PRIu64 " claims free block %" PRIu64 "\n"),
> -					forkname, ino, (__uint64_t) b);
> +					forkname, ino, (uint64_t) b);
>  				/* fall through ... */
>  			case XR_E_INUSE1:	/* seen by rmap */
>  			case XR_E_UNKNOWN:
> @@ -923,7 +923,7 @@ process_btinode(
>  	int			type,
>  	int			*dirty,
>  	xfs_rfsblock_t		*tot,
> -	__uint64_t		*nex,
> +	uint64_t		*nex,
>  	blkmap_t		**blkmapp,
>  	int			whichfork,
>  	int			check_dups)
> @@ -939,7 +939,7 @@ process_btinode(
>  	int			level;
>  	int			numrecs;
>  	bmap_cursor_t		cursor;
> -	__uint64_t		magic;
> +	uint64_t		magic;
>  
>  	dib = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
>  	lino = XFS_AGINO_TO_INO(mp, agno, ino);
> @@ -1098,7 +1098,7 @@ process_exinode(
>  	int			type,
>  	int			*dirty,
>  	xfs_rfsblock_t		*tot,
> -	__uint64_t		*nex,
> +	uint64_t		*nex,
>  	blkmap_t		**blkmapp,
>  	int			whichfork,
>  	int			check_dups)
> @@ -1200,14 +1200,14 @@ process_symlink_extlist(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino)
>  		do_warn(
>  _("mismatch between format (%d) and size (%" PRId64 ") in symlink ino %" PRIu64 "\n"),
>  			dino->di_format,
> -			(__int64_t)be64_to_cpu(dino->di_size), lino);
> +			(int64_t)be64_to_cpu(dino->di_size), lino);
>  		return 1;
>  	}
>  	if (dino->di_format == XFS_DINODE_FMT_LOCAL) {
>  		do_warn(
>  _("mismatch between format (%d) and size (%" PRId64 ") in symlink inode %" PRIu64 "\n"),
>  			dino->di_format,
> -			(__int64_t)be64_to_cpu(dino->di_size), lino);
> +			(int64_t)be64_to_cpu(dino->di_size), lino);
>  		return 1;
>  	}
>  
> @@ -1454,22 +1454,22 @@ _("inode %" PRIu64 " has bad inode type (IFMNT)\n"), lino);
>  		case XR_INO_CHRDEV:
>  			do_warn(
>  _("size of character device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> -				(__int64_t)be64_to_cpu(dino->di_size));
> +				(int64_t)be64_to_cpu(dino->di_size));
>  			break;
>  		case XR_INO_BLKDEV:
>  			do_warn(
>  _("size of block device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> -				(__int64_t)be64_to_cpu(dino->di_size));
> +				(int64_t)be64_to_cpu(dino->di_size));
>  			break;
>  		case XR_INO_SOCK:
>  			do_warn(
>  _("size of socket inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> -				(__int64_t)be64_to_cpu(dino->di_size));
> +				(int64_t)be64_to_cpu(dino->di_size));
>  			break;
>  		case XR_INO_FIFO:
>  			do_warn(
>  _("size of fifo inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> -				(__int64_t)be64_to_cpu(dino->di_size));
> +				(int64_t)be64_to_cpu(dino->di_size));
>  			break;
>  		default:
>  			do_warn(_("Internal error - process_misc_ino_types, "
> @@ -1743,12 +1743,12 @@ _("found inode %" PRIu64 " claiming to be a real-time file\n"), lino);
>  		break;
>  
>  	case XR_INO_RTBITMAP:
> -		if (size != (__int64_t)mp->m_sb.sb_rbmblocks *
> +		if (size != (int64_t)mp->m_sb.sb_rbmblocks *
>  					mp->m_sb.sb_blocksize) {
>  			do_warn(
>  _("realtime bitmap inode %" PRIu64 " has bad size %" PRId64 " (should be %" PRIu64 ")\n"),
>  				lino, size,
> -				(__int64_t) mp->m_sb.sb_rbmblocks *
> +				(int64_t) mp->m_sb.sb_rbmblocks *
>  					mp->m_sb.sb_blocksize);
>  			return 1;
>  		}
> @@ -1817,8 +1817,8 @@ static int
>  process_inode_blocks_and_extents(
>  	xfs_dinode_t	*dino,
>  	xfs_rfsblock_t	nblocks,
> -	__uint64_t	nextents,
> -	__uint64_t	anextents,
> +	uint64_t	nextents,
> +	uint64_t	anextents,
>  	xfs_ino_t	lino,
>  	int		*dirty)
>  {
> @@ -1908,7 +1908,7 @@ process_inode_data_fork(
>  	int		type,
>  	int		*dirty,
>  	xfs_rfsblock_t	*totblocks,
> -	__uint64_t	*nextents,
> +	uint64_t	*nextents,
>  	blkmap_t	**dblkmap,
>  	int		check_dups)
>  {
> @@ -2017,7 +2017,7 @@ process_inode_attr_fork(
>  	int		type,
>  	int		*dirty,
>  	xfs_rfsblock_t	*atotblocks,
> -	__uint64_t	*anextents,
> +	uint64_t	*anextents,
>  	int		check_dups,
>  	int		extra_attr_check,
>  	int		*retval)
> @@ -2228,8 +2228,8 @@ process_dinode_int(xfs_mount_t *mp,
>  	int			di_mode;
>  	int			type;
>  	int			retval = 0;
> -	__uint64_t		nextents;
> -	__uint64_t		anextents;
> +	uint64_t		nextents;
> +	uint64_t		anextents;
>  	xfs_ino_t		lino;
>  	const int		is_free = 0;
>  	const int		is_used = 1;
> @@ -2346,7 +2346,7 @@ _("inode identifier %llu mismatch on inode %" PRIu64 "\n"),
>  		if (!uncertain)
>  			do_warn(
>  _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
> -				(__int64_t)be64_to_cpu(dino->di_size),
> +				(int64_t)be64_to_cpu(dino->di_size),
>  				lino);
>  		if (verify_mode)
>  			return 1;
> diff --git a/repair/dinode.h b/repair/dinode.h
> index 61d0736..39d6a72 100644
> --- a/repair/dinode.h
> +++ b/repair/dinode.h
> @@ -46,8 +46,8 @@ process_bmbt_reclist(xfs_mount_t	*mp,
>  		xfs_ino_t		ino,
>  		xfs_rfsblock_t		*tot,
>  		struct blkmap		**blkmapp,
> -		__uint64_t		*first_key,
> -		__uint64_t		*last_key,
> +		uint64_t		*first_key,
> +		uint64_t		*last_key,
>  		int			whichfork);
>  
>  int
> diff --git a/repair/dir2.c b/repair/dir2.c
> index e6415e4..73dff90 100644
> --- a/repair/dir2.c
> +++ b/repair/dir2.c
> @@ -160,7 +160,7 @@ process_sf_dir2(
>  	int			bad_sfnamelen;
>  	int			i;
>  	int			i8;
> -	__int64_t		ino_dir_size;
> +	int64_t			ino_dir_size;
>  	int			ino_off;
>  	ino_tree_node_t		*irec_p;
>  	int			junkit;
> diff --git a/repair/globals.h b/repair/globals.h
> index 4085ccc..800128a 100644
> --- a/repair/globals.h
> +++ b/repair/globals.h
> @@ -141,7 +141,7 @@ EXTERN int		inodes_per_cluster;
>  EXTERN unsigned int	glob_agcount;
>  EXTERN int		chunks_pblock;	/* # of 64-ino chunks per allocation */
>  EXTERN int		max_symlink_blocks;
> -EXTERN __int64_t	fs_max_file_offset;
> +EXTERN int64_t		fs_max_file_offset;
>  
>  /* realtime info */
>  
> @@ -161,16 +161,16 @@ EXTERN int		full_ino_ex_data;/*
>  
>  /* superblock counters */
>  
> -EXTERN __uint64_t	sb_icount;	/* allocated (made) inodes */
> -EXTERN __uint64_t	sb_ifree;	/* free inodes */
> -EXTERN __uint64_t	sb_fdblocks;	/* free data blocks */
> -EXTERN __uint64_t	sb_frextents;	/* free realtime extents */
> +EXTERN uint64_t	sb_icount;	/* allocated (made) inodes */
> +EXTERN uint64_t	sb_ifree;	/* free inodes */
> +EXTERN uint64_t	sb_fdblocks;	/* free data blocks */
> +EXTERN uint64_t	sb_frextents;	/* free realtime extents */
>  
>  /* superblock geometry info */
>  
>  EXTERN xfs_extlen_t	sb_inoalignmt;
> -EXTERN __uint32_t	sb_unit;
> -EXTERN __uint32_t	sb_width;
> +EXTERN uint32_t	sb_unit;
> +EXTERN uint32_t	sb_width;
>  
>  struct aglock {
>  	pthread_mutex_t	lock __attribute__((__aligned__(64)));
> @@ -178,7 +178,7 @@ struct aglock {
>  EXTERN struct aglock	*ag_locks;
>  
>  EXTERN int 		report_interval;
> -EXTERN __uint64_t 	*prog_rpt_done;
> +EXTERN uint64_t 	*prog_rpt_done;
>  
>  EXTERN int		ag_stride;
>  EXTERN int		thread_count;
> diff --git a/repair/incore.c b/repair/incore.c
> index cb57316..a9191ae 100644
> --- a/repair/incore.c
> +++ b/repair/incore.c
> @@ -179,7 +179,7 @@ get_bmap_ext(
>  static uint64_t		*rt_bmap;
>  static size_t		rt_bmap_size;
>  
> -/* block records fit into __uint64_t's units */
> +/* block records fit into uint64_t's units */
>  #define XR_BB_UNIT	64			/* number of bits/unit */
>  #define XR_BB		4			/* bits per block record */
>  #define XR_BB_NUM	(XR_BB_UNIT/XR_BB)	/* number of records per unit */
> @@ -203,8 +203,8 @@ set_rtbmap(
>  {
>  	*(rt_bmap + bno / XR_BB_NUM) =
>  	 ((*(rt_bmap + bno / XR_BB_NUM) &
> -	  (~((__uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
> -	 (((__uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
> +	  (~((uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
> +	 (((uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
>  }
>  
>  static void
> @@ -222,9 +222,9 @@ init_rt_bmap(
>  		return;
>  
>  	rt_bmap_size = roundup(mp->m_sb.sb_rextents / (NBBY / XR_BB),
> -			       sizeof(__uint64_t));
> +			       sizeof(uint64_t));
>  
> -	rt_bmap = memalign(sizeof(__uint64_t), rt_bmap_size);
> +	rt_bmap = memalign(sizeof(uint64_t), rt_bmap_size);
>  	if (!rt_bmap) {
>  		do_error(
>  	_("couldn't allocate realtime block map, size = %" PRIu64 "\n"),
> diff --git a/repair/incore.h b/repair/incore.h
> index c23a3a3..fd66084 100644
> --- a/repair/incore.h
> +++ b/repair/incore.h
> @@ -257,7 +257,7 @@ typedef xfs_ino_t parent_entry_t;
>  struct nlink_ops;
>  
>  typedef struct parent_list  {
> -	__uint64_t		pmask;
> +	uint64_t		pmask;
>  	parent_entry_t		*pentries;
>  #ifdef DEBUG
>  	short			cnt;
> @@ -265,14 +265,14 @@ typedef struct parent_list  {
>  } parent_list_t;
>  
>  union ino_nlink {
> -	__uint8_t	*un8;
> -	__uint16_t	*un16;
> -	__uint32_t	*un32;
> +	uint8_t		*un8;
> +	uint16_t	*un16;
> +	uint32_t	*un32;
>  };
>  
>  typedef struct ino_ex_data  {
> -	__uint64_t		ino_reached;	/* bit == 1 if reached */
> -	__uint64_t		ino_processed;	/* reference checked bit mask */
> +	uint64_t		ino_reached;	/* bit == 1 if reached */
> +	uint64_t		ino_processed;	/* reference checked bit mask */
>  	parent_list_t		*parents;
>  	union ino_nlink		counted_nlinks;/* counted nlinks in P6 */
>  } ino_ex_data_t;
> @@ -281,22 +281,22 @@ typedef struct ino_tree_node  {
>  	avlnode_t		avl_node;
>  	xfs_agino_t		ino_startnum;	/* starting inode # */
>  	xfs_inofree_t		ir_free;	/* inode free bit mask */
> -	__uint64_t		ir_sparse;	/* sparse inode bitmask */
> -	__uint64_t		ino_confirmed;	/* confirmed bitmask */
> -	__uint64_t		ino_isa_dir;	/* bit == 1 if a directory */
> -	__uint64_t		ino_was_rl;	/* bit == 1 if reflink flag set */
> -	__uint64_t		ino_is_rl;	/* bit == 1 if reflink flag should be set */
> -	__uint8_t		nlink_size;
> +	uint64_t		ir_sparse;	/* sparse inode bitmask */
> +	uint64_t		ino_confirmed;	/* confirmed bitmask */
> +	uint64_t		ino_isa_dir;	/* bit == 1 if a directory */
> +	uint64_t		ino_was_rl;	/* bit == 1 if reflink flag set */
> +	uint64_t		ino_is_rl;	/* bit == 1 if reflink flag should be set */
> +	uint8_t			nlink_size;
>  	union ino_nlink		disk_nlinks;	/* on-disk nlinks, set in P3 */
>  	union  {
>  		ino_ex_data_t	*ex_data;	/* phases 6,7 */
>  		parent_list_t	*plist;		/* phases 2-5 */
>  	} ino_un;
> -	__uint8_t		*ftypes;	/* phases 3,6 */
> +	uint8_t			*ftypes;	/* phases 3,6 */
>  } ino_tree_node_t;
>  
> -#define INOS_PER_IREC	(sizeof(__uint64_t) * NBBY)
> -#define	IREC_MASK(i)	((__uint64_t)1 << (i))
> +#define INOS_PER_IREC	(sizeof(uint64_t) * NBBY)
> +#define	IREC_MASK(i)	((uint64_t)1 << (i))
>  
>  void		add_ino_ex_data(xfs_mount_t *mp);
>  
> @@ -543,10 +543,10 @@ static inline int inode_is_rl(struct ino_tree_node *irec, int offset)
>   */
>  void add_inode_ref(struct ino_tree_node *irec, int offset);
>  void drop_inode_ref(struct ino_tree_node *irec, int offset);
> -__uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
> +uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
>  
> -void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, __uint32_t nlinks);
> -__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
> +void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, uint32_t nlinks);
> +uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
>  
>  static inline int is_inode_reached(struct ino_tree_node *irec, int offset)
>  {
> @@ -567,13 +567,13 @@ static inline void add_inode_reached(struct ino_tree_node *irec, int offset)
>  static inline void
>  set_inode_ftype(struct ino_tree_node *irec,
>  	int		ino_offset,
> -	__uint8_t	ftype)
> +	uint8_t		ftype)
>  {
>  	if (irec->ftypes)
>  		irec->ftypes[ino_offset] = ftype;
>  }
>  
> -static inline __uint8_t
> +static inline uint8_t
>  get_inode_ftype(
>  	struct ino_tree_node *irec,
>  	int		ino_offset)
> @@ -606,11 +606,11 @@ typedef struct bm_level_state  {
>  	xfs_fsblock_t		fsbno;
>  	xfs_fsblock_t		left_fsbno;
>  	xfs_fsblock_t		right_fsbno;
> -	__uint64_t		first_key;
> -	__uint64_t		last_key;
> +	uint64_t		first_key;
> +	uint64_t		last_key;
>  /*
>  	int			level;
> -	__uint64_t		prev_last_key;
> +	uint64_t		prev_last_key;
>  	xfs_buf_t		*bp;
>  	xfs_bmbt_block_t	*block;
>  */
> diff --git a/repair/incore_ext.c b/repair/incore_ext.c
> index 7e6786c..0a8138a 100644
> --- a/repair/incore_ext.c
> +++ b/repair/incore_ext.c
> @@ -721,13 +721,13 @@ search_rt_dup_extent(xfs_mount_t *mp, xfs_rtblock_t bno)
>  	return(ret);
>  }
>  
> -static __uint64_t
> +static uint64_t
>  avl64_rt_ext_start(avl64node_t *node)
>  {
>  	return(((rt_extent_tree_node_t *) node)->rt_startblock);
>  }
>  
> -static __uint64_t
> +static uint64_t
>  avl64_ext_end(avl64node_t *node)
>  {
>  	return(((rt_extent_tree_node_t *) node)->rt_startblock +
> @@ -834,7 +834,7 @@ count_extents(xfs_agnumber_t agno, avltree_desc_t *tree, int whichtree)
>  int
>  count_bno_extents_blocks(xfs_agnumber_t agno, uint *numblocks)
>  {
> -	__uint64_t nblocks;
> +	uint64_t nblocks;
>  	extent_tree_node_t *node;
>  	int i = 0;
>  
> diff --git a/repair/incore_ino.c b/repair/incore_ino.c
> index 2ec1765..3b6b44d 100644
> --- a/repair/incore_ino.c
> +++ b/repair/incore_ino.c
> @@ -38,7 +38,7 @@ static avltree_desc_t	**inode_uncertain_tree_ptrs;
>  /* memory optimised nlink counting for all inodes */
>  
>  static void *
> -alloc_nlink_array(__uint8_t nlink_size)
> +alloc_nlink_array(uint8_t nlink_size)
>  {
>  	void *ptr;
>  
> @@ -51,10 +51,10 @@ alloc_nlink_array(__uint8_t nlink_size)
>  static void
>  nlink_grow_8_to_16(ino_tree_node_t *irec)
>  {
> -	__uint16_t	*new_nlinks;
> +	uint16_t	*new_nlinks;
>  	int		i;
>  
> -	irec->nlink_size = sizeof(__uint16_t);
> +	irec->nlink_size = sizeof(uint16_t);
>  
>  	new_nlinks = alloc_nlink_array(irec->nlink_size);
>  	for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
> @@ -76,10 +76,10 @@ nlink_grow_8_to_16(ino_tree_node_t *irec)
>  static void
>  nlink_grow_16_to_32(ino_tree_node_t *irec)
>  {
> -	__uint32_t	*new_nlinks;
> +	uint32_t	*new_nlinks;
>  	int		i;
>  
> -	irec->nlink_size = sizeof(__uint32_t);
> +	irec->nlink_size = sizeof(uint32_t);
>  
>  	new_nlinks = alloc_nlink_array(irec->nlink_size);
>  	for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
> @@ -104,21 +104,21 @@ void add_inode_ref(struct ino_tree_node *irec, int ino_offset)
>  	ASSERT(irec->ino_un.ex_data != NULL);
>  
>  	switch (irec->nlink_size) {
> -	case sizeof(__uint8_t):
> +	case sizeof(uint8_t):
>  		if (irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] < 0xff) {
>  			irec->ino_un.ex_data->counted_nlinks.un8[ino_offset]++;
>  			break;
>  		}
>  		nlink_grow_8_to_16(irec);
>  		/*FALLTHRU*/
> -	case sizeof(__uint16_t):
> +	case sizeof(uint16_t):
>  		if (irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] < 0xffff) {
>  			irec->ino_un.ex_data->counted_nlinks.un16[ino_offset]++;
>  			break;
>  		}
>  		nlink_grow_16_to_32(irec);
>  		/*FALLTHRU*/
> -	case sizeof(__uint32_t):
> +	case sizeof(uint32_t):
>  		irec->ino_un.ex_data->counted_nlinks.un32[ino_offset]++;
>  		break;
>  	default:
> @@ -128,20 +128,20 @@ void add_inode_ref(struct ino_tree_node *irec, int ino_offset)
>  
>  void drop_inode_ref(struct ino_tree_node *irec, int ino_offset)
>  {
> -	__uint32_t	refs = 0;
> +	uint32_t	refs = 0;
>  
>  	ASSERT(irec->ino_un.ex_data != NULL);
>  
>  	switch (irec->nlink_size) {
> -	case sizeof(__uint8_t):
> +	case sizeof(uint8_t):
>  		ASSERT(irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] > 0);
>  		refs = --irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
>  		break;
> -	case sizeof(__uint16_t):
> +	case sizeof(uint16_t):
>  		ASSERT(irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] > 0);
>  		refs = --irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
>  		break;
> -	case sizeof(__uint32_t):
> +	case sizeof(uint32_t):
>  		ASSERT(irec->ino_un.ex_data->counted_nlinks.un32[ino_offset] > 0);
>  		refs = --irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
>  		break;
> @@ -153,16 +153,16 @@ void drop_inode_ref(struct ino_tree_node *irec, int ino_offset)
>  		irec->ino_un.ex_data->ino_reached &= ~IREC_MASK(ino_offset);
>  }
>  
> -__uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
> +uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
>  {
>  	ASSERT(irec->ino_un.ex_data != NULL);
>  
>  	switch (irec->nlink_size) {
> -	case sizeof(__uint8_t):
> +	case sizeof(uint8_t):
>  		return irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
> -	case sizeof(__uint16_t):
> +	case sizeof(uint16_t):
>  		return irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
> -	case sizeof(__uint32_t):
> +	case sizeof(uint32_t):
>  		return irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
>  	default:
>  		ASSERT(0);
> @@ -171,24 +171,24 @@ __uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
>  }
>  
>  void set_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset,
> -		__uint32_t nlinks)
> +		uint32_t nlinks)
>  {
>  	switch (irec->nlink_size) {
> -	case sizeof(__uint8_t):
> +	case sizeof(uint8_t):
>  		if (nlinks < 0xff) {
>  			irec->disk_nlinks.un8[ino_offset] = nlinks;
>  			break;
>  		}
>  		nlink_grow_8_to_16(irec);
>  		/*FALLTHRU*/
> -	case sizeof(__uint16_t):
> +	case sizeof(uint16_t):
>  		if (nlinks < 0xffff) {
>  			irec->disk_nlinks.un16[ino_offset] = nlinks;
>  			break;
>  		}
>  		nlink_grow_16_to_32(irec);
>  		/*FALLTHRU*/
> -	case sizeof(__uint32_t):
> +	case sizeof(uint32_t):
>  		irec->disk_nlinks.un32[ino_offset] = nlinks;
>  		break;
>  	default:
> @@ -196,14 +196,14 @@ void set_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset,
>  	}
>  }
>  
> -__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
> +uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
>  {
>  	switch (irec->nlink_size) {
> -	case sizeof(__uint8_t):
> +	case sizeof(uint8_t):
>  		return irec->disk_nlinks.un8[ino_offset];
> -	case sizeof(__uint16_t):
> +	case sizeof(uint16_t):
>  		return irec->disk_nlinks.un16[ino_offset];
> -	case sizeof(__uint32_t):
> +	case sizeof(uint32_t):
>  		return irec->disk_nlinks.un32[ino_offset];
>  	default:
>  		ASSERT(0);
> @@ -211,11 +211,11 @@ __uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
>  	return 0;
>  }
>  
> -static __uint8_t *
> +static uint8_t *
>  alloc_ftypes_array(
>  	struct xfs_mount *mp)
>  {
> -	__uint8_t	*ptr;
> +	uint8_t		*ptr;
>  
>  	if (!xfs_sb_version_hasftype(&mp->m_sb))
>  		return NULL;
> @@ -262,23 +262,23 @@ alloc_ino_node(
>  	irec->ir_free = (xfs_inofree_t) - 1;
>  	irec->ir_sparse = 0;
>  	irec->ino_un.ex_data = NULL;
> -	irec->nlink_size = sizeof(__uint8_t);
> +	irec->nlink_size = sizeof(uint8_t);
>  	irec->disk_nlinks.un8 = alloc_nlink_array(irec->nlink_size);
>  	irec->ftypes = alloc_ftypes_array(mp);
>  	return irec;
>  }
>  
>  static void
> -free_nlink_array(union ino_nlink nlinks, __uint8_t nlink_size)
> +free_nlink_array(union ino_nlink nlinks, uint8_t nlink_size)
>  {
>  	switch (nlink_size) {
> -	case sizeof(__uint8_t):
> +	case sizeof(uint8_t):
>  		free(nlinks.un8);
>  		break;
> -	case sizeof(__uint16_t):
> +	case sizeof(uint16_t):
>  		free(nlinks.un16);
>  		break;
> -	case sizeof(__uint32_t):
> +	case sizeof(uint32_t):
>  		free(nlinks.un32);
>  		break;
>  	default:
> @@ -609,7 +609,7 @@ set_inode_parent(
>  	int			i;
>  	int			cnt;
>  	int			target;
> -	__uint64_t		bitmask;
> +	uint64_t		bitmask;
>  	parent_entry_t		*tmp;
>  
>  	if (full_ino_ex_data)
> @@ -699,7 +699,7 @@ set_inode_parent(
>  xfs_ino_t
>  get_inode_parent(ino_tree_node_t *irec, int offset)
>  {
> -	__uint64_t	bitmask;
> +	uint64_t	bitmask;
>  	parent_list_t	*ptbl;
>  	int		i;
>  	int		target;
> @@ -740,15 +740,15 @@ alloc_ex_data(ino_tree_node_t *irec)
>  	irec->ino_un.ex_data->parents = ptbl;
>  
>  	switch (irec->nlink_size) {
> -	case sizeof(__uint8_t):
> +	case sizeof(uint8_t):
>  		irec->ino_un.ex_data->counted_nlinks.un8 =
>  			alloc_nlink_array(irec->nlink_size);
>  		break;
> -	case sizeof(__uint16_t):
> +	case sizeof(uint16_t):
>  		irec->ino_un.ex_data->counted_nlinks.un16 =
>  			alloc_nlink_array(irec->nlink_size);
>  		break;
> -	case sizeof(__uint32_t):
> +	case sizeof(uint32_t):
>  		irec->ino_un.ex_data->counted_nlinks.un32 =
>  			alloc_nlink_array(irec->nlink_size);
>  		break;
> diff --git a/repair/phase2.c b/repair/phase2.c
> index c21778b..0085732 100644
> --- a/repair/phase2.c
> +++ b/repair/phase2.c
> @@ -179,7 +179,7 @@ phase2(
>  
>  	bad_ino_btree = 0;
>  
> -	set_progress_msg(PROG_FMT_SCAN_AG, (__uint64_t) glob_agcount);
> +	set_progress_msg(PROG_FMT_SCAN_AG, (uint64_t) glob_agcount);
>  
>  	scan_ags(mp, scan_threads);
>  
> diff --git a/repair/phase3.c b/repair/phase3.c
> index 0890a27..17b1c28 100644
> --- a/repair/phase3.c
> +++ b/repair/phase3.c
> @@ -122,7 +122,7 @@ phase3(
>  	else
>  		do_log(_("        - scan (but don't clear) agi unlinked lists...\n"));
>  
> -	set_progress_msg(PROG_FMT_AGI_UNLINKED, (__uint64_t) glob_agcount);
> +	set_progress_msg(PROG_FMT_AGI_UNLINKED, (uint64_t) glob_agcount);
>  
>  	/* first clear the agi unlinked AGI list */
>  	if (!no_modify) {
> @@ -142,7 +142,7 @@ phase3(
>  	do_log(_(
>  	    "        - process known inodes and perform inode discovery...\n"));
>  
> -	set_progress_msg(PROG_FMT_PROCESS_INO, (__uint64_t) mp->m_sb.sb_icount);
> +	set_progress_msg(PROG_FMT_PROCESS_INO, (uint64_t) mp->m_sb.sb_icount);
>  
>  	process_ags(mp);
>  
> @@ -152,7 +152,7 @@ phase3(
>  	 * process newly discovered inode chunks
>  	 */
>  	do_log(_("        - process newly discovered inodes...\n"));
> -	set_progress_msg(PROG_FMT_NEW_INODES, (__uint64_t) glob_agcount);
> +	set_progress_msg(PROG_FMT_NEW_INODES, (uint64_t) glob_agcount);
>  
>  	counts = calloc(sizeof(*counts), mp->m_sb.sb_agcount);
>  	if (!counts) {
> diff --git a/repair/phase4.c b/repair/phase4.c
> index e59464b..cc17ec0 100644
> --- a/repair/phase4.c
> +++ b/repair/phase4.c
> @@ -290,7 +290,7 @@ phase4(xfs_mount_t *mp)
>  	do_log(_("Phase 4 - check for duplicate blocks...\n"));
>  	do_log(_("        - setting up duplicate extent list...\n"));
>  
> -	set_progress_msg(PROG_FMT_DUP_EXTENT, (__uint64_t) glob_agcount);
> +	set_progress_msg(PROG_FMT_DUP_EXTENT, (uint64_t) glob_agcount);
>  
>  	irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino),
>  				XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino));
> @@ -404,7 +404,7 @@ phase4(xfs_mount_t *mp)
>  	reset_bmaps(mp);
>  
>  	do_log(_("        - check for inodes claiming duplicate blocks...\n"));
> -	set_progress_msg(PROG_FMT_DUP_BLOCKS, (__uint64_t) mp->m_sb.sb_icount);
> +	set_progress_msg(PROG_FMT_DUP_BLOCKS, (uint64_t) mp->m_sb.sb_icount);
>  
>  	/*
>  	 * ok, now process the inodes -- signal 2-pass check per inode.
> diff --git a/repair/phase5.c b/repair/phase5.c
> index 0b833f1..bf86730 100644
> --- a/repair/phase5.c
> +++ b/repair/phase5.c
> @@ -86,9 +86,9 @@ struct agi_stat {
>  	xfs_agino_t		freecount;
>  };
>  
> -static __uint64_t	*sb_icount_ag;		/* allocated inodes per ag */
> -static __uint64_t	*sb_ifree_ag;		/* free inodes per ag */
> -static __uint64_t	*sb_fdblocks_ag;	/* free data blocks per ag */
> +static uint64_t	*sb_icount_ag;		/* allocated inodes per ag */
> +static uint64_t	*sb_ifree_ag;		/* free inodes per ag */
> +static uint64_t	*sb_fdblocks_ag;	/* free data blocks per ag */
>  
>  static int
>  mk_incore_fstree(xfs_mount_t *mp, xfs_agnumber_t agno)
> @@ -886,10 +886,10 @@ build_freespace_tree(xfs_mount_t *mp, xfs_agnumber_t agno,
>   */
>  static void
>  init_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs,
> -		__uint64_t *num_inos, __uint64_t *num_free_inos, int finobt)
> +		uint64_t *num_inos, uint64_t *num_free_inos, int finobt)
>  {
> -	__uint64_t		ninos;
> -	__uint64_t		nfinos;
> +	uint64_t		ninos;
> +	uint64_t		nfinos;
>  	int			rec_nfinos;
>  	int			rec_ninos;
>  	ino_tree_node_t		*ino_rec;
> @@ -2193,10 +2193,10 @@ phase5_func(
>  	xfs_agnumber_t	agno,
>  	struct xfs_slab	*lost_fsb)
>  {
> -	__uint64_t	num_inos;
> -	__uint64_t	num_free_inos;
> -	__uint64_t	finobt_num_inos;
> -	__uint64_t	finobt_num_free_inos;
> +	uint64_t	num_inos;
> +	uint64_t	num_free_inos;
> +	uint64_t	finobt_num_inos;
> +	uint64_t	finobt_num_free_inos;
>  	bt_status_t	bno_btree_curs;
>  	bt_status_t	bcnt_btree_curs;
>  	bt_status_t	ino_btree_curs;
> @@ -2471,7 +2471,7 @@ phase5(xfs_mount_t *mp)
>  	int			error;
>  
>  	do_log(_("Phase 5 - rebuild AG headers and trees...\n"));
> -	set_progress_msg(PROG_FMT_REBUILD_AG, (__uint64_t )glob_agcount);
> +	set_progress_msg(PROG_FMT_REBUILD_AG, (uint64_t )glob_agcount);
>  
>  #ifdef XR_BLD_FREE_TRACE
>  	fprintf(stderr, "inobt level 1, maxrec = %d, minrec = %d\n",
> @@ -2497,15 +2497,15 @@ phase5(xfs_mount_t *mp)
>  	keep_fsinos(mp);
>  
>  	/* allocate per ag counters */
> -	sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
> +	sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
>  	if (sb_icount_ag == NULL)
>  		do_error(_("cannot alloc sb_icount_ag buffers\n"));
>  
> -	sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
> +	sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
>  	if (sb_ifree_ag == NULL)
>  		do_error(_("cannot alloc sb_ifree_ag buffers\n"));
>  
> -	sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
> +	sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
>  	if (sb_fdblocks_ag == NULL)
>  		do_error(_("cannot alloc sb_fdblocks_ag buffers\n"));
>  
> diff --git a/repair/phase6.c b/repair/phase6.c
> index 08636dc..373b1a5 100644
> --- a/repair/phase6.c
> +++ b/repair/phase6.c
> @@ -82,7 +82,7 @@ typedef struct dir_hash_ent {
>  	struct dir_hash_ent	*nextbyhash;	/* next in name bucket */
>  	struct dir_hash_ent	*nextbyorder;	/* next in order added */
>  	xfs_dahash_t		hashval;	/* hash value of name */
> -	__uint32_t		address;	/* offset of data entry */
> +	uint32_t		address;	/* offset of data entry */
>  	xfs_ino_t 		inum;		/* inode num of entry */
>  	short			junkit;		/* name starts with / */
>  	short			seen;		/* have seen leaf entry */
> @@ -170,11 +170,11 @@ static int
>  dir_hash_add(
>  	xfs_mount_t		*mp,
>  	dir_hash_tab_t		*hashtab,
> -	__uint32_t		addr,
> +	uint32_t		addr,
>  	xfs_ino_t		inum,
>  	int			namelen,
>  	unsigned char		*name,
> -	__uint8_t		ftype)
> +	uint8_t			ftype)
>  {
>  	xfs_dahash_t		hash = 0;
>  	int			byaddr;
> @@ -357,7 +357,7 @@ static void
>  dir_hash_update_ftype(
>  	dir_hash_tab_t		*hashtab,
>  	xfs_dir2_dataptr_t	addr,
> -	__uint8_t		ftype)
> +	uint8_t			ftype)
>  {
>  	int			i;
>  	dir_hash_ent_t		*p;
> @@ -1791,8 +1791,8 @@ longform_dir2_entry_check_data(
>  
>  		/* validate ftype field if supported */
>  		if (xfs_sb_version_hasftype(&mp->m_sb)) {
> -			__uint8_t dir_ftype;
> -			__uint8_t ino_ftype;
> +			uint8_t dir_ftype;
> +			uint8_t ino_ftype;
>  
>  			dir_ftype = M_DIROPS(mp)->data_get_ftype(dep);
>  			ino_ftype = get_inode_ftype(irec, ino_offset);
> @@ -2703,8 +2703,8 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
>  
>  		/* validate ftype field if supported */
>  		if (xfs_sb_version_hasftype(&mp->m_sb)) {
> -			__uint8_t dir_ftype;
> -			__uint8_t ino_ftype;
> +			uint8_t dir_ftype;
> +			uint8_t ino_ftype;
>  
>  			dir_ftype = M_DIROPS(mp)->sf_get_ftype(sfep);
>  			ino_ftype = get_inode_ftype(irec, ino_offset);
> diff --git a/repair/phase7.c b/repair/phase7.c
> index 8bce117..4ffb81a 100644
> --- a/repair/phase7.c
> +++ b/repair/phase7.c
> @@ -32,7 +32,7 @@ static void
>  update_inode_nlinks(
>  	xfs_mount_t 		*mp,
>  	xfs_ino_t		ino,
> -	__uint32_t		nlinks)
> +	uint32_t		nlinks)
>  {
>  	xfs_trans_t		*tp;
>  	xfs_inode_t		*ip;
> @@ -104,7 +104,7 @@ do_link_updates(
>  {
>  	ino_tree_node_t		*irec;
>  	int			j;
> -	__uint32_t		nrefs;
> +	uint32_t		nrefs;
>  
>  	for (irec = findfirst_inode_rec(agno); irec;
>  	     irec = next_ino_rec(irec)) {
> @@ -143,7 +143,7 @@ phase7(
>  	else
>  		do_log(_("Phase 7 - verify link counts...\n"));
>  
> -	set_progress_msg(PROGRESS_FMT_CORR_LINK, (__uint64_t) glob_agcount);
> +	set_progress_msg(PROGRESS_FMT_CORR_LINK, (uint64_t) glob_agcount);
>  
>  	create_work_queue(&wq, mp, scan_threads);
>  
> diff --git a/repair/progress.c b/repair/progress.c
> index 2a09b23..3a2e9a2 100644
> --- a/repair/progress.c
> +++ b/repair/progress.c
> @@ -85,8 +85,8 @@ pthread_t	report_thread;
>  typedef struct msg_block_s {
>  	pthread_mutex_t	mutex;
>  	progress_rpt_t	*format;
> -	__uint64_t	*done;
> -	__uint64_t	*total;
> +	uint64_t	*done;
> +	uint64_t	*total;
>  	int		count;
>  	int		interval;
>  } msg_block_t;
> @@ -96,14 +96,14 @@ typedef struct phase_times_s {
>  	time_t		start;
>  	time_t		end;
>  	time_t		duration;
> -	__uint64_t	item_counts[4];
> +	uint64_t	item_counts[4];
>  } phase_times_t;
>  static phase_times_t phase_times[8];
>  
>  static void *progress_rpt_thread(void *);
>  static int current_phase;
>  static int running;
> -static __uint64_t prog_rpt_total;
> +static uint64_t prog_rpt_total;
>  
>  void
>  init_progress_rpt (void)
> @@ -113,11 +113,11 @@ init_progress_rpt (void)
>  	 *  allocate the done vector
>  	 */
>  
> -	if ((prog_rpt_done = (__uint64_t *)
> -		malloc(sizeof(__uint64_t)*glob_agcount)) == NULL ) {
> +	if ((prog_rpt_done = (uint64_t *)
> +		malloc(sizeof(uint64_t)*glob_agcount)) == NULL ) {
>  		do_error(_("cannot malloc pointer to done vector\n"));
>  	}
> -	bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
> +	bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
>  
>  	/*
>  	 *  Setup comm block, start the thread
> @@ -165,10 +165,10 @@ progress_rpt_thread (void *p)
>  	timer_t timerid;
>  	struct itimerspec timespec;
>  	char *msgbuf;
> -	__uint64_t *donep;
> -	__uint64_t sum;
> +	uint64_t *donep;
> +	uint64_t sum;
>  	msg_block_t *msgp = (msg_block_t *)p;
> -	__uint64_t percent;
> +	uint64_t percent;
>  
>  	/* It's possible to get here very early w/ no progress msg set */
>  	if (!msgp->format)
> @@ -286,7 +286,7 @@ progress_rpt_thread (void *p)
>  }
>  
>  int
> -set_progress_msg (int report, __uint64_t total)
> +set_progress_msg (int report, uint64_t total)
>  {
>  
>  	if (!ag_stride)
> @@ -300,7 +300,7 @@ set_progress_msg (int report, __uint64_t total)
>  
>  	/* reset all the accumulative totals */
>  	if (prog_rpt_done)
> -		bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
> +		bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
>  
>  	if (pthread_mutex_unlock(&global_msgs.mutex))
>  		do_error(_("set_progress_msg: cannot unlock progress mutex\n"));
> @@ -308,14 +308,14 @@ set_progress_msg (int report, __uint64_t total)
>  	return (0);
>  }
>  
> -__uint64_t
> +uint64_t
>  print_final_rpt(void)
>  {
>  	int i;
>  	struct tm *tmp;
>  	time_t now;
> -	__uint64_t *donep;
> -	__uint64_t sum;
> +	uint64_t *donep;
> +	uint64_t sum;
>  	msg_block_t 	*msgp = &global_msgs;
>  	char		msgbuf[DURATION_BUF_SIZE];
>  
> diff --git a/repair/progress.h b/repair/progress.h
> index 33db834..5152648 100644
> --- a/repair/progress.h
> +++ b/repair/progress.h
> @@ -32,8 +32,8 @@
>  extern void init_progress_rpt(void);
>  extern void stop_progress_rpt(void);
>  extern void summary_report(void);
> -extern int  set_progress_msg(int report, __uint64_t total);
> -extern __uint64_t print_final_rpt(void);
> +extern int  set_progress_msg(int report, uint64_t total);
> +extern uint64_t print_final_rpt(void);
>  extern char *timestamp(int end, int phase, char *buf);
>  extern char *duration(int val, char *buf);
>  extern int do_parallel;
> diff --git a/repair/rmap.c b/repair/rmap.c
> index ab6e583..01d6f0f 100644
> --- a/repair/rmap.c
> +++ b/repair/rmap.c
> @@ -343,7 +343,7 @@ _("Insufficient memory while allocating raw metadata reverse mapping slabs."));
>  
>  static int
>  find_first_zero_bit(
> -	__uint64_t	mask)
> +	uint64_t	mask)
>  {
>  	int		n;
>  	int		b = 0;
> @@ -356,7 +356,7 @@ find_first_zero_bit(
>  
>  static int
>  popcnt(
> -	__uint64_t	mask)
> +	uint64_t	mask)
>  {
>  	int		n;
>  	int		b = 0;
> @@ -1064,14 +1064,14 @@ _("Incorrect reverse-mapping: saw (%u/%u) %slen %u owner %"PRId64" %s%soff \
>   * Compare the key fields of two rmap records -- positive if key1 > key2,
>   * negative if key1 < key2, and zero if equal.
>   */
> -__int64_t
> +int64_t
>  rmap_diffkeys(
>  	struct xfs_rmap_irec	*kp1,
>  	struct xfs_rmap_irec	*kp2)
>  {
>  	__u64			oa;
>  	__u64			ob;
> -	__int64_t		d;
> +	int64_t			d;
>  	struct xfs_rmap_irec	tmp;
>  
>  	tmp = *kp1;
> @@ -1081,7 +1081,7 @@ rmap_diffkeys(
>  	tmp.rm_flags &= ~XFS_RMAP_REC_FLAGS;
>  	ob = libxfs_rmap_irec_offset_pack(&tmp);
>  
> -	d = (__int64_t)kp1->rm_startblock - kp2->rm_startblock;
> +	d = (int64_t)kp1->rm_startblock - kp2->rm_startblock;
>  	if (d)
>  		return d;
>  
> @@ -1192,10 +1192,10 @@ fix_inode_reflink_flags(
>  {
>  	struct ino_tree_node	*irec;
>  	int			bit;
> -	__uint64_t		was;
> -	__uint64_t		is;
> -	__uint64_t		diff;
> -	__uint64_t		mask;
> +	uint64_t		was;
> +	uint64_t		is;
> +	uint64_t		diff;
> +	uint64_t		mask;
>  	int			error = 0;
>  	xfs_agino_t		agino;
>  
> diff --git a/repair/rmap.h b/repair/rmap.h
> index 752ece8..1616ab7 100644
> --- a/repair/rmap.h
> +++ b/repair/rmap.h
> @@ -44,7 +44,7 @@ extern int rmap_init_cursor(xfs_agnumber_t, struct xfs_slab_cursor **);
>  extern void rmap_avoid_check(void);
>  extern int rmaps_verify_btree(struct xfs_mount *, xfs_agnumber_t);
>  
> -extern __int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
> +extern int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
>  		struct xfs_rmap_irec *kp2);
>  extern void rmap_high_key_from_rec(struct xfs_rmap_irec *rec,
>  		struct xfs_rmap_irec *key);
> diff --git a/repair/sb.c b/repair/sb.c
> index 77e5154..acc9283 100644
> --- a/repair/sb.c
> +++ b/repair/sb.c
> @@ -40,7 +40,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest)
>  	xfs_ino_t	uquotino;
>  	xfs_ino_t	gquotino;
>  	xfs_ino_t	pquotino;
> -	__uint16_t	versionnum;
> +	uint16_t	versionnum;
>  
>  	rootino = dest->sb_rootino;
>  	rbmino = dest->sb_rbmino;
> @@ -106,8 +106,8 @@ verify_sb_blocksize(xfs_sb_t *sb)
>  static int
>  __find_secondary_sb(
>  	xfs_sb_t	*rsb,
> -	__uint64_t	start,
> -	__uint64_t	skip)
> +	uint64_t	start,
> +	uint64_t	skip)
>  {
>  	xfs_off_t	off;
>  	xfs_sb_t	*sb;
> @@ -187,13 +187,13 @@ __find_secondary_sb(
>  
>  static int
>  guess_default_geometry(
> -	__uint64_t		*agsize,
> -	__uint64_t		*agcount,
> +	uint64_t		*agsize,
> +	uint64_t		*agcount,
>  	libxfs_init_t		*x)
>  {
>  	struct fs_topology	ft;
>  	int			blocklog;
> -	__uint64_t		dblocks;
> +	uint64_t		dblocks;
>  	int			multidisk;
>  
>  	memset(&ft, 0, sizeof(ft));
> @@ -216,9 +216,9 @@ int
>  find_secondary_sb(xfs_sb_t *rsb)
>  {
>  	int		retval = 0;
> -	__uint64_t	agcount;
> -	__uint64_t	agsize;
> -	__uint64_t	skip;
> +	uint64_t	agcount;
> +	uint64_t	agsize;
> +	uint64_t	skip;
>  	int		blocklog;
>  
>  	/*
> @@ -229,7 +229,7 @@ find_secondary_sb(xfs_sb_t *rsb)
>  	do_warn(_("\nattempting to find secondary superblock...\n"));
>  
>  	if (verify_sb_blocksize(rsb) == 0) {
> -		skip = (__uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
> +		skip = (uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
>  		if (skip >= XFS_AG_MIN_BYTES && skip <= XFS_AG_MAX_BYTES)
>  			retval = __find_secondary_sb(rsb, skip, skip);
>  	}
> @@ -343,7 +343,7 @@ sb_validate_ino_align(struct xfs_sb *sb)
>  int
>  verify_sb(char *sb_buf, xfs_sb_t *sb, int is_primary_sb)
>  {
> -	__uint32_t	bsize;
> +	uint32_t	bsize;
>  	int		i;
>  	int		ret;
>  
> @@ -399,7 +399,7 @@ verify_sb(char *sb_buf, xfs_sb_t *sb, int is_primary_sb)
>  		sb->sb_dblocks < XFS_MIN_DBLOCKS(sb))
>  		return(XR_BAD_FS_SIZE_DATA);
>  
> -	if (sb->sb_agblklog != (__uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
> +	if (sb->sb_agblklog != (uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
>  		return(XR_BAD_FS_SIZE_DATA);
>  
>  	if (sb->sb_inodesize < XFS_DINODE_MIN_SIZE                     ||
> diff --git a/repair/scan.c b/repair/scan.c
> index b9ef4dc..447611a 100644
> --- a/repair/scan.c
> +++ b/repair/scan.c
> @@ -42,13 +42,13 @@ struct aghdr_cnts {
>  	xfs_agnumber_t	agno;
>  	xfs_extlen_t	agffreeblks;
>  	xfs_extlen_t	agflongest;
> -	__uint64_t	agfbtreeblks;
> -	__uint32_t	agicount;
> -	__uint32_t	agifreecount;
> -	__uint64_t	fdblocks;
> -	__uint64_t	usedblocks;
> -	__uint64_t	ifreecount;
> -	__uint32_t	fibtfreecount;
> +	uint64_t	agfbtreeblks;
> +	uint32_t	agicount;
> +	uint32_t	agifreecount;
> +	uint64_t	fdblocks;
> +	uint64_t	usedblocks;
> +	uint64_t	ifreecount;
> +	uint32_t	fibtfreecount;
>  };
>  
>  void
> @@ -70,10 +70,10 @@ scan_sbtree(
>  				xfs_agnumber_t		agno,
>  				int			suspect,
>  				int			isroot,
> -				__uint32_t		magic,
> +				uint32_t		magic,
>  				void			*priv),
>  	int		isroot,
> -	__uint32_t	magic,
> +	uint32_t	magic,
>  	void		*priv,
>  	const struct xfs_buf_ops *ops)
>  {
> @@ -110,23 +110,23 @@ scan_lbtree(
>  				xfs_fsblock_t		bno,
>  				xfs_ino_t		ino,
>  				xfs_rfsblock_t		*tot,
> -				__uint64_t		*nex,
> +				uint64_t		*nex,
>  				blkmap_t		**blkmapp,
>  				bmap_cursor_t		*bm_cursor,
>  				int			isroot,
>  				int			check_dups,
>  				int			*dirty,
> -				__uint64_t		magic),
> +				uint64_t		magic),
>  	int		type,
>  	int		whichfork,
>  	xfs_ino_t	ino,
>  	xfs_rfsblock_t	*tot,
> -	__uint64_t	*nex,
> +	uint64_t	*nex,
>  	blkmap_t	**blkmapp,
>  	bmap_cursor_t	*bm_cursor,
>  	int		isroot,
>  	int		check_dups,
> -	__uint64_t	magic,
> +	uint64_t	magic,
>  	const struct xfs_buf_ops *ops)
>  {
>  	xfs_buf_t	*bp;
> @@ -179,13 +179,13 @@ scan_bmapbt(
>  	xfs_fsblock_t		bno,
>  	xfs_ino_t		ino,
>  	xfs_rfsblock_t		*tot,
> -	__uint64_t		*nex,
> +	uint64_t		*nex,
>  	blkmap_t		**blkmapp,
>  	bmap_cursor_t		*bm_cursor,
>  	int			isroot,
>  	int			check_dups,
>  	int			*dirty,
> -	__uint64_t		magic)
> +	uint64_t		magic)
>  {
>  	int			i;
>  	int			err;
> @@ -548,7 +548,7 @@ scan_allocbt(
>  	xfs_agnumber_t		agno,
>  	int			suspect,
>  	int			isroot,
> -	__uint32_t		magic,
> +	uint32_t		magic,
>  	void			*priv)
>  {
>  	struct aghdr_cnts	*agcnts = priv;
> @@ -930,7 +930,7 @@ scan_rmapbt(
>  	xfs_agnumber_t		agno,
>  	int			suspect,
>  	int			isroot,
> -	__uint32_t		magic,
> +	uint32_t		magic,
>  	void			*priv)
>  {
>  	const char		*name = "rmap";
> @@ -1233,7 +1233,7 @@ scan_refcbt(
>  	xfs_agnumber_t		agno,
>  	int			suspect,
>  	int			isroot,
> -	__uint32_t		magic,
> +	uint32_t		magic,
>  	void			*priv)
>  {
>  	const char		*name = "refcount";
> @@ -1939,7 +1939,7 @@ scan_inobt(
>  	xfs_agnumber_t		agno,
>  	int			suspect,
>  	int			isroot,
> -	__uint32_t		magic,
> +	uint32_t		magic,
>  	void			*priv)
>  {
>  	struct aghdr_cnts	*agcnts = priv;
> @@ -2176,7 +2176,7 @@ validate_agf(
>  	struct aghdr_cnts	*agcnts)
>  {
>  	xfs_agblock_t		bno;
> -	__uint32_t		magic;
> +	uint32_t		magic;
>  
>  	bno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]);
>  	if (bno != 0 && verify_agbno(mp, agno, bno)) {
> @@ -2274,7 +2274,7 @@ validate_agi(
>  {
>  	xfs_agblock_t		bno;
>  	int			i;
> -	__uint32_t		magic;
> +	uint32_t		magic;
>  
>  	bno = be32_to_cpu(agi->agi_root);
>  	if (bno != 0 && verify_agbno(mp, agno, bno)) {
> @@ -2499,10 +2499,10 @@ scan_ags(
>  	int			scan_threads)
>  {
>  	struct aghdr_cnts *agcnts;
> -	__uint64_t	fdblocks = 0;
> -	__uint64_t	icount = 0;
> -	__uint64_t	ifreecount = 0;
> -	__uint64_t	usedblocks = 0;
> +	uint64_t	fdblocks = 0;
> +	uint64_t	icount = 0;
> +	uint64_t	ifreecount = 0;
> +	uint64_t	usedblocks = 0;
>  	xfs_agnumber_t	i;
>  	work_queue_t	wq;
>  
> diff --git a/repair/scan.h b/repair/scan.h
> index ea8c0bf..9bbe1e6 100644
> --- a/repair/scan.h
> +++ b/repair/scan.h
> @@ -30,23 +30,23 @@ int scan_lbtree(
>  				xfs_fsblock_t		bno,
>  				xfs_ino_t		ino,
>  				xfs_rfsblock_t		*tot,
> -				__uint64_t		*nex,
> +				uint64_t		*nex,
>  				struct blkmap		**blkmapp,
>  				bmap_cursor_t		*bm_cursor,
>  				int			isroot,
>  				int			check_dups,
>  				int			*dirty,
> -				__uint64_t		magic),
> +				uint64_t		magic),
>  	int		type,
>  	int		whichfork,
>  	xfs_ino_t	ino,
>  	xfs_rfsblock_t	*tot,
> -	__uint64_t	*nex,
> +	uint64_t	*nex,
>  	struct blkmap	**blkmapp,
>  	bmap_cursor_t	*bm_cursor,
>  	int		isroot,
>  	int		check_dups,
> -	__uint64_t	magic,
> +	uint64_t	magic,
>  	const struct xfs_buf_ops *ops);
>  
>  int scan_bmapbt(
> @@ -57,13 +57,13 @@ int scan_bmapbt(
>  	xfs_fsblock_t		bno,
>  	xfs_ino_t		ino,
>  	xfs_rfsblock_t		*tot,
> -	__uint64_t		*nex,
> +	uint64_t		*nex,
>  	struct blkmap		**blkmapp,
>  	bmap_cursor_t		*bm_cursor,
>  	int			isroot,
>  	int			check_dups,
>  	int			*dirty,
> -	__uint64_t		magic);
> +	uint64_t		magic);
>  
>  void
>  scan_ags(
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
---end quoted text---

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-18  1:32 ` [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot Darrick J. Wong
  2017-05-18  6:28   ` Christoph Hellwig
@ 2017-05-18  8:34   ` Dave Chinner
  2017-05-18 22:30     ` Darrick J. Wong
  1 sibling, 1 reply; 27+ messages in thread
From: Dave Chinner @ 2017-05-18  8:34 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: xfs, Eric Sandeen

On Wed, May 17, 2017 at 06:32:42PM -0700, Darrick J. Wong wrote:
> Apparently there are certain system software configurations that do odd
> things like update the kernel and reboot without umounting the /boot fs
> or remounting it readonly, either of which would push all the AIL items
> out to disk.  As a result, a subsequent invocation of something like
> grub (which has a frightening willingness to read a fs with a dirty log)
> can read stale disk contents and/or miss files the metadata for which
> have been written to the log but not checkpointed into the filesystem.

> Granted, most of the time /boot is a separate partition and
> systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
> This "fix" is only needed for people who have one giant filesystem.

Let me guess the series of events: grub calls "sync" and says "I'm
done", then user runs an immediate reboot/shutdown and something
still running after init has killed everything but PID 1 has an open
writeable file descriptor causing the remount-ro of / to return
EBUSY and so it just shuts down/restarts with an unflushed log?

> Therefore, add a reboot hook to freeze the rw filesystems (which
> checkpoints the log) just prior to reboot.  This is an unfortunate and
> insufficient workaround for multiple layers of inadequate external
> software, but at least it will reduce boot time surprises for the "OS
> updater failed to disengage the filesystem before rebooting" case.
> 
> Seeing as grub is unlikely ever to learn to replay the XFS log (and we
> probably don't want it doing that),

If anything other than XFS code modifies the filesystem (log,
metadata or data) then we have a tainted, unsuportable filesystem
image.....

> *LILO has been discontinued for at least 18 months,

Yet Lilo still works just fine.

> and we're not quite to the point of putting kernel
> files directly on the EFI System Partition,

Really? How have we not got there yet - we were doing this almost
15 years ago with ia64 and elilo via mounting the EFI partition on
/boot....

> this seems like the least
> crappy solution to this problem.
> 
> Yes, you're still screwed in grub if the system crashes. :)

This really sounds like the perennial "grub doesn't ensure the
information it requires to boot is safely on stable storage before
reboot" problem combined with some sub-optimal init behaviour to
expose the grub issue....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-18  8:34   ` Dave Chinner
@ 2017-05-18 22:30     ` Darrick J. Wong
  2017-05-19 19:09       ` Chris Murphy
  0 siblings, 1 reply; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-18 22:30 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs, Eric Sandeen

On Thu, May 18, 2017 at 06:34:05PM +1000, Dave Chinner wrote:
> On Wed, May 17, 2017 at 06:32:42PM -0700, Darrick J. Wong wrote:
> > Apparently there are certain system software configurations that do odd
> > things like update the kernel and reboot without umounting the /boot fs
> > or remounting it readonly, either of which would push all the AIL items
> > out to disk.  As a result, a subsequent invocation of something like
> > grub (which has a frightening willingness to read a fs with a dirty log)
> > can read stale disk contents and/or miss files the metadata for which
> > have been written to the log but not checkpointed into the filesystem.
> 
> > Granted, most of the time /boot is a separate partition and
> > systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
> > This "fix" is only needed for people who have one giant filesystem.
> 
> Let me guess the series of events: grub calls "sync" and says "I'm

dpkg/rpm/systemd/CABEXTRACT.EXE/whatever, but yes :)

> done", then user runs an immediate reboot/shutdown and something
> still running after init has killed everything but PID 1 has an open

Worse than that, actually -- it was plymouthd, aka the splash screen.
If plymouthd isn't running, then the ro remount succeeds (not that
systemd actually checks) and grub is fine afterwards.

> writeable file descriptor causing the remount-ro of / to return
> EBUSY and so it just shuts down/restarts with an unflushed log?

Yes, it's /that/ problem again, that you and I were going 'round and
'round about a month or two ago.  I decided that I could at least try to
get something merged to reduce the user pain, even if the real problem
is herpy derpy userspace.

> > Therefore, add a reboot hook to freeze the rw filesystems (which
> > checkpoints the log) just prior to reboot.  This is an unfortunate and
> > insufficient workaround for multiple layers of inadequate external
> > software, but at least it will reduce boot time surprises for the "OS
> > updater failed to disengage the filesystem before rebooting" case.
> > 
> > Seeing as grub is unlikely ever to learn to replay the XFS log (and we
> > probably don't want it doing that),
> 
> If anything other than XFS code modifies the filesystem (log,
> metadata or data) then we have a tainted, unsuportable filesystem
> image.....

Indeed.

> > *LILO has been discontinued for at least 18 months,
> 
> Yet Lilo still works just fine.

Ok fine it's been /totally stable/ for 18 months. ;)
https://lilo.alioth.debian.org/

FWIW lilo isn't compatible with reflinked inodes (admittedly unlikely on
/boot) but 

> > and we're not quite to the point of putting kernel
> > files directly on the EFI System Partition,
> 
> Really? How have we not got there yet - we were doing this almost
> 15 years ago with ia64 and elilo via mounting the EFI partition on
> /boot....

elilo also seems dead, according to its SF page.
https://sourceforge.net/projects/elilo/

I'm not sure why we don't just drop kernel+initrd into the ESP and
create a bootloader entry via efibootmgr, other than the ages ago
reports about EFI firmwares bricking if the nvram fills up with data:
https://mjg59.dreamwidth.org/22855.html

Though I imagine certain distros don't want to have to get their kernels
signed by Microsoft so that Secure Boot works or whatever, etc. etc.
I guess elilo was a nice shim for that.

> > this seems like the least
> > crappy solution to this problem.
> > 
> > Yes, you're still screwed in grub if the system crashes. :)
> 
> This really sounds like the perennial "grub doesn't ensure the
> information it requires to boot is safely on stable storage before
> reboot" problem combined with some sub-optimal init behaviour to
> expose the grub issue....

Yep!  Anyway Christoph is right, this isn't something that plagues only
XFS; Ted was also musing that ext4 likely needs the same workaround, so
I'll go move this to fsdevel. :)

--D

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-18 22:30     ` Darrick J. Wong
@ 2017-05-19 19:09       ` Chris Murphy
  2017-05-19 21:00         ` Darrick J. Wong
  0 siblings, 1 reply; 27+ messages in thread
From: Chris Murphy @ 2017-05-19 19:09 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Dave Chinner, xfs, Eric Sandeen

On Thu, May 18, 2017 at 4:30 PM, Darrick J. Wong
<darrick.wong@oracle.com> wrote:
> On Thu, May 18, 2017 at 06:34:05PM +1000, Dave Chinner wrote:
>> On Wed, May 17, 2017 at 06:32:42PM -0700, Darrick J. Wong wrote:
>> > Apparently there are certain system software configurations that do odd
>> > things like update the kernel and reboot without umounting the /boot fs
>> > or remounting it readonly, either of which would push all the AIL items
>> > out to disk.  As a result, a subsequent invocation of something like
>> > grub (which has a frightening willingness to read a fs with a dirty log)
>> > can read stale disk contents and/or miss files the metadata for which
>> > have been written to the log but not checkpointed into the filesystem.
>>
>> > Granted, most of the time /boot is a separate partition and
>> > systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
>> > This "fix" is only needed for people who have one giant filesystem.
>>
>> Let me guess the series of events: grub calls "sync" and says "I'm
>
> dpkg/rpm/systemd/CABEXTRACT.EXE/whatever, but yes :)


It has nothing to do with GRUB. The exact same problem would happen
regardless of bootloader because the thing writing out bootloader
configuration prior to reboot is grubby, which is not at all in any
way related to GRUB.

I've explained this before, and now Dave's continued misstatements are
propagating to Darrick. If you guys want to believe in untrue things,
have at it. But please stop repeating untrue things.


>
>> done", then user runs an immediate reboot/shutdown and something
>> still running after init has killed everything but PID 1 has an open
>
> Worse than that, actually -- it was plymouthd, aka the splash screen.
> If plymouthd isn't running, then the ro remount succeeds (not that
> systemd actually checks) and grub is fine afterwards.
>
>> writeable file descriptor causing the remount-ro of / to return
>> EBUSY and so it just shuts down/restarts with an unflushed log?
>
> Yes, it's /that/ problem again, that you and I were going 'round and
> 'round about a month or two ago.  I decided that I could at least try to
> get something merged to reduce the user pain, even if the real problem
> is herpy derpy userspace.


Note that plymouth is doing the wrong thing per systemd's own
documentation. Plymouth has asked systemd to be exempt from being
killed, which systemd honors, but documentation says that programs
should not request such exemption on root file systems and should
instead run from the initramfs if they must be non-killable.

Both systemd and plymouth upstreams are aware of this and have been
looking into their own solution the problem, I don't know why they
consider the fix invasive, but that's how it's been characterized.

And I've argued to systemd folks that they need to take some
responsibility for this because this happens during their
offline-update.target which which a particular boot mode that is
explicitly designed for system software updates, and it's used because
it's supposed to be a safe, stable, known environment, compared to
doing updates while a bunch of stuff including a desktop environment
is running. And yet - poof - it yanks the file system out from under
itself.

Now originally they were blaming the file systems, saying that sync()
is supposed to guarantee everything, data and metadata is completely
written to stable media. But I think that definition of sync()
predates journaled file systems, so now there's broad understanding in
fs circles that journaled file systems only guarantee the journal and
data are committed to stable media, not the fs metadata itself. And do
require sync() to apply to fs metadata, I suspect means file systems
would become slower than molasses in winter.


>
>> > Therefore, add a reboot hook to freeze the rw filesystems (which
>> > checkpoints the log) just prior to reboot.  This is an unfortunate and
>> > insufficient workaround for multiple layers of inadequate external
>> > software, but at least it will reduce boot time surprises for the "OS
>> > updater failed to disengage the filesystem before rebooting" case.
>> >
>> > Seeing as grub is unlikely ever to learn to replay the XFS log (and we
>> > probably don't want it doing that),
>>
>> If anything other than XFS code modifies the filesystem (log,
>> metadata or data) then we have a tainted, unsuportable filesystem
>> image.....
>
> Indeed.

Doesn't mount -o ro still do journal replay but then doesn't write any
fixes back to stable media? Why can't the bootloader do this? GRUB2
for a rather long time now has a 4GiB memory limit on 32-bit and GRUB
devs have said this could be lifted higher on 64-bit. There is no
640KiB limit for GRUB.


>
>> > *LILO has been discontinued for at least 18 months,
>>
>> Yet Lilo still works just fine.
>
> Ok fine it's been /totally stable/ for 18 months. ;)
> https://lilo.alioth.debian.org/
>
> FWIW lilo isn't compatible with reflinked inodes (admittedly unlikely on
> /boot) but


This whole LILO thing is irritating. I don't know how many times I
have to say it...

grubby is the sole thing responsible for writing bootloader
configuration changes, no matter the bootloader, on Red Hat and Fedora
systems. There is absolutely no difference between LILO and GRUB
bootloader configuration changes on these distros.


>
>> > and we're not quite to the point of putting kernel
>> > files directly on the EFI System Partition,
>>
>> Really? How have we not got there yet - we were doing this almost
>> 15 years ago with ia64 and elilo via mounting the EFI partition on
>> /boot....
>
> elilo also seems dead, according to its SF page.
> https://sourceforge.net/projects/elilo/
>
> I'm not sure why we don't just drop kernel+initrd into the ESP and
> create a bootloader entry via efibootmgr,


I explained this too already.

So long as there is dual boot, this is a dead end. There isn't enough
room on ESP's for this, and it can't be grown, and it's unreliable to
have two ESPs on  the same system due to myriad UEFI bugs, and also it
confuses Windows. So it's not ever going to happen except on Linux
only systems.



>> This really sounds like the perennial "grub doesn't ensure the
>> information it requires to boot is safely on stable storage before
>> reboot" problem combined with some sub-optimal init behaviour to
>> expose the grub issue....
>
> Yep!  Anyway Christoph is right, this isn't something that plagues only
> XFS; Ted was also musing that ext4 likely needs the same workaround, so
> I'll go move this to fsdevel. :)


*facepalm* You guys are driving me crazy.

1. The grub.cfg is modified by grubby. Not grub. The same damn problem
would happen no matter what bootloader is used.
2. It's not just the grub.cfg that cannot be found by GRUB. It can't
find the new kernel file, any of its modules, or the new initramfs.
None of that has XFS file system metadata either. It's all simply not
there as far as the bootloader is concerned. And all of those things
were written by RPM.

So to be consistent you have to blame RPM for not ensuring its writes
are safely on stable storage either, before reboot.

Jesus Christ...

I want Dave to write "this problem has nothing to do with GRUB" 50
times on a chalkboard.

And then I want him to strace grub2-mkconfig (which grubby does not
use, which no Fedora or Red Hat system uses except one time during the
original installation of the system) to prove his claim that grub
isn't ensuring bootloader configuration info isn't getting to stable
storage. Otherwise this is just handwaiving without evidence. If the
GRUB folks are doing something wrong, seeing as all other distros do
rely upon it, then it needs to get fixed. But claiming things without
evidence is super shitty.

Now I just tried to strace grub2-mkconfig with -ff and I get literally
2880+ files. That is batshit crazy, but aside from that I think the
most relevant child process that writes out the actual final grub.cfg
is this:

https://paste.fedoraproject.org/paste/iksyeiYhxAIgbrbrugqOzV5M1UNdIGYhyRLivL9gydE=

I don't know what its not doing that it should be doing, but then also
RPM must also not being doing it.

-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-19 19:09       ` Chris Murphy
@ 2017-05-19 21:00         ` Darrick J. Wong
  2017-05-20  0:27           ` Chris Murphy
       [not found]           ` <20170522020112.GV17542@dastard>
  0 siblings, 2 replies; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-19 21:00 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Dave Chinner, xfs, Eric Sandeen

On Fri, May 19, 2017 at 01:09:31PM -0600, Chris Murphy wrote:
> On Thu, May 18, 2017 at 4:30 PM, Darrick J. Wong
> <darrick.wong@oracle.com> wrote:
> > On Thu, May 18, 2017 at 06:34:05PM +1000, Dave Chinner wrote:
> >> On Wed, May 17, 2017 at 06:32:42PM -0700, Darrick J. Wong wrote:
> >> > Apparently there are certain system software configurations that do odd
> >> > things like update the kernel and reboot without umounting the /boot fs
> >> > or remounting it readonly, either of which would push all the AIL items
> >> > out to disk.  As a result, a subsequent invocation of something like
> >> > grub (which has a frightening willingness to read a fs with a dirty log)
> >> > can read stale disk contents and/or miss files the metadata for which
> >> > have been written to the log but not checkpointed into the filesystem.
> >>
> >> > Granted, most of the time /boot is a separate partition and
> >> > systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
> >> > This "fix" is only needed for people who have one giant filesystem.
> >>
> >> Let me guess the series of events: grub calls "sync" and says "I'm
> >
> > dpkg/rpm/systemd/CABEXTRACT.EXE/whatever, but yes :)
> 
> 
> It has nothing to do with GRUB. The exact same problem would happen
> regardless of bootloader because the thing writing out bootloader
> configuration prior to reboot is grubby, which is not at all in any
> way related to GRUB.
> 
> I've explained this before, and now Dave's continued misstatements are
> propagating to Darrick. If you guys want to believe in untrue things,
> have at it. But please stop repeating untrue things.

I need to clarify here what I meant by
"dpkg/rpm/systemd/CABEXTRACT.EXE/whatever, but yes". is that the thing
that writes to the filesystem prior to the reboot -- the package manager
and the boot configuration file writer.  Not the grub stage1/2/3, not
the lilo binary, not any of the bootloaders.  I won't speak for Dave but
I think you and I are roughly on the same page here.

> >> done", then user runs an immediate reboot/shutdown and something
> >> still running after init has killed everything but PID 1 has an open
> >
> > Worse than that, actually -- it was plymouthd, aka the splash screen.
> > If plymouthd isn't running, then the ro remount succeeds (not that
> > systemd actually checks) and grub is fine afterwards.
> >
> >> writeable file descriptor causing the remount-ro of / to return
> >> EBUSY and so it just shuts down/restarts with an unflushed log?
> >
> > Yes, it's /that/ problem again, that you and I were going 'round and
> > 'round about a month or two ago.  I decided that I could at least try to
> > get something merged to reduce the user pain, even if the real problem
> > is herpy derpy userspace.
> 
> 
> Note that plymouth is doing the wrong thing per systemd's own
> documentation. Plymouth has asked systemd to be exempt from being
> killed, which systemd honors, but documentation says that programs
> should not request such exemption on root file systems and should
> instead run from the initramfs if they must be non-killable.
> 
> Both systemd and plymouth upstreams are aware of this and have been
> looking into their own solution the problem, I don't know why they
> consider the fix invasive, but that's how it's been characterized.
> 
> And I've argued to systemd folks that they need to take some
> responsibility for this because this happens during their
> offline-update.target which which a particular boot mode that is
> explicitly designed for system software updates, and it's used because
> it's supposed to be a safe, stable, known environment, compared to
> doing updates while a bunch of stuff including a desktop environment
> is running. And yet - poof - it yanks the file system out from under
> itself.
> 
> Now originally they were blaming the file systems, saying that sync()
> is supposed to guarantee everything, data and metadata is completely
> written to stable media. But I think that definition of sync()
> predates journaled file systems, so now there's broad understanding in
> fs circles that journaled file systems only guarantee the journal and
> data are committed to stable media, not the fs metadata itself.

Right.  Everything's committed to stable media /somewhere/, but the
metadata isn't necessarily where an fs driver will find it if that
driver ignores the dirty log.

> And do require sync() to apply to fs metadata, I suspect means file
> systems would become slower than molasses in winter.

Probably.

> >> > Therefore, add a reboot hook to freeze the rw filesystems (which
> >> > checkpoints the log) just prior to reboot.  This is an unfortunate and
> >> > insufficient workaround for multiple layers of inadequate external
> >> > software, but at least it will reduce boot time surprises for the "OS
> >> > updater failed to disengage the filesystem before rebooting" case.
> >> >
> >> > Seeing as grub is unlikely ever to learn to replay the XFS log (and we
> >> > probably don't want it doing that),
> >>
> >> If anything other than XFS code modifies the filesystem (log,
> >> metadata or data) then we have a tainted, unsuportable filesystem
> >> image.....
> >
> > Indeed.
> 
> Doesn't mount -o ro still do journal replay but then doesn't write any
> fixes back to stable media?

There are multiple opinions about what an ro mount means.  The most
common I've heard are "userspace cannot change files but the fs can
write to the underlying block device" and "userspace cannot change files
and the fs cannot write to the underlying block device".  XFS does the
second if the block device is ro, and the first if it is rw.

> Why can't the bootloader do this? GRUB2 for a rather long time now has
> a 4GiB memory limit on 32-bit and GRUB devs have said this could be
> lifted higher on 64-bit. There is no 640KiB limit for GRUB.

I don't think the XFS community will look fondly on a second competing
log implementation since the XFS log is rather more complex than jbd2.

> >> > *LILO has been discontinued for at least 18 months,
> >>
> >> Yet Lilo still works just fine.
> >
> > Ok fine it's been /totally stable/ for 18 months. ;)
> > https://lilo.alioth.debian.org/
> >
> > FWIW lilo isn't compatible with reflinked inodes (admittedly unlikely on
> > /boot) but
> 
> 
> This whole LILO thing is irritating. I don't know how many times I
> have to say it...
> 
> grubby is the sole thing responsible for writing bootloader
> configuration changes, no matter the bootloader, on Red Hat and Fedora
> systems. There is absolutely no difference between LILO and GRUB
> bootloader configuration changes on these distros.

I'm tired of getting beat over the head about this.  There's no grubby
on Debian!

# apt-cache search grubby
<nothing>

# dpkg -S /etc/kernel/postinst.d/zz-update-grub 
grub-efi-amd64: /etc/kernel/postinst.d/zz-update-grub

zz-update-grub calls update-grub:

# dpkg -S $(which update-grub)
grub2-common: /usr/sbin/update-grub

update-grub calls grub-mkconfig:

# dpkg -S $(which grub-mkconfig)
grub-common: /usr/sbin/grub-mkconfig

# head -n30 /usr/sbin/grub-mkconfig
head -n30 !$
head -n30 /usr/sbin/grub-mkconfig
#! /bin/sh
set -e

# Generate grub.cfg by inspecting /boot contents.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# strace -f -o /tmp/a update-grub
# egrep '(/boot.*cfg|sync)' /tmp/a
20879 execve("/usr/share/djwong-colorgcc/grub-mkconfig", ["grub-mkconfig", "-o", "/boot/grub/grub.cfg"], [/* 31 vars */]) = -1 ENOENT (No such file or directory)
20879 execve("/usr/local/sbin/grub-mkconfig", ["grub-mkconfig", "-o", "/boot/grub/grub.cfg"], [/* 31 vars */]) = -1 ENOENT (No such file or directory)
20879 execve("/usr/local/bin/grub-mkconfig", ["grub-mkconfig", "-o", "/boot/grub/grub.cfg"], [/* 31 vars */]) = -1 ENOENT (No such file or directory)
20879 execve("/usr/sbin/grub-mkconfig", ["grub-mkconfig", "-o", "/boot/grub/grub.cfg"], [/* 31 vars */]) = 0
20882 write(1, "/boot/grub/grub.cfg\n", 20 <unfinished ...>
20879 <... read resumed> "/boot/grub/grub.cfg\n", 128) = 20
20961 execve("/bin/rm", ["rm", "-f", "/boot/grub/grub.cfg.new"], [/* 50 vars */]) = 0
20961 newfstatat(AT_FDCWD, "/boot/grub/grub.cfg.new", 0x1f48948, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
20961 unlinkat(AT_FDCWD, "/boot/grub/grub.cfg.new", 0) = -1 ENOENT (No such file or directory)
20879 open("/boot/grub/grub.cfg.new", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
22199 execve("/bin/grep", ["grep", "^password", "/boot/grub/grub.cfg.new"], [/* 50 vars */]) = 0
22199 openat(AT_FDCWD, "/boot/grub/grub.cfg.new", O_RDONLY|O_NOCTTY) = 3
22200 execve("/bin/chmod", ["chmod", "444", "/boot/grub/grub.cfg.new"], [/* 50 vars */]) = 0
22200 stat("/boot/grub/grub.cfg.new", {st_mode=S_IFREG|0600, st_size=10329, ...}) = 0
22200 fchmodat(AT_FDCWD, "/boot/grub/grub.cfg.new", 0444) = 0
22201 execve("/usr/bin/grub-script-check", ["/usr/bin/grub-script-check", "/boot/grub/grub.cfg.new"], [/* 50 vars */]) = 0
22201 open("/boot/grub/grub.cfg.new", O_RDONLY) = 3
22202 execve("/bin/mv", ["mv", "-f", "/boot/grub/grub.cfg.new", "/boot/grub/grub.cfg"], [/* 50 vars */]) = 0
22202 stat("/boot/grub/grub.cfg", {st_mode=S_IFREG|0444, st_size=10329, ...}) = 0
22202 lstat("/boot/grub/grub.cfg.new", {st_mode=S_IFREG|0444, st_size=10329, ...}) = 0
22202 lstat("/boot/grub/grub.cfg", {st_mode=S_IFREG|0444, st_size=10329, ...}) = 0
22202 rename("/boot/grub/grub.cfg.new", "/boot/grub/grub.cfg") = 0

(No *sync(), huh?)

So, no, grub actually /does/ generate grub.cfg on Debian.  Let's go have
a look at RHEL7.3, which I agree does have grubby:

# rpm -qf /etc/kernel/postinst.d/51-dracut-rescue-postinst.sh 
dracut-config-rescue-033-463.0.2.el7.x86_64

51-dracut-rescue-postinst.sh calls new-kernel-pkg:

# rpm -qf $(which new-kernel-pkg)
grubby-8.28-21.0.1.el7_3.x86_64
# grub-mkconfig
-bash: grub-mkconfig: command not found
# strace -f -o /tmp/a grubby --update-kernel /boot/vmlinuz-3.10.0-514.16.1.el7.x86_64
...
# grep /boot.*cfg /tmp/a
14568 readlink("grub2.cfg", "../boot/grub2/grub.cfg", 256) = 22
14568 open("../boot/grub2/grub.cfg-", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
14568 stat("../boot/grub2/grub.cfg", {st_mode=S_IFREG|0644, st_size=8731, ...}) = 0
14568 chmod("../boot/grub2/grub.cfg-", 0644) = 0
14572 fsync(4)
14568 rename("../boot/grub2/grub.cfg-", "../boot/grub2/grub.cfg") = 0

(we only fsync the grubenv file??)

So yes, grubby does handle things for RHEL and Fedora, but RHEL and
Fedora are not the entire universe.

> >> > and we're not quite to the point of putting kernel
> >> > files directly on the EFI System Partition,
> >>
> >> Really? How have we not got there yet - we were doing this almost
> >> 15 years ago with ia64 and elilo via mounting the EFI partition on
> >> /boot....
> >
> > elilo also seems dead, according to its SF page.
> > https://sourceforge.net/projects/elilo/
> >
> > I'm not sure why we don't just drop kernel+initrd into the ESP and
> > create a bootloader entry via efibootmgr,
> 
> 
> I explained this too already.
> 
> So long as there is dual boot, this is a dead end. There isn't enough
> room on ESP's for this, and it can't be grown, and it's unreliable to
> have two ESPs on  the same system due to myriad UEFI bugs, and also it
> confuses Windows. So it's not ever going to happen except on Linux
> only systems.

Fair enough.  Though truth be told, /boot can be small and unresizable
which just leads to problems if the distro doesn't take care of reaping
old kernel packages before installing new ones.

Though /boot tends to be bigger than the default ESPs I see.

> >> This really sounds like the perennial "grub doesn't ensure the
> >> information it requires to boot is safely on stable storage before
> >> reboot" problem combined with some sub-optimal init behaviour to
> >> expose the grub issue....
> >
> > Yep!  Anyway Christoph is right, this isn't something that plagues only
> > XFS; Ted was also musing that ext4 likely needs the same workaround, so
> > I'll go move this to fsdevel. :)
> 
> 
> *facepalm* You guys are driving me crazy.
> 
> 1. The grub.cfg is modified by grubby. Not grub.  The same damn
> problem would happen no matter what bootloader is used.
>
> 2. It's not just the grub.cfg that cannot be found by GRUB. It can't
> find the new kernel file, any of its modules, or the new initramfs.
> None of that has XFS file system metadata either.

Those new files /do/ have XFS metadata; the metadata is sitting
(uncheckpointed) in the log.

> It's all simply not there as far as the bootloader is concerned.

Yes, because the bootloader ignores dirty logs and goes looking for
directories and files, the metadata for which is sitting
(uncheckpointed) in the log.

> And all of those things were written by RPM.

Would it help if I mentioned this --

*sync() -> write data to disk, write metadata to log
FIFREEZE() -> sync() and write log contents to fs.
unmount() -> sync() write log contents to fs.
reboot() -> sync() and reboot.

So if you're going to write data to a filesystem that has to be read by
a piece of software that /ignores dirty logs/, you have to write the log
to disk before you reboot.  This can be unmount or freeze, take your
pick.  You cannot sync, because sync only ensures that everything is
/somewhere/ on the stable medium.  It does not guarantee that log
contents have been written to the fs.

> So to be consistent you have to blame RPM for not ensuring its writes
> are safely on stable storage either, before reboot.
> 
> Jesus Christ...
> 
> I want Dave to write "this problem has nothing to do with GRUB" 50
> times on a chalkboard.

Frankly, all you have to do is tweak the grub config file writer to
"fsfreeze -f /boot && fsfreeze -u /boot" after it writes the grub.cfg and
before it exits.  That's both grubby and grub-mkconfig.

Or systemd/sysvinit could always ensure that the fs containing the boot
files is unmounted no matter what.  Or systemd/sysvinit could freeze the
fs for us before asking for a reboot.  Or the kernel could freeze the fs
for us before actually doing the reboot.  Any one of those options is
sufficient, but not one of them is reliably performed by any of the
pieces.  systemd *almost* always succeed at unmounting /boot, which is
why few people see this problem.

> And then I want him to strace grub2-mkconfig (which grubby does not
> use, which no Fedora or Red Hat system uses except one time during the
> original installation of the system) to prove his claim that grub
> isn't ensuring bootloader configuration info isn't getting to stable
> storage. Otherwise this is just handwaiving without evidence. If the
> GRUB folks are doing something wrong, seeing as all other distros do
> rely upon it, then it needs to get fixed. But claiming things without
> evidence is super shitty.
> 
> Now I just tried to strace grub2-mkconfig with -ff and I get literally
> 2880+ files. That is batshit crazy, but aside from that I think the
> most relevant child process that writes out the actual final grub.cfg
> is this:
> 
> https://paste.fedoraproject.org/paste/iksyeiYhxAIgbrbrugqOzV5M1UNdIGYhyRLivL9gydE=
> 
> I don't know what its not doing that it should be doing, but then also
> RPM must also not being doing it.
> 
> -- 
> Chris Murphy
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-19 21:00         ` Darrick J. Wong
@ 2017-05-20  0:27           ` Chris Murphy
  2017-05-22  2:07             ` Dave Chinner
       [not found]           ` <20170522020112.GV17542@dastard>
  1 sibling, 1 reply; 27+ messages in thread
From: Chris Murphy @ 2017-05-20  0:27 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Chris Murphy, Dave Chinner, xfs, Eric Sandeen

On Fri, May 19, 2017 at 3:00 PM, Darrick J. Wong
<darrick.wong@oracle.com> wrote:


> Would it help if I mentioned this --
>
> *sync() -> write data to disk, write metadata to log
> FIFREEZE() -> sync() and write log contents to fs.
> unmount() -> sync() write log contents to fs.
> reboot() -> sync() and reboot.
>
> So if you're going to write data to a filesystem that has to be read by
> a piece of software that /ignores dirty logs/, you have to write the log
> to disk before you reboot.  This can be unmount or freeze, take your
> pick.  You cannot sync, because sync only ensures that everything is
> /somewhere/ on the stable medium.  It does not guarantee that log
> contents have been written to the fs.

Yes that helps quite a bit.


> Frankly, all you have to do is tweak the grub config file writer to
> "fsfreeze -f /boot && fsfreeze -u /boot" after it writes the grub.cfg and
> before it exits.  That's both grubby and grub-mkconfig.

I am willing to bet that their assumption has been, since ancient
times, that PID 1 umounts the file system before reboot, thereby
writing log contents to the file system. And it's not just these two
programs, there's probably bunches of kernel updates that are done by
myriad scripts that likewise assume on umount happening before reboot.


For sure systemd devs did not previously understand that sync() does
not write the log contents to the file system, and I think they are
open to the idea of falling back to FIFREEZE if remount-ro or umount
fail, before doing a reboot. That is functionally equivalent to what
they thought sync() was doing, after all.

Does that that alter your assessment of where to fix this?


> Or systemd/sysvinit could always ensure that the fs containing the boot
> files is unmounted no matter what.

systemd has an explicit feature allowing programs to opt out and so
far the feature can be abused contrary to documentation. So it's
definitely not reasonable (anymore) that PID 1 guarantees remount-ro
or umount prior to reboot.


>Or systemd/sysvinit could freeze the
> fs for us before asking for a reboot.

I think that's very plausible, but I do not speak for the systemd folks.

>Or the kernel could freeze the fs
> for us before actually doing the reboot.  Any one of those options is
> sufficient, but not one of them is reliably performed by any of the
> pieces.  systemd *almost* always succeed at unmounting /boot, which is
> why few people see this problem.

I can't assess what is better, systemd doing freeze, vs the kernel, vs
bootloader scripts. I think the path of least resistance is systemd
doing it, that more closely mimics historical assumptions anyway.

If there is a better way of doing it than history proposes, that's
fine also. But I think the fsdevel folks should actually have a direct
conversation with the systemd folks, to arrest the wrong assumptions
about sync() vs FIFREEZE(), and avoid duplicate efforts.

-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-20  0:27           ` Chris Murphy
@ 2017-05-22  2:07             ` Dave Chinner
  0 siblings, 0 replies; 27+ messages in thread
From: Dave Chinner @ 2017-05-22  2:07 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Darrick J. Wong, xfs, Eric Sandeen

On Fri, May 19, 2017 at 06:27:53PM -0600, Chris Murphy wrote:
> On Fri, May 19, 2017 at 3:00 PM, Darrick J. Wong
> <darrick.wong@oracle.com> wrote:
> > Frankly, all you have to do is tweak the grub config file writer to
> > "fsfreeze -f /boot && fsfreeze -u /boot" after it writes the grub.cfg and
> > before it exits.  That's both grubby and grub-mkconfig.
> 
> I am willing to bet that their assumption has been, since ancient
> times, that PID 1 umounts the file system before reboot, thereby
> writing log contents to the file system. And it's not just these two
> programs, there's probably bunches of kernel updates that are done by
> myriad scripts that likewise assume on umount happening before reboot.

This is not relevant to the discussion, because sync(1) is
sufficient for those updates to be accessible after reboot because
the filesystem replays the log at mount time and the changes are not
accessed until the filesystem is mounted.

IOWs, the problem is purely a bootloader issue due to the fact it is
the only software on the system that directly accesses the
filesystem metadata prior to log recovery being performed at boot
time.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
       [not found]           ` <20170522020112.GV17542@dastard>
@ 2017-05-22 20:46             ` Chris Murphy
  2017-05-23  3:56               ` Chris Murphy
                                 ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Chris Murphy @ 2017-05-22 20:46 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Darrick J. Wong, Chris Murphy, xfs, Eric Sandeen

On Sun, May 21, 2017 at 8:01 PM, Dave Chinner <david@fromorbit.com> wrote:
> On Fri, May 19, 2017 at 02:00:40PM -0700, Darrick J. Wong wrote:
>> On Fri, May 19, 2017 at 01:09:31PM -0600, Chris Murphy wrote:
>> > On Thu, May 18, 2017 at 4:30 PM, Darrick J. Wong
>> > <darrick.wong@oracle.com> wrote:
>> > > On Thu, May 18, 2017 at 06:34:05PM +1000, Dave Chinner wrote:
>> > >> On Wed, May 17, 2017 at 06:32:42PM -0700, Darrick J. Wong wrote:
>> > >> > Apparently there are certain system software configurations that do odd
>> > >> > things like update the kernel and reboot without umounting the /boot fs
>> > >> > or remounting it readonly, either of which would push all the AIL items
>> > >> > out to disk.  As a result, a subsequent invocation of something like
>> > >> > grub (which has a frightening willingness to read a fs with a dirty log)
>> > >> > can read stale disk contents and/or miss files the metadata for which
>> > >> > have been written to the log but not checkpointed into the filesystem.
>> > >>
>> > >> > Granted, most of the time /boot is a separate partition and
>> > >> > systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
>> > >> > This "fix" is only needed for people who have one giant filesystem.
>> > >>
>> > >> Let me guess the series of events: grub calls "sync" and says "I'm
>> > >
>> > > dpkg/rpm/systemd/CABEXTRACT.EXE/whatever, but yes :)
>> >
>> >
>> > It has nothing to do with GRUB. The exact same problem would happen
>> > regardless of bootloader because the thing writing out bootloader
>> > configuration prior to reboot is grubby, which is not at all in any
>> > way related to GRUB.
>
> Chris, I've told you previously this is wrong (it's incorrect for
> lilo) and too narrow (grubby is not the only update infrastructure
> around), but I'll repeat it again because we need to move past your
> single-distro focus on grubby and discuss the underlying problems.


And I'm trying to get you to move past your ancient legacy bootloader
focus and discuss things that matter in 2017.

First, nothing works like LILO, not even ELILO works like LILO.

Second, I have only been able to reproduce this problem with grubby +
XFS. If I manually do grub2-mkconfig + reboot -f instead, the problem
does not happen. It might be that I'm too slow, and the marginal
amount of extra time permits the new grub.cfg to fully commit, but I
don't know.

Third, basic bootloader concepts:

The bootloader is the executable that's loaded by the firmware after POST.

The bootloader installer is not the bootloader. /sbin/lilo,
/sbin/extlinux, /sbin/grub-install are not bootloaders, they are
bootloader installers. Only lilo totally reinstalls the bootloader
binary when configurations change. GRUB, extlinux, uboot, zipl don't
do that. Their configuration files change and that's it, and they do
not depend on boot sectors for this, they don't write outside the file
system to the drive like lilo. They depend on the file system.

So what you are stuck with, what you have in 2017, are bootloaders
that do not work the way you describe, and will not ever work like
what you describe.



> However, IMO problem does indeed lie with the bootloader and not the
> distro packaging mechanism/scripts, and so we need to talk a bit out
> the architectural differences between bootloaders like lilo and
> grub/petitboot and why I consider update durability to be something
> the bootloader needs to provide, not thrid party packagers or the
> init system.

Either the bootloader needs to learn how to read dirty logs, or there
can be no dirty log entries related to three things: kernel,
initramfs, and bootloader configuration. If any of those three things
are not fully committed to the file system metadata,  the bootloader
will fail to find them.

GRUB, extlinux, uboot - they are reading the file system to find their
configuration files, the kernel and the initramfs. That's not how LILO
works. And putting it on some pedestal as if that's how these other
bootloader ought to work in order to be fail safe, is ridiculous on
its face. It's basically demanding they do a total architectural
change and rewrite from scratch.

If GRUB or grubby are not being used, then the bootloader
configuration file is most likely modified by a script in the kernel
package. How do you avoid burdening the kernel package from update
durability when it is responsible for writing the kernel, initramfs,
and the third most likely thing to modify the bootloader
configuration?

You're also saying that sync() is not sufficient, and also haven't
answered the question if it's sane for the kernel package manager as
well as the bootloader configuration modifier (be it the kernel
package, grubby, or grub-mkconfig) to assume that something else is
going to reliably remount-ro or umount or freeze the file system and
thus fully commit these changes.

If that is not sane, then you're burdening all of them with freeze
because they aren't in a position to remount or umount.


>> > Now originally they were blaming the file systems, saying that sync()
>> > is supposed to guarantee everything, data and metadata is completely
>> > written to stable media. But I think that definition of sync()
>> > predates journaled file systems, so now there's broad understanding in
>> > fs circles that journaled file systems only guarantee the journal and
>> > data are committed to stable media, not the fs metadata itself.
>>
>> Right.  Everything's committed to stable media /somewhere/, but the
>> metadata isn't necessarily where an fs driver will find it if that
>> driver ignores the dirty log.
>
> Right. ISTR that early FS journalling papers from the late 80s
> talked about this in detail, and why they didn't need to write back
> metadata to provide sync(1) guarantees.  All journalling filesystems
> since then have simply written the data+journal on sync(1).  These
> sorts of basic OS concepts should be known by *everyone* writing low
> level OS infrastructure...



*shrug* ok well there's evidence they do not in fact know this. So
start imagining what other confusion exists from wrong assumptions
about basic concepts, and how to go about mitigating this.







>> > This whole LILO thing is irritating. I don't know how many times I
>> > have to say it...
>> >
>> > grubby is the sole thing responsible for writing bootloader
>> > configuration changes, no matter the bootloader, on Red Hat and Fedora
>> > systems. There is absolutely no difference between LILO and GRUB
>> > bootloader configuration changes on these distros.
>>
>> I'm tired of getting beat over the head about this.  There's no grubby
>> on Debian!
>
> I've told Chris that several times, too. He's still shouting at me
> (and you!) about grubby, though...
>
>> (No *sync(), huh?)
> ...
>> (we only fsync the grubenv file??)
>
> Yikes! It's worse than I thought.
>
> So, with that all out of the way, lets look at a lilo update.
> My laptop (debian) running lilo:
>
> $ sudo vi /etc/lilo.conf
> <modify and save new config file to simulate dpkg installing a new
>  kernel package, updating /boot and various links and modifying the
>  /etc/lilo.conf file>
> $ sudo strace -o t.t lilo
> Added Linux  *
> Added Linux.old
> $ grep sync t.t
> sync()                                  = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> fdatasync(6)                            = 0
> sync()                                  = 0
> sync()                                  = 0
> $
>
> The files decriptors of note are:
>
> open("/dev/disk/by-id/ata-C400-MTFDDAK256MAM_000000001305036641EA", O_RDWR) = 5
> open("/boot/map~", O_RDWR)              = 6
>
> And here's the last ~10 operations done:
>
> write(6, "\353N\0\0\0\0LILO\30\2\3360\"Y\2\3\0\0\266\0\0\0\0\0\225;\340V\2\0", 32) = 32
> close(6)                                = 0
> lseek(5, 0, SEEK_SET)                   = 0
> sync()                                  = 0
> write(5, "\372\353!\1\264\1LILO\30\2\3360\"Y\0\0\0\0\303\3049Q\224\236\7\0\241\0\200`"..., 512) = 512
> close(5)                                = 0
> rename("/boot/map~", "/boot/map")       = 0
> sync()                                  = 0
> close(4)                                = 0
> exit_group(0)
>
> This says that lilo uses a safe overwrite proceedure to do the
> on-disk bootloader update. i.e. the initial sync ensures all the new
> kernel updates and config file mods are written to disk. It then
> maps all the files and writes the /boot/map~ file and syncs
> everything. At this point, the new boot information is on the block
> device. It then writes the new boot sector, renames /boot/map~ to it's
> proper name, then runs sync. This atomic update of the boot sector
> switches to the new boot map and makes the switch permanent.
>
> Hence when the lilo binary exits, the information required by the
> bootloader is *completely on stable storage*. At each stage, right
> up to the atomic boot sector overwrite, a crash or failure leaves
> the old boot map and boot sector intact. IOWs, lilo has a *fail-safe
> update procedure*.
>
> As a result, you do *not* need to call sync or freeze the filesystem
> after running the lilo command because it has already guaranteed the
> updated bootloader information is on stable storage.  And because
> you have to run lilo to update the bootloader, distro package
> managers *can't fuck it up* because the bootloader has full control
> of the update process.

Haha. Well it can't fuck it up because it's doing a total end run
around the file system. Not even ELILO can do that. There is no such
thing as boot sectors, and writing data outside the file system on a
UEFI computer.




>
> IOWs, Lilo updates are based on a fool-proof design.  It's also
> fail-safe on many levels because not only is the update mechanism
> fail-safe, config errors/failures will be caught during update
> rather before the system is restarted rather than when the config
> files are parsed during bootloader execution when it errors may be
> difficult/impossible to fix.
>
> Grub, unfortunately, does not have a fail-safe update procedure, and
> it clearly does not have a fool-proof update architecture (as this
> thread demonstrates). If we expect distro packaging tools to do
> reliable boot loader updates, then the bootloader needs to provide
> both fail-safe updates and do it via a fool-proof mechanism. It's no
> good having a fail-safe update mechanism if it does not get used to
> do updates. Grub currently fails on both accounts....


Fool proof design because it doesn't trust the file system, at all, for writing.

Actually GRUB has a functional equivalent, it's just that it's not the
upstream default, and no distro appears to want to use it by default:
create configuration file, create core image with that configuration
file baked into it, and then install new core.img to MBR gap or
bios-grub partition. And this can be done atomically and fail safe if
the gap is big enough, with the last step being to write a new
boot.img in the first 440 bytes of LBA 0 to point to the new core.img.

That works and is fail safe why? Because it depends on the file system
as much as lilo. Zero.




>
>> > So to be consistent you have to blame RPM for not ensuring its writes
>> > are safely on stable storage either, before reboot.
>> >
>> > Jesus Christ...
>> >
>> > I want Dave to write "this problem has nothing to do with GRUB" 50
>> > times on a chalkboard.
>>
>> Frankly, all you have to do is tweak the grub config file writer to
>> "fsfreeze -f /boot && fsfreeze -u /boot" after it writes the grub.cfg and
>> before it exits.  That's both grubby and grub-mkconfig.
>
> Yup, that's the work-around I've previously suggested should be
> added to grub and distro update mechanisms.  It doesn't fix the
> underlying architectural issues grub has (e.g. updates are still
> not fail-safe), but it provides the durability guarantee that is
> required if the whole update process completes.

It assumes that the kernel package executes grub-mkconfig or grubby
only once the kernel and initramfs have finished writing. I've seen
this happen in parallel with RPM and new-kernel-package, so you could
conceivably get this scenario:

1. kernel is written and sync()
2. initramfs is opened and dracut is creating it
3. grub-mkconfig runs and then fifreeze/fiunfreeze
4. dracut continues to append to initramfs then completes
5. reboot without remount-ro or umount

And now you have a borked boot because the initramfs isn't fully
committed, part of its writes are only in the journal which the
bootloader will not see. So it'll end up loading only part of the
initramfs into memory.


>
>> Or systemd/sysvinit could always ensure that the fs containing the boot
>> files is unmounted no matter what.  Or systemd/sysvinit could freeze the
>> fs for us before asking for a reboot.  Or the kernel could freeze the fs
>> for us before actually doing the reboot.  Any one of those options is
>> sufficient, but not one of them is reliably performed by any of the
>> pieces.  systemd *almost* always succeed at unmounting /boot, which is
>> why few people see this problem.
>
> Design principles of modularity and coupling say it's really up to
> the bootloader to provide the durability mechanisms it needs.  IOWs,
> the *bootloader update infrastructure* needs to provide the
> durability guarantee/mechanism the bootloader infrastructure
> requires (as per the lilo example) and not the init system.


The lilo example needs to be banned from the discussion. Nothing else
works like it does, nor will it. And it also ignores the fact that the
kernel or initramfs could possibly only be in the dirty log, without
being in fs metadata itself and thus not locatable by the bootloader.



Chris Murphy

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/3] xfsprogs: remove double-underscore integer types
  2017-05-18  1:31 ` [PATCH 2/3] xfsprogs: " Darrick J. Wong
  2017-05-18  6:32   ` Christoph Hellwig
@ 2017-05-23  2:24   ` Eric Sandeen
  1 sibling, 0 replies; 27+ messages in thread
From: Eric Sandeen @ 2017-05-23  2:24 UTC (permalink / raw)
  To: Darrick J. Wong, xfs; +Cc: Eric Sandeen



On 5/17/17 8:31 PM, Darrick J. Wong wrote:
> This is a purely mechanical patch that removes the private
> __{u,}int{8,16,32,64}_t typedefs in favor of using the system
> {u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
> the transformation and fix the resulting whitespace and indentation
> errors:
> 
> s/typedef\t__uint8_t/typedef __uint8_t\t/g
> s/typedef\t__uint/typedef __uint/g
> s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
> s/__uint8_t\t/__uint8_t\t\t/g
> s/__uint/uint/g
> s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
> s/__int/int/g
> /^typedef.*int[0-9]*_t;$/d
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

I built this in the Fedora buildsystem for a bunch of arches, 

buildArch (xfsprogs-4.11.0-1.fc25.double.src.rpm, x86_64)
buildArch (xfsprogs-4.11.0-1.fc25.double.src.rpm, ppc64le)
buildArch (xfsprogs-4.11.0-1.fc25.double.src.rpm, aarch64)
buildArch (xfsprogs-4.11.0-1.fc25.double.src.rpm, ppc64)
buildArch (xfsprogs-4.11.0-1.fc25.double.src.rpm, i686)
buildArch (xfsprogs-4.11.0-1.fc25.double.src.rpm, s390x)
buildArch (xfsprogs-4.11.0-1.fc25.double.src.rpm, armv7hl) 

and it all completed, for whatever that's worth.  ;)

https://koji.fedoraproject.org/koji/taskinfo?taskID=19698440

I'm fine with this change, too.

I guess that warrants a:

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

Though "reviewed" might be a bit strong ... :)

-Eric

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/3] xfsprogs: remove double-underscore integer types
  2017-05-18  6:32   ` Christoph Hellwig
@ 2017-05-23  2:48     ` Darrick J. Wong
  0 siblings, 0 replies; 27+ messages in thread
From: Darrick J. Wong @ 2017-05-23  2:48 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs, Eric Sandeen

On Wed, May 17, 2017 at 11:32:06PM -0700, Christoph Hellwig wrote:
> On Wed, May 17, 2017 at 06:31:38PM -0700, Darrick J. Wong wrote:
> > This is a purely mechanical patch that removes the private
> > __{u,}int{8,16,32,64}_t typedefs in favor of using the system
> > {u,}int{8,16,32,64}_t typedefs.  This is the sed script used to perform
> > the transformation and fix the resulting whitespace and indentation
> > errors:
> 
> While I'm fine with this in general, didn't we run into xfstests error
> last time this was attempted?  Or was that just the move from the *64
> libc calls to the non64 ones and asking for LFS support?

I /think/ that was the 64bit LFS support change that did that.  I ran
xfstests over the weekend and didn't see any new breakage resulting from
the type change.  I also tried nastier things like __uint kernel + uint
xfsprogs and that didn't pop anything else up either.

--D

> 
> > s/typedef\t__uint8_t/typedef __uint8_t\t/g
> > s/typedef\t__uint/typedef __uint/g
> > s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g
> > s/__uint8_t\t/__uint8_t\t\t/g
> > s/__uint/uint/g
> > s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g
> > s/__int/int/g
> > /^typedef.*int[0-9]*_t;$/d
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  copy/xfs_copy.c             |   14 +-
> >  copy/xfs_copy.h             |    2 
> >  db/attr.c                   |    8 +
> >  db/attrshort.c              |    4 -
> >  db/bit.c                    |    4 -
> >  db/bit.h                    |    2 
> >  db/block.c                  |    8 +
> >  db/check.c                  |   18 ++-
> >  db/convert.c                |   28 ++---
> >  db/faddr.c                  |   14 +-
> >  db/field.c                  |   44 ++++---
> >  db/fprint.c                 |    8 +
> >  db/frag.c                   |    8 +
> >  db/inode.c                  |   34 +++---
> >  db/io.c                     |    4 -
> >  db/io.h                     |    8 +
> >  db/metadump.c               |   12 +-
> >  db/sb.c                     |    6 +
> >  fsr/xfs_fsr.c               |    2 
> >  include/darwin.h            |   18 ++-
> >  include/freebsd.h           |    6 +
> >  include/gnukfreebsd.h       |    6 +
> >  include/libxcmd.h           |    6 +
> >  include/linux.h             |    8 +
> >  include/xfs_arch.h          |   22 ++--
> >  include/xfs_inode.h         |    4 -
> >  include/xfs_log_recover.h   |    2 
> >  include/xfs_metadump.h      |    4 -
> >  include/xfs_mount.h         |   22 ++--
> >  libhandle/handle.c          |    2 
> >  libhandle/jdm.c             |    2 
> >  libxcmd/topology.c          |   14 +-
> >  libxfs/darwin.c             |    2 
> >  libxfs/freebsd.c            |    2 
> >  libxfs/init.c               |    2 
> >  libxfs/irix.c               |    2 
> >  libxfs/libxfs_priv.h        |    4 -
> >  libxfs/linux.c              |    2 
> >  libxfs/logitem.c            |    2 
> >  libxfs/radix-tree.c         |    8 +
> >  libxfs/rdwr.c               |    6 +
> >  libxfs/util.c               |    8 +
> >  libxfs/xfs_alloc_btree.c    |   20 ++-
> >  libxfs/xfs_attr_remote.c    |    8 +
> >  libxfs/xfs_attr_sf.h        |   10 +-
> >  libxfs/xfs_bit.h            |   24 ++--
> >  libxfs/xfs_bmap_btree.c     |    8 +
> >  libxfs/xfs_btree.c          |   22 ++--
> >  libxfs/xfs_btree.h          |   18 ++-
> >  libxfs/xfs_cksum.h          |   16 +--
> >  libxfs/xfs_da_btree.c       |    2 
> >  libxfs/xfs_da_btree.h       |    8 +
> >  libxfs/xfs_da_format.c      |   28 ++---
> >  libxfs/xfs_da_format.h      |   64 +++++------
> >  libxfs/xfs_dir2.h           |    8 +
> >  libxfs/xfs_dir2_leaf.c      |   12 +-
> >  libxfs/xfs_dir2_priv.h      |    2 
> >  libxfs/xfs_dir2_sf.c        |    2 
> >  libxfs/xfs_format.h         |  112 +++++++++----------
> >  libxfs/xfs_fs.h             |   12 +-
> >  libxfs/xfs_ialloc.c         |    6 +
> >  libxfs/xfs_ialloc_btree.c   |    4 -
> >  libxfs/xfs_inode_buf.c      |    2 
> >  libxfs/xfs_inode_buf.h      |   28 ++---
> >  libxfs/xfs_log_format.h     |  256 ++++++++++++++++++++++---------------------
> >  libxfs/xfs_quota_defs.h     |    4 -
> >  libxfs/xfs_refcount_btree.c |    8 +
> >  libxfs/xfs_rmap.c           |    8 +
> >  libxfs/xfs_rmap.h           |    8 +
> >  libxfs/xfs_rmap_btree.c     |   30 +++--
> >  libxfs/xfs_rtbitmap.c       |    2 
> >  libxfs/xfs_sb.c             |    4 -
> >  libxfs/xfs_types.h          |   46 ++++----
> >  logprint/log_misc.c         |    6 +
> >  mdrestore/xfs_mdrestore.c   |    2 
> >  mkfs/proto.c                |    2 
> >  mkfs/xfs_mkfs.c             |   76 ++++++-------
> >  quota/edit.c                |   64 +++++------
> >  quota/free.c                |   44 ++++---
> >  quota/quot.c                |   24 ++--
> >  quota/quota.c               |    4 -
> >  quota/quota.h               |   12 +-
> >  quota/report.c              |    4 -
> >  quota/state.c               |    2 
> >  quota/util.c                |   66 ++++++-----
> >  repair/README               |    2 
> >  repair/agheader.h           |   14 +-
> >  repair/attr_repair.h        |   26 ++--
> >  repair/avl64.c              |   38 +++---
> >  repair/avl64.h              |   18 ++-
> >  repair/dinode.c             |   38 +++---
> >  repair/dinode.h             |    4 -
> >  repair/dir2.c               |    2 
> >  repair/globals.h            |   16 +--
> >  repair/incore.c             |   10 +-
> >  repair/incore.h             |   46 ++++----
> >  repair/incore_ext.c         |    6 +
> >  repair/incore_ino.c         |   72 ++++++------
> >  repair/phase2.c             |    2 
> >  repair/phase3.c             |    6 +
> >  repair/phase4.c             |    4 -
> >  repair/phase5.c             |   28 ++---
> >  repair/phase6.c             |   16 +--
> >  repair/phase7.c             |    6 +
> >  repair/progress.c           |   30 +++--
> >  repair/progress.h           |    4 -
> >  repair/rmap.c               |   18 ++-
> >  repair/rmap.h               |    2 
> >  repair/sb.c                 |   24 ++--
> >  repair/scan.c               |   50 ++++----
> >  repair/scan.h               |   12 +-
> >  111 files changed, 982 insertions(+), 982 deletions(-)
> > 
> > diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
> > index a7da824..33e05df 100644
> > --- a/copy/xfs_copy.c
> > +++ b/copy/xfs_copy.c
> > @@ -43,7 +43,7 @@ unsigned int	source_sectorsize;	/* source disk sectorsize */
> >  
> >  xfs_agblock_t	first_agbno;
> >  
> > -__uint64_t	barcount[11];
> > +uint64_t	barcount[11];
> >  
> >  unsigned int	num_targets;
> >  target_control	*target;
> > @@ -313,7 +313,7 @@ usage(void)
> >  }
> >  
> >  void
> > -init_bar(__uint64_t source_blocks)
> > +init_bar(uint64_t source_blocks)
> >  {
> >  	int	i;
> >  
> > @@ -322,7 +322,7 @@ init_bar(__uint64_t source_blocks)
> >  }
> >  
> >  int
> > -bump_bar(int tenths, __uint64_t numblocks)
> > +bump_bar(int tenths, uint64_t numblocks)
> >  {
> >  	static char *bar[11] = {
> >  		" 0% ",
> > @@ -534,8 +534,8 @@ main(int argc, char **argv)
> >  	xfs_off_t	pos;
> >  	size_t		length;
> >  	int		c;
> > -	__uint64_t	size, sizeb;
> > -	__uint64_t	numblocks = 0;
> > +	uint64_t	size, sizeb;
> > +	uint64_t	numblocks = 0;
> >  	int		wblocks = 0;
> >  	int		num_threads = 0;
> >  	struct dioattr	d;
> > @@ -951,8 +951,8 @@ main(int argc, char **argv)
> >  	num_ags = mp->m_sb.sb_agcount;
> >  
> >  	init_bar(mp->m_sb.sb_blocksize / BBSIZE
> > -			* ((__uint64_t)mp->m_sb.sb_dblocks
> > -			    - (__uint64_t)mp->m_sb.sb_fdblocks + 10 * num_ags));
> > +			* ((uint64_t)mp->m_sb.sb_dblocks
> > +			    - (uint64_t)mp->m_sb.sb_fdblocks + 10 * num_ags));
> >  
> >  	kids = num_targets;
> >  
> > diff --git a/copy/xfs_copy.h b/copy/xfs_copy.h
> > index 2737068..53c6e42 100644
> > --- a/copy/xfs_copy.h
> > +++ b/copy/xfs_copy.h
> > @@ -76,7 +76,7 @@ typedef struct {
> >  
> >  typedef int thread_id;
> >  typedef int tm_index;			/* index into thread mask array */
> > -typedef __uint32_t thread_mask;		/* a thread mask */
> > +typedef uint32_t thread_mask;		/* a thread mask */
> >  
> >  typedef struct {
> >  	char		*name;
> > diff --git a/db/attr.c b/db/attr.c
> > index e26ac67..6f56953 100644
> > --- a/db/attr.c
> > +++ b/db/attr.c
> > @@ -77,16 +77,16 @@ const field_t	attr_leaf_entry_flds[] = {
> >  	{ "nameidx", FLDT_UINT16D, OI(LEOFF(nameidx)), C1, 0, TYP_NONE },
> >  	{ "flags", FLDT_UINT8X, OI(LEOFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
> >  	{ "incomplete", FLDT_UINT1,
> > -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_INCOMPLETE_BIT - 1), C1,
> > +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_INCOMPLETE_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "root", FLDT_UINT1,
> > -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
> > +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
> >  	  TYP_NONE },
> >  	{ "secure", FLDT_UINT1,
> > -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
> > +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
> >  	  TYP_NONE },
> >  	{ "local", FLDT_UINT1,
> > -	  OI(LEOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_LOCAL_BIT - 1), C1, 0,
> > +	  OI(LEOFF(flags) + bitsz(uint8_t) - XFS_ATTR_LOCAL_BIT - 1), C1, 0,
> >  	  TYP_NONE },
> >  	{ "pad2", FLDT_UINT8X, OI(LEOFF(pad2)), C1, FLD_SKIPALL, TYP_NONE },
> >  	{ NULL }
> > diff --git a/db/attrshort.c b/db/attrshort.c
> > index d82559c..2ef358f 100644
> > --- a/db/attrshort.c
> > +++ b/db/attrshort.c
> > @@ -51,10 +51,10 @@ const field_t	attr_sf_entry_flds[] = {
> >  	{ "valuelen", FLDT_UINT8D, OI(EOFF(valuelen)), C1, 0, TYP_NONE },
> >  	{ "flags", FLDT_UINT8X, OI(EOFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
> >  	{ "root", FLDT_UINT1,
> > -	  OI(EOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
> > +	  OI(EOFF(flags) + bitsz(uint8_t) - XFS_ATTR_ROOT_BIT - 1), C1, 0,
> >  	  TYP_NONE },
> >  	{ "secure", FLDT_UINT1,
> > -	  OI(EOFF(flags) + bitsz(__uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
> > +	  OI(EOFF(flags) + bitsz(uint8_t) - XFS_ATTR_SECURE_BIT - 1), C1, 0,
> >  	  TYP_NONE },
> >  	{ "name", FLDT_CHARNS, OI(EOFF(nameval)), attr_sf_entry_name_count,
> >  	  FLD_COUNT, TYP_NONE },
> > diff --git a/db/bit.c b/db/bit.c
> > index 24872bf..f5ebf68 100644
> > --- a/db/bit.c
> > +++ b/db/bit.c
> > @@ -60,7 +60,7 @@ setbit(
> >  	}
> >  }
> >  
> > -__int64_t
> > +int64_t
> >  getbitval(
> >  	void		*obj,
> >  	int		bitoff,
> > @@ -70,7 +70,7 @@ getbitval(
> >  	int		bit;
> >  	int		i;
> >  	char		*p;
> > -	__int64_t	rval;
> > +	int64_t		rval;
> >  	int		signext;
> >  	int		z1, z2, z3, z4;
> >  
> > diff --git a/db/bit.h b/db/bit.h
> > index 80ba24c..9fd71f4 100644
> > --- a/db/bit.h
> > +++ b/db/bit.h
> > @@ -25,5 +25,5 @@
> >  #define	BVUNSIGNED	0
> >  #define	BVSIGNED	1
> >  
> > -extern __int64_t	getbitval(void *obj, int bitoff, int nbits, int flags);
> > +extern int64_t		getbitval(void *obj, int bitoff, int nbits, int flags);
> >  extern void             setbitval(void *obuf, int bitoff, int nbits, void *ibuf);
> > diff --git a/db/block.c b/db/block.c
> > index 4a357ce..5ecd687 100644
> > --- a/db/block.c
> > +++ b/db/block.c
> > @@ -98,7 +98,7 @@ ablock_f(
> >  	}
> >  	dfsbno = bm.startblock + (bno - bm.startoff);
> >  	ASSERT(typtab[TYP_ATTR].typnm == TYP_ATTR);
> > -	set_cur(&typtab[TYP_ATTR], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> > +	set_cur(&typtab[TYP_ATTR], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> >  		blkbb, DB_RING_ADD, NULL);
> >  	return 0;
> >  }
> > @@ -128,14 +128,14 @@ daddr_f(
> >  	int		argc,
> >  	char		**argv)
> >  {
> > -	__int64_t	d;
> > +	int64_t		d;
> >  	char		*p;
> >  
> >  	if (argc == 1) {
> >  		dbprintf(_("current daddr is %lld\n"), iocur_top->off >> BBSHIFT);
> >  		return 0;
> >  	}
> > -	d = (__int64_t)strtoull(argv[1], &p, 0);
> > +	d = (int64_t)strtoull(argv[1], &p, 0);
> >  	if (*p != '\0' ||
> >  	    d >= mp->m_sb.sb_dblocks << (mp->m_sb.sb_blocklog - BBSHIFT)) {
> >  		dbprintf(_("bad daddr %s\n"), argv[1]);
> > @@ -197,7 +197,7 @@ dblock_f(
> >  	ASSERT(typtab[type].typnm == type);
> >  	if (nex > 1)
> >  		make_bbmap(&bbmap, nex, bmp);
> > -	set_cur(&typtab[type], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> > +	set_cur(&typtab[type], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> >  		nb * blkbb, DB_RING_ADD, nex > 1 ? &bbmap : NULL);
> >  	free(bmp);
> >  	return 0;
> > diff --git a/db/check.c b/db/check.c
> > index 8e618a2..81ba63a 100644
> > --- a/db/check.c
> > +++ b/db/check.c
> > @@ -114,8 +114,8 @@ typedef struct dirhash {
> >  
> >  static xfs_extlen_t	agffreeblks;
> >  static xfs_extlen_t	agflongest;
> > -static __uint64_t	agf_aggr_freeblks;	/* aggregate count over all */
> > -static __uint32_t	agfbtreeblks;
> > +static uint64_t	agf_aggr_freeblks;	/* aggregate count over all */
> > +static uint32_t	agfbtreeblks;
> >  static int		lazycount;
> >  static xfs_agino_t	agicount;
> >  static xfs_agino_t	agifreecount;
> > @@ -124,10 +124,10 @@ static int		blist_size;
> >  static char		**dbmap;	/* really dbm_t:8 */
> >  static dirhash_t	**dirhash;
> >  static int		error;
> > -static __uint64_t	fdblocks;
> > -static __uint64_t	frextents;
> > -static __uint64_t	icount;
> > -static __uint64_t	ifree;
> > +static uint64_t	fdblocks;
> > +static uint64_t	frextents;
> > +static uint64_t	icount;
> > +static uint64_t	ifree;
> >  static inodata_t	***inodata;
> >  static int		inodata_hash_size;
> >  static inodata_t	***inomap;
> > @@ -1187,7 +1187,7 @@ blocktrash_f(
> >  		goto out;
> >  	}
> >  	for (i = 0; i < count; i++) {
> > -		randb = (xfs_rfsblock_t)((((__int64_t)random() << 32) |
> > +		randb = (xfs_rfsblock_t)((((int64_t)random() << 32) |
> >  					 random()) % blocks);
> >  		for (bi = 0, agno = 0, done = 0;
> >  		     !done && agno < mp->m_sb.sb_agcount;
> > @@ -3032,7 +3032,7 @@ process_leaf_node_dir_v2(
> >  		}
> >  		if (v)
> >  			dbprintf(_("dir inode %lld block %u=%llu\n"), id->ino,
> > -				(__uint32_t)dbno,
> > +				(uint32_t)dbno,
> >  				(xfs_fsblock_t)bmp->startblock);
> >  		push_cur();
> >  		if (nex > 1)
> > @@ -3045,7 +3045,7 @@ process_leaf_node_dir_v2(
> >  			if (!sflag || v)
> >  				dbprintf(_("can't read block %u for directory "
> >  					 "inode %lld\n"),
> > -					(__uint32_t)dbno, id->ino);
> > +					(uint32_t)dbno, id->ino);
> >  			error++;
> >  			pop_cur();
> >  			dbno += mp->m_dir_geo->fsbcount - 1;
> > diff --git a/db/convert.c b/db/convert.c
> > index a337abe..fa4f962 100644
> > --- a/db/convert.c
> > +++ b/db/convert.c
> > @@ -24,13 +24,13 @@
> >  
> >  #define	M(A)	(1 << CT_ ## A)
> >  #define	agblock_to_bytes(x)	\
> > -	((__uint64_t)(x) << mp->m_sb.sb_blocklog)
> > +	((uint64_t)(x) << mp->m_sb.sb_blocklog)
> >  #define	agino_to_bytes(x)	\
> > -	((__uint64_t)(x) << mp->m_sb.sb_inodelog)
> > +	((uint64_t)(x) << mp->m_sb.sb_inodelog)
> >  #define	agnumber_to_bytes(x)	\
> > -	agblock_to_bytes((__uint64_t)(x) * mp->m_sb.sb_agblocks)
> > +	agblock_to_bytes((uint64_t)(x) * mp->m_sb.sb_agblocks)
> >  #define	daddr_to_bytes(x)	\
> > -	((__uint64_t)(x) << BBSHIFT)
> > +	((uint64_t)(x) << BBSHIFT)
> >  #define	fsblock_to_bytes(x)	\
> >  	(agnumber_to_bytes(XFS_FSB_TO_AGNO(mp, (x))) + \
> >  	 agblock_to_bytes(XFS_FSB_TO_AGBNO(mp, (x))))
> > @@ -38,7 +38,7 @@
> >  	(agnumber_to_bytes(XFS_INO_TO_AGNO(mp, (x))) + \
> >  	 agino_to_bytes(XFS_INO_TO_AGINO(mp, (x))))
> >  #define	inoidx_to_bytes(x)	\
> > -	((__uint64_t)(x) << mp->m_sb.sb_inodelog)
> > +	((uint64_t)(x) << mp->m_sb.sb_inodelog)
> >  
> >  typedef enum {
> >  	CT_NONE = -1,
> > @@ -68,7 +68,7 @@ typedef union {
> >  	xfs_agnumber_t	agnumber;
> >  	int		bboff;
> >  	int		blkoff;
> > -	__uint64_t	byte;
> > +	uint64_t	byte;
> >  	xfs_daddr_t	daddr;
> >  	xfs_fsblock_t	fsblock;
> >  	xfs_ino_t	ino;
> > @@ -76,7 +76,7 @@ typedef union {
> >  	int		inooff;
> >  } cval_t;
> >  
> > -static __uint64_t		bytevalue(ctype_t ctype, cval_t *val);
> > +static uint64_t		bytevalue(ctype_t ctype, cval_t *val);
> >  static int		convert_f(int argc, char **argv);
> >  static int		getvalue(char *s, ctype_t ctype, cval_t *val);
> >  static ctype_t		lookupcty(char *ctyname);
> > @@ -118,7 +118,7 @@ static const cmdinfo_t	convert_cmd =
> >  	{ "convert", NULL, convert_f, 3, 9, 0, "type num [type num]... type",
> >  	  "convert from one address form to another", NULL };
> >  
> > -static __uint64_t
> > +static uint64_t
> >  bytevalue(ctype_t ctype, cval_t *val)
> >  {
> >  	switch (ctype) {
> > @@ -129,9 +129,9 @@ bytevalue(ctype_t ctype, cval_t *val)
> >  	case CT_AGNUMBER:
> >  		return agnumber_to_bytes(val->agnumber);
> >  	case CT_BBOFF:
> > -		return (__uint64_t)val->bboff;
> > +		return (uint64_t)val->bboff;
> >  	case CT_BLKOFF:
> > -		return (__uint64_t)val->blkoff;
> > +		return (uint64_t)val->blkoff;
> >  	case CT_BYTE:
> >  		return val->byte;
> >  	case CT_DADDR:
> > @@ -143,7 +143,7 @@ bytevalue(ctype_t ctype, cval_t *val)
> >  	case CT_INOIDX:
> >  		return inoidx_to_bytes(val->inoidx);
> >  	case CT_INOOFF:
> > -		return (__uint64_t)val->inooff;
> > +		return (uint64_t)val->inooff;
> >  	case CT_NONE:
> >  	case NCTS:
> >  		break;
> > @@ -160,7 +160,7 @@ convert_f(int argc, char **argv)
> >  	cval_t		cvals[NCTS] = {};
> >  	int		i;
> >  	int		mask;
> > -	__uint64_t	v;
> > +	uint64_t	v;
> >  	ctype_t		wtype;
> >  
> >  	/* move past the "convert" command */
> > @@ -262,7 +262,7 @@ static int
> >  getvalue(char *s, ctype_t ctype, cval_t *val)
> >  {
> >  	char		*p;
> > -	__uint64_t	v;
> > +	uint64_t	v;
> >  
> >  	v = strtoull(s, &p, 0);
> >  	if (*p != '\0') {
> > @@ -286,7 +286,7 @@ getvalue(char *s, ctype_t ctype, cval_t *val)
> >  		val->blkoff = (int)v;
> >  		break;
> >  	case CT_BYTE:
> > -		val->byte = (__uint64_t)v;
> > +		val->byte = (uint64_t)v;
> >  		break;
> >  	case CT_DADDR:
> >  		val->daddr = (xfs_daddr_t)v;
> > diff --git a/db/faddr.c b/db/faddr.c
> > index 877200b..5620764 100644
> > --- a/db/faddr.c
> > +++ b/db/faddr.c
> > @@ -79,11 +79,11 @@ fa_attrblock(
> >  	typnm_t		next)
> >  {
> >  	bmap_ext_t	bm;
> > -	__uint32_t	bno;
> > +	uint32_t	bno;
> >  	xfs_fsblock_t	dfsbno;
> >  	int		nex;
> >  
> > -	bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
> > +	bno = (uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
> >  	if (bno == 0) {
> >  		dbprintf(_("null attribute block number, cannot set new addr\n"));
> >  		return;
> > @@ -96,7 +96,7 @@ fa_attrblock(
> >  	}
> >  	dfsbno = bm.startblock + (bno - bm.startoff);
> >  	ASSERT(typtab[next].typnm == next);
> > -	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno), blkbb,
> > +	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno), blkbb,
> >  		DB_RING_ADD, NULL);
> >  }
> >  
> > @@ -276,11 +276,11 @@ fa_dirblock(
> >  {
> >  	bbmap_t		bbmap;
> >  	bmap_ext_t	*bmp;
> > -	__uint32_t	bno;
> > +	uint32_t	bno;
> >  	xfs_fsblock_t	dfsbno;
> >  	int		nex;
> >  
> > -	bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
> > +	bno = (uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
> >  	if (bno == 0) {
> >  		dbprintf(_("null directory block number, cannot set new addr\n"));
> >  		return;
> > @@ -297,7 +297,7 @@ fa_dirblock(
> >  	ASSERT(typtab[next].typnm == next);
> >  	if (nex > 1)
> >  		make_bbmap(&bbmap, nex, bmp);
> > -	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> > +	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_DADDR(mp, dfsbno),
> >  		XFS_FSB_TO_BB(mp, mp->m_dir_geo->fsbcount), DB_RING_ADD,
> >  		nex > 1 ? &bbmap : NULL);
> >  	free(bmp);
> > @@ -317,7 +317,7 @@ fa_drfsbno(
> >  		return;
> >  	}
> >  	ASSERT(typtab[next].typnm == next);
> > -	set_cur(&typtab[next], (__int64_t)XFS_FSB_TO_BB(mp, bno), blkbb,
> > +	set_cur(&typtab[next], (int64_t)XFS_FSB_TO_BB(mp, bno), blkbb,
> >  		DB_RING_ADD, NULL);
> >  }
> >  
> > diff --git a/db/field.c b/db/field.c
> > index 1968dd5..2a2197a 100644
> > --- a/db/field.c
> > +++ b/db/field.c
> > @@ -83,7 +83,7 @@ const ftattr_t	ftattrtab[] = {
> >  	  attr_sf_entry_size, FTARG_SIZE, NULL, attr_sf_entry_flds },
> >  	{ FLDT_ATTR_SF_HDR, "attr_sf_hdr", NULL, (char *)attr_sf_hdr_flds,
> >  	  SI(bitsz(struct xfs_attr_sf_hdr)), 0, NULL, attr_sf_hdr_flds },
> > -	{ FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
> > +	{ FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
> >  	  fa_attrblock, NULL },
> >  	{ FLDT_ATTRSHORT, "attrshort", NULL, (char *)attr_shortform_flds,
> >  	  attrshort_size, FTARG_SIZE, NULL, attr_shortform_flds },
> > @@ -197,7 +197,7 @@ const ftattr_t	ftattrtab[] = {
> >  	  SI(bitsz(struct xfs_refcount_rec)), 0, NULL, refcbt_rec_flds },
> >  
> >  /* CRC field */
> > -	{ FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(__uint32_t)),
> > +	{ FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(uint32_t)),
> >  	  0, NULL, NULL },
> >  
> >  	{ FLDT_DEV, "dev", fp_num, "%#x", SI(bitsz(xfs_dev_t)), 0, NULL, NULL },
> > @@ -212,7 +212,7 @@ const ftattr_t	ftattrtab[] = {
> >  	{ FLDT_DINODE_CORE, "dinode_core", NULL, (char *)inode_core_flds,
> >  	  SI(bitsz(xfs_dinode_t)), 0, NULL, inode_core_flds },
> >  	{ FLDT_DINODE_FMT, "dinode_fmt", fp_dinode_fmt, NULL,
> > -	  SI(bitsz(__int8_t)), 0, NULL, NULL },
> > +	  SI(bitsz(int8_t)), 0, NULL, NULL },
> >  	{ FLDT_DINODE_U, "dinode_u", NULL, (char *)inode_u_flds, inode_u_size,
> >  	  FTARG_SIZE|FTARG_OKEMPTY, NULL, inode_u_flds },
> >  	{ FLDT_DINODE_V3, "dinode_v3", NULL, (char *)inode_v3_flds,
> > @@ -293,7 +293,7 @@ const ftattr_t	ftattrtab[] = {
> >  	{ FLDT_DA3_NODE_HDR, "dir_node_hdr", NULL, (char *)da3_node_hdr_flds,
> >  	  SI(bitsz(struct xfs_da3_node_hdr)), 0, NULL, da3_node_hdr_flds },
> >  
> > -	{ FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
> > +	{ FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
> >  	  fa_dirblock, NULL },
> >  	{ FLDT_DISK_DQUOT, "disk_dquot", NULL, (char *)disk_dquot_flds,
> >  	  SI(bitsz(xfs_disk_dquot_t)), 0, NULL, disk_dquot_flds },
> > @@ -333,15 +333,15 @@ const ftattr_t	ftattrtab[] = {
> >  	  FTARG_SIZE, NULL, inode_crc_flds },
> >  	{ FLDT_INOFREE, "inofree", fp_num, "%#llx", SI(bitsz(xfs_inofree_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(__int16_t)),
> > +	{ FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(int16_t)),
> >  	  FTARG_SIGNED, NULL, NULL },
> > -	{ FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(__int32_t)),
> > +	{ FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(int32_t)),
> >  	  FTARG_SIGNED, NULL, NULL },
> > -	{ FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(__int64_t)),
> > +	{ FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(int64_t)),
> >  	  FTARG_SIGNED, NULL, NULL },
> > -	{ FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(__int8_t)), FTARG_SIGNED,
> > +	{ FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(int8_t)), FTARG_SIGNED,
> >  	  NULL, NULL },
> > -	{ FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(__int32_t)), FTARG_SIGNED,
> > +	{ FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(int32_t)), FTARG_SIGNED,
> >  	  NULL, NULL },
> >  	{ FLDT_QCNT, "qcnt", fp_num, "%llu", SI(bitsz(xfs_qcnt_t)), 0, NULL,
> >  	  NULL },
> > @@ -354,34 +354,34 @@ const ftattr_t	ftattrtab[] = {
> >  	{ FLDT_SYMLINK_CRC, "symlink", NULL, (char *)symlink_crc_flds,
> >  	  symlink_size, FTARG_SIZE, NULL, symlink_crc_flds },
> >  
> > -	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(__int32_t)), FTARG_SIGNED,
> > +	{ FLDT_TIME, "time", fp_time, NULL, SI(bitsz(int32_t)), FTARG_SIGNED,
> >  	  NULL, NULL },
> >  	{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
> >  	  SI(bitsz(xfs_timestamp_t)), 0, NULL, timestamp_flds },
> >  	{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
> > -	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(__uint16_t)), 0, NULL,
> > +	{ FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
> >  	  NULL },
> > -	{ FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(__uint16_t)), 0,
> > +	{ FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(uint16_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(__uint16_t)), 0,
> > +	{ FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(uint16_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(__uint32_t)), 0, NULL,
> > +	{ FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(uint32_t)), 0, NULL,
> >  	  NULL },
> > -	{ FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(__uint32_t)), 0,
> > +	{ FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(uint32_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(__uint32_t)), 0,
> > +	{ FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(uint32_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(__uint64_t)), 0,
> > +	{ FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(uint64_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(__uint64_t)), 0,
> > +	{ FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(uint64_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(__uint64_t)), 0,
> > +	{ FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(uint64_t)), 0,
> >  	  NULL, NULL },
> > -	{ FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(__uint8_t)), 0, NULL,
> > +	{ FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(uint8_t)), 0, NULL,
> >  	  NULL },
> > -	{ FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(__uint8_t)), 0, NULL,
> > +	{ FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(uint8_t)), 0, NULL,
> >  	  NULL },
> > -	{ FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(__uint8_t)), 0, NULL,
> > +	{ FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(uint8_t)), 0, NULL,
> >  	  NULL },
> >  	{ FLDT_UUID, "uuid", fp_uuid, NULL, SI(bitsz(uuid_t)), 0, NULL, NULL },
> >  	{ FLDT_ZZZ, NULL }
> > diff --git a/db/fprint.c b/db/fprint.c
> > index fd7e7f4..261a31e 100644
> > --- a/db/fprint.c
> > +++ b/db/fprint.c
> > @@ -80,7 +80,7 @@ fp_num(
> >  	int		bitpos;
> >  	int		i;
> >  	int		isnull;
> > -	__int64_t	val;
> > +	int64_t		val;
> >  
> >  	for (i = 0, bitpos = bit;
> >  	     i < count && !seenint();
> > @@ -100,7 +100,7 @@ fp_num(
> >  		else if (size > 32)
> >  			dbprintf(fmtstr, val);
> >  		else
> > -			dbprintf(fmtstr, (__int32_t)val);
> > +			dbprintf(fmtstr, (int32_t)val);
> >  		if (i < count - 1)
> >  			dbprintf(" ");
> >  	}
> > @@ -203,7 +203,7 @@ fp_crc(
> >  {
> >  	int		bitpos;
> >  	int		i;
> > -	__int64_t	val;
> > +	int64_t		val;
> >  	char		*ok;
> >  
> >  	switch (iocur_crc_valid()) {
> > @@ -230,7 +230,7 @@ fp_crc(
> >  		if (size > 32)
> >  			dbprintf(fmtstr, val, ok);
> >  		else
> > -			dbprintf(fmtstr, (__int32_t)val, ok);
> > +			dbprintf(fmtstr, (int32_t)val, ok);
> >  		if (i < count - 1)
> >  			dbprintf(" ");
> >  	}
> > diff --git a/db/frag.c b/db/frag.c
> > index 8005e45..d224f0c 100644
> > --- a/db/frag.c
> > +++ b/db/frag.c
> > @@ -42,8 +42,8 @@ typedef	struct extmap {
> >  
> >  static int		aflag;
> >  static int		dflag;
> > -static __uint64_t	extcount_actual;
> > -static __uint64_t	extcount_ideal;
> > +static uint64_t	extcount_actual;
> > +static uint64_t	extcount_ideal;
> >  static int		fflag;
> >  static int		lflag;
> >  static int		qflag;
> > @@ -310,8 +310,8 @@ process_inode(
> >  	xfs_agino_t		agino,
> >  	xfs_dinode_t		*dip)
> >  {
> > -	__uint64_t		actual;
> > -	__uint64_t		ideal;
> > +	uint64_t		actual;
> > +	uint64_t		ideal;
> >  	xfs_ino_t		ino;
> >  	int			skipa;
> >  	int			skipd;
> > diff --git a/db/inode.c b/db/inode.c
> > index 8b7a41e..7538ee0 100644
> > --- a/db/inode.c
> > +++ b/db/inode.c
> > @@ -119,49 +119,49 @@ const field_t	inode_core_flds[] = {
> >  	{ "dmstate", FLDT_UINT16D, OI(COFF(dmstate)), C1, 0, TYP_NONE },
> >  	{ "flags", FLDT_UINT16X, OI(COFF(flags)), C1, FLD_SKIPALL, TYP_NONE },
> >  	{ "newrtbm", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NEWRTBM_BIT - 1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NEWRTBM_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "prealloc", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_PREALLOC_BIT - 1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_PREALLOC_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "realtime", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_REALTIME_BIT - 1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_REALTIME_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "immutable", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_IMMUTABLE_BIT-1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_IMMUTABLE_BIT-1), C1,
> >  	  0, TYP_NONE },
> >  	{ "append", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_APPEND_BIT - 1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_APPEND_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "sync", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_SYNC_BIT - 1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_SYNC_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "noatime", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NOATIME_BIT - 1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NOATIME_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "nodump", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NODUMP_BIT - 1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NODUMP_BIT - 1), C1,
> >  	  0, TYP_NONE },
> >  	{ "rtinherit", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_RTINHERIT_BIT-1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_RTINHERIT_BIT-1), C1,
> >  	  0, TYP_NONE },
> >  	{ "projinherit", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT-1),C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT-1),C1,
> >  	  0, TYP_NONE },
> >  	{ "nosymlinks", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT-1), C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT-1), C1,
> >  	  0, TYP_NONE },
> >  	{ "extsz", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_EXTSIZE_BIT-1),C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_EXTSIZE_BIT-1),C1,
> >  	  0, TYP_NONE },
> >  	{ "extszinherit", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT-1),C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT-1),C1,
> >  	  0, TYP_NONE },
> >  	{ "nodefrag", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NODEFRAG_BIT-1),C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_NODEFRAG_BIT-1),C1,
> >  	  0, TYP_NONE },
> >  	{ "filestream", FLDT_UINT1,
> > -	  OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_FILESTREAM_BIT-1),C1,
> > +	  OI(COFF(flags) + bitsz(uint16_t) - XFS_DIFLAG_FILESTREAM_BIT-1),C1,
> >  	  0, TYP_NONE },
> >  	{ "gen", FLDT_UINT32D, OI(COFF(gen)), C1, 0, TYP_NONE },
> >  	{ NULL }
> > @@ -177,10 +177,10 @@ const field_t	inode_v3_flds[] = {
> >  	{ "inumber", FLDT_INO, OI(COFF(ino)), C1, 0, TYP_NONE },
> >  	{ "uuid", FLDT_UUID, OI(COFF(uuid)), C1, 0, TYP_NONE },
> >  	{ "reflink", FLDT_UINT1,
> > -	  OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
> > +	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
> >  	  0, TYP_NONE },
> >  	{ "cowextsz", FLDT_UINT1,
> > -	  OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
> > +	  OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
> >  	  0, TYP_NONE },
> >  	{ NULL }
> >  };
> > diff --git a/db/io.c b/db/io.c
> > index 9918a51..f93c8af 100644
> > --- a/db/io.c
> > +++ b/db/io.c
> > @@ -536,7 +536,7 @@ write_cur(void)
> >  void
> >  set_cur(
> >  	const typ_t	*t,
> > -	__int64_t	d,
> > +	int64_t		d,
> >  	int		c,
> >  	int		ring_flag,
> >  	bbmap_t		*bbmap)
> > @@ -544,7 +544,7 @@ set_cur(
> >  	struct xfs_buf	*bp;
> >  	xfs_ino_t	dirino;
> >  	xfs_ino_t	ino;
> > -	__uint16_t	mode;
> > +	uint16_t	mode;
> >  	const struct xfs_buf_ops *ops = t ? t->bops : NULL;
> >  
> >  	if (iocur_sp < 0) {
> > diff --git a/db/io.h b/db/io.h
> > index b415b82..0b3cba4 100644
> > --- a/db/io.h
> > +++ b/db/io.h
> > @@ -25,7 +25,7 @@ typedef struct bbmap {
> >  } bbmap_t;
> >  
> >  typedef struct iocur {
> > -	__int64_t		bb;	/* BB number in filesystem of buf */
> > +	int64_t			bb;	/* BB number in filesystem of buf */
> >  	int			blen;	/* length of "buf", bb's */
> >  	int			boff;	/* data - buf */
> >  	void			*buf;	/* base address of buffer */
> > @@ -33,7 +33,7 @@ typedef struct iocur {
> >  	xfs_ino_t		dirino;	/* current directory inode number */
> >  	xfs_ino_t		ino;	/* current inode number */
> >  	int			len;	/* length of "data", bytes */
> > -	__uint16_t		mode;	/* current inode's mode */
> > +	uint16_t		mode;	/* current inode's mode */
> >  	xfs_off_t		off;	/* fs offset of "data" in bytes */
> >  	const struct typ	*typ;	/* type of "data" */
> >  	bbmap_t			*bbmap;	/* map daddr if fragmented */
> > @@ -57,9 +57,9 @@ extern void	off_cur(int off, int len);
> >  extern void	pop_cur(void);
> >  extern void	print_iocur(char *tag, iocur_t *ioc);
> >  extern void	push_cur(void);
> > -extern int	read_buf(__int64_t daddr, int count, void *bufp);
> > +extern int	read_buf(int64_t daddr, int count, void *bufp);
> >  extern void     write_cur(void);
> > -extern void	set_cur(const struct typ *t, __int64_t d, int c, int ring_add,
> > +extern void	set_cur(const struct typ *t, int64_t d, int c, int ring_add,
> >  			bbmap_t *bbmap);
> >  extern void     ring_add(void);
> >  extern void	set_iocur_type(const struct typ *t);
> > diff --git a/db/metadump.c b/db/metadump.c
> > index 66952f6..06da7c6 100644
> > --- a/db/metadump.c
> > +++ b/db/metadump.c
> > @@ -175,7 +175,7 @@ write_index(void)
> >  static int
> >  write_buf_segment(
> >  	char		*data,
> > -	__int64_t	off,
> > +	int64_t		off,
> >  	int		len)
> >  {
> >  	int		i;
> > @@ -1256,7 +1256,7 @@ process_sf_dir(
> >  {
> >  	struct xfs_dir2_sf_hdr	*sfp;
> >  	xfs_dir2_sf_entry_t	*sfep;
> > -	__uint64_t		ino_dir_size;
> > +	uint64_t		ino_dir_size;
> >  	int			i;
> >  
> >  	sfp = (struct xfs_dir2_sf_hdr *)XFS_DFORK_DPTR(dip);
> > @@ -1322,7 +1322,7 @@ process_sf_dir(
> >  static void
> >  obfuscate_path_components(
> >  	char			*buf,
> > -	__uint64_t		len)
> > +	uint64_t		len)
> >  {
> >  	unsigned char		*comp = (unsigned char *)buf;
> >  	unsigned char		*end = comp + len;
> > @@ -1359,7 +1359,7 @@ static void
> >  process_sf_symlink(
> >  	xfs_dinode_t		*dip)
> >  {
> > -	__uint64_t		len;
> > +	uint64_t		len;
> >  	char			*buf;
> >  
> >  	len = be64_to_cpu(dip->di_size);
> > @@ -1631,7 +1631,7 @@ process_attr_block(
> >  	xfs_attr_leaf_entry_t 		*entry;
> >  	xfs_attr_leaf_name_local_t 	*local;
> >  	xfs_attr_leaf_name_remote_t 	*remote;
> > -	__uint32_t			bs = mp->m_sb.sb_blocksize;
> > +	uint32_t			bs = mp->m_sb.sb_blocksize;
> >  	char				*first_name;
> >  
> >  
> > @@ -2270,7 +2270,7 @@ process_inode(
> >  	return success;
> >  }
> >  
> > -static __uint32_t	inodes_copied = 0;
> > +static uint32_t	inodes_copied = 0;
> >  
> >  static int
> >  copy_inode_chunk(
> > diff --git a/db/sb.c b/db/sb.c
> > index 8e7722c..f19248d 100644
> > --- a/db/sb.c
> > +++ b/db/sb.c
> > @@ -606,7 +606,7 @@ version_help(void)
> >  }
> >  
> >  static int
> > -do_version(xfs_agnumber_t agno, __uint16_t version, __uint32_t features)
> > +do_version(xfs_agnumber_t agno, uint16_t version, uint32_t features)
> >  {
> >  	xfs_sb_t	tsb;
> >  
> > @@ -710,8 +710,8 @@ version_f(
> >  	int		argc,
> >  	char		**argv)
> >  {
> > -	__uint16_t	version = 0;
> > -	__uint32_t	features = 0;
> > +	uint16_t	version = 0;
> > +	uint32_t	features = 0;
> >  	xfs_agnumber_t	ag;
> >  
> >  	if (argc == 2) {	/* WRITE VERSION */
> > diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
> > index 517b75f..d4846a3 100644
> > --- a/fsr/xfs_fsr.c
> > +++ b/fsr/xfs_fsr.c
> > @@ -54,7 +54,7 @@ struct getbmap  *outmap = NULL;
> >  int             outmap_size = 0;
> >  int		RealUid;
> >  int		tmp_agi;
> > -static __int64_t	minimumfree = 2048;
> > +static int64_t		minimumfree = 2048;
> >  
> >  #define MNTTYPE_XFS             "xfs"
> >  
> > diff --git a/include/darwin.h b/include/darwin.h
> > index 7bbd576..51031c4 100644
> > --- a/include/darwin.h
> > +++ b/include/darwin.h
> > @@ -125,15 +125,15 @@ typedef signed int		__s32;
> >  typedef unsigned long long int	__u64;
> >  typedef signed long long int	__s64;
> >  
> > -#define __int8_t	int8_t
> > -#define __int16_t	int16_t
> > -#define __int32_t	int32_t
> > -#define __int32_t	int32_t
> > -#define __int64_t	int64_t
> > -#define __uint8_t	u_int8_t
> > -#define __uint16_t	u_int16_t
> > -#define __uint32_t	u_int32_t
> > -#define __uint64_t	u_int64_t
> > +#define int8_t		int8_t
> > +#define int16_t		int16_t
> > +#define int32_t		int32_t
> > +#define int32_t		int32_t
> > +#define int64_t		int64_t
> > +#define uint8_t		u_int8_t
> > +#define uint16_t	u_int16_t
> > +#define uint32_t	u_int32_t
> > +#define uint64_t	u_int64_t
> >  
> >  typedef off_t		xfs_off_t;
> >  typedef u_int64_t	xfs_ino_t;
> > diff --git a/include/freebsd.h b/include/freebsd.h
> > index fb318b8..f52ed0a 100644
> > --- a/include/freebsd.h
> > +++ b/include/freebsd.h
> > @@ -50,9 +50,9 @@ typedef unsigned long long int	__u64;
> >  typedef signed long long int	__s64;
> >  
> >  typedef off_t		xfs_off_t;
> > -typedef __uint64_t	xfs_ino_t;
> > -typedef __uint32_t	xfs_dev_t;
> > -typedef __int64_t	xfs_daddr_t;
> > +typedef uint64_t	xfs_ino_t;
> > +typedef uint32_t	xfs_dev_t;
> > +typedef int64_t		xfs_daddr_t;
> >  typedef __u32		xfs_nlink_t;
> >  
> >  #define	O_LARGEFILE	0
> > diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h
> > index 6916e65..1db3f4f 100644
> > --- a/include/gnukfreebsd.h
> > +++ b/include/gnukfreebsd.h
> > @@ -46,9 +46,9 @@ typedef unsigned long long int	__u64;
> >  typedef signed long long int	__s64;
> >  
> >  typedef off_t		xfs_off_t;
> > -typedef __uint64_t	xfs_ino_t;
> > -typedef __uint32_t	xfs_dev_t;
> > -typedef __int64_t	xfs_daddr_t;
> > +typedef uint64_t	xfs_ino_t;
> > +typedef uint32_t	xfs_dev_t;
> > +typedef int64_t		xfs_daddr_t;
> >  typedef __u32		xfs_nlink_t;
> >  
> >  #define HAVE_FID	1
> > diff --git a/include/libxcmd.h b/include/libxcmd.h
> > index e8d2ffc..6806380 100644
> > --- a/include/libxcmd.h
> > +++ b/include/libxcmd.h
> > @@ -42,10 +42,10 @@ get_topology(
> >  extern void
> >  calc_default_ag_geometry(
> >  	int		blocklog,
> > -	__uint64_t	dblocks,
> > +	uint64_t	dblocks,
> >  	int		multidisk,
> > -	__uint64_t	*agsize,
> > -	__uint64_t	*agcount);
> > +	uint64_t	*agsize,
> > +	uint64_t	*agcount);
> >  
> >  extern int
> >  check_overwrite(
> > diff --git a/include/linux.h b/include/linux.h
> > index 181d25c..4726915 100644
> > --- a/include/linux.h
> > +++ b/include/linux.h
> > @@ -140,7 +140,7 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
> >  static __inline__ int
> >  platform_discard_blocks(int fd, uint64_t start, uint64_t len)
> >  {
> > -	__uint64_t range[2] = { start, len };
> > +	uint64_t range[2] = { start, len };
> >  
> >  	if (ioctl(fd, BLKDISCARD, &range) < 0)
> >  		return errno;
> > @@ -152,9 +152,9 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
> >  #define EFSBADCRC	EBADMSG	/* Bad CRC detected */
> >  
> >  typedef off_t		xfs_off_t;
> > -typedef __uint64_t	xfs_ino_t;
> > -typedef __uint32_t	xfs_dev_t;
> > -typedef __int64_t	xfs_daddr_t;
> > +typedef uint64_t	xfs_ino_t;
> > +typedef uint32_t	xfs_dev_t;
> > +typedef int64_t		xfs_daddr_t;
> >  typedef __u32		xfs_nlink_t;
> >  
> >  /**
> > diff --git a/include/xfs_arch.h b/include/xfs_arch.h
> > index 12cd43e..186cadb 100644
> > --- a/include/xfs_arch.h
> > +++ b/include/xfs_arch.h
> > @@ -244,39 +244,39 @@ static inline void be64_add_cpu(__be64 *a, __s64 b)
> >  	*a = cpu_to_be64(be64_to_cpu(*a) + b);
> >  }
> >  
> > -static inline __uint16_t get_unaligned_be16(void *p)
> > +static inline uint16_t get_unaligned_be16(void *p)
> >  {
> > -	__uint8_t *__p = p;
> > +	uint8_t *__p = p;
> >  	return __p[0] << 8 | __p[1];
> >  }
> >  
> > -static inline __uint32_t get_unaligned_be32(void *p)
> > +static inline uint32_t get_unaligned_be32(void *p)
> >  {
> > -	__uint8_t *__p = p;
> > +	uint8_t *__p = p;
> >          return __p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3];
> >  }
> >  
> > -static inline __uint64_t get_unaligned_be64(void *p)
> > +static inline uint64_t get_unaligned_be64(void *p)
> >  {
> > -	return (__uint64_t)get_unaligned_be32(p) << 32 |
> > +	return (uint64_t)get_unaligned_be32(p) << 32 |
> >  			   get_unaligned_be32(p + 4);
> >  }
> >  
> > -static inline void put_unaligned_be16(__uint16_t val, void *p)
> > +static inline void put_unaligned_be16(uint16_t val, void *p)
> >  {
> > -	__uint8_t *__p = p;
> > +	uint8_t *__p = p;
> >  	*__p++ = val >> 8;
> >  	*__p++ = val;
> >  }
> >  
> > -static inline void put_unaligned_be32(__uint32_t val, void *p)
> > +static inline void put_unaligned_be32(uint32_t val, void *p)
> >  {
> > -	__uint8_t *__p = p;
> > +	uint8_t *__p = p;
> >  	put_unaligned_be16(val >> 16, __p);
> >  	put_unaligned_be16(val, __p + 2);
> >  }
> >  
> > -static inline void put_unaligned_be64(__uint64_t val, void *p)
> > +static inline void put_unaligned_be64(uint64_t val, void *p)
> >  {
> >  	put_unaligned_be32(val >> 32, p);
> >  	put_unaligned_be32(val, p + 4);
> > diff --git a/include/xfs_inode.h b/include/xfs_inode.h
> > index fb6b542..8766024 100644
> > --- a/include/xfs_inode.h
> > +++ b/include/xfs_inode.h
> > @@ -123,8 +123,8 @@ xfs_get_projid(struct xfs_icdinode *id)
> >  static inline void
> >  xfs_set_projid(struct xfs_icdinode *id, prid_t projid)
> >  {
> > -	id->di_projid_hi = (__uint16_t) (projid >> 16);
> > -	id->di_projid_lo = (__uint16_t) (projid & 0xffff);
> > +	id->di_projid_hi = (uint16_t) (projid >> 16);
> > +	id->di_projid_lo = (uint16_t) (projid & 0xffff);
> >  }
> >  
> >  static inline bool xfs_is_reflink_inode(struct xfs_inode *ip)
> > diff --git a/include/xfs_log_recover.h b/include/xfs_log_recover.h
> > index 7582676..0d09862 100644
> > --- a/include/xfs_log_recover.h
> > +++ b/include/xfs_log_recover.h
> > @@ -26,7 +26,7 @@
> >  #define XLOG_RHASH_SIZE	16
> >  #define XLOG_RHASH_SHIFT 2
> >  #define XLOG_RHASH(tid)	\
> > -	((((__uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
> > +	((((uint32_t)tid)>>XLOG_RHASH_SHIFT) & (XLOG_RHASH_SIZE-1))
> >  
> >  #define XLOG_MAX_REGIONS_IN_ITEM   (XFS_MAX_BLOCKSIZE / XFS_BLF_CHUNK / 2 + 1)
> >  
> > diff --git a/include/xfs_metadump.h b/include/xfs_metadump.h
> > index f4be51b..90d6cb1 100644
> > --- a/include/xfs_metadump.h
> > +++ b/include/xfs_metadump.h
> > @@ -24,8 +24,8 @@
> >  typedef struct xfs_metablock {
> >  	__be32		mb_magic;
> >  	__be16		mb_count;
> > -	__uint8_t	mb_blocklog;
> > -	__uint8_t	mb_reserved;
> > +	uint8_t		mb_blocklog;
> > +	uint8_t		mb_reserved;
> >  	/* followed by an array of xfs_daddr_t */
> >  } xfs_metablock_t;
> >  
> > diff --git a/include/xfs_mount.h b/include/xfs_mount.h
> > index 5ff24eb..5b323bb 100644
> > --- a/include/xfs_mount.h
> > +++ b/include/xfs_mount.h
> > @@ -48,12 +48,12 @@ typedef struct xfs_mount {
> >  #define m_dev		m_ddev_targp
> >  #define m_logdev	m_logdev_targp
> >  #define m_rtdev		m_rtdev_targp
> > -	__uint8_t		m_dircook_elog;	/* log d-cookie entry bits */
> > -	__uint8_t		m_blkbit_log;	/* blocklog + NBBY */
> > -	__uint8_t		m_blkbb_log;	/* blocklog - BBSHIFT */
> > -	__uint8_t		m_sectbb_log;	/* sectorlog - BBSHIFT */
> > -	__uint8_t		m_agno_log;	/* log #ag's */
> > -	__uint8_t		m_agino_log;	/* #bits for agino in inum */
> > +	uint8_t			m_dircook_elog;	/* log d-cookie entry bits */
> > +	uint8_t			m_blkbit_log;	/* blocklog + NBBY */
> > +	uint8_t			m_blkbb_log;	/* blocklog - BBSHIFT */
> > +	uint8_t			m_sectbb_log;	/* sectorlog - BBSHIFT */
> > +	uint8_t			m_agno_log;	/* log #ag's */
> > +	uint8_t			m_agino_log;	/* #bits for agino in inum */
> >  	uint			m_inode_cluster_size;/* min inode buf size */
> >  	uint			m_blockmask;	/* sb_blocksize-1 */
> >  	uint			m_blockwsize;	/* sb_blocksize in words */
> > @@ -88,7 +88,7 @@ typedef struct xfs_mount {
> >  	int			m_litino;	/* size of inode union area */
> >  	int			m_inoalign_mask;/* mask sb_inoalignmt if used */
> >  	struct xfs_trans_resv	m_resv;		/* precomputed res values */
> > -	__uint64_t		m_maxicount;	/* maximum inode count */
> > +	uint64_t		m_maxicount;	/* maximum inode count */
> >  	int			m_dalign;	/* stripe unit */
> >  	int			m_swidth;	/* stripe width */
> >  	int			m_sinoalign;	/* stripe unit inode alignmnt */
> > @@ -144,12 +144,12 @@ typedef struct xfs_perag {
> >  	char		pagi_init;	/* this agi's entry is initialized */
> >  	char		pagf_metadata;	/* the agf is preferred to be metadata */
> >  	char		pagi_inodeok;	/* The agi is ok for inodes */
> > -	__uint8_t	pagf_levels[XFS_BTNUM_AGF];
> > +	uint8_t		pagf_levels[XFS_BTNUM_AGF];
> >  					/* # of levels in bno & cnt btree */
> > -	__uint32_t	pagf_flcount;	/* count of blocks in freelist */
> > +	uint32_t	pagf_flcount;	/* count of blocks in freelist */
> >  	xfs_extlen_t	pagf_freeblks;	/* total free blocks */
> >  	xfs_extlen_t	pagf_longest;	/* longest free space */
> > -	__uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
> > +	uint32_t	pagf_btreeblks;	/* # of blocks held in AGF btrees */
> >  	xfs_agino_t	pagi_freecount;	/* number of free inodes */
> >  	xfs_agino_t	pagi_count;	/* number of allocated inodes */
> >  
> > @@ -169,7 +169,7 @@ typedef struct xfs_perag {
> >  	struct xfs_ag_resv	pag_agfl_resv;
> >  
> >  	/* reference count */
> > -	__uint8_t	pagf_refcount_level;
> > +	uint8_t		pagf_refcount_level;
> >  } xfs_perag_t;
> >  
> >  static inline struct xfs_ag_resv *
> > diff --git a/libhandle/handle.c b/libhandle/handle.c
> > index 236ed22..00127b3 100644
> > --- a/libhandle/handle.c
> > +++ b/libhandle/handle.c
> > @@ -232,7 +232,7 @@ obj_to_handle(
> >  {
> >  	char		hbuf [MAXHANSIZ];
> >  	int		ret;
> > -	__uint32_t	handlen;
> > +	uint32_t	handlen;
> >  	xfs_fsop_handlereq_t hreq;
> >  
> >  	if (opcode == XFS_IOC_FD_TO_HANDLE) {
> > diff --git a/libhandle/jdm.c b/libhandle/jdm.c
> > index e52f5d8..821061b 100644
> > --- a/libhandle/jdm.c
> > +++ b/libhandle/jdm.c
> > @@ -36,7 +36,7 @@ typedef struct filehandle {
> >  	fshandle_t fh_fshandle;		/* handle of fs containing this inode */
> >  	int16_t fh_sz_following;	/* bytes in handle after this member */
> >  	char fh_pad[FILEHANDLE_SZ_PAD];	/* padding, must be zeroed */
> > -	__uint32_t fh_gen;		/* generation count */
> > +	uint32_t fh_gen;		/* generation count */
> >  	xfs_ino_t fh_ino;		/* 64 bit ino */
> >  } filehandle_t;
> >  
> > diff --git a/libxcmd/topology.c b/libxcmd/topology.c
> > index 8b0276a..f66dd1b 100644
> > --- a/libxcmd/topology.c
> > +++ b/libxcmd/topology.c
> > @@ -23,19 +23,19 @@
> >  #endif /* ENABLE_BLKID */
> >  #include "xfs_multidisk.h"
> >  
> > -#define TERABYTES(count, blog)	((__uint64_t)(count) << (40 - (blog)))
> > -#define GIGABYTES(count, blog)	((__uint64_t)(count) << (30 - (blog)))
> > -#define MEGABYTES(count, blog)	((__uint64_t)(count) << (20 - (blog)))
> > +#define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
> > +#define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
> > +#define MEGABYTES(count, blog)	((uint64_t)(count) << (20 - (blog)))
> >  
> >  void
> >  calc_default_ag_geometry(
> >  	int		blocklog,
> > -	__uint64_t	dblocks,
> > +	uint64_t	dblocks,
> >  	int		multidisk,
> > -	__uint64_t	*agsize,
> > -	__uint64_t	*agcount)
> > +	uint64_t	*agsize,
> > +	uint64_t	*agcount)
> >  {
> > -	__uint64_t	blocks = 0;
> > +	uint64_t	blocks = 0;
> >  	int		shift = 0;
> >  
> >  	/*
> > diff --git a/libxfs/darwin.c b/libxfs/darwin.c
> > index 74507e8..16d2c35 100644
> > --- a/libxfs/darwin.c
> > +++ b/libxfs/darwin.c
> > @@ -68,7 +68,7 @@ platform_flush_device(int fd, dev_t device)
> >  void
> >  platform_findsizes(char *path, int fd, long long *sz, int *bsz)
> >  {
> > -	__uint64_t	size;
> > +	uint64_t	size;
> >  	struct stat	st;
> >  
> >  	if (fstat(fd, &st) < 0) {
> > diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c
> > index 4667d1f..d7bca14 100644
> > --- a/libxfs/freebsd.c
> > +++ b/libxfs/freebsd.c
> > @@ -109,7 +109,7 @@ void
> >  platform_findsizes(char *path, int fd, long long *sz, int *bsz)
> >  {
> >  	struct stat	st;
> > -	__int64_t	size;
> > +	int64_t		size;
> >  	u_int		ssize;
> >  
> >  	if (fstat(fd, &st) < 0) {
> > diff --git a/libxfs/init.c b/libxfs/init.c
> > index 85e0d15..27a7600 100644
> > --- a/libxfs/init.c
> > +++ b/libxfs/init.c
> > @@ -546,7 +546,7 @@ libxfs_initialize_perag(
> >  		 * the max inode percentage.
> >  		 */
> >  		if (mp->m_maxicount) {
> > -			__uint64_t	icount;
> > +			uint64_t	icount;
> >  
> >  			icount = sbp->sb_dblocks * sbp->sb_imax_pct;
> >  			do_div(icount, 100);
> > diff --git a/libxfs/irix.c b/libxfs/irix.c
> > index 32fcb3e..0f14aec 100644
> > --- a/libxfs/irix.c
> > +++ b/libxfs/irix.c
> > @@ -22,7 +22,7 @@
> >  
> >  int platform_has_uuid = 0;
> >  extern char *progname;
> > -extern __int64_t findsize(char *);
> > +extern int64_t findsize(char *);
> >  
> >  int
> >  platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
> > diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
> > index 0b4c489..a3912e7 100644
> > --- a/libxfs/libxfs_priv.h
> > +++ b/libxfs/libxfs_priv.h
> > @@ -296,8 +296,8 @@ roundup_pow_of_two(uint v)
> >  	return 0;
> >  }
> >  
> > -static inline __uint64_t
> > -roundup_64(__uint64_t x, __uint32_t y)
> > +static inline uint64_t
> > +roundup_64(uint64_t x, uint32_t y)
> >  {
> >  	x += y - 1;
> >  	do_div(x, y);
> > diff --git a/libxfs/linux.c b/libxfs/linux.c
> > index 69f04ad..0bace3e 100644
> > --- a/libxfs/linux.c
> > +++ b/libxfs/linux.c
> > @@ -163,7 +163,7 @@ void
> >  platform_findsizes(char *path, int fd, long long *sz, int *bsz)
> >  {
> >  	struct stat	st;
> > -	__uint64_t	size;
> > +	uint64_t	size;
> >  	int		error;
> >  
> >  	if (fstat(fd, &st) < 0) {
> > diff --git a/libxfs/logitem.c b/libxfs/logitem.c
> > index 7e93f60..466b442 100644
> > --- a/libxfs/logitem.c
> > +++ b/libxfs/logitem.c
> > @@ -121,7 +121,7 @@ xfs_buf_item_init(
> >  	bip->bli_item.li_mountp = mp;
> >  	bip->bli_buf = bp;
> >  	bip->bli_format.blf_type = XFS_LI_BUF;
> > -	bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp);
> > +	bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp);
> >  	bip->bli_format.blf_len = (unsigned short)BTOBB(XFS_BUF_COUNT(bp));
> >  	XFS_BUF_SET_FSPRIVATE(bp, bip);
> >  }
> > diff --git a/libxfs/radix-tree.c b/libxfs/radix-tree.c
> > index eef9c36..3f0257f 100644
> > --- a/libxfs/radix-tree.c
> > +++ b/libxfs/radix-tree.c
> > @@ -66,21 +66,21 @@ static unsigned long height_to_maxindex[RADIX_TREE_MAX_PATH];
> >  static inline void tag_set(struct radix_tree_node *node, unsigned int tag,
> >  		int offset)
> >  {
> > -	*((__uint32_t *)node->tags[tag] + (offset >> 5)) |= (1 << (offset & 31));
> > +	*((uint32_t *)node->tags[tag] + (offset >> 5)) |= (1 << (offset & 31));
> >  }
> >  
> >  static inline void tag_clear(struct radix_tree_node *node, unsigned int tag,
> >  		int offset)
> >  {
> > -	__uint32_t 	*p = (__uint32_t*)node->tags[tag] + (offset >> 5);
> > -	__uint32_t 	m = 1 << (offset & 31);
> > +	uint32_t 	*p = (uint32_t*)node->tags[tag] + (offset >> 5);
> > +	uint32_t 	m = 1 << (offset & 31);
> >  	*p &= ~m;
> >  }
> >  
> >  static inline int tag_get(struct radix_tree_node *node, unsigned int tag,
> >  		int offset)
> >  {
> > -	return 1 & (((const __uint32_t *)node->tags[tag])[offset >> 5] >> (offset & 31));
> > +	return 1 & (((const uint32_t *)node->tags[tag])[offset >> 5] >> (offset & 31));
> >  }
> >  
> >  /*
> > diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
> > index 6c8a192..43b4f1d 100644
> > --- a/libxfs/rdwr.c
> > +++ b/libxfs/rdwr.c
> > @@ -118,9 +118,9 @@ static void unmount_record(void *p)
> >  	xlog_op_header_t	*op = (xlog_op_header_t *)p;
> >  	/* the data section must be 32 bit size aligned */
> >  	struct {
> > -	    __uint16_t magic;
> > -	    __uint16_t pad1;
> > -	    __uint32_t pad2; /* may as well make it 64 bits */
> > +	    uint16_t magic;
> > +	    uint16_t pad1;
> > +	    uint32_t pad2; /* may as well make it 64 bits */
> >  	} magic = { XLOG_UNMOUNT_TYPE, 0, 0 };
> >  
> >  	memset(p, 0, BBSIZE);
> > diff --git a/libxfs/util.c b/libxfs/util.c
> > index dcfca39..7938e31 100644
> > --- a/libxfs/util.c
> > +++ b/libxfs/util.c
> > @@ -170,8 +170,8 @@ libxfs_trans_ichgtime(
> >  	if (flags & XFS_ICHGTIME_CHG)
> >  		VFS_I(ip)->i_ctime = tv;
> >  	if (flags & XFS_ICHGTIME_CREATE) {
> > -		ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec;
> > -		ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec;
> > +		ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
> > +		ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
> >  	}
> >  }
> >  
> > @@ -261,8 +261,8 @@ libxfs_ialloc(
> >  		ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid));
> >  		VFS_I(ip)->i_version = 1;
> >  		ip->i_d.di_flags2 = 0;
> > -		ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec;
> > -		ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec;
> > +		ip->i_d.di_crtime.t_sec = (int32_t)VFS_I(ip)->i_mtime.tv_sec;
> > +		ip->i_d.di_crtime.t_nsec = (int32_t)VFS_I(ip)->i_mtime.tv_nsec;
> >  	}
> >  
> >  	flags = XFS_ILOG_CORE;
> > diff --git a/libxfs/xfs_alloc_btree.c b/libxfs/xfs_alloc_btree.c
> > index e11d89a..8e77e6e 100644
> > --- a/libxfs/xfs_alloc_btree.c
> > +++ b/libxfs/xfs_alloc_btree.c
> > @@ -251,7 +251,7 @@ xfs_allocbt_init_ptr_from_cur(
> >  	ptr->s = agf->agf_roots[cur->bc_btnum];
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_bnobt_key_diff(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*key)
> > @@ -259,42 +259,42 @@ xfs_bnobt_key_diff(
> >  	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
> >  	xfs_alloc_key_t		*kp = &key->alloc;
> >  
> > -	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
> > +	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_cntbt_key_diff(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*key)
> >  {
> >  	xfs_alloc_rec_incore_t	*rec = &cur->bc_rec.a;
> >  	xfs_alloc_key_t		*kp = &key->alloc;
> > -	__int64_t		diff;
> > +	int64_t			diff;
> >  
> > -	diff = (__int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
> > +	diff = (int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount;
> >  	if (diff)
> >  		return diff;
> >  
> > -	return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
> > +	return (int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock;
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_bnobt_diff_two_keys(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*k1,
> >  	union xfs_btree_key	*k2)
> >  {
> > -	return (__int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
> > +	return (int64_t)be32_to_cpu(k1->alloc.ar_startblock) -
> >  			  be32_to_cpu(k2->alloc.ar_startblock);
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_cntbt_diff_two_keys(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*k1,
> >  	union xfs_btree_key	*k2)
> >  {
> > -	__int64_t		diff;
> > +	int64_t			diff;
> >  
> >  	diff =  be32_to_cpu(k1->alloc.ar_blockcount) -
> >  		be32_to_cpu(k2->alloc.ar_blockcount);
> > diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c
> > index abe1705..1f25e36 100644
> > --- a/libxfs/xfs_attr_remote.c
> > +++ b/libxfs/xfs_attr_remote.c
> > @@ -248,7 +248,7 @@ xfs_attr_rmtval_copyout(
> >  	xfs_ino_t	ino,
> >  	int		*offset,
> >  	int		*valuelen,
> > -	__uint8_t	**dst)
> > +	uint8_t		**dst)
> >  {
> >  	char		*src = bp->b_addr;
> >  	xfs_daddr_t	bno = bp->b_bn;
> > @@ -296,7 +296,7 @@ xfs_attr_rmtval_copyin(
> >  	xfs_ino_t	ino,
> >  	int		*offset,
> >  	int		*valuelen,
> > -	__uint8_t	**src)
> > +	uint8_t		**src)
> >  {
> >  	char		*dst = bp->b_addr;
> >  	xfs_daddr_t	bno = bp->b_bn;
> > @@ -350,7 +350,7 @@ xfs_attr_rmtval_get(
> >  	struct xfs_mount	*mp = args->dp->i_mount;
> >  	struct xfs_buf		*bp;
> >  	xfs_dablk_t		lblkno = args->rmtblkno;
> > -	__uint8_t		*dst = args->value;
> > +	uint8_t			*dst = args->value;
> >  	int			valuelen;
> >  	int			nmap;
> >  	int			error;
> > @@ -416,7 +416,7 @@ xfs_attr_rmtval_set(
> >  	struct xfs_bmbt_irec	map;
> >  	xfs_dablk_t		lblkno;
> >  	xfs_fileoff_t		lfileoff = 0;
> > -	__uint8_t		*src = args->value;
> > +	uint8_t			*src = args->value;
> >  	int			blkcnt;
> >  	int			valuelen;
> >  	int			nmap;
> > diff --git a/libxfs/xfs_attr_sf.h b/libxfs/xfs_attr_sf.h
> > index 90928bb..afd684a 100644
> > --- a/libxfs/xfs_attr_sf.h
> > +++ b/libxfs/xfs_attr_sf.h
> > @@ -31,10 +31,10 @@ typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t;
> >   * We generate this then sort it, attr_list() must return things in hash-order.
> >   */
> >  typedef struct xfs_attr_sf_sort {
> > -	__uint8_t	entno;		/* entry number in original list */
> > -	__uint8_t	namelen;	/* length of name value (no null) */
> > -	__uint8_t	valuelen;	/* length of value */
> > -	__uint8_t	flags;		/* flags bits (see xfs_attr_leaf.h) */
> > +	uint8_t		entno;		/* entry number in original list */
> > +	uint8_t		namelen;	/* length of name value (no null) */
> > +	uint8_t		valuelen;	/* length of value */
> > +	uint8_t		flags;		/* flags bits (see xfs_attr_leaf.h) */
> >  	xfs_dahash_t	hash;		/* this entry's hash value */
> >  	unsigned char	*name;		/* name value, pointer into buffer */
> >  } xfs_attr_sf_sort_t;
> > @@ -42,7 +42,7 @@ typedef struct xfs_attr_sf_sort {
> >  #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen)	/* space name/value uses */ \
> >  	(((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen)))
> >  #define XFS_ATTR_SF_ENTSIZE_MAX			/* max space for name&value */ \
> > -	((1 << (NBBY*(int)sizeof(__uint8_t))) - 1)
> > +	((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
> >  #define XFS_ATTR_SF_ENTSIZE(sfep)		/* space an entry uses */ \
> >  	((int)sizeof(xfs_attr_sf_entry_t)-1 + (sfep)->namelen+(sfep)->valuelen)
> >  #define XFS_ATTR_SF_NEXTENTRY(sfep)		/* next entry in struct */ \
> > diff --git a/libxfs/xfs_bit.h b/libxfs/xfs_bit.h
> > index e1649c0..61c6b20 100644
> > --- a/libxfs/xfs_bit.h
> > +++ b/libxfs/xfs_bit.h
> > @@ -25,47 +25,47 @@
> >  /*
> >   * masks with n high/low bits set, 64-bit values
> >   */
> > -static inline __uint64_t xfs_mask64hi(int n)
> > +static inline uint64_t xfs_mask64hi(int n)
> >  {
> > -	return (__uint64_t)-1 << (64 - (n));
> > +	return (uint64_t)-1 << (64 - (n));
> >  }
> > -static inline __uint32_t xfs_mask32lo(int n)
> > +static inline uint32_t xfs_mask32lo(int n)
> >  {
> > -	return ((__uint32_t)1 << (n)) - 1;
> > +	return ((uint32_t)1 << (n)) - 1;
> >  }
> > -static inline __uint64_t xfs_mask64lo(int n)
> > +static inline uint64_t xfs_mask64lo(int n)
> >  {
> > -	return ((__uint64_t)1 << (n)) - 1;
> > +	return ((uint64_t)1 << (n)) - 1;
> >  }
> >  
> >  /* Get high bit set out of 32-bit argument, -1 if none set */
> > -static inline int xfs_highbit32(__uint32_t v)
> > +static inline int xfs_highbit32(uint32_t v)
> >  {
> >  	return fls(v) - 1;
> >  }
> >  
> >  /* Get high bit set out of 64-bit argument, -1 if none set */
> > -static inline int xfs_highbit64(__uint64_t v)
> > +static inline int xfs_highbit64(uint64_t v)
> >  {
> >  	return fls64(v) - 1;
> >  }
> >  
> >  /* Get low bit set out of 32-bit argument, -1 if none set */
> > -static inline int xfs_lowbit32(__uint32_t v)
> > +static inline int xfs_lowbit32(uint32_t v)
> >  {
> >  	return ffs(v) - 1;
> >  }
> >  
> >  /* Get low bit set out of 64-bit argument, -1 if none set */
> > -static inline int xfs_lowbit64(__uint64_t v)
> > +static inline int xfs_lowbit64(uint64_t v)
> >  {
> > -	__uint32_t	w = (__uint32_t)v;
> > +	uint32_t	w = (uint32_t)v;
> >  	int		n = 0;
> >  
> >  	if (w) {	/* lower bits */
> >  		n = ffs(w);
> >  	} else {	/* upper bits */
> > -		w = (__uint32_t)(v >> 32);
> > +		w = (uint32_t)(v >> 32);
> >  		if (w) {
> >  			n = ffs(w);
> >  			if (n)
> > diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c
> > index c48cbec..9ee40d8 100644
> > --- a/libxfs/xfs_bmap_btree.c
> > +++ b/libxfs/xfs_bmap_btree.c
> > @@ -91,8 +91,8 @@ xfs_bmdr_to_bmbt(
> >   */
> >  STATIC void
> >  __xfs_bmbt_get_all(
> > -		__uint64_t l0,
> > -		__uint64_t l1,
> > +		uint64_t l0,
> > +		uint64_t l1,
> >  		xfs_bmbt_irec_t *s)
> >  {
> >  	int	ext_flag;
> > @@ -585,12 +585,12 @@ xfs_bmbt_init_ptr_from_cur(
> >  	ptr->l = 0;
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_bmbt_key_diff(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*key)
> >  {
> > -	return (__int64_t)be64_to_cpu(key->bmbt.br_startoff) -
> > +	return (int64_t)be64_to_cpu(key->bmbt.br_startoff) -
> >  				      cur->bc_rec.b.br_startoff;
> >  }
> >  
> > diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
> > index a9e1fa8..646f2bf 100644
> > --- a/libxfs/xfs_btree.c
> > +++ b/libxfs/xfs_btree.c
> > @@ -39,7 +39,7 @@ kmem_zone_t	*xfs_btree_cur_zone;
> >  /*
> >   * Btree magic numbers.
> >   */
> > -static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
> > +static const uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
> >  	{ XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, 0, XFS_BMAP_MAGIC, XFS_IBT_MAGIC,
> >  	  XFS_FIBT_MAGIC, 0 },
> >  	{ XFS_ABTB_CRC_MAGIC, XFS_ABTC_CRC_MAGIC, XFS_RMAP_CRC_MAGIC,
> > @@ -47,12 +47,12 @@ static const __uint32_t xfs_magics[2][XFS_BTNUM_MAX] = {
> >  	  XFS_REFC_CRC_MAGIC }
> >  };
> >  
> > -__uint32_t
> > +uint32_t
> >  xfs_btree_magic(
> >  	int			crc,
> >  	xfs_btnum_t		btnum)
> >  {
> > -	__uint32_t		magic = xfs_magics[crc][btnum];
> > +	uint32_t		magic = xfs_magics[crc][btnum];
> >  
> >  	/* Ensure we asked for crc for crc-only magics. */
> >  	ASSERT(magic != 0);
> > @@ -774,14 +774,14 @@ xfs_btree_lastrec(
> >   */
> >  void
> >  xfs_btree_offsets(
> > -	__int64_t	fields,		/* bitmask of fields */
> > +	int64_t		fields,		/* bitmask of fields */
> >  	const short	*offsets,	/* table of field offsets */
> >  	int		nbits,		/* number of bits to inspect */
> >  	int		*first,		/* output: first byte offset */
> >  	int		*last)		/* output: last byte offset */
> >  {
> >  	int		i;		/* current bit number */
> > -	__int64_t	imask;		/* mask for current bit number */
> > +	int64_t		imask;		/* mask for current bit number */
> >  
> >  	ASSERT(fields != 0);
> >  	/*
> > @@ -1842,7 +1842,7 @@ xfs_btree_lookup(
> >  	int			*stat)	/* success/failure */
> >  {
> >  	struct xfs_btree_block	*block;	/* current btree block */
> > -	__int64_t		diff;	/* difference for the current key */
> > +	int64_t			diff;	/* difference for the current key */
> >  	int			error;	/* error return value */
> >  	int			keyno;	/* current key number */
> >  	int			level;	/* level in the btree */
> > @@ -4435,7 +4435,7 @@ xfs_btree_visit_blocks(
> >   * recovery completion writes the changes to disk.
> >   */
> >  struct xfs_btree_block_change_owner_info {
> > -	__uint64_t		new_owner;
> > +	uint64_t		new_owner;
> >  	struct list_head	*buffer_list;
> >  };
> >  
> > @@ -4481,7 +4481,7 @@ xfs_btree_block_change_owner(
> >  int
> >  xfs_btree_change_owner(
> >  	struct xfs_btree_cur	*cur,
> > -	__uint64_t		new_owner,
> > +	uint64_t		new_owner,
> >  	struct list_head	*buffer_list)
> >  {
> >  	struct xfs_btree_block_change_owner_info	bbcoi;
> > @@ -4585,7 +4585,7 @@ xfs_btree_simple_query_range(
> >  {
> >  	union xfs_btree_rec		*recp;
> >  	union xfs_btree_key		rec_key;
> > -	__int64_t			diff;
> > +	int64_t				diff;
> >  	int				stat;
> >  	bool				firstrec = true;
> >  	int				error;
> > @@ -4682,8 +4682,8 @@ xfs_btree_overlapped_query_range(
> >  	union xfs_btree_key		*hkp;
> >  	union xfs_btree_rec		*recp;
> >  	struct xfs_btree_block		*block;
> > -	__int64_t			ldiff;
> > -	__int64_t			hdiff;
> > +	int64_t				ldiff;
> > +	int64_t				hdiff;
> >  	int				level;
> >  	struct xfs_buf			*bp;
> >  	int				i;
> > diff --git a/libxfs/xfs_btree.h b/libxfs/xfs_btree.h
> > index 05cf35b..3c1fed2 100644
> > --- a/libxfs/xfs_btree.h
> > +++ b/libxfs/xfs_btree.h
> > @@ -76,7 +76,7 @@ union xfs_btree_rec {
> >  #define	XFS_BTNUM_RMAP	((xfs_btnum_t)XFS_BTNUM_RMAPi)
> >  #define	XFS_BTNUM_REFC	((xfs_btnum_t)XFS_BTNUM_REFCi)
> >  
> > -__uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
> > +uint32_t xfs_btree_magic(int crc, xfs_btnum_t btnum);
> >  
> >  /*
> >   * For logging record fields.
> > @@ -150,14 +150,14 @@ struct xfs_btree_ops {
> >  					  union xfs_btree_rec *rec);
> >  
> >  	/* difference between key value and cursor value */
> > -	__int64_t (*key_diff)(struct xfs_btree_cur *cur,
> > +	int64_t (*key_diff)(struct xfs_btree_cur *cur,
> >  			      union xfs_btree_key *key);
> >  
> >  	/*
> >  	 * Difference between key2 and key1 -- positive if key1 > key2,
> >  	 * negative if key1 < key2, and zero if equal.
> >  	 */
> > -	__int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
> > +	int64_t (*diff_two_keys)(struct xfs_btree_cur *cur,
> >  				   union xfs_btree_key *key1,
> >  				   union xfs_btree_key *key2);
> >  
> > @@ -213,11 +213,11 @@ typedef struct xfs_btree_cur
> >  	union xfs_btree_irec	bc_rec;	/* current insert/search record value */
> >  	struct xfs_buf	*bc_bufs[XFS_BTREE_MAXLEVELS];	/* buf ptr per level */
> >  	int		bc_ptrs[XFS_BTREE_MAXLEVELS];	/* key/record # */
> > -	__uint8_t	bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
> > +	uint8_t		bc_ra[XFS_BTREE_MAXLEVELS];	/* readahead bits */
> >  #define	XFS_BTCUR_LEFTRA	1	/* left sibling has been read-ahead */
> >  #define	XFS_BTCUR_RIGHTRA	2	/* right sibling has been read-ahead */
> > -	__uint8_t	bc_nlevels;	/* number of levels in the tree */
> > -	__uint8_t	bc_blocklog;	/* log2(blocksize) of btree blocks */
> > +	uint8_t		bc_nlevels;	/* number of levels in the tree */
> > +	uint8_t		bc_blocklog;	/* log2(blocksize) of btree blocks */
> >  	xfs_btnum_t	bc_btnum;	/* identifies which btree type */
> >  	int		bc_statoff;	/* offset of btre stats array */
> >  	union {
> > @@ -330,7 +330,7 @@ xfs_btree_islastblock(
> >   */
> >  void
> >  xfs_btree_offsets(
> > -	__int64_t		fields,	/* bitmask of fields */
> > +	int64_t			fields,	/* bitmask of fields */
> >  	const short		*offsets,/* table of field offsets */
> >  	int			nbits,	/* number of bits to inspect */
> >  	int			*first,	/* output: first byte offset */
> > @@ -408,7 +408,7 @@ int xfs_btree_new_iroot(struct xfs_btree_cur *, int *, int *);
> >  int xfs_btree_insert(struct xfs_btree_cur *, int *);
> >  int xfs_btree_delete(struct xfs_btree_cur *, int *);
> >  int xfs_btree_get_rec(struct xfs_btree_cur *, union xfs_btree_rec **, int *);
> > -int xfs_btree_change_owner(struct xfs_btree_cur *cur, __uint64_t new_owner,
> > +int xfs_btree_change_owner(struct xfs_btree_cur *cur, uint64_t new_owner,
> >  			   struct list_head *buffer_list);
> >  
> >  /*
> > @@ -434,7 +434,7 @@ static inline int xfs_btree_get_numrecs(struct xfs_btree_block *block)
> >  }
> >  
> >  static inline void xfs_btree_set_numrecs(struct xfs_btree_block *block,
> > -		__uint16_t numrecs)
> > +		uint16_t numrecs)
> >  {
> >  	block->bb_numrecs = cpu_to_be16(numrecs);
> >  }
> > diff --git a/libxfs/xfs_cksum.h b/libxfs/xfs_cksum.h
> > index a416c7c..8211f48 100644
> > --- a/libxfs/xfs_cksum.h
> > +++ b/libxfs/xfs_cksum.h
> > @@ -1,7 +1,7 @@
> >  #ifndef _XFS_CKSUM_H
> >  #define _XFS_CKSUM_H 1
> >  
> > -#define XFS_CRC_SEED	(~(__uint32_t)0)
> > +#define XFS_CRC_SEED	(~(uint32_t)0)
> >  
> >  /*
> >   * Calculate the intermediate checksum for a buffer that has the CRC field
> > @@ -9,11 +9,11 @@
> >   * cksum_offset parameter. We do not modify the buffer during verification,
> >   * hence we have to split the CRC calculation across the cksum_offset.
> >   */
> > -static inline __uint32_t
> > +static inline uint32_t
> >  xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
> >  {
> > -	__uint32_t zero = 0;
> > -	__uint32_t crc;
> > +	uint32_t zero = 0;
> > +	uint32_t crc;
> >  
> >  	/* Calculate CRC up to the checksum. */
> >  	crc = crc32c(XFS_CRC_SEED, buffer, cksum_offset);
> > @@ -30,7 +30,7 @@ xfs_start_cksum_safe(char *buffer, size_t length, unsigned long cksum_offset)
> >   * Fast CRC method where the buffer is modified. Callers must have exclusive
> >   * access to the buffer while the calculation takes place.
> >   */
> > -static inline __uint32_t
> > +static inline uint32_t
> >  xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
> >  {
> >  	/* zero the CRC field */
> > @@ -48,7 +48,7 @@ xfs_start_cksum_update(char *buffer, size_t length, unsigned long cksum_offset)
> >   * so that it is consistent on disk.
> >   */
> >  static inline __le32
> > -xfs_end_cksum(__uint32_t crc)
> > +xfs_end_cksum(uint32_t crc)
> >  {
> >  	return ~cpu_to_le32(crc);
> >  }
> > @@ -62,7 +62,7 @@ xfs_end_cksum(__uint32_t crc)
> >  static inline void
> >  xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
> >  {
> > -	__uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
> > +	uint32_t crc = xfs_start_cksum_update(buffer, length, cksum_offset);
> >  
> >  	*(__le32 *)(buffer + cksum_offset) = xfs_end_cksum(crc);
> >  }
> > @@ -73,7 +73,7 @@ xfs_update_cksum(char *buffer, size_t length, unsigned long cksum_offset)
> >  static inline int
> >  xfs_verify_cksum(char *buffer, size_t length, unsigned long cksum_offset)
> >  {
> > -	__uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
> > +	uint32_t crc = xfs_start_cksum_safe(buffer, length, cksum_offset);
> >  
> >  	return *(__le32 *)(buffer + cksum_offset) == xfs_end_cksum(crc);
> >  }
> > diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c
> > index bc12f58..08447be 100644
> > --- a/libxfs/xfs_da_btree.c
> > +++ b/libxfs/xfs_da_btree.c
> > @@ -1947,7 +1947,7 @@ xfs_da3_path_shift(
> >   * This is implemented with some source-level loop unrolling.
> >   */
> >  xfs_dahash_t
> > -xfs_da_hashname(const __uint8_t *name, int namelen)
> > +xfs_da_hashname(const uint8_t *name, int namelen)
> >  {
> >  	xfs_dahash_t hash;
> >  
> > diff --git a/libxfs/xfs_da_btree.h b/libxfs/xfs_da_btree.h
> > index 4e29cb6..ae6de17 100644
> > --- a/libxfs/xfs_da_btree.h
> > +++ b/libxfs/xfs_da_btree.h
> > @@ -60,10 +60,10 @@ enum xfs_dacmp {
> >   */
> >  typedef struct xfs_da_args {
> >  	struct xfs_da_geometry *geo;	/* da block geometry */
> > -	const __uint8_t	*name;		/* string (maybe not NULL terminated) */
> > +	const uint8_t		*name;		/* string (maybe not NULL terminated) */
> >  	int		namelen;	/* length of string (maybe no NULL) */
> > -	__uint8_t	filetype;	/* filetype of inode for directories */
> > -	__uint8_t	*value;		/* set of bytes (maybe contain NULLs) */
> > +	uint8_t		filetype;	/* filetype of inode for directories */
> > +	uint8_t		*value;		/* set of bytes (maybe contain NULLs) */
> >  	int		valuelen;	/* length of value */
> >  	int		flags;		/* argument flags (eg: ATTR_NOCREATE) */
> >  	xfs_dahash_t	hashval;	/* hash value of name */
> > @@ -207,7 +207,7 @@ int	xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
> >  int	xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
> >  					  struct xfs_buf *dead_buf);
> >  
> > -uint xfs_da_hashname(const __uint8_t *name_string, int name_length);
> > +uint xfs_da_hashname(const uint8_t *name_string, int name_length);
> >  enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
> >  				const unsigned char *name, int len);
> >  
> > diff --git a/libxfs/xfs_da_format.c b/libxfs/xfs_da_format.c
> > index 2b732b3..f30004f 100644
> > --- a/libxfs/xfs_da_format.c
> > +++ b/libxfs/xfs_da_format.c
> > @@ -49,7 +49,7 @@ xfs_dir3_sf_entsize(
> >  	struct xfs_dir2_sf_hdr	*hdr,
> >  	int			len)
> >  {
> > -	return xfs_dir2_sf_entsize(hdr, len) + sizeof(__uint8_t);
> > +	return xfs_dir2_sf_entsize(hdr, len) + sizeof(uint8_t);
> >  }
> >  
> >  static struct xfs_dir2_sf_entry *
> > @@ -77,7 +77,7 @@ xfs_dir3_sf_nextentry(
> >   * not necessary. For non-filetype enable directories, the type is always
> >   * unknown and we never store the value.
> >   */
> > -static __uint8_t
> > +static uint8_t
> >  xfs_dir2_sfe_get_ftype(
> >  	struct xfs_dir2_sf_entry *sfep)
> >  {
> > @@ -87,16 +87,16 @@ xfs_dir2_sfe_get_ftype(
> >  static void
> >  xfs_dir2_sfe_put_ftype(
> >  	struct xfs_dir2_sf_entry *sfep,
> > -	__uint8_t		ftype)
> > +	uint8_t			ftype)
> >  {
> >  	ASSERT(ftype < XFS_DIR3_FT_MAX);
> >  }
> >  
> > -static __uint8_t
> > +static uint8_t
> >  xfs_dir3_sfe_get_ftype(
> >  	struct xfs_dir2_sf_entry *sfep)
> >  {
> > -	__uint8_t	ftype;
> > +	uint8_t		ftype;
> >  
> >  	ftype = sfep->name[sfep->namelen];
> >  	if (ftype >= XFS_DIR3_FT_MAX)
> > @@ -107,7 +107,7 @@ xfs_dir3_sfe_get_ftype(
> >  static void
> >  xfs_dir3_sfe_put_ftype(
> >  	struct xfs_dir2_sf_entry *sfep,
> > -	__uint8_t		ftype)
> > +	uint8_t			ftype)
> >  {
> >  	ASSERT(ftype < XFS_DIR3_FT_MAX);
> >  
> > @@ -124,7 +124,7 @@ xfs_dir3_sfe_put_ftype(
> >  static xfs_ino_t
> >  xfs_dir2_sf_get_ino(
> >  	struct xfs_dir2_sf_hdr	*hdr,
> > -	__uint8_t		*from)
> > +	uint8_t			*from)
> >  {
> >  	if (hdr->i8count)
> >  		return get_unaligned_be64(from) & 0x00ffffffffffffffULL;
> > @@ -135,7 +135,7 @@ xfs_dir2_sf_get_ino(
> >  static void
> >  xfs_dir2_sf_put_ino(
> >  	struct xfs_dir2_sf_hdr	*hdr,
> > -	__uint8_t		*to,
> > +	uint8_t			*to,
> >  	xfs_ino_t		ino)
> >  {
> >  	ASSERT((ino & 0xff00000000000000ULL) == 0);
> > @@ -225,7 +225,7 @@ xfs_dir3_sfe_put_ino(
> >  
> >  #define XFS_DIR3_DATA_ENTSIZE(n)					\
> >  	round_up((offsetof(struct xfs_dir2_data_entry, name[0]) + (n) +	\
> > -		 sizeof(xfs_dir2_data_off_t) + sizeof(__uint8_t)),	\
> > +		 sizeof(xfs_dir2_data_off_t) + sizeof(uint8_t)),	\
> >  		XFS_DIR2_DATA_ALIGN)
> >  
> >  static int
> > @@ -242,7 +242,7 @@ xfs_dir3_data_entsize(
> >  	return XFS_DIR3_DATA_ENTSIZE(n);
> >  }
> >  
> > -static __uint8_t
> > +static uint8_t
> >  xfs_dir2_data_get_ftype(
> >  	struct xfs_dir2_data_entry *dep)
> >  {
> > @@ -252,16 +252,16 @@ xfs_dir2_data_get_ftype(
> >  static void
> >  xfs_dir2_data_put_ftype(
> >  	struct xfs_dir2_data_entry *dep,
> > -	__uint8_t		ftype)
> > +	uint8_t			ftype)
> >  {
> >  	ASSERT(ftype < XFS_DIR3_FT_MAX);
> >  }
> >  
> > -static __uint8_t
> > +static uint8_t
> >  xfs_dir3_data_get_ftype(
> >  	struct xfs_dir2_data_entry *dep)
> >  {
> > -	__uint8_t	ftype = dep->name[dep->namelen];
> > +	uint8_t		ftype = dep->name[dep->namelen];
> >  
> >  	if (ftype >= XFS_DIR3_FT_MAX)
> >  		return XFS_DIR3_FT_UNKNOWN;
> > @@ -271,7 +271,7 @@ xfs_dir3_data_get_ftype(
> >  static void
> >  xfs_dir3_data_put_ftype(
> >  	struct xfs_dir2_data_entry *dep,
> > -	__uint8_t		type)
> > +	uint8_t			type)
> >  {
> >  	ASSERT(type < XFS_DIR3_FT_MAX);
> >  	ASSERT(dep->namelen != 0);
> > diff --git a/libxfs/xfs_da_format.h b/libxfs/xfs_da_format.h
> > index 9a492a9..3771edc 100644
> > --- a/libxfs/xfs_da_format.h
> > +++ b/libxfs/xfs_da_format.h
> > @@ -111,11 +111,11 @@ struct xfs_da3_intnode {
> >   * appropriate.
> >   */
> >  struct xfs_da3_icnode_hdr {
> > -	__uint32_t	forw;
> > -	__uint32_t	back;
> > -	__uint16_t	magic;
> > -	__uint16_t	count;
> > -	__uint16_t	level;
> > +	uint32_t	forw;
> > +	uint32_t	back;
> > +	uint16_t	magic;
> > +	uint16_t	count;
> > +	uint16_t	level;
> >  };
> >  
> >  /*
> > @@ -187,14 +187,14 @@ struct xfs_da3_icnode_hdr {
> >  /*
> >   * Byte offset in data block and shortform entry.
> >   */
> > -typedef	__uint16_t	xfs_dir2_data_off_t;
> > +typedef uint16_t	xfs_dir2_data_off_t;
> >  #define	NULLDATAOFF	0xffffU
> >  typedef uint		xfs_dir2_data_aoff_t;	/* argument form */
> >  
> >  /*
> >   * Offset in data space of a data entry.
> >   */
> > -typedef	__uint32_t	xfs_dir2_dataptr_t;
> > +typedef uint32_t	xfs_dir2_dataptr_t;
> >  #define	XFS_DIR2_MAX_DATAPTR	((xfs_dir2_dataptr_t)0xffffffff)
> >  #define	XFS_DIR2_NULL_DATAPTR	((xfs_dir2_dataptr_t)0)
> >  
> > @@ -206,7 +206,7 @@ typedef	xfs_off_t	xfs_dir2_off_t;
> >  /*
> >   * Directory block number (logical dirblk in file)
> >   */
> > -typedef	__uint32_t	xfs_dir2_db_t;
> > +typedef uint32_t	xfs_dir2_db_t;
> >  
> >  #define XFS_INO32_SIZE	4
> >  #define XFS_INO64_SIZE	8
> > @@ -226,9 +226,9 @@ typedef	__uint32_t	xfs_dir2_db_t;
> >   * over them.
> >   */
> >  typedef struct xfs_dir2_sf_hdr {
> > -	__uint8_t		count;		/* count of entries */
> > -	__uint8_t		i8count;	/* count of 8-byte inode #s */
> > -	__uint8_t		parent[8];	/* parent dir inode number */
> > +	uint8_t			count;		/* count of entries */
> > +	uint8_t			i8count;	/* count of 8-byte inode #s */
> > +	uint8_t			parent[8];	/* parent dir inode number */
> >  } __packed xfs_dir2_sf_hdr_t;
> >  
> >  typedef struct xfs_dir2_sf_entry {
> > @@ -447,11 +447,11 @@ struct xfs_dir3_leaf_hdr {
> >  };
> >  
> >  struct xfs_dir3_icleaf_hdr {
> > -	__uint32_t		forw;
> > -	__uint32_t		back;
> > -	__uint16_t		magic;
> > -	__uint16_t		count;
> > -	__uint16_t		stale;
> > +	uint32_t		forw;
> > +	uint32_t		back;
> > +	uint16_t		magic;
> > +	uint16_t		count;
> > +	uint16_t		stale;
> >  };
> >  
> >  /*
> > @@ -538,10 +538,10 @@ struct xfs_dir3_free {
> >   * xfs_dir3_free_hdr_from_disk/xfs_dir3_free_hdr_to_disk.
> >   */
> >  struct xfs_dir3_icfree_hdr {
> > -	__uint32_t	magic;
> > -	__uint32_t	firstdb;
> > -	__uint32_t	nvalid;
> > -	__uint32_t	nused;
> > +	uint32_t	magic;
> > +	uint32_t	firstdb;
> > +	uint32_t	nvalid;
> > +	uint32_t	nused;
> >  
> >  };
> >  
> > @@ -632,10 +632,10 @@ typedef struct xfs_attr_shortform {
> >  		__u8	padding;
> >  	} hdr;
> >  	struct xfs_attr_sf_entry {
> > -		__uint8_t namelen;	/* actual length of name (no NULL) */
> > -		__uint8_t valuelen;	/* actual length of value (no NULL) */
> > -		__uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
> > -		__uint8_t nameval[1];	/* name & value bytes concatenated */
> > +		uint8_t namelen;	/* actual length of name (no NULL) */
> > +		uint8_t valuelen;	/* actual length of value (no NULL) */
> > +		uint8_t flags;	/* flags bits (see xfs_attr_leaf.h) */
> > +		uint8_t nameval[1];	/* name & value bytes concatenated */
> >  	} list[1];			/* variable sized array */
> >  } xfs_attr_shortform_t;
> >  
> > @@ -725,22 +725,22 @@ struct xfs_attr3_leafblock {
> >   * incore, neutral version of the attribute leaf header
> >   */
> >  struct xfs_attr3_icleaf_hdr {
> > -	__uint32_t	forw;
> > -	__uint32_t	back;
> > -	__uint16_t	magic;
> > -	__uint16_t	count;
> > -	__uint16_t	usedbytes;
> > +	uint32_t	forw;
> > +	uint32_t	back;
> > +	uint16_t	magic;
> > +	uint16_t	count;
> > +	uint16_t	usedbytes;
> >  	/*
> >  	 * firstused is 32-bit here instead of 16-bit like the on-disk variant
> >  	 * to support maximum fsb size of 64k without overflow issues throughout
> >  	 * the attr code. Instead, the overflow condition is handled on
> >  	 * conversion to/from disk.
> >  	 */
> > -	__uint32_t	firstused;
> > +	uint32_t	firstused;
> >  	__u8		holes;
> >  	struct {
> > -		__uint16_t	base;
> > -		__uint16_t	size;
> > +		uint16_t	base;
> > +		uint16_t	size;
> >  	} freemap[XFS_ATTR_LEAF_MAPSIZE];
> >  };
> >  
> > diff --git a/libxfs/xfs_dir2.h b/libxfs/xfs_dir2.h
> > index d6e6d9d..21c8f8b 100644
> > --- a/libxfs/xfs_dir2.h
> > +++ b/libxfs/xfs_dir2.h
> > @@ -47,9 +47,9 @@ struct xfs_dir_ops {
> >  	struct xfs_dir2_sf_entry *
> >  		(*sf_nextentry)(struct xfs_dir2_sf_hdr *hdr,
> >  				struct xfs_dir2_sf_entry *sfep);
> > -	__uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
> > +	uint8_t (*sf_get_ftype)(struct xfs_dir2_sf_entry *sfep);
> >  	void	(*sf_put_ftype)(struct xfs_dir2_sf_entry *sfep,
> > -				__uint8_t ftype);
> > +				uint8_t ftype);
> >  	xfs_ino_t (*sf_get_ino)(struct xfs_dir2_sf_hdr *hdr,
> >  				struct xfs_dir2_sf_entry *sfep);
> >  	void	(*sf_put_ino)(struct xfs_dir2_sf_hdr *hdr,
> > @@ -60,9 +60,9 @@ struct xfs_dir_ops {
> >  				     xfs_ino_t ino);
> >  
> >  	int	(*data_entsize)(int len);
> > -	__uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
> > +	uint8_t (*data_get_ftype)(struct xfs_dir2_data_entry *dep);
> >  	void	(*data_put_ftype)(struct xfs_dir2_data_entry *dep,
> > -				__uint8_t ftype);
> > +				uint8_t ftype);
> >  	__be16 * (*data_entry_tag_p)(struct xfs_dir2_data_entry *dep);
> >  	struct xfs_dir2_data_free *
> >  		(*data_bestfree_p)(struct xfs_dir2_data_hdr *hdr);
> > diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c
> > index f80d91f..40a35b8 100644
> > --- a/libxfs/xfs_dir2_leaf.c
> > +++ b/libxfs/xfs_dir2_leaf.c
> > @@ -142,7 +142,7 @@ xfs_dir3_leaf_check_int(
> >  static bool
> >  xfs_dir3_leaf_verify(
> >  	struct xfs_buf		*bp,
> > -	__uint16_t		magic)
> > +	uint16_t		magic)
> >  {
> >  	struct xfs_mount	*mp = bp->b_target->bt_mount;
> >  	struct xfs_dir2_leaf	*leaf = bp->b_addr;
> > @@ -151,7 +151,7 @@ xfs_dir3_leaf_verify(
> >  
> >  	if (xfs_sb_version_hascrc(&mp->m_sb)) {
> >  		struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
> > -		__uint16_t		magic3;
> > +		uint16_t		magic3;
> >  
> >  		magic3 = (magic == XFS_DIR2_LEAF1_MAGIC) ? XFS_DIR3_LEAF1_MAGIC
> >  							 : XFS_DIR3_LEAFN_MAGIC;
> > @@ -175,7 +175,7 @@ xfs_dir3_leaf_verify(
> >  static void
> >  __read_verify(
> >  	struct xfs_buf  *bp,
> > -	__uint16_t	magic)
> > +	uint16_t	magic)
> >  {
> >  	struct xfs_mount	*mp = bp->b_target->bt_mount;
> >  
> > @@ -192,7 +192,7 @@ __read_verify(
> >  static void
> >  __write_verify(
> >  	struct xfs_buf  *bp,
> > -	__uint16_t	magic)
> > +	uint16_t	magic)
> >  {
> >  	struct xfs_mount	*mp = bp->b_target->bt_mount;
> >  	struct xfs_buf_log_item	*bip = bp->b_fspriv;
> > @@ -296,7 +296,7 @@ xfs_dir3_leaf_init(
> >  	struct xfs_trans	*tp,
> >  	struct xfs_buf		*bp,
> >  	xfs_ino_t		owner,
> > -	__uint16_t		type)
> > +	uint16_t		type)
> >  {
> >  	struct xfs_dir2_leaf	*leaf = bp->b_addr;
> >  
> > @@ -340,7 +340,7 @@ xfs_dir3_leaf_get_buf(
> >  	xfs_da_args_t		*args,
> >  	xfs_dir2_db_t		bno,
> >  	struct xfs_buf		**bpp,
> > -	__uint16_t		magic)
> > +	uint16_t		magic)
> >  {
> >  	struct xfs_inode	*dp = args->dp;
> >  	struct xfs_trans	*tp = args->trans;
> > diff --git a/libxfs/xfs_dir2_priv.h b/libxfs/xfs_dir2_priv.h
> > index 39f8604..011df4d 100644
> > --- a/libxfs/xfs_dir2_priv.h
> > +++ b/libxfs/xfs_dir2_priv.h
> > @@ -69,7 +69,7 @@ extern void xfs_dir3_leaf_compact_x1(struct xfs_dir3_icleaf_hdr *leafhdr,
> >  		struct xfs_dir2_leaf_entry *ents, int *indexp,
> >  		int *lowstalep, int *highstalep, int *lowlogp, int *highlogp);
> >  extern int xfs_dir3_leaf_get_buf(struct xfs_da_args *args, xfs_dir2_db_t bno,
> > -		struct xfs_buf **bpp, __uint16_t magic);
> > +		struct xfs_buf **bpp, uint16_t magic);
> >  extern void xfs_dir3_leaf_log_ents(struct xfs_da_args *args,
> >  		struct xfs_buf *bp, int first, int last);
> >  extern void xfs_dir3_leaf_log_header(struct xfs_da_args *args,
> > diff --git a/libxfs/xfs_dir2_sf.c b/libxfs/xfs_dir2_sf.c
> > index 195f816..fdbe5e1 100644
> > --- a/libxfs/xfs_dir2_sf.c
> > +++ b/libxfs/xfs_dir2_sf.c
> > @@ -645,7 +645,7 @@ xfs_dir2_sf_verify(
> >  	int				offset;
> >  	int				size;
> >  	int				error;
> > -	__uint8_t			filetype;
> > +	uint8_t				filetype;
> >  
> >  	ASSERT(ip->i_d.di_format == XFS_DINODE_FMT_LOCAL);
> >  	/*
> > diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h
> > index 4c3ed1f..a53f035 100644
> > --- a/libxfs/xfs_format.h
> > +++ b/libxfs/xfs_format.h
> > @@ -103,8 +103,8 @@ struct xfs_ifork;
> >   * Must be padded to 64 bit alignment.
> >   */
> >  typedef struct xfs_sb {
> > -	__uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
> > -	__uint32_t	sb_blocksize;	/* logical block size, bytes */
> > +	uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
> > +	uint32_t	sb_blocksize;	/* logical block size, bytes */
> >  	xfs_rfsblock_t	sb_dblocks;	/* number of data blocks */
> >  	xfs_rfsblock_t	sb_rblocks;	/* number of realtime blocks */
> >  	xfs_rtblock_t	sb_rextents;	/* number of realtime extents */
> > @@ -118,45 +118,45 @@ typedef struct xfs_sb {
> >  	xfs_agnumber_t	sb_agcount;	/* number of allocation groups */
> >  	xfs_extlen_t	sb_rbmblocks;	/* number of rt bitmap blocks */
> >  	xfs_extlen_t	sb_logblocks;	/* number of log blocks */
> > -	__uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
> > -	__uint16_t	sb_sectsize;	/* volume sector size, bytes */
> > -	__uint16_t	sb_inodesize;	/* inode size, bytes */
> > -	__uint16_t	sb_inopblock;	/* inodes per block */
> > +	uint16_t	sb_versionnum;	/* header version == XFS_SB_VERSION */
> > +	uint16_t	sb_sectsize;	/* volume sector size, bytes */
> > +	uint16_t	sb_inodesize;	/* inode size, bytes */
> > +	uint16_t	sb_inopblock;	/* inodes per block */
> >  	char		sb_fname[12];	/* file system name */
> > -	__uint8_t	sb_blocklog;	/* log2 of sb_blocksize */
> > -	__uint8_t	sb_sectlog;	/* log2 of sb_sectsize */
> > -	__uint8_t	sb_inodelog;	/* log2 of sb_inodesize */
> > -	__uint8_t	sb_inopblog;	/* log2 of sb_inopblock */
> > -	__uint8_t	sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
> > -	__uint8_t	sb_rextslog;	/* log2 of sb_rextents */
> > -	__uint8_t	sb_inprogress;	/* mkfs is in progress, don't mount */
> > -	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
> > +	uint8_t		sb_blocklog;	/* log2 of sb_blocksize */
> > +	uint8_t		sb_sectlog;	/* log2 of sb_sectsize */
> > +	uint8_t		sb_inodelog;	/* log2 of sb_inodesize */
> > +	uint8_t		sb_inopblog;	/* log2 of sb_inopblock */
> > +	uint8_t		sb_agblklog;	/* log2 of sb_agblocks (rounded up) */
> > +	uint8_t		sb_rextslog;	/* log2 of sb_rextents */
> > +	uint8_t		sb_inprogress;	/* mkfs is in progress, don't mount */
> > +	uint8_t		sb_imax_pct;	/* max % of fs for inode space */
> >  					/* statistics */
> >  	/*
> >  	 * These fields must remain contiguous.  If you really
> >  	 * want to change their layout, make sure you fix the
> >  	 * code in xfs_trans_apply_sb_deltas().
> >  	 */
> > -	__uint64_t	sb_icount;	/* allocated inodes */
> > -	__uint64_t	sb_ifree;	/* free inodes */
> > -	__uint64_t	sb_fdblocks;	/* free data blocks */
> > -	__uint64_t	sb_frextents;	/* free realtime extents */
> > +	uint64_t	sb_icount;	/* allocated inodes */
> > +	uint64_t	sb_ifree;	/* free inodes */
> > +	uint64_t	sb_fdblocks;	/* free data blocks */
> > +	uint64_t	sb_frextents;	/* free realtime extents */
> >  	/*
> >  	 * End contiguous fields.
> >  	 */
> >  	xfs_ino_t	sb_uquotino;	/* user quota inode */
> >  	xfs_ino_t	sb_gquotino;	/* group quota inode */
> > -	__uint16_t	sb_qflags;	/* quota flags */
> > -	__uint8_t	sb_flags;	/* misc. flags */
> > -	__uint8_t	sb_shared_vn;	/* shared version number */
> > +	uint16_t	sb_qflags;	/* quota flags */
> > +	uint8_t		sb_flags;	/* misc. flags */
> > +	uint8_t		sb_shared_vn;	/* shared version number */
> >  	xfs_extlen_t	sb_inoalignmt;	/* inode chunk alignment, fsblocks */
> > -	__uint32_t	sb_unit;	/* stripe or raid unit */
> > -	__uint32_t	sb_width;	/* stripe or raid width */
> > -	__uint8_t	sb_dirblklog;	/* log2 of dir block size (fsbs) */
> > -	__uint8_t	sb_logsectlog;	/* log2 of the log sector size */
> > -	__uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
> > -	__uint32_t	sb_logsunit;	/* stripe unit size for the log */
> > -	__uint32_t	sb_features2;	/* additional feature bits */
> > +	uint32_t	sb_unit;	/* stripe or raid unit */
> > +	uint32_t	sb_width;	/* stripe or raid width */
> > +	uint8_t		sb_dirblklog;	/* log2 of dir block size (fsbs) */
> > +	uint8_t		sb_logsectlog;	/* log2 of the log sector size */
> > +	uint16_t	sb_logsectsize;	/* sector size for the log, bytes */
> > +	uint32_t	sb_logsunit;	/* stripe unit size for the log */
> > +	uint32_t	sb_features2;	/* additional feature bits */
> >  
> >  	/*
> >  	 * bad features2 field as a result of failing to pad the sb structure to
> > @@ -167,17 +167,17 @@ typedef struct xfs_sb {
> >  	 * the value in sb_features2 when formatting the incore superblock to
> >  	 * the disk buffer.
> >  	 */
> > -	__uint32_t	sb_bad_features2;
> > +	uint32_t	sb_bad_features2;
> >  
> >  	/* version 5 superblock fields start here */
> >  
> >  	/* feature masks */
> > -	__uint32_t	sb_features_compat;
> > -	__uint32_t	sb_features_ro_compat;
> > -	__uint32_t	sb_features_incompat;
> > -	__uint32_t	sb_features_log_incompat;
> > +	uint32_t	sb_features_compat;
> > +	uint32_t	sb_features_ro_compat;
> > +	uint32_t	sb_features_incompat;
> > +	uint32_t	sb_features_log_incompat;
> >  
> > -	__uint32_t	sb_crc;		/* superblock crc */
> > +	uint32_t	sb_crc;		/* superblock crc */
> >  	xfs_extlen_t	sb_spino_align;	/* sparse inode chunk alignment */
> >  
> >  	xfs_ino_t	sb_pquotino;	/* project quota inode */
> > @@ -449,7 +449,7 @@ static inline void xfs_sb_version_addprojid32bit(struct xfs_sb *sbp)
> >  static inline bool
> >  xfs_sb_has_compat_feature(
> >  	struct xfs_sb	*sbp,
> > -	__uint32_t	feature)
> > +	uint32_t	feature)
> >  {
> >  	return (sbp->sb_features_compat & feature) != 0;
> >  }
> > @@ -465,7 +465,7 @@ xfs_sb_has_compat_feature(
> >  static inline bool
> >  xfs_sb_has_ro_compat_feature(
> >  	struct xfs_sb	*sbp,
> > -	__uint32_t	feature)
> > +	uint32_t	feature)
> >  {
> >  	return (sbp->sb_features_ro_compat & feature) != 0;
> >  }
> > @@ -482,7 +482,7 @@ xfs_sb_has_ro_compat_feature(
> >  static inline bool
> >  xfs_sb_has_incompat_feature(
> >  	struct xfs_sb	*sbp,
> > -	__uint32_t	feature)
> > +	uint32_t	feature)
> >  {
> >  	return (sbp->sb_features_incompat & feature) != 0;
> >  }
> > @@ -492,7 +492,7 @@ xfs_sb_has_incompat_feature(
> >  static inline bool
> >  xfs_sb_has_incompat_log_feature(
> >  	struct xfs_sb	*sbp,
> > -	__uint32_t	feature)
> > +	uint32_t	feature)
> >  {
> >  	return (sbp->sb_features_log_incompat & feature) != 0;
> >  }
> > @@ -594,8 +594,8 @@ xfs_is_quota_inode(struct xfs_sb *sbp, xfs_ino_t ino)
> >   */
> >  #define XFS_FSB_TO_B(mp,fsbno)	((xfs_fsize_t)(fsbno) << (mp)->m_sb.sb_blocklog)
> >  #define XFS_B_TO_FSB(mp,b)	\
> > -	((((__uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
> > -#define XFS_B_TO_FSBT(mp,b)	(((__uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
> > +	((((uint64_t)(b)) + (mp)->m_blockmask) >> (mp)->m_sb.sb_blocklog)
> > +#define XFS_B_TO_FSBT(mp,b)	(((uint64_t)(b)) >> (mp)->m_sb.sb_blocklog)
> >  #define XFS_B_FSB_OFFSET(mp,b)	((b) & (mp)->m_blockmask)
> >  
> >  /*
> > @@ -1072,7 +1072,7 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
> >   * next agno_log bits - ag number
> >   * high agno_log-agblklog-inopblog bits - 0
> >   */
> > -#define	XFS_INO_MASK(k)			(__uint32_t)((1ULL << (k)) - 1)
> > +#define	XFS_INO_MASK(k)			(uint32_t)((1ULL << (k)) - 1)
> >  #define	XFS_INO_OFFSET_BITS(mp)		(mp)->m_sb.sb_inopblog
> >  #define	XFS_INO_AGBNO_BITS(mp)		(mp)->m_sb.sb_agblklog
> >  #define	XFS_INO_AGINO_BITS(mp)		(mp)->m_agino_log
> > @@ -1269,16 +1269,16 @@ typedef __be32 xfs_alloc_ptr_t;
> >  #define	XFS_FIBT_MAGIC		0x46494254	/* 'FIBT' */
> >  #define	XFS_FIBT_CRC_MAGIC	0x46494233	/* 'FIB3' */
> >  
> > -typedef	__uint64_t	xfs_inofree_t;
> > +typedef uint64_t	xfs_inofree_t;
> >  #define	XFS_INODES_PER_CHUNK		(NBBY * sizeof(xfs_inofree_t))
> >  #define	XFS_INODES_PER_CHUNK_LOG	(XFS_NBBYLOG + 3)
> >  #define	XFS_INOBT_ALL_FREE		((xfs_inofree_t)-1)
> >  #define	XFS_INOBT_MASK(i)		((xfs_inofree_t)1 << (i))
> >  
> >  #define XFS_INOBT_HOLEMASK_FULL		0	/* holemask for full chunk */
> > -#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(__uint16_t))
> > +#define XFS_INOBT_HOLEMASK_BITS		(NBBY * sizeof(uint16_t))
> >  #define XFS_INODES_PER_HOLEMASK_BIT	\
> > -	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(__uint16_t)))
> > +	(XFS_INODES_PER_CHUNK / (NBBY * sizeof(uint16_t)))
> >  
> >  static inline xfs_inofree_t xfs_inobt_maskn(int i, int n)
> >  {
> > @@ -1312,9 +1312,9 @@ typedef struct xfs_inobt_rec {
> >  
> >  typedef struct xfs_inobt_rec_incore {
> >  	xfs_agino_t	ir_startino;	/* starting inode number */
> > -	__uint16_t	ir_holemask;	/* hole mask for sparse chunks */
> > -	__uint8_t	ir_count;	/* total inode count */
> > -	__uint8_t	ir_freecount;	/* count of free inodes (set bits) */
> > +	uint16_t	ir_holemask;	/* hole mask for sparse chunks */
> > +	uint8_t		ir_count;	/* total inode count */
> > +	uint8_t		ir_freecount;	/* count of free inodes (set bits) */
> >  	xfs_inofree_t	ir_free;	/* free inode mask */
> >  } xfs_inobt_rec_incore_t;
> >  
> > @@ -1397,15 +1397,15 @@ struct xfs_rmap_rec {
> >   *  rm_offset:54-60 aren't used and should be zero
> >   *  rm_offset:0-53 is the block offset within the inode
> >   */
> > -#define XFS_RMAP_OFF_ATTR_FORK	((__uint64_t)1ULL << 63)
> > -#define XFS_RMAP_OFF_BMBT_BLOCK	((__uint64_t)1ULL << 62)
> > -#define XFS_RMAP_OFF_UNWRITTEN	((__uint64_t)1ULL << 61)
> > +#define XFS_RMAP_OFF_ATTR_FORK	((uint64_t)1ULL << 63)
> > +#define XFS_RMAP_OFF_BMBT_BLOCK	((uint64_t)1ULL << 62)
> > +#define XFS_RMAP_OFF_UNWRITTEN	((uint64_t)1ULL << 61)
> >  
> > -#define XFS_RMAP_LEN_MAX	((__uint32_t)~0U)
> > +#define XFS_RMAP_LEN_MAX	((uint32_t)~0U)
> >  #define XFS_RMAP_OFF_FLAGS	(XFS_RMAP_OFF_ATTR_FORK | \
> >  				 XFS_RMAP_OFF_BMBT_BLOCK | \
> >  				 XFS_RMAP_OFF_UNWRITTEN)
> > -#define XFS_RMAP_OFF_MASK	((__uint64_t)0x3FFFFFFFFFFFFFULL)
> > +#define XFS_RMAP_OFF_MASK	((uint64_t)0x3FFFFFFFFFFFFFULL)
> >  
> >  #define XFS_RMAP_OFF(off)		((off) & XFS_RMAP_OFF_MASK)
> >  
> > @@ -1431,8 +1431,8 @@ struct xfs_rmap_rec {
> >  struct xfs_rmap_irec {
> >  	xfs_agblock_t	rm_startblock;	/* extent start block */
> >  	xfs_extlen_t	rm_blockcount;	/* extent length */
> > -	__uint64_t	rm_owner;	/* extent owner */
> > -	__uint64_t	rm_offset;	/* offset within the owner */
> > +	uint64_t	rm_owner;	/* extent owner */
> > +	uint64_t	rm_offset;	/* offset within the owner */
> >  	unsigned int	rm_flags;	/* state flags */
> >  };
> >  
> > @@ -1544,11 +1544,11 @@ typedef struct xfs_bmbt_rec {
> >  	__be64			l0, l1;
> >  } xfs_bmbt_rec_t;
> >  
> > -typedef __uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
> > +typedef uint64_t	xfs_bmbt_rec_base_t;	/* use this for casts */
> >  typedef xfs_bmbt_rec_t xfs_bmdr_rec_t;
> >  
> >  typedef struct xfs_bmbt_rec_host {
> > -	__uint64_t		l0, l1;
> > +	uint64_t		l0, l1;
> >  } xfs_bmbt_rec_host_t;
> >  
> >  /*
> > diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h
> > index 1831cff..2d28332 100644
> > --- a/libxfs/xfs_fs.h
> > +++ b/libxfs/xfs_fs.h
> > @@ -323,10 +323,10 @@ typedef struct xfs_bstat {
> >   * and using two 16bit values to hold new 32bit projid was choosen
> >   * to retain compatibility with "old" filesystems).
> >   */
> > -static inline __uint32_t
> > +static inline uint32_t
> >  bstat_get_projid(struct xfs_bstat *bs)
> >  {
> > -	return (__uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
> > +	return (uint32_t)bs->bs_projid_hi << 16 | bs->bs_projid_lo;
> >  }
> >  
> >  /*
> > @@ -476,10 +476,10 @@ typedef struct xfs_handle {
> >   */
> >  typedef struct xfs_swapext
> >  {
> > -	__int64_t	sx_version;	/* version */
> > +	int64_t		sx_version;	/* version */
> >  #define XFS_SX_VERSION		0
> > -	__int64_t	sx_fdtarget;	/* fd of target file */
> > -	__int64_t	sx_fdtmp;	/* fd of tmp file */
> > +	int64_t		sx_fdtarget;	/* fd of target file */
> > +	int64_t		sx_fdtmp;	/* fd of tmp file */
> >  	xfs_off_t	sx_offset;	/* offset into file */
> >  	xfs_off_t	sx_length;	/* leng from offset */
> >  	char		sx_pad[16];	/* pad space, unused */
> > @@ -566,7 +566,7 @@ typedef struct xfs_swapext
> >  #define XFS_IOC_ATTRLIST_BY_HANDLE   _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq)
> >  #define XFS_IOC_ATTRMULTI_BY_HANDLE  _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)
> >  #define XFS_IOC_FSGEOMETRY	     _IOR ('X', 124, struct xfs_fsop_geom)
> > -#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, __uint32_t)
> > +#define XFS_IOC_GOINGDOWN	     _IOR ('X', 125, uint32_t)
> >  /*	XFS_IOC_GETFSUUID ---------- deprecated 140	 */
> >  
> >  /* reflink ioctls; these MUST match the btrfs ioctl definitions */
> > diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
> > index 55cc450..8d24518 100644
> > --- a/libxfs/xfs_ialloc.c
> > +++ b/libxfs/xfs_ialloc.c
> > @@ -134,9 +134,9 @@ xfs_inobt_get_rec(
> >  STATIC int
> >  xfs_inobt_insert_rec(
> >  	struct xfs_btree_cur	*cur,
> > -	__uint16_t		holemask,
> > -	__uint8_t		count,
> > -	__int32_t		freecount,
> > +	uint16_t		holemask,
> > +	uint8_t			count,
> > +	int32_t			freecount,
> >  	xfs_inofree_t		free,
> >  	int			*stat)
> >  {
> > diff --git a/libxfs/xfs_ialloc_btree.c b/libxfs/xfs_ialloc_btree.c
> > index 7b4be76..5b28105 100644
> > --- a/libxfs/xfs_ialloc_btree.c
> > +++ b/libxfs/xfs_ialloc_btree.c
> > @@ -218,12 +218,12 @@ xfs_finobt_init_ptr_from_cur(
> >  	ptr->s = agi->agi_free_root;
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_inobt_key_diff(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*key)
> >  {
> > -	return (__int64_t)be32_to_cpu(key->inobt.ir_startino) -
> > +	return (int64_t)be32_to_cpu(key->inobt.ir_startino) -
> >  			  cur->bc_rec.i.ir_startino;
> >  }
> >  
> > diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c
> > index 2972701..fcc6fb8 100644
> > --- a/libxfs/xfs_inode_buf.c
> > +++ b/libxfs/xfs_inode_buf.c
> > @@ -442,7 +442,7 @@ xfs_dinode_calc_crc(
> >  	struct xfs_mount	*mp,
> >  	struct xfs_dinode	*dip)
> >  {
> > -	__uint32_t		crc;
> > +	uint32_t		crc;
> >  
> >  	if (dip->di_version < 3)
> >  		return;
> > diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h
> > index 6848a0a..0827d7d 100644
> > --- a/libxfs/xfs_inode_buf.h
> > +++ b/libxfs/xfs_inode_buf.h
> > @@ -28,26 +28,26 @@ struct xfs_dinode;
> >   * format specific structures at the appropriate time.
> >   */
> >  struct xfs_icdinode {
> > -	__int8_t	di_version;	/* inode version */
> > -	__int8_t	di_format;	/* format of di_c data */
> > -	__uint16_t	di_flushiter;	/* incremented on flush */
> > -	__uint32_t	di_uid;		/* owner's user id */
> > -	__uint32_t	di_gid;		/* owner's group id */
> > -	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
> > -	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
> > +	int8_t		di_version;	/* inode version */
> > +	int8_t		di_format;	/* format of di_c data */
> > +	uint16_t	di_flushiter;	/* incremented on flush */
> > +	uint32_t	di_uid;		/* owner's user id */
> > +	uint32_t	di_gid;		/* owner's group id */
> > +	uint16_t	di_projid_lo;	/* lower part of owner's project id */
> > +	uint16_t	di_projid_hi;	/* higher part of owner's project id */
> >  	xfs_fsize_t	di_size;	/* number of bytes in file */
> >  	xfs_rfsblock_t	di_nblocks;	/* # of direct & btree blocks used */
> >  	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
> >  	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
> >  	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
> > -	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
> > -	__int8_t	di_aformat;	/* format of attr fork's data */
> > -	__uint32_t	di_dmevmask;	/* DMIG event mask */
> > -	__uint16_t	di_dmstate;	/* DMIG state info */
> > -	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
> > +	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
> > +	int8_t		di_aformat;	/* format of attr fork's data */
> > +	uint32_t	di_dmevmask;	/* DMIG event mask */
> > +	uint16_t	di_dmstate;	/* DMIG state info */
> > +	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
> >  
> > -	__uint64_t	di_flags2;	/* more random flags */
> > -	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
> > +	uint64_t	di_flags2;	/* more random flags */
> > +	uint32_t	di_cowextsize;	/* basic cow extent size for file */
> >  
> >  	xfs_ictimestamp_t di_crtime;	/* time created */
> >  };
> > diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h
> > index 7ae571f..8372e9b 100644
> > --- a/libxfs/xfs_log_format.h
> > +++ b/libxfs/xfs_log_format.h
> > @@ -31,7 +31,7 @@ struct xfs_trans_res;
> >   * through all the log items definitions and everything they encode into the
> >   * log.
> >   */
> > -typedef __uint32_t xlog_tid_t;
> > +typedef uint32_t xlog_tid_t;
> >  
> >  #define XLOG_MIN_ICLOGS		2
> >  #define XLOG_MAX_ICLOGS		8
> > @@ -211,7 +211,7 @@ typedef struct xfs_log_iovec {
> >  typedef struct xfs_trans_header {
> >  	uint		th_magic;		/* magic number */
> >  	uint		th_type;		/* transaction type */
> > -	__int32_t	th_tid;			/* transaction id (unused) */
> > +	int32_t		th_tid;			/* transaction id (unused) */
> >  	uint		th_num_items;		/* num items logged by trans */
> >  } xfs_trans_header_t;
> >  
> > @@ -265,52 +265,52 @@ typedef struct xfs_trans_header {
> >   * must be added on to the end.
> >   */
> >  typedef struct xfs_inode_log_format {
> > -	__uint16_t		ilf_type;	/* inode log item type */
> > -	__uint16_t		ilf_size;	/* size of this item */
> > -	__uint32_t		ilf_fields;	/* flags for fields logged */
> > -	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
> > -	__uint16_t		ilf_dsize;	/* size of data/ext/root */
> > -	__uint64_t		ilf_ino;	/* inode number */
> > +	uint16_t		ilf_type;	/* inode log item type */
> > +	uint16_t		ilf_size;	/* size of this item */
> > +	uint32_t		ilf_fields;	/* flags for fields logged */
> > +	uint16_t		ilf_asize;	/* size of attr d/ext/root */
> > +	uint16_t		ilf_dsize;	/* size of data/ext/root */
> > +	uint64_t		ilf_ino;	/* inode number */
> >  	union {
> > -		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> > +		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> >  		uuid_t		ilfu_uuid;	/* mount point value */
> >  	} ilf_u;
> > -	__int64_t		ilf_blkno;	/* blkno of inode buffer */
> > -	__int32_t		ilf_len;	/* len of inode buffer */
> > -	__int32_t		ilf_boffset;	/* off of inode in buffer */
> > +	int64_t			ilf_blkno;	/* blkno of inode buffer */
> > +	int32_t			ilf_len;	/* len of inode buffer */
> > +	int32_t			ilf_boffset;	/* off of inode in buffer */
> >  } xfs_inode_log_format_t;
> >  
> >  typedef struct xfs_inode_log_format_32 {
> > -	__uint16_t		ilf_type;	/* inode log item type */
> > -	__uint16_t		ilf_size;	/* size of this item */
> > -	__uint32_t		ilf_fields;	/* flags for fields logged */
> > -	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
> > -	__uint16_t		ilf_dsize;	/* size of data/ext/root */
> > -	__uint64_t		ilf_ino;	/* inode number */
> > +	uint16_t		ilf_type;	/* inode log item type */
> > +	uint16_t		ilf_size;	/* size of this item */
> > +	uint32_t		ilf_fields;	/* flags for fields logged */
> > +	uint16_t		ilf_asize;	/* size of attr d/ext/root */
> > +	uint16_t		ilf_dsize;	/* size of data/ext/root */
> > +	uint64_t		ilf_ino;	/* inode number */
> >  	union {
> > -		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> > +		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> >  		uuid_t		ilfu_uuid;	/* mount point value */
> >  	} ilf_u;
> > -	__int64_t		ilf_blkno;	/* blkno of inode buffer */
> > -	__int32_t		ilf_len;	/* len of inode buffer */
> > -	__int32_t		ilf_boffset;	/* off of inode in buffer */
> > +	int64_t			ilf_blkno;	/* blkno of inode buffer */
> > +	int32_t			ilf_len;	/* len of inode buffer */
> > +	int32_t			ilf_boffset;	/* off of inode in buffer */
> >  } __attribute__((packed)) xfs_inode_log_format_32_t;
> >  
> >  typedef struct xfs_inode_log_format_64 {
> > -	__uint16_t		ilf_type;	/* inode log item type */
> > -	__uint16_t		ilf_size;	/* size of this item */
> > -	__uint32_t		ilf_fields;	/* flags for fields logged */
> > -	__uint16_t		ilf_asize;	/* size of attr d/ext/root */
> > -	__uint16_t		ilf_dsize;	/* size of data/ext/root */
> > -	__uint32_t		ilf_pad;	/* pad for 64 bit boundary */
> > -	__uint64_t		ilf_ino;	/* inode number */
> > +	uint16_t		ilf_type;	/* inode log item type */
> > +	uint16_t		ilf_size;	/* size of this item */
> > +	uint32_t		ilf_fields;	/* flags for fields logged */
> > +	uint16_t		ilf_asize;	/* size of attr d/ext/root */
> > +	uint16_t		ilf_dsize;	/* size of data/ext/root */
> > +	uint32_t		ilf_pad;	/* pad for 64 bit boundary */
> > +	uint64_t		ilf_ino;	/* inode number */
> >  	union {
> > -		__uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> > +		uint32_t	ilfu_rdev;	/* rdev value for dev inode*/
> >  		uuid_t		ilfu_uuid;	/* mount point value */
> >  	} ilf_u;
> > -	__int64_t		ilf_blkno;	/* blkno of inode buffer */
> > -	__int32_t		ilf_len;	/* len of inode buffer */
> > -	__int32_t		ilf_boffset;	/* off of inode in buffer */
> > +	int64_t			ilf_blkno;	/* blkno of inode buffer */
> > +	int32_t			ilf_len;	/* len of inode buffer */
> > +	int32_t			ilf_boffset;	/* off of inode in buffer */
> >  } xfs_inode_log_format_64_t;
> >  
> >  
> > @@ -379,8 +379,8 @@ static inline int xfs_ilog_fdata(int w)
> >   * information.
> >   */
> >  typedef struct xfs_ictimestamp {
> > -	__int32_t	t_sec;		/* timestamp seconds */
> > -	__int32_t	t_nsec;		/* timestamp nanoseconds */
> > +	int32_t		t_sec;		/* timestamp seconds */
> > +	int32_t		t_nsec;		/* timestamp nanoseconds */
> >  } xfs_ictimestamp_t;
> >  
> >  /*
> > @@ -388,18 +388,18 @@ typedef struct xfs_ictimestamp {
> >   * kept identical to struct xfs_dinode except for the endianness annotations.
> >   */
> >  struct xfs_log_dinode {
> > -	__uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
> > -	__uint16_t	di_mode;	/* mode and type of file */
> > -	__int8_t	di_version;	/* inode version */
> > -	__int8_t	di_format;	/* format of di_c data */
> > -	__uint8_t	di_pad3[2];	/* unused in v2/3 inodes */
> > -	__uint32_t	di_uid;		/* owner's user id */
> > -	__uint32_t	di_gid;		/* owner's group id */
> > -	__uint32_t	di_nlink;	/* number of links to file */
> > -	__uint16_t	di_projid_lo;	/* lower part of owner's project id */
> > -	__uint16_t	di_projid_hi;	/* higher part of owner's project id */
> > -	__uint8_t	di_pad[6];	/* unused, zeroed space */
> > -	__uint16_t	di_flushiter;	/* incremented on flush */
> > +	uint16_t	di_magic;	/* inode magic # = XFS_DINODE_MAGIC */
> > +	uint16_t	di_mode;	/* mode and type of file */
> > +	int8_t		di_version;	/* inode version */
> > +	int8_t		di_format;	/* format of di_c data */
> > +	uint8_t		di_pad3[2];	/* unused in v2/3 inodes */
> > +	uint32_t	di_uid;		/* owner's user id */
> > +	uint32_t	di_gid;		/* owner's group id */
> > +	uint32_t	di_nlink;	/* number of links to file */
> > +	uint16_t	di_projid_lo;	/* lower part of owner's project id */
> > +	uint16_t	di_projid_hi;	/* higher part of owner's project id */
> > +	uint8_t		di_pad[6];	/* unused, zeroed space */
> > +	uint16_t	di_flushiter;	/* incremented on flush */
> >  	xfs_ictimestamp_t di_atime;	/* time last accessed */
> >  	xfs_ictimestamp_t di_mtime;	/* time last modified */
> >  	xfs_ictimestamp_t di_ctime;	/* time created/inode modified */
> > @@ -408,23 +408,23 @@ struct xfs_log_dinode {
> >  	xfs_extlen_t	di_extsize;	/* basic/minimum extent size for file */
> >  	xfs_extnum_t	di_nextents;	/* number of extents in data fork */
> >  	xfs_aextnum_t	di_anextents;	/* number of extents in attribute fork*/
> > -	__uint8_t	di_forkoff;	/* attr fork offs, <<3 for 64b align */
> > -	__int8_t	di_aformat;	/* format of attr fork's data */
> > -	__uint32_t	di_dmevmask;	/* DMIG event mask */
> > -	__uint16_t	di_dmstate;	/* DMIG state info */
> > -	__uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
> > -	__uint32_t	di_gen;		/* generation number */
> > +	uint8_t		di_forkoff;	/* attr fork offs, <<3 for 64b align */
> > +	int8_t		di_aformat;	/* format of attr fork's data */
> > +	uint32_t	di_dmevmask;	/* DMIG event mask */
> > +	uint16_t	di_dmstate;	/* DMIG state info */
> > +	uint16_t	di_flags;	/* random flags, XFS_DIFLAG_... */
> > +	uint32_t	di_gen;		/* generation number */
> >  
> >  	/* di_next_unlinked is the only non-core field in the old dinode */
> >  	xfs_agino_t	di_next_unlinked;/* agi unlinked list ptr */
> >  
> >  	/* start of the extended dinode, writable fields */
> > -	__uint32_t	di_crc;		/* CRC of the inode */
> > -	__uint64_t	di_changecount;	/* number of attribute changes */
> > +	uint32_t	di_crc;		/* CRC of the inode */
> > +	uint64_t	di_changecount;	/* number of attribute changes */
> >  	xfs_lsn_t	di_lsn;		/* flush sequence */
> > -	__uint64_t	di_flags2;	/* more random flags */
> > -	__uint32_t	di_cowextsize;	/* basic cow extent size for file */
> > -	__uint8_t	di_pad2[12];	/* more padding for future expansion */
> > +	uint64_t	di_flags2;	/* more random flags */
> > +	uint32_t	di_cowextsize;	/* basic cow extent size for file */
> > +	uint8_t		di_pad2[12];	/* more padding for future expansion */
> >  
> >  	/* fields only written to during inode creation */
> >  	xfs_ictimestamp_t di_crtime;	/* time created */
> > @@ -483,7 +483,7 @@ typedef struct xfs_buf_log_format {
> >  	unsigned short	blf_size;	/* size of this item */
> >  	unsigned short	blf_flags;	/* misc state */
> >  	unsigned short	blf_len;	/* number of blocks in this buf */
> > -	__int64_t	blf_blkno;	/* starting blkno of this buf */
> > +	int64_t		blf_blkno;	/* starting blkno of this buf */
> >  	unsigned int	blf_map_size;	/* used size of data bitmap in words */
> >  	unsigned int	blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */
> >  } xfs_buf_log_format_t;
> > @@ -533,7 +533,7 @@ xfs_blft_to_flags(struct xfs_buf_log_format *blf, enum xfs_blft type)
> >  	blf->blf_flags |= ((type << XFS_BLFT_SHIFT) & XFS_BLFT_MASK);
> >  }
> >  
> > -static inline __uint16_t
> > +static inline uint16_t
> >  xfs_blft_from_flags(struct xfs_buf_log_format *blf)
> >  {
> >  	return (blf->blf_flags & XFS_BLFT_MASK) >> XFS_BLFT_SHIFT;
> > @@ -554,14 +554,14 @@ typedef struct xfs_extent {
> >   * conversion routine.
> >   */
> >  typedef struct xfs_extent_32 {
> > -	__uint64_t	ext_start;
> > -	__uint32_t	ext_len;
> > +	uint64_t	ext_start;
> > +	uint32_t	ext_len;
> >  } __attribute__((packed)) xfs_extent_32_t;
> >  
> >  typedef struct xfs_extent_64 {
> > -	__uint64_t	ext_start;
> > -	__uint32_t	ext_len;
> > -	__uint32_t	ext_pad;
> > +	uint64_t	ext_start;
> > +	uint32_t	ext_len;
> > +	uint32_t	ext_pad;
> >  } xfs_extent_64_t;
> >  
> >  /*
> > @@ -570,26 +570,26 @@ typedef struct xfs_extent_64 {
> >   * size is given by efi_nextents.
> >   */
> >  typedef struct xfs_efi_log_format {
> > -	__uint16_t		efi_type;	/* efi log item type */
> > -	__uint16_t		efi_size;	/* size of this item */
> > -	__uint32_t		efi_nextents;	/* # extents to free */
> > -	__uint64_t		efi_id;		/* efi identifier */
> > +	uint16_t		efi_type;	/* efi log item type */
> > +	uint16_t		efi_size;	/* size of this item */
> > +	uint32_t		efi_nextents;	/* # extents to free */
> > +	uint64_t		efi_id;		/* efi identifier */
> >  	xfs_extent_t		efi_extents[1];	/* array of extents to free */
> >  } xfs_efi_log_format_t;
> >  
> >  typedef struct xfs_efi_log_format_32 {
> > -	__uint16_t		efi_type;	/* efi log item type */
> > -	__uint16_t		efi_size;	/* size of this item */
> > -	__uint32_t		efi_nextents;	/* # extents to free */
> > -	__uint64_t		efi_id;		/* efi identifier */
> > +	uint16_t		efi_type;	/* efi log item type */
> > +	uint16_t		efi_size;	/* size of this item */
> > +	uint32_t		efi_nextents;	/* # extents to free */
> > +	uint64_t		efi_id;		/* efi identifier */
> >  	xfs_extent_32_t		efi_extents[1];	/* array of extents to free */
> >  } __attribute__((packed)) xfs_efi_log_format_32_t;
> >  
> >  typedef struct xfs_efi_log_format_64 {
> > -	__uint16_t		efi_type;	/* efi log item type */
> > -	__uint16_t		efi_size;	/* size of this item */
> > -	__uint32_t		efi_nextents;	/* # extents to free */
> > -	__uint64_t		efi_id;		/* efi identifier */
> > +	uint16_t		efi_type;	/* efi log item type */
> > +	uint16_t		efi_size;	/* size of this item */
> > +	uint32_t		efi_nextents;	/* # extents to free */
> > +	uint64_t		efi_id;		/* efi identifier */
> >  	xfs_extent_64_t		efi_extents[1];	/* array of extents to free */
> >  } xfs_efi_log_format_64_t;
> >  
> > @@ -599,26 +599,26 @@ typedef struct xfs_efi_log_format_64 {
> >   * size is given by efd_nextents;
> >   */
> >  typedef struct xfs_efd_log_format {
> > -	__uint16_t		efd_type;	/* efd log item type */
> > -	__uint16_t		efd_size;	/* size of this item */
> > -	__uint32_t		efd_nextents;	/* # of extents freed */
> > -	__uint64_t		efd_efi_id;	/* id of corresponding efi */
> > +	uint16_t		efd_type;	/* efd log item type */
> > +	uint16_t		efd_size;	/* size of this item */
> > +	uint32_t		efd_nextents;	/* # of extents freed */
> > +	uint64_t		efd_efi_id;	/* id of corresponding efi */
> >  	xfs_extent_t		efd_extents[1];	/* array of extents freed */
> >  } xfs_efd_log_format_t;
> >  
> >  typedef struct xfs_efd_log_format_32 {
> > -	__uint16_t		efd_type;	/* efd log item type */
> > -	__uint16_t		efd_size;	/* size of this item */
> > -	__uint32_t		efd_nextents;	/* # of extents freed */
> > -	__uint64_t		efd_efi_id;	/* id of corresponding efi */
> > +	uint16_t		efd_type;	/* efd log item type */
> > +	uint16_t		efd_size;	/* size of this item */
> > +	uint32_t		efd_nextents;	/* # of extents freed */
> > +	uint64_t		efd_efi_id;	/* id of corresponding efi */
> >  	xfs_extent_32_t		efd_extents[1];	/* array of extents freed */
> >  } __attribute__((packed)) xfs_efd_log_format_32_t;
> >  
> >  typedef struct xfs_efd_log_format_64 {
> > -	__uint16_t		efd_type;	/* efd log item type */
> > -	__uint16_t		efd_size;	/* size of this item */
> > -	__uint32_t		efd_nextents;	/* # of extents freed */
> > -	__uint64_t		efd_efi_id;	/* id of corresponding efi */
> > +	uint16_t		efd_type;	/* efd log item type */
> > +	uint16_t		efd_size;	/* size of this item */
> > +	uint32_t		efd_nextents;	/* # of extents freed */
> > +	uint64_t		efd_efi_id;	/* id of corresponding efi */
> >  	xfs_extent_64_t		efd_extents[1];	/* array of extents freed */
> >  } xfs_efd_log_format_64_t;
> >  
> > @@ -626,11 +626,11 @@ typedef struct xfs_efd_log_format_64 {
> >   * RUI/RUD (reverse mapping) log format definitions
> >   */
> >  struct xfs_map_extent {
> > -	__uint64_t		me_owner;
> > -	__uint64_t		me_startblock;
> > -	__uint64_t		me_startoff;
> > -	__uint32_t		me_len;
> > -	__uint32_t		me_flags;
> > +	uint64_t		me_owner;
> > +	uint64_t		me_startblock;
> > +	uint64_t		me_startoff;
> > +	uint32_t		me_len;
> > +	uint32_t		me_flags;
> >  };
> >  
> >  /* rmap me_flags: upper bits are flags, lower byte is type code */
> > @@ -659,10 +659,10 @@ struct xfs_map_extent {
> >   * size is given by rui_nextents.
> >   */
> >  struct xfs_rui_log_format {
> > -	__uint16_t		rui_type;	/* rui log item type */
> > -	__uint16_t		rui_size;	/* size of this item */
> > -	__uint32_t		rui_nextents;	/* # extents to free */
> > -	__uint64_t		rui_id;		/* rui identifier */
> > +	uint16_t		rui_type;	/* rui log item type */
> > +	uint16_t		rui_size;	/* size of this item */
> > +	uint32_t		rui_nextents;	/* # extents to free */
> > +	uint64_t		rui_id;		/* rui identifier */
> >  	struct xfs_map_extent	rui_extents[];	/* array of extents to rmap */
> >  };
> >  
> > @@ -680,19 +680,19 @@ xfs_rui_log_format_sizeof(
> >   * size is given by rud_nextents;
> >   */
> >  struct xfs_rud_log_format {
> > -	__uint16_t		rud_type;	/* rud log item type */
> > -	__uint16_t		rud_size;	/* size of this item */
> > -	__uint32_t		__pad;
> > -	__uint64_t		rud_rui_id;	/* id of corresponding rui */
> > +	uint16_t		rud_type;	/* rud log item type */
> > +	uint16_t		rud_size;	/* size of this item */
> > +	uint32_t		__pad;
> > +	uint64_t		rud_rui_id;	/* id of corresponding rui */
> >  };
> >  
> >  /*
> >   * CUI/CUD (refcount update) log format definitions
> >   */
> >  struct xfs_phys_extent {
> > -	__uint64_t		pe_startblock;
> > -	__uint32_t		pe_len;
> > -	__uint32_t		pe_flags;
> > +	uint64_t		pe_startblock;
> > +	uint32_t		pe_len;
> > +	uint32_t		pe_flags;
> >  };
> >  
> >  /* refcount pe_flags: upper bits are flags, lower byte is type code */
> > @@ -707,10 +707,10 @@ struct xfs_phys_extent {
> >   * size is given by cui_nextents.
> >   */
> >  struct xfs_cui_log_format {
> > -	__uint16_t		cui_type;	/* cui log item type */
> > -	__uint16_t		cui_size;	/* size of this item */
> > -	__uint32_t		cui_nextents;	/* # extents to free */
> > -	__uint64_t		cui_id;		/* cui identifier */
> > +	uint16_t		cui_type;	/* cui log item type */
> > +	uint16_t		cui_size;	/* size of this item */
> > +	uint32_t		cui_nextents;	/* # extents to free */
> > +	uint64_t		cui_id;		/* cui identifier */
> >  	struct xfs_phys_extent	cui_extents[];	/* array of extents */
> >  };
> >  
> > @@ -728,10 +728,10 @@ xfs_cui_log_format_sizeof(
> >   * size is given by cud_nextents;
> >   */
> >  struct xfs_cud_log_format {
> > -	__uint16_t		cud_type;	/* cud log item type */
> > -	__uint16_t		cud_size;	/* size of this item */
> > -	__uint32_t		__pad;
> > -	__uint64_t		cud_cui_id;	/* id of corresponding cui */
> > +	uint16_t		cud_type;	/* cud log item type */
> > +	uint16_t		cud_size;	/* size of this item */
> > +	uint32_t		__pad;
> > +	uint64_t		cud_cui_id;	/* id of corresponding cui */
> >  };
> >  
> >  /*
> > @@ -755,10 +755,10 @@ struct xfs_cud_log_format {
> >   * size is given by bui_nextents.
> >   */
> >  struct xfs_bui_log_format {
> > -	__uint16_t		bui_type;	/* bui log item type */
> > -	__uint16_t		bui_size;	/* size of this item */
> > -	__uint32_t		bui_nextents;	/* # extents to free */
> > -	__uint64_t		bui_id;		/* bui identifier */
> > +	uint16_t		bui_type;	/* bui log item type */
> > +	uint16_t		bui_size;	/* size of this item */
> > +	uint32_t		bui_nextents;	/* # extents to free */
> > +	uint64_t		bui_id;		/* bui identifier */
> >  	struct xfs_map_extent	bui_extents[];	/* array of extents to bmap */
> >  };
> >  
> > @@ -776,10 +776,10 @@ xfs_bui_log_format_sizeof(
> >   * size is given by bud_nextents;
> >   */
> >  struct xfs_bud_log_format {
> > -	__uint16_t		bud_type;	/* bud log item type */
> > -	__uint16_t		bud_size;	/* size of this item */
> > -	__uint32_t		__pad;
> > -	__uint64_t		bud_bui_id;	/* id of corresponding bui */
> > +	uint16_t		bud_type;	/* bud log item type */
> > +	uint16_t		bud_size;	/* size of this item */
> > +	uint32_t		__pad;
> > +	uint64_t		bud_bui_id;	/* id of corresponding bui */
> >  };
> >  
> >  /*
> > @@ -789,12 +789,12 @@ struct xfs_bud_log_format {
> >   * 32 bits : log_recovery code assumes that.
> >   */
> >  typedef struct xfs_dq_logformat {
> > -	__uint16_t		qlf_type;      /* dquot log item type */
> > -	__uint16_t		qlf_size;      /* size of this item */
> > +	uint16_t		qlf_type;      /* dquot log item type */
> > +	uint16_t		qlf_size;      /* size of this item */
> >  	xfs_dqid_t		qlf_id;	       /* usr/grp/proj id : 32 bits */
> > -	__int64_t		qlf_blkno;     /* blkno of dquot buffer */
> > -	__int32_t		qlf_len;       /* len of dquot buffer */
> > -	__uint32_t		qlf_boffset;   /* off of dquot in buffer */
> > +	int64_t			qlf_blkno;     /* blkno of dquot buffer */
> > +	int32_t			qlf_len;       /* len of dquot buffer */
> > +	uint32_t		qlf_boffset;   /* off of dquot in buffer */
> >  } xfs_dq_logformat_t;
> >  
> >  /*
> > @@ -853,8 +853,8 @@ typedef struct xfs_qoff_logformat {
> >   * decoding can be done correctly.
> >   */
> >  struct xfs_icreate_log {
> > -	__uint16_t	icl_type;	/* type of log format structure */
> > -	__uint16_t	icl_size;	/* size of log format structure */
> > +	uint16_t	icl_type;	/* type of log format structure */
> > +	uint16_t	icl_size;	/* size of log format structure */
> >  	__be32		icl_ag;		/* ag being allocated in */
> >  	__be32		icl_agbno;	/* start block of inode range */
> >  	__be32		icl_count;	/* number of inodes to initialise */
> > diff --git a/libxfs/xfs_quota_defs.h b/libxfs/xfs_quota_defs.h
> > index 8eed512..d69c772 100644
> > --- a/libxfs/xfs_quota_defs.h
> > +++ b/libxfs/xfs_quota_defs.h
> > @@ -27,8 +27,8 @@
> >   * they may need 64-bit accounting. Hence, 64-bit quota-counters,
> >   * and quota-limits. This is a waste in the common case, but hey ...
> >   */
> > -typedef __uint64_t	xfs_qcnt_t;
> > -typedef __uint16_t	xfs_qwarncnt_t;
> > +typedef uint64_t	xfs_qcnt_t;
> > +typedef uint16_t	xfs_qwarncnt_t;
> >  
> >  /*
> >   * flags for q_flags field in the dquot.
> > diff --git a/libxfs/xfs_refcount_btree.c b/libxfs/xfs_refcount_btree.c
> > index 2814f94..bd1a8f2 100644
> > --- a/libxfs/xfs_refcount_btree.c
> > +++ b/libxfs/xfs_refcount_btree.c
> > @@ -201,7 +201,7 @@ xfs_refcountbt_init_ptr_from_cur(
> >  	ptr->s = agf->agf_refcount_root;
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_refcountbt_key_diff(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*key)
> > @@ -209,16 +209,16 @@ xfs_refcountbt_key_diff(
> >  	struct xfs_refcount_irec	*rec = &cur->bc_rec.rc;
> >  	struct xfs_refcount_key		*kp = &key->refc;
> >  
> > -	return (__int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
> > +	return (int64_t)be32_to_cpu(kp->rc_startblock) - rec->rc_startblock;
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_refcountbt_diff_two_keys(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*k1,
> >  	union xfs_btree_key	*k2)
> >  {
> > -	return (__int64_t)be32_to_cpu(k1->refc.rc_startblock) -
> > +	return (int64_t)be32_to_cpu(k1->refc.rc_startblock) -
> >  			  be32_to_cpu(k2->refc.rc_startblock);
> >  }
> >  
> > diff --git a/libxfs/xfs_rmap.c b/libxfs/xfs_rmap.c
> > index f78771d..0d6b5d4 100644
> > --- a/libxfs/xfs_rmap.c
> > +++ b/libxfs/xfs_rmap.c
> > @@ -2059,7 +2059,7 @@ int
> >  xfs_rmap_finish_one(
> >  	struct xfs_trans		*tp,
> >  	enum xfs_rmap_intent_type	type,
> > -	__uint64_t			owner,
> > +	uint64_t			owner,
> >  	int				whichfork,
> >  	xfs_fileoff_t			startoff,
> >  	xfs_fsblock_t			startblock,
> > @@ -2180,7 +2180,7 @@ __xfs_rmap_add(
> >  	struct xfs_mount		*mp,
> >  	struct xfs_defer_ops		*dfops,
> >  	enum xfs_rmap_intent_type	type,
> > -	__uint64_t			owner,
> > +	uint64_t			owner,
> >  	int				whichfork,
> >  	struct xfs_bmbt_irec		*bmap)
> >  {
> > @@ -2264,7 +2264,7 @@ xfs_rmap_alloc_extent(
> >  	xfs_agnumber_t		agno,
> >  	xfs_agblock_t		bno,
> >  	xfs_extlen_t		len,
> > -	__uint64_t		owner)
> > +	uint64_t		owner)
> >  {
> >  	struct xfs_bmbt_irec	bmap;
> >  
> > @@ -2288,7 +2288,7 @@ xfs_rmap_free_extent(
> >  	xfs_agnumber_t		agno,
> >  	xfs_agblock_t		bno,
> >  	xfs_extlen_t		len,
> > -	__uint64_t		owner)
> > +	uint64_t		owner)
> >  {
> >  	struct xfs_bmbt_irec	bmap;
> >  
> > diff --git a/libxfs/xfs_rmap.h b/libxfs/xfs_rmap.h
> > index 98f908f..265116d 100644
> > --- a/libxfs/xfs_rmap.h
> > +++ b/libxfs/xfs_rmap.h
> > @@ -179,7 +179,7 @@ enum xfs_rmap_intent_type {
> >  struct xfs_rmap_intent {
> >  	struct list_head			ri_list;
> >  	enum xfs_rmap_intent_type		ri_type;
> > -	__uint64_t				ri_owner;
> > +	uint64_t				ri_owner;
> >  	int					ri_whichfork;
> >  	struct xfs_bmbt_irec			ri_bmap;
> >  };
> > @@ -196,15 +196,15 @@ int xfs_rmap_convert_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
> >  		struct xfs_bmbt_irec *imap);
> >  int xfs_rmap_alloc_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
> >  		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
> > -		__uint64_t owner);
> > +		uint64_t owner);
> >  int xfs_rmap_free_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops,
> >  		xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len,
> > -		__uint64_t owner);
> > +		uint64_t owner);
> >  
> >  void xfs_rmap_finish_one_cleanup(struct xfs_trans *tp,
> >  		struct xfs_btree_cur *rcur, int error);
> >  int xfs_rmap_finish_one(struct xfs_trans *tp, enum xfs_rmap_intent_type type,
> > -		__uint64_t owner, int whichfork, xfs_fileoff_t startoff,
> > +		uint64_t owner, int whichfork, xfs_fileoff_t startoff,
> >  		xfs_fsblock_t startblock, xfs_filblks_t blockcount,
> >  		xfs_exntst_t state, struct xfs_btree_cur **pcur);
> >  
> > diff --git a/libxfs/xfs_rmap_btree.c b/libxfs/xfs_rmap_btree.c
> > index a186c87..45ac436 100644
> > --- a/libxfs/xfs_rmap_btree.c
> > +++ b/libxfs/xfs_rmap_btree.c
> > @@ -197,7 +197,7 @@ xfs_rmapbt_init_high_key_from_rec(
> >  	union xfs_btree_key	*key,
> >  	union xfs_btree_rec	*rec)
> >  {
> > -	__uint64_t		off;
> > +	uint64_t		off;
> >  	int			adj;
> >  
> >  	adj = be32_to_cpu(rec->rmap.rm_blockcount) - 1;
> > @@ -239,7 +239,7 @@ xfs_rmapbt_init_ptr_from_cur(
> >  	ptr->s = agf->agf_roots[cur->bc_btnum];
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_rmapbt_key_diff(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*key)
> > @@ -247,9 +247,9 @@ xfs_rmapbt_key_diff(
> >  	struct xfs_rmap_irec	*rec = &cur->bc_rec.r;
> >  	struct xfs_rmap_key	*kp = &key->rmap;
> >  	__u64			x, y;
> > -	__int64_t		d;
> > +	int64_t			d;
> >  
> > -	d = (__int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
> > +	d = (int64_t)be32_to_cpu(kp->rm_startblock) - rec->rm_startblock;
> >  	if (d)
> >  		return d;
> >  
> > @@ -269,7 +269,7 @@ xfs_rmapbt_key_diff(
> >  	return 0;
> >  }
> >  
> > -STATIC __int64_t
> > +STATIC int64_t
> >  xfs_rmapbt_diff_two_keys(
> >  	struct xfs_btree_cur	*cur,
> >  	union xfs_btree_key	*k1,
> > @@ -277,10 +277,10 @@ xfs_rmapbt_diff_two_keys(
> >  {
> >  	struct xfs_rmap_key	*kp1 = &k1->rmap;
> >  	struct xfs_rmap_key	*kp2 = &k2->rmap;
> > -	__int64_t		d;
> > +	int64_t			d;
> >  	__u64			x, y;
> >  
> > -	d = (__int64_t)be32_to_cpu(kp1->rm_startblock) -
> > +	d = (int64_t)be32_to_cpu(kp1->rm_startblock) -
> >  		       be32_to_cpu(kp2->rm_startblock);
> >  	if (d)
> >  		return d;
> > @@ -382,10 +382,10 @@ xfs_rmapbt_keys_inorder(
> >  	union xfs_btree_key	*k1,
> >  	union xfs_btree_key	*k2)
> >  {
> > -	__uint32_t		x;
> > -	__uint32_t		y;
> > -	__uint64_t		a;
> > -	__uint64_t		b;
> > +	uint32_t		x;
> > +	uint32_t		y;
> > +	uint64_t		a;
> > +	uint64_t		b;
> >  
> >  	x = be32_to_cpu(k1->rmap.rm_startblock);
> >  	y = be32_to_cpu(k2->rmap.rm_startblock);
> > @@ -412,10 +412,10 @@ xfs_rmapbt_recs_inorder(
> >  	union xfs_btree_rec	*r1,
> >  	union xfs_btree_rec	*r2)
> >  {
> > -	__uint32_t		x;
> > -	__uint32_t		y;
> > -	__uint64_t		a;
> > -	__uint64_t		b;
> > +	uint32_t		x;
> > +	uint32_t		y;
> > +	uint64_t		a;
> > +	uint64_t		b;
> >  
> >  	x = be32_to_cpu(r1->rmap.rm_startblock);
> >  	y = be32_to_cpu(r2->rmap.rm_startblock);
> > diff --git a/libxfs/xfs_rtbitmap.c b/libxfs/xfs_rtbitmap.c
> > index dbd2f88..8f8a99d 100644
> > --- a/libxfs/xfs_rtbitmap.c
> > +++ b/libxfs/xfs_rtbitmap.c
> > @@ -1006,7 +1006,7 @@ xfs_rtfree_extent(
> >  	    mp->m_sb.sb_rextents) {
> >  		if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM))
> >  			mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM;
> > -		*(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
> > +		*(uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
> >  		xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE);
> >  	}
> >  	return 0;
> > diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c
> > index 93a1819..51f6970 100644
> > --- a/libxfs/xfs_sb.c
> > +++ b/libxfs/xfs_sb.c
> > @@ -430,7 +430,7 @@ xfs_sb_quota_to_disk(
> >  	struct xfs_dsb	*to,
> >  	struct xfs_sb	*from)
> >  {
> > -	__uint16_t	qflags = from->sb_qflags;
> > +	uint16_t	qflags = from->sb_qflags;
> >  
> >  	to->sb_uquotino = cpu_to_be64(from->sb_uquotino);
> >  	if (xfs_sb_version_has_pquotino(from)) {
> > @@ -738,7 +738,7 @@ xfs_sb_mount_common(
> >  	mp->m_refc_mnr[1] = mp->m_refc_mxr[1] / 2;
> >  
> >  	mp->m_bsize = XFS_FSB_TO_BB(mp, 1);
> > -	mp->m_ialloc_inos = (int)MAX((__uint16_t)XFS_INODES_PER_CHUNK,
> > +	mp->m_ialloc_inos = (int)MAX((uint16_t)XFS_INODES_PER_CHUNK,
> >  					sbp->sb_inopblock);
> >  	mp->m_ialloc_blks = mp->m_ialloc_inos >> sbp->sb_inopblog;
> >  
> > diff --git a/libxfs/xfs_types.h b/libxfs/xfs_types.h
> > index 717909f..0220159 100644
> > --- a/libxfs/xfs_types.h
> > +++ b/libxfs/xfs_types.h
> > @@ -18,34 +18,34 @@
> >  #ifndef __XFS_TYPES_H__
> >  #define	__XFS_TYPES_H__
> >  
> > -typedef __uint32_t	prid_t;		/* project ID */
> > +typedef uint32_t	prid_t;		/* project ID */
> >  
> > -typedef __uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
> > -typedef	__uint32_t	xfs_agino_t;	/* inode # within allocation grp */
> > -typedef	__uint32_t	xfs_extlen_t;	/* extent length in blocks */
> > -typedef	__uint32_t	xfs_agnumber_t;	/* allocation group number */
> > -typedef __int32_t	xfs_extnum_t;	/* # of extents in a file */
> > -typedef __int16_t	xfs_aextnum_t;	/* # extents in an attribute fork */
> > -typedef	__int64_t	xfs_fsize_t;	/* bytes in a file */
> > -typedef __uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
> > +typedef uint32_t	xfs_agblock_t;	/* blockno in alloc. group */
> > +typedef uint32_t	xfs_agino_t;	/* inode # within allocation grp */
> > +typedef uint32_t	xfs_extlen_t;	/* extent length in blocks */
> > +typedef uint32_t	xfs_agnumber_t;	/* allocation group number */
> > +typedef int32_t		xfs_extnum_t;	/* # of extents in a file */
> > +typedef int16_t		xfs_aextnum_t;	/* # extents in an attribute fork */
> > +typedef int64_t		xfs_fsize_t;	/* bytes in a file */
> > +typedef uint64_t	xfs_ufsize_t;	/* unsigned bytes in a file */
> >  
> > -typedef	__int32_t	xfs_suminfo_t;	/* type of bitmap summary info */
> > -typedef	__int32_t	xfs_rtword_t;	/* word type for bitmap manipulations */
> > +typedef int32_t		xfs_suminfo_t;	/* type of bitmap summary info */
> > +typedef int32_t		xfs_rtword_t;	/* word type for bitmap manipulations */
> >  
> > -typedef	__int64_t	xfs_lsn_t;	/* log sequence number */
> > -typedef	__int32_t	xfs_tid_t;	/* transaction identifier */
> > +typedef int64_t		xfs_lsn_t;	/* log sequence number */
> > +typedef int32_t		xfs_tid_t;	/* transaction identifier */
> >  
> > -typedef	__uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
> > -typedef	__uint32_t	xfs_dahash_t;	/* dir/attr hash value */
> > +typedef uint32_t	xfs_dablk_t;	/* dir/attr block number (in file) */
> > +typedef uint32_t	xfs_dahash_t;	/* dir/attr hash value */
> >  
> > -typedef	__uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
> > -typedef __uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
> > -typedef __uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
> > -typedef __uint64_t	xfs_fileoff_t;	/* block number in a file */
> > -typedef __uint64_t	xfs_filblks_t;	/* number of blocks in a file */
> > +typedef uint64_t	xfs_fsblock_t;	/* blockno in filesystem (agno|agbno) */
> > +typedef uint64_t	xfs_rfsblock_t;	/* blockno in filesystem (raw) */
> > +typedef uint64_t	xfs_rtblock_t;	/* extent (block) in realtime area */
> > +typedef uint64_t	xfs_fileoff_t;	/* block number in a file */
> > +typedef uint64_t	xfs_filblks_t;	/* number of blocks in a file */
> >  
> > -typedef	__int64_t	xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
> > -typedef __int64_t	xfs_sfiloff_t;	/* signed block number in a file */
> > +typedef int64_t		xfs_srtblock_t;	/* signed version of xfs_rtblock_t */
> > +typedef int64_t		xfs_sfiloff_t;	/* signed block number in a file */
> >  
> >  /*
> >   * Null values for the types.
> > @@ -125,7 +125,7 @@ struct xfs_name {
> >   * uid_t and gid_t are hard-coded to 32 bits in the inode.
> >   * Hence, an 'id' in a dquot is 32 bits..
> >   */
> > -typedef __uint32_t	xfs_dqid_t;
> > +typedef uint32_t	xfs_dqid_t;
> >  
> >  /*
> >   * Constants for bit manipulations.
> > diff --git a/logprint/log_misc.c b/logprint/log_misc.c
> > index 0dfcfd1..fe27f15 100644
> > --- a/logprint/log_misc.c
> > +++ b/logprint/log_misc.c
> > @@ -166,12 +166,12 @@ xlog_print_trans_header(char **ptr, int len)
> >  {
> >      xfs_trans_header_t  *h;
> >      char		*cptr = *ptr;
> > -    __uint32_t          magic;
> > +    uint32_t          magic;
> >      char                *magic_c = (char *)&magic;
> >  
> >      *ptr += len;
> >  
> > -    magic=*(__uint32_t*)cptr; /* XXX be32_to_cpu soon */
> > +    magic=*(uint32_t*)cptr; /* XXX be32_to_cpu soon */
> >  
> >      if (len >= 4) {
> >  #if __BYTE_ORDER == __LITTLE_ENDIAN
> > @@ -201,7 +201,7 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
> >      int			 num, skip;
> >      int			 super_block = 0;
> >      int			 bucket, col, buckets;
> > -    __int64_t		 blkno;
> > +    int64_t			 blkno;
> >      xfs_buf_log_format_t lbuf;
> >      int			 size, blen, map_size, struct_size;
> >      __be64		 x, y;
> > diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
> > index 0d399f1..0667e39 100644
> > --- a/mdrestore/xfs_mdrestore.c
> > +++ b/mdrestore/xfs_mdrestore.c
> > @@ -65,7 +65,7 @@ perform_restore(
> >  	int			mb_count;
> >  	xfs_metablock_t		tmb;
> >  	xfs_sb_t		sb;
> > -	__int64_t		bytes_read;
> > +	int64_t			bytes_read;
> >  
> >  	/*
> >  	 * read in first blocks (superblock 0), set "inprogress" flag for it,
> > diff --git a/mkfs/proto.c b/mkfs/proto.c
> > index 89cd237..cf8cc39 100644
> > --- a/mkfs/proto.c
> > +++ b/mkfs/proto.c
> > @@ -667,7 +667,7 @@ rtinit(
> >  	mp->m_sb.sb_rbmino = rbmip->i_ino;
> >  	rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
> >  	rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
> > -	*(__uint64_t *)&VFS_I(rbmip)->i_atime = 0;
> > +	*(uint64_t *)&VFS_I(rbmip)->i_atime = 0;
> >  	libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
> >  	libxfs_log_sb(tp);
> >  	mp->m_rbmip = rbmip;
> > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> > index 930f3d2..45ab83c 100644
> > --- a/mkfs/xfs_mkfs.c
> > +++ b/mkfs/xfs_mkfs.c
> > @@ -708,9 +708,9 @@ struct opt_params mopts = {
> >  	},
> >  };
> >  
> > -#define TERABYTES(count, blog)	((__uint64_t)(count) << (40 - (blog)))
> > -#define GIGABYTES(count, blog)	((__uint64_t)(count) << (30 - (blog)))
> > -#define MEGABYTES(count, blog)	((__uint64_t)(count) << (20 - (blog)))
> > +#define TERABYTES(count, blog)	((uint64_t)(count) << (40 - (blog)))
> > +#define GIGABYTES(count, blog)	((uint64_t)(count) << (30 - (blog)))
> > +#define MEGABYTES(count, blog)	((uint64_t)(count) << (20 - (blog)))
> >  
> >  /*
> >   * Use this macro before we have superblock and mount structure
> > @@ -881,7 +881,7 @@ fixup_log_stripe_unit(
> >  	xfs_rfsblock_t	*logblocks,
> >  	int		blocklog)
> >  {
> > -	__uint64_t	tmp_logblocks;
> > +	uint64_t	tmp_logblocks;
> >  
> >  	/*
> >  	 * Make sure that the log size is a multiple of the stripe unit
> > @@ -913,7 +913,7 @@ fixup_internal_log_stripe(
> >  	xfs_mount_t	*mp,
> >  	int		lsflag,
> >  	xfs_fsblock_t	logstart,
> > -	__uint64_t	agsize,
> > +	uint64_t	agsize,
> >  	int		sunit,
> >  	xfs_rfsblock_t	*logblocks,
> >  	int		blocklog,
> > @@ -937,7 +937,7 @@ fixup_internal_log_stripe(
> >  }
> >  
> >  void
> > -validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks)
> > +validate_log_size(uint64_t logblocks, int blocklog, int min_logblocks)
> >  {
> >  	if (logblocks < min_logblocks) {
> >  		fprintf(stderr,
> > @@ -962,7 +962,7 @@ validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks)
> >  static int
> >  calc_default_imaxpct(
> >  	int		blocklog,
> > -	__uint64_t	dblocks)
> > +	uint64_t	dblocks)
> >  {
> >  	/*
> >  	 * This returns the % of the disk space that is used for
> > @@ -984,9 +984,9 @@ calc_default_imaxpct(
> >  static void
> >  validate_ag_geometry(
> >  	int		blocklog,
> > -	__uint64_t	dblocks,
> > -	__uint64_t	agsize,
> > -	__uint64_t	agcount)
> > +	uint64_t	dblocks,
> > +	uint64_t	agsize,
> > +	uint64_t	agcount)
> >  {
> >  	if (agsize < XFS_AG_MIN_BLOCKS(blocklog)) {
> >  		fprintf(stderr,
> > @@ -1062,7 +1062,7 @@ zero_old_xfs_structures(
> >  {
> >  	void 			*buf;
> >  	xfs_sb_t 		sb;
> > -	__uint32_t		bsize;
> > +	uint32_t		bsize;
> >  	int			i;
> >  	xfs_off_t		off;
> >  
> > @@ -1115,8 +1115,8 @@ zero_old_xfs_structures(
> >  			i != sb.sb_blocklog)
> >  		goto done;
> >  
> > -	if (sb.sb_dblocks > ((__uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
> > -			sb.sb_dblocks < ((__uint64_t)(sb.sb_agcount - 1) *
> > +	if (sb.sb_dblocks > ((uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
> > +			sb.sb_dblocks < ((uint64_t)(sb.sb_agcount - 1) *
> >  					 sb.sb_agblocks + XFS_MIN_AG_BLOCKS))
> >  		goto done;
> >  
> > @@ -1136,7 +1136,7 @@ zero_old_xfs_structures(
> >  }
> >  
> >  static void
> > -discard_blocks(dev_t dev, __uint64_t nsectors)
> > +discard_blocks(dev_t dev, uint64_t nsectors)
> >  {
> >  	int fd;
> >  
> > @@ -1398,11 +1398,11 @@ main(
> >  	int			argc,
> >  	char			**argv)
> >  {
> > -	__uint64_t		agcount;
> > +	uint64_t		agcount;
> >  	xfs_agf_t		*agf;
> >  	xfs_agi_t		*agi;
> >  	xfs_agnumber_t		agno;
> > -	__uint64_t		agsize;
> > +	uint64_t		agsize;
> >  	xfs_alloc_rec_t		*arec;
> >  	struct xfs_btree_block	*block;
> >  	int			blflag;
> > @@ -1477,10 +1477,10 @@ main(
> >  	char			*rtsize;
> >  	xfs_sb_t		*sbp;
> >  	int			sectorlog;
> > -	__uint64_t		sector_mask;
> > +	uint64_t		sector_mask;
> >  	int			slflag;
> >  	int			ssflag;
> > -	__uint64_t		tmp_agsize;
> > +	uint64_t		tmp_agsize;
> >  	uuid_t			uuid;
> >  	int			worst_freelist;
> >  	libxfs_init_t		xi;
> > @@ -2165,7 +2165,7 @@ _("rmapbt not supported with realtime devices\n"));
> >  
> >  
> >  	if (dsize) {
> > -		__uint64_t dbytes;
> > +		uint64_t dbytes;
> >  
> >  		dbytes = getnum(dsize, &dopts, D_SIZE);
> >  		if (dbytes % XFS_MIN_BLOCKSIZE) {
> > @@ -2197,7 +2197,7 @@ _("rmapbt not supported with realtime devices\n"));
> >  	}
> >  
> >  	if (logsize) {
> > -		__uint64_t logbytes;
> > +		uint64_t logbytes;
> >  
> >  		logbytes = getnum(logsize, &lopts, L_SIZE);
> >  		if (logbytes % XFS_MIN_BLOCKSIZE) {
> > @@ -2214,7 +2214,7 @@ _("rmapbt not supported with realtime devices\n"));
> >  				(long long)(logblocks << blocklog));
> >  	}
> >  	if (rtsize) {
> > -		__uint64_t rtbytes;
> > +		uint64_t rtbytes;
> >  
> >  		rtbytes = getnum(rtsize, &ropts, R_SIZE);
> >  		if (rtbytes % XFS_MIN_BLOCKSIZE) {
> > @@ -2234,7 +2234,7 @@ _("rmapbt not supported with realtime devices\n"));
> >  	 * If specified, check rt extent size against its constraints.
> >  	 */
> >  	if (rtextsize) {
> > -		__uint64_t rtextbytes;
> > +		uint64_t rtextbytes;
> >  
> >  		rtextbytes = getnum(rtextsize, &ropts, R_EXTSIZE);
> >  		if (rtextbytes % blocksize) {
> > @@ -2250,8 +2250,8 @@ _("rmapbt not supported with realtime devices\n"));
> >  		 * and the underlying volume is striped, then set rtextblocks
> >  		 * to the stripe width.
> >  		 */
> > -		__uint64_t	rswidth;
> > -		__uint64_t	rtextbytes;
> > +		uint64_t	rswidth;
> > +		uint64_t	rtextbytes;
> >  
> >  		if (!norsflag && !xi.risfile && !(!rtsize && xi.disfile))
> >  			rswidth = ft.rtswidth;
> > @@ -2329,10 +2329,10 @@ _("rmapbt not supported with realtime devices\n"));
> >  	 * multiple of the sector size, or 1024, whichever is larger.
> >  	 */
> >  
> > -	sector_mask = (__uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
> > +	sector_mask = (uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
> >  	xi.dsize &= sector_mask;
> >  	xi.rtsize &= sector_mask;
> > -	xi.logBBsize &= (__uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
> > +	xi.logBBsize &= (uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
> >  
> >  
> >  	/* don't do discards on print-only runs or on files */
> > @@ -2689,9 +2689,9 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
> >  	mp = &mbuf;
> >  	sbp = &mp->m_sb;
> >  	memset(mp, 0, sizeof(xfs_mount_t));
> > -	sbp->sb_blocklog = (__uint8_t)blocklog;
> > -	sbp->sb_sectlog = (__uint8_t)sectorlog;
> > -	sbp->sb_agblklog = (__uint8_t)libxfs_log2_roundup((unsigned int)agsize);
> > +	sbp->sb_blocklog = (uint8_t)blocklog;
> > +	sbp->sb_sectlog = (uint8_t)sectorlog;
> > +	sbp->sb_agblklog = (uint8_t)libxfs_log2_roundup((unsigned int)agsize);
> >  	sbp->sb_agblocks = (xfs_agblock_t)agsize;
> >  	mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
> >  	mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
> > @@ -2798,14 +2798,14 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
> >  	sbp->sb_agcount = (xfs_agnumber_t)agcount;
> >  	sbp->sb_rbmblocks = nbmblocks;
> >  	sbp->sb_logblocks = (xfs_extlen_t)logblocks;
> > -	sbp->sb_sectsize = (__uint16_t)sectorsize;
> > -	sbp->sb_inodesize = (__uint16_t)isize;
> > -	sbp->sb_inopblock = (__uint16_t)(blocksize / isize);
> > -	sbp->sb_sectlog = (__uint8_t)sectorlog;
> > -	sbp->sb_inodelog = (__uint8_t)inodelog;
> > -	sbp->sb_inopblog = (__uint8_t)(blocklog - inodelog);
> > +	sbp->sb_sectsize = (uint16_t)sectorsize;
> > +	sbp->sb_inodesize = (uint16_t)isize;
> > +	sbp->sb_inopblock = (uint16_t)(blocksize / isize);
> > +	sbp->sb_sectlog = (uint8_t)sectorlog;
> > +	sbp->sb_inodelog = (uint8_t)inodelog;
> > +	sbp->sb_inopblog = (uint8_t)(blocklog - inodelog);
> >  	sbp->sb_rextslog =
> > -		(__uint8_t)(rtextents ?
> > +		(uint8_t)(rtextents ?
> >  			libxfs_highbit32((unsigned int)rtextents) : 0);
> >  	sbp->sb_inprogress = 1;	/* mkfs is in progress */
> >  	sbp->sb_imax_pct = imaxpct;
> > @@ -2833,8 +2833,8 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
> >  	} else
> >  		sbp->sb_inoalignmt = 0;
> >  	if (lsectorsize != BBSIZE || sectorsize != BBSIZE) {
> > -		sbp->sb_logsectlog = (__uint8_t)lsectorlog;
> > -		sbp->sb_logsectsize = (__uint16_t)lsectorsize;
> > +		sbp->sb_logsectlog = (uint8_t)lsectorlog;
> > +		sbp->sb_logsectsize = (uint16_t)lsectorsize;
> >  	} else {
> >  		sbp->sb_logsectlog = 0;
> >  		sbp->sb_logsectsize = 0;
> > diff --git a/quota/edit.c b/quota/edit.c
> > index 36b327a..8418e85 100644
> > --- a/quota/edit.c
> > +++ b/quota/edit.c
> > @@ -115,16 +115,16 @@ warn_help(void)
> >  
> >  static void
> >  set_limits(
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	uint		type,
> >  	uint		mask,
> >  	char		*dev,
> > -	__uint64_t	*bsoft,
> > -	__uint64_t	*bhard,
> > -	__uint64_t	*isoft,
> > -	__uint64_t	*ihard,
> > -	__uint64_t	*rtbsoft,
> > -	__uint64_t	*rtbhard)
> > +	uint64_t	*bsoft,
> > +	uint64_t	*bhard,
> > +	uint64_t	*isoft,
> > +	uint64_t	*ihard,
> > +	uint64_t	*rtbsoft,
> > +	uint64_t	*rtbhard)
> >  {
> >  	fs_disk_quota_t	d;
> >  
> > @@ -152,12 +152,12 @@ set_user_limits(
> >  	char		*name,
> >  	uint		type,
> >  	uint		mask,
> > -	__uint64_t	*bsoft,
> > -	__uint64_t	*bhard,
> > -	__uint64_t	*isoft,
> > -	__uint64_t	*ihard,
> > -	__uint64_t	*rtbsoft,
> > -	__uint64_t	*rtbhard)
> > +	uint64_t	*bsoft,
> > +	uint64_t	*bhard,
> > +	uint64_t	*isoft,
> > +	uint64_t	*ihard,
> > +	uint64_t	*rtbsoft,
> > +	uint64_t	*rtbhard)
> >  {
> >  	uid_t		uid = uid_from_string(name);
> >  
> > @@ -175,12 +175,12 @@ set_group_limits(
> >  	char		*name,
> >  	uint		type,
> >  	uint		mask,
> > -	__uint64_t	*bsoft,
> > -	__uint64_t	*bhard,
> > -	__uint64_t	*isoft,
> > -	__uint64_t	*ihard,
> > -	__uint64_t	*rtbsoft,
> > -	__uint64_t	*rtbhard)
> > +	uint64_t	*bsoft,
> > +	uint64_t	*bhard,
> > +	uint64_t	*isoft,
> > +	uint64_t	*ihard,
> > +	uint64_t	*rtbsoft,
> > +	uint64_t	*rtbhard)
> >  {
> >  	gid_t		gid = gid_from_string(name);
> >  
> > @@ -198,12 +198,12 @@ set_project_limits(
> >  	char		*name,
> >  	uint		type,
> >  	uint		mask,
> > -	__uint64_t	*bsoft,
> > -	__uint64_t	*bhard,
> > -	__uint64_t	*isoft,
> > -	__uint64_t	*ihard,
> > -	__uint64_t	*rtbsoft,
> > -	__uint64_t	*rtbhard)
> > +	uint64_t	*bsoft,
> > +	uint64_t	*bhard,
> > +	uint64_t	*isoft,
> > +	uint64_t	*ihard,
> > +	uint64_t	*rtbsoft,
> > +	uint64_t	*rtbhard)
> >  {
> >  	prid_t		prid = prid_from_string(name);
> >  
> > @@ -224,7 +224,7 @@ extractb(
> >  	int		length,
> >  	uint		blocksize,
> >  	uint		sectorsize,
> > -	__uint64_t	*value)
> > +	uint64_t	*value)
> >  {
> >  	long long	v;
> >  	char		*s = string;
> > @@ -238,7 +238,7 @@ extractb(
> >  				progname, s);
> >  			return 0;
> >  		}
> > -		*value = (__uint64_t)v >> 9;	/* syscalls use basic blocks */
> > +		*value = (uint64_t)v >> 9;	/* syscalls use basic blocks */
> >  		if (v > 0 && *value == 0)
> >  			fprintf(stderr, _("%s: Warning: `%s' in quota blocks is 0 (unlimited).\n"), progname, s);
> >  		return 1;
> > @@ -252,7 +252,7 @@ extracti(
> >  	char		*string,
> >  	const char	*prefix,
> >  	int		length,
> > -	__uint64_t	*value)
> > +	uint64_t	*value)
> >  {
> >  	char		*sp, *s = string;
> >  
> > @@ -270,7 +270,7 @@ limit_f(
> >  	char		**argv)
> >  {
> >  	char		*name;
> > -	__uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
> > +	uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
> >  	int		c, type = 0, mask = 0, flags = 0;
> >  	uint		bsize, ssize, endoptions;
> >  
> > @@ -384,8 +384,8 @@ restore_file(
> >  	char		*dev = NULL;
> >  	uint		mask;
> >  	int		cnt;
> > -	__uint32_t	id;
> > -	__uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
> > +	uint32_t	id;
> > +	uint64_t	bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
> >  
> >  	while (fgets(buffer, sizeof(buffer), fp) != NULL) {
> >  		if (strncmp("fs = ", buffer, 5) == 0) {
> > @@ -546,7 +546,7 @@ timer_f(
> >  
> >  static void
> >  set_warnings(
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	uint		type,
> >  	uint		mask,
> >  	char		*dev,
> > diff --git a/quota/free.c b/quota/free.c
> > index cee15ee..1f8378d 100644
> > --- a/quota/free.c
> > +++ b/quota/free.c
> > @@ -49,20 +49,20 @@ free_help(void)
> >  static int
> >  mount_free_space_data(
> >  	struct fs_path		*mount,
> > -	__uint64_t		*bcount,
> > -	__uint64_t		*bused,
> > -	__uint64_t		*bfree,
> > -	__uint64_t		*icount,
> > -	__uint64_t		*iused,
> > -	__uint64_t		*ifree,
> > -	__uint64_t		*rcount,
> > -	__uint64_t		*rused,
> > -	__uint64_t		*rfree)
> > +	uint64_t		*bcount,
> > +	uint64_t		*bused,
> > +	uint64_t		*bfree,
> > +	uint64_t		*icount,
> > +	uint64_t		*iused,
> > +	uint64_t		*ifree,
> > +	uint64_t		*rcount,
> > +	uint64_t		*rused,
> > +	uint64_t		*rfree)
> >  {
> >  	struct xfs_fsop_counts	fscounts;
> >  	struct xfs_fsop_geom	fsgeo;
> >  	struct statfs		st;
> > -	__uint64_t		logsize, count, free;
> > +	uint64_t		logsize, count, free;
> >  	int			fd;
> >  
> >  	if ((fd = open(mount->fs_dir, O_RDONLY)) < 0) {
> > @@ -132,15 +132,15 @@ mount_free_space_data(
> >  static int
> >  projects_free_space_data(
> >  	struct fs_path		*path,
> > -	__uint64_t		*bcount,
> > -	__uint64_t		*bused,
> > -	__uint64_t		*bfree,
> > -	__uint64_t		*icount,
> > -	__uint64_t		*iused,
> > -	__uint64_t		*ifree,
> > -	__uint64_t		*rcount,
> > -	__uint64_t		*rused,
> > -	__uint64_t		*rfree)
> > +	uint64_t		*bcount,
> > +	uint64_t		*bused,
> > +	uint64_t		*bfree,
> > +	uint64_t		*icount,
> > +	uint64_t		*iused,
> > +	uint64_t		*ifree,
> > +	uint64_t		*rcount,
> > +	uint64_t		*rused,
> > +	uint64_t		*rfree)
> >  {
> >  	fs_quota_stat_t		qfs;
> >  	fs_disk_quota_t		d;
> > @@ -226,9 +226,9 @@ free_space(
> >  	fs_path_t	*path,
> >  	uint		flags)
> >  {
> > -	__uint64_t	bcount, bused, bfree;
> > -	__uint64_t	icount, iused, ifree;
> > -	__uint64_t	rcount, rused, rfree;
> > +	uint64_t	bcount, bused, bfree;
> > +	uint64_t	icount, iused, ifree;
> > +	uint64_t	rcount, rused, rfree;
> >  	char		a[8], s[8], u[8], p[8];
> >  	int		count;
> >  
> > diff --git a/quota/quot.c b/quota/quot.c
> > index ccc154f..6378fbb 100644
> > --- a/quota/quot.c
> > +++ b/quota/quot.c
> > @@ -26,17 +26,17 @@
> >  
> >  typedef struct du {
> >  	struct du	*next;
> > -	__uint64_t	blocks;
> > -	__uint64_t	blocks30;
> > -	__uint64_t	blocks60;
> > -	__uint64_t	blocks90;
> > -	__uint64_t	nfiles;
> > -	__uint32_t	id;
> > +	uint64_t	blocks;
> > +	uint64_t	blocks30;
> > +	uint64_t	blocks60;
> > +	uint64_t	blocks90;
> > +	uint64_t	nfiles;
> > +	uint32_t	id;
> >  } du_t;
> >  
> >  #define	TSIZE		500
> > -static __uint64_t	sizes[TSIZE];
> > -static __uint64_t	overflow;
> > +static uint64_t	sizes[TSIZE];
> > +static uint64_t	overflow;
> >  
> >  #define	NDU		60000
> >  #define	DUHASH		8209
> > @@ -84,8 +84,8 @@ quot_bulkstat_add(
> >  {
> >  	du_t		*dp;
> >  	du_t		**hp;
> > -	__uint64_t	size;
> > -	__uint32_t	i, id;
> > +	uint64_t	size;
> > +	uint32_t	i, id;
> >  
> >  	if ((p->bs_mode & S_IFMT) == 0)
> >  		return;
> > @@ -203,7 +203,7 @@ qcompare(
> >  	return 0;
> >  }
> >  
> > -typedef char *(*idtoname_t)(__uint32_t);
> > +typedef char *(*idtoname_t)(uint32_t);
> >  
> >  static void
> >  quot_report_mount_any_type(
> > @@ -291,7 +291,7 @@ quot_histogram_mount(
> >  	fs_path_t	*mount,
> >  	uint		flags)
> >  {
> > -	__uint64_t	t = 0;
> > +	uint64_t	t = 0;
> >  	int		i;
> >  
> >  	fprintf(fp, _("%s (%s):\n"), mount->fs_name, mount->fs_dir);
> > diff --git a/quota/quota.c b/quota/quota.c
> > index d09e239..479b970 100644
> > --- a/quota/quota.c
> > +++ b/quota/quota.c
> > @@ -52,7 +52,7 @@ quota_help(void)
> >  static int
> >  quota_mount(
> >  	FILE		*fp,
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	char		*name,
> >  	uint		form,
> >  	uint		type,
> > @@ -181,7 +181,7 @@ quota_mount(
> >  static void
> >  quota(
> >  	FILE		*fp,
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	char		*name,
> >  	uint		form,
> >  	uint		type,
> > diff --git a/quota/quota.h b/quota/quota.h
> > index 4bde351..9ed28be 100644
> > --- a/quota/quota.h
> > +++ b/quota/quota.h
> > @@ -53,9 +53,9 @@ enum {
> >  extern char *type_to_string(uint __type);
> >  extern char *form_to_string(uint __form);
> >  extern char *time_to_string(time_t __time, uint __flags);
> > -extern char *bbs_to_string(__uint64_t __v, char *__c, uint __size);
> > -extern char *num_to_string(__uint64_t __v, char *__c, uint __size);
> > -extern char *pct_to_string(__uint64_t __v, __uint64_t __t, char *__c, uint __s);
> > +extern char *bbs_to_string(uint64_t __v, char *__c, uint __size);
> > +extern char *num_to_string(uint64_t __v, char *__c, uint __size);
> > +extern char *pct_to_string(uint64_t __v, uint64_t __t, char *__c, uint __s);
> >  
> >  extern FILE *fopen_write_secure(char *__filename);
> >  
> > @@ -81,7 +81,7 @@ enum {
> >   * Identifier (uid/gid/prid) cache routines
> >   */
> >  #define NMAX 32
> > -extern char *uid_to_name(__uint32_t __uid);
> > -extern char *gid_to_name(__uint32_t __gid);
> > -extern char *prid_to_name(__uint32_t __prid);
> > +extern char *uid_to_name(uint32_t __uid);
> > +extern char *gid_to_name(uint32_t __gid);
> > +extern char *prid_to_name(uint32_t __prid);
> >  extern bool isdigits_only(const char *);
> > diff --git a/quota/report.c b/quota/report.c
> > index d0509c2..b2ea3bb 100644
> > --- a/quota/report.c
> > +++ b/quota/report.c
> > @@ -333,9 +333,9 @@ report_header(
> >  static int
> >  report_mount(
> >  	FILE		*fp,
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	char		*name,
> > -	__uint32_t	*oid,
> > +	uint32_t	*oid,
> >  	uint		form,
> >  	uint		type,
> >  	fs_path_t	*mount,
> > diff --git a/quota/state.c b/quota/state.c
> > index 09dfa70..b08bf50 100644
> > --- a/quota/state.c
> > +++ b/quota/state.c
> > @@ -135,7 +135,7 @@ static void
> >  state_timelimit(
> >  	FILE		*fp,
> >  	uint		form,
> > -	__uint32_t	timelimit)
> > +	uint32_t	timelimit)
> >  {
> >  	fprintf(fp, _("%s grace time: %s\n"),
> >  		form_to_string(form),
> > diff --git a/quota/util.c b/quota/util.c
> > index cafd45f..37840a8 100644
> > --- a/quota/util.c
> > +++ b/quota/util.c
> > @@ -94,8 +94,8 @@ round_snprintf(
> >  	size_t		size,
> >  	const char	*fmt_round,
> >  	const char	*fmt_not_round,
> > -	__uint64_t	value,
> > -	__uint64_t	divisor)
> > +	uint64_t	value,
> > +	uint64_t	divisor)
> >  {
> >  	double		v = (double)value / divisor;
> >  
> > @@ -107,23 +107,23 @@ round_snprintf(
> >  }
> >  
> >  /* Basic blocks (512) bytes are returned from quotactl */
> > -#define BBS_TO_EXABYTES(bbs)	((__uint64_t)(bbs)>>51)
> > -#define BBS_TO_PETABYTES(bbs)	((__uint64_t)(bbs)>>41)
> > -#define BBS_TO_TERABYTES(bbs)	((__uint64_t)(bbs)>>31)
> > -#define BBS_TO_GIGABYTES(bbs)	((__uint64_t)(bbs)>>21)
> > -#define BBS_TO_MEGABYTES(bbs)	((__uint64_t)(bbs)>>11)
> > -#define BBS_TO_KILOBYTES(bbs)	((__uint64_t)(bbs)>>1)
> > -
> > -#define BBEXABYTE		((__uint64_t)1<<51)
> > -#define BBPETABYTE		((__uint64_t)1<<41)
> > -#define BBTERABYTE		((__uint64_t)1<<31)
> > -#define BBGIGABYTE		((__uint64_t)1<<21)
> > -#define BBMEGABYTE		((__uint64_t)1<<11)
> > -#define BBKILOBYTE		((__uint64_t)1<< 1)
> > +#define BBS_TO_EXABYTES(bbs)	((uint64_t)(bbs)>>51)
> > +#define BBS_TO_PETABYTES(bbs)	((uint64_t)(bbs)>>41)
> > +#define BBS_TO_TERABYTES(bbs)	((uint64_t)(bbs)>>31)
> > +#define BBS_TO_GIGABYTES(bbs)	((uint64_t)(bbs)>>21)
> > +#define BBS_TO_MEGABYTES(bbs)	((uint64_t)(bbs)>>11)
> > +#define BBS_TO_KILOBYTES(bbs)	((uint64_t)(bbs)>>1)
> > +
> > +#define BBEXABYTE		((uint64_t)1<<51)
> > +#define BBPETABYTE		((uint64_t)1<<41)
> > +#define BBTERABYTE		((uint64_t)1<<31)
> > +#define BBGIGABYTE		((uint64_t)1<<21)
> > +#define BBMEGABYTE		((uint64_t)1<<11)
> > +#define BBKILOBYTE		((uint64_t)1<< 1)
> >  
> >  char *
> >  bbs_to_string(
> > -	__uint64_t	v,
> > +	uint64_t	v,
> >  	char		*sp,
> >  	uint		size)
> >  {
> > @@ -146,17 +146,17 @@ bbs_to_string(
> >  	return sp;
> >  }
> >  
> > -#define THOUSAND		((__uint64_t)1000)
> > -#define MILLION			((__uint64_t)1000*1000)
> > -#define BILLION			((__uint64_t)1000*1000*1000)
> > -#define TRILLION		((__uint64_t)1000*1000*1000*1000)
> > -#define GAZILLION		((__uint64_t)1000*1000*1000*1000*1000)
> > -#define RIDICULOUS		((__uint64_t)1000*1000*1000*1000*1000*1000)
> > -#define STOPALREADY		((__uint64_t)1000*1000*1000*1000*1000*1000*1000)
> > +#define THOUSAND		((uint64_t)1000)
> > +#define MILLION			((uint64_t)1000*1000)
> > +#define BILLION			((uint64_t)1000*1000*1000)
> > +#define TRILLION		((uint64_t)1000*1000*1000*1000)
> > +#define GAZILLION		((uint64_t)1000*1000*1000*1000*1000)
> > +#define RIDICULOUS		((uint64_t)1000*1000*1000*1000*1000*1000)
> > +#define STOPALREADY		((uint64_t)1000*1000*1000*1000*1000*1000*1000)
> >  
> >  char *
> >  num_to_string(
> > -	__uint64_t	v,
> > +	uint64_t	v,
> >  	char		*sp,
> >  	uint		size)
> >  {
> > @@ -183,8 +183,8 @@ num_to_string(
> >  
> >  char *
> >  pct_to_string(
> > -	__uint64_t	portion,
> > -	__uint64_t	whole,
> > +	uint64_t	portion,
> > +	uint64_t	whole,
> >  	char		*buf,
> >  	uint		size)
> >  {
> > @@ -237,7 +237,7 @@ type_to_string(
> >  #define IDMASK		(NID-1)
> >  
> >  typedef struct {
> > -	__uint32_t	id;
> > +	uint32_t	id;
> >  	char		name[NMAX+1];
> >  } idcache_t;
> >  
> > @@ -250,7 +250,7 @@ static int		pentriesleft = NID;
> >  
> >  static idcache_t *
> >  getnextpwent(
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	int		byid)
> >  {
> >  	struct passwd	*pw;
> > @@ -266,7 +266,7 @@ getnextpwent(
> >  
> >  static idcache_t *
> >  getnextgrent(
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	int		byid)
> >  {
> >  	struct group	*gr;
> > @@ -281,7 +281,7 @@ getnextgrent(
> >  
> >  static idcache_t *
> >  getnextprent(
> > -	__uint32_t	id,
> > +	uint32_t	id,
> >  	int		byid)
> >  {
> >  	fs_project_t	*pr;
> > @@ -296,7 +296,7 @@ getnextprent(
> >  
> >  char *
> >  uid_to_name(
> > -	__uint32_t	id)
> > +	uint32_t	id)
> >  {
> >  	idcache_t	*ncp, *idp;
> >  
> > @@ -333,7 +333,7 @@ uid_to_name(
> >  
> >  char *
> >  gid_to_name(
> > -	__uint32_t	id)
> > +	uint32_t	id)
> >  {
> >  	idcache_t	*ncp, *idp;
> >  
> > @@ -370,7 +370,7 @@ gid_to_name(
> >  
> >  char *
> >  prid_to_name(
> > -	__uint32_t	id)
> > +	uint32_t	id)
> >  {
> >  	idcache_t	*ncp, *idp;
> >  
> > diff --git a/repair/README b/repair/README
> > index 7f168e6..4692463 100644
> > --- a/repair/README
> > +++ b/repair/README
> > @@ -189,7 +189,7 @@ D - 0) look at usage of XFS_MAKE_IPTR().  It does the right
> >  
> >  
> >  D - 0) look at references to XFS_INODES_PER_CHUNK.  change the
> > -	ones that really mean sizeof(__uint64_t)*NBBY to
> > +	ones that really mean sizeof(uint64_t)*NBBY to
> >  	something else (like that only defined as a constant
> >  	INOS_PER_IREC. this isn't as important since
> >  	XFS_INODES_PER_CHUNK will never chang
> > diff --git a/repair/agheader.h b/repair/agheader.h
> > index 6b2974c..2f7246d 100644
> > --- a/repair/agheader.h
> > +++ b/repair/agheader.h
> > @@ -20,7 +20,7 @@ typedef struct fs_geometry  {
> >  	/*
> >  	 * these types should match the superblock types
> >  	 */
> > -	__uint32_t	sb_blocksize;	/* blocksize (bytes) */
> > +	uint32_t	sb_blocksize;	/* blocksize (bytes) */
> >  	xfs_rfsblock_t	sb_dblocks;	/* # data blocks */
> >  	xfs_rfsblock_t	sb_rblocks;	/* # realtime blocks */
> >  	xfs_rtblock_t	sb_rextents;	/* # realtime extents */
> > @@ -30,9 +30,9 @@ typedef struct fs_geometry  {
> >  	xfs_agnumber_t	sb_agcount;	/* # of ags */
> >  	xfs_extlen_t	sb_rbmblocks;	/* # of rt bitmap blocks */
> >  	xfs_extlen_t	sb_logblocks;	/* # of log blocks */
> > -	__uint16_t	sb_sectsize;	/* volume sector size (bytes) */
> > -	__uint16_t	sb_inodesize;	/* inode size (bytes) */
> > -	__uint8_t	sb_imax_pct;	/* max % of fs for inode space */
> > +	uint16_t	sb_sectsize;	/* volume sector size (bytes) */
> > +	uint16_t	sb_inodesize;	/* inode size (bytes) */
> > +	uint8_t		sb_imax_pct;	/* max % of fs for inode space */
> >  
> >  	/*
> >  	 * these don't have to match the superblock types but are placed
> > @@ -49,10 +49,10 @@ typedef struct fs_geometry  {
> >  	/*
> >  	 * fields after this point have to be checked manually in compare_sb()
> >  	 */
> > -	__uint8_t	sb_shared_vn;	/* shared version number */
> > +	uint8_t		sb_shared_vn;	/* shared version number */
> >  	xfs_extlen_t	sb_inoalignmt;	/* inode chunk alignment, fsblocks */
> > -	__uint32_t	sb_unit;	/* stripe or raid unit */
> > -	__uint32_t	sb_width;	/* stripe or width unit */
> > +	uint32_t	sb_unit;	/* stripe or raid unit */
> > +	uint32_t	sb_width;	/* stripe or width unit */
> >  
> >  	/*
> >  	 * these don't have to match, they track superblock properties
> > diff --git a/repair/attr_repair.h b/repair/attr_repair.h
> > index 7010e4f..294fad4 100644
> > --- a/repair/attr_repair.h
> > +++ b/repair/attr_repair.h
> > @@ -32,10 +32,10 @@
> >  #define ACL_WRITE	02
> >  #define ACL_EXECUTE	01
> >  
> > -typedef __uint16_t	xfs_acl_perm_t;
> > -typedef __int32_t	xfs_acl_type_t;
> > -typedef __int32_t	xfs_acl_tag_t;
> > -typedef __int32_t	xfs_acl_id_t;
> > +typedef uint16_t	xfs_acl_perm_t;
> > +typedef int32_t		xfs_acl_type_t;
> > +typedef int32_t		xfs_acl_tag_t;
> > +typedef int32_t		xfs_acl_id_t;
> >  
> >  /*
> >   * "icacl" = in-core ACL. There is no equivalent in the XFS kernel code,
> > @@ -50,7 +50,7 @@ struct xfs_icacl_entry {
> >  };
> >  
> >  struct xfs_icacl {
> > -	__int32_t		acl_cnt;
> > +	int32_t			acl_cnt;
> >  	struct xfs_icacl_entry	acl_entry[0];
> >  };
> >  
> > @@ -59,14 +59,14 @@ struct xfs_icacl {
> >   */
> >  #define XFS_MAC_MAX_SETS	250
> >  typedef struct xfs_mac_label {
> > -	__uint8_t       ml_msen_type;	/* MSEN label type */
> > -	__uint8_t       ml_mint_type;	/* MINT label type */
> > -	__uint8_t       ml_level;	/* Hierarchical level */
> > -	__uint8_t       ml_grade;	/* Hierarchical grade */
> > -	__uint16_t      ml_catcount;	/* Category count */
> > -	__uint16_t      ml_divcount;	/* Division count */
> > +	uint8_t       ml_msen_type;	/* MSEN label type */
> > +	uint8_t       ml_mint_type;	/* MINT label type */
> > +	uint8_t       ml_level;	/* Hierarchical level */
> > +	uint8_t       ml_grade;	/* Hierarchical grade */
> > +	uint16_t      ml_catcount;	/* Category count */
> > +	uint16_t      ml_divcount;	/* Division count */
> >  					/* Category set, then Division set */
> > -	__uint16_t      ml_list[XFS_MAC_MAX_SETS];
> > +	uint16_t      ml_list[XFS_MAC_MAX_SETS];
> >  } xfs_mac_label_t;
> >  
> >  /* MSEN label type names. Choose an upper case ASCII character.  */
> > @@ -93,7 +93,7 @@ typedef struct xfs_mac_label {
> >  /*
> >   * Capabilities (IRIX)
> >   */
> > -typedef __uint64_t xfs_cap_value_t;
> > +typedef uint64_t xfs_cap_value_t;
> >  
> >  typedef struct xfs_cap_set {
> >  	xfs_cap_value_t	cap_effective;  /* use in capability checks */
> > diff --git a/repair/avl64.c b/repair/avl64.c
> > index 51cd624..8f4a121 100644
> > --- a/repair/avl64.c
> > +++ b/repair/avl64.c
> > @@ -70,8 +70,8 @@ avl64_checktree(
> >  	avl64node_t *root)
> >  {
> >  	avl64node_t *nlast, *nnext, *np;
> > -	__uint64_t offset = 0;
> > -	__uint64_t end;
> > +	uint64_t offset = 0;
> > +	uint64_t end;
> >  
> >  	nlast = nnext = root;
> >  
> > @@ -583,8 +583,8 @@ avl64_delete(
> >  avl64node_t *
> >  avl64_findanyrange(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t start,
> > -	__uint64_t end,
> > +	uint64_t start,
> > +	uint64_t end,
> >  	int	checklen)
> >  {
> >  	avl64node_t *np = tree->avl_root;
> > @@ -655,7 +655,7 @@ avl64_findanyrange(
> >  avl64node_t *
> >  avl64_findrange(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t value)
> > +	uint64_t value)
> >  {
> >  	avl64node_t *np = tree->avl_root;
> >  
> > @@ -682,10 +682,10 @@ avl64_findrange(
> >  avl64node_t *
> >  avl64_find(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t value)
> > +	uint64_t value)
> >  {
> >  	avl64node_t *np = tree->avl_root;
> > -	__uint64_t nvalue;
> > +	uint64_t nvalue;
> >  
> >  	while (np) {
> >  		nvalue = AVL_START(tree, np);
> > @@ -909,8 +909,8 @@ static
> >  avl64node_t *
> >  avl64_insert_find_growth(
> >  		avl64tree_desc_t *tree,
> > -		__uint64_t start,	/* range start at start, */
> > -		__uint64_t end,	/* exclusive */
> > +		uint64_t start,	/* range start at start, */
> > +		uint64_t end,	/* exclusive */
> >  		int   *growthp)	/* OUT */
> >  {
> >  	avl64node_t *root = tree->avl_root;
> > @@ -963,7 +963,7 @@ avl64_insert_grow(
> >  	int growth)
> >  {
> >  	avl64node_t *nnext;
> > -	__uint64_t start = AVL_START(tree, newnode);
> > +	uint64_t start = AVL_START(tree, newnode);
> >  
> >  	if (growth == AVL_BACK) {
> >  
> > @@ -1005,8 +1005,8 @@ avl64_insert(
> >  	avl64node_t *newnode)
> >  {
> >  	avl64node_t *np;
> > -	__uint64_t start = AVL_START(tree, newnode);
> > -	__uint64_t end = AVL_END(tree, newnode);
> > +	uint64_t start = AVL_START(tree, newnode);
> > +	uint64_t end = AVL_END(tree, newnode);
> >  	int growth;
> >  
> >  	ASSERT(newnode);
> > @@ -1159,16 +1159,16 @@ avl64ops_t avl_debug_ops = {
> >  	avl_debug_end,
> >  }
> >  
> > -static __uint64_t
> > +static uint64_t
> >  avl64_debug_start(avl64node_t *node)
> >  {
> > -	return (__uint64_t)(struct avl_debug_node *)node->avl_start;
> > +	return (uint64_t)(struct avl_debug_node *)node->avl_start;
> >  }
> >  
> > -static __uint64_t
> > +static uint64_t
> >  avl64_debug_end(avl64node_t *node)
> >  {
> > -	return (__uint64_t)
> > +	return (uint64_t)
> >  		((struct avl_debug_node *)node->avl_start +
> >  		 (struct avl_debug_node *)node->avl_size);
> >  }
> > @@ -1304,7 +1304,7 @@ main()
> >  avl64node_t *
> >  avl64_findadjacent(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t value,
> > +	uint64_t value,
> >  	int		dir)
> >  {
> >  	avl64node_t *np = tree->avl_root;
> > @@ -1378,8 +1378,8 @@ avl64_findadjacent(
> >  void
> >  avl64_findranges(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t start,
> > -	__uint64_t end,
> > +	uint64_t start,
> > +	uint64_t end,
> >  	avl64node_t	        **startp,
> >  	avl64node_t		**endp)
> >  {
> > diff --git a/repair/avl64.h b/repair/avl64.h
> > index fd19321..cd079a0 100644
> > --- a/repair/avl64.h
> > +++ b/repair/avl64.h
> > @@ -32,8 +32,8 @@ typedef struct	avl64node {
> >   * avl-tree operations
> >   */
> >  typedef struct avl64ops {
> > -	__uint64_t	(*avl_start)(avl64node_t *);
> > -	__uint64_t	(*avl_end)(avl64node_t *);
> > +	uint64_t	(*avl_start)(avl64node_t *);
> > +	uint64_t	(*avl_end)(avl64node_t *);
> >  } avl64ops_t;
> >  
> >  /*
> > @@ -89,32 +89,32 @@ avl64_init_tree(
> >  avl64node_t *
> >  avl64_findrange(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t value);
> > +	uint64_t value);
> >  
> >  avl64node_t *
> >  avl64_find(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t value);
> > +	uint64_t value);
> >  
> >  avl64node_t *
> >  avl64_findanyrange(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t	start,
> > -	__uint64_t	end,
> > +	uint64_t	start,
> > +	uint64_t	end,
> >  	int     checklen);
> >  
> >  
> >  avl64node_t *
> >  avl64_findadjacent(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t	value,
> > +	uint64_t	value,
> >  	int		dir);
> >  
> >  void
> >  avl64_findranges(
> >  	avl64tree_desc_t *tree,
> > -	__uint64_t	start,
> > -	__uint64_t	end,
> > +	uint64_t	start,
> > +	uint64_t	end,
> >  	avl64node_t	        **startp,
> >  	avl64node_t		**endp);
> >  
> > diff --git a/repair/dinode.c b/repair/dinode.c
> > index d664f87..da87217 100644
> > --- a/repair/dinode.c
> > +++ b/repair/dinode.c
> > @@ -746,7 +746,7 @@ _("%s fork in ino %" PRIu64 " claims dup extent, "
> >  			case XR_E_FREE1:
> >  				do_warn(
> >  _("%s fork in ino %" PRIu64 " claims free block %" PRIu64 "\n"),
> > -					forkname, ino, (__uint64_t) b);
> > +					forkname, ino, (uint64_t) b);
> >  				/* fall through ... */
> >  			case XR_E_INUSE1:	/* seen by rmap */
> >  			case XR_E_UNKNOWN:
> > @@ -923,7 +923,7 @@ process_btinode(
> >  	int			type,
> >  	int			*dirty,
> >  	xfs_rfsblock_t		*tot,
> > -	__uint64_t		*nex,
> > +	uint64_t		*nex,
> >  	blkmap_t		**blkmapp,
> >  	int			whichfork,
> >  	int			check_dups)
> > @@ -939,7 +939,7 @@ process_btinode(
> >  	int			level;
> >  	int			numrecs;
> >  	bmap_cursor_t		cursor;
> > -	__uint64_t		magic;
> > +	uint64_t		magic;
> >  
> >  	dib = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
> >  	lino = XFS_AGINO_TO_INO(mp, agno, ino);
> > @@ -1098,7 +1098,7 @@ process_exinode(
> >  	int			type,
> >  	int			*dirty,
> >  	xfs_rfsblock_t		*tot,
> > -	__uint64_t		*nex,
> > +	uint64_t		*nex,
> >  	blkmap_t		**blkmapp,
> >  	int			whichfork,
> >  	int			check_dups)
> > @@ -1200,14 +1200,14 @@ process_symlink_extlist(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino)
> >  		do_warn(
> >  _("mismatch between format (%d) and size (%" PRId64 ") in symlink ino %" PRIu64 "\n"),
> >  			dino->di_format,
> > -			(__int64_t)be64_to_cpu(dino->di_size), lino);
> > +			(int64_t)be64_to_cpu(dino->di_size), lino);
> >  		return 1;
> >  	}
> >  	if (dino->di_format == XFS_DINODE_FMT_LOCAL) {
> >  		do_warn(
> >  _("mismatch between format (%d) and size (%" PRId64 ") in symlink inode %" PRIu64 "\n"),
> >  			dino->di_format,
> > -			(__int64_t)be64_to_cpu(dino->di_size), lino);
> > +			(int64_t)be64_to_cpu(dino->di_size), lino);
> >  		return 1;
> >  	}
> >  
> > @@ -1454,22 +1454,22 @@ _("inode %" PRIu64 " has bad inode type (IFMNT)\n"), lino);
> >  		case XR_INO_CHRDEV:
> >  			do_warn(
> >  _("size of character device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> > -				(__int64_t)be64_to_cpu(dino->di_size));
> > +				(int64_t)be64_to_cpu(dino->di_size));
> >  			break;
> >  		case XR_INO_BLKDEV:
> >  			do_warn(
> >  _("size of block device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> > -				(__int64_t)be64_to_cpu(dino->di_size));
> > +				(int64_t)be64_to_cpu(dino->di_size));
> >  			break;
> >  		case XR_INO_SOCK:
> >  			do_warn(
> >  _("size of socket inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> > -				(__int64_t)be64_to_cpu(dino->di_size));
> > +				(int64_t)be64_to_cpu(dino->di_size));
> >  			break;
> >  		case XR_INO_FIFO:
> >  			do_warn(
> >  _("size of fifo inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
> > -				(__int64_t)be64_to_cpu(dino->di_size));
> > +				(int64_t)be64_to_cpu(dino->di_size));
> >  			break;
> >  		default:
> >  			do_warn(_("Internal error - process_misc_ino_types, "
> > @@ -1743,12 +1743,12 @@ _("found inode %" PRIu64 " claiming to be a real-time file\n"), lino);
> >  		break;
> >  
> >  	case XR_INO_RTBITMAP:
> > -		if (size != (__int64_t)mp->m_sb.sb_rbmblocks *
> > +		if (size != (int64_t)mp->m_sb.sb_rbmblocks *
> >  					mp->m_sb.sb_blocksize) {
> >  			do_warn(
> >  _("realtime bitmap inode %" PRIu64 " has bad size %" PRId64 " (should be %" PRIu64 ")\n"),
> >  				lino, size,
> > -				(__int64_t) mp->m_sb.sb_rbmblocks *
> > +				(int64_t) mp->m_sb.sb_rbmblocks *
> >  					mp->m_sb.sb_blocksize);
> >  			return 1;
> >  		}
> > @@ -1817,8 +1817,8 @@ static int
> >  process_inode_blocks_and_extents(
> >  	xfs_dinode_t	*dino,
> >  	xfs_rfsblock_t	nblocks,
> > -	__uint64_t	nextents,
> > -	__uint64_t	anextents,
> > +	uint64_t	nextents,
> > +	uint64_t	anextents,
> >  	xfs_ino_t	lino,
> >  	int		*dirty)
> >  {
> > @@ -1908,7 +1908,7 @@ process_inode_data_fork(
> >  	int		type,
> >  	int		*dirty,
> >  	xfs_rfsblock_t	*totblocks,
> > -	__uint64_t	*nextents,
> > +	uint64_t	*nextents,
> >  	blkmap_t	**dblkmap,
> >  	int		check_dups)
> >  {
> > @@ -2017,7 +2017,7 @@ process_inode_attr_fork(
> >  	int		type,
> >  	int		*dirty,
> >  	xfs_rfsblock_t	*atotblocks,
> > -	__uint64_t	*anextents,
> > +	uint64_t	*anextents,
> >  	int		check_dups,
> >  	int		extra_attr_check,
> >  	int		*retval)
> > @@ -2228,8 +2228,8 @@ process_dinode_int(xfs_mount_t *mp,
> >  	int			di_mode;
> >  	int			type;
> >  	int			retval = 0;
> > -	__uint64_t		nextents;
> > -	__uint64_t		anextents;
> > +	uint64_t		nextents;
> > +	uint64_t		anextents;
> >  	xfs_ino_t		lino;
> >  	const int		is_free = 0;
> >  	const int		is_used = 1;
> > @@ -2346,7 +2346,7 @@ _("inode identifier %llu mismatch on inode %" PRIu64 "\n"),
> >  		if (!uncertain)
> >  			do_warn(
> >  _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
> > -				(__int64_t)be64_to_cpu(dino->di_size),
> > +				(int64_t)be64_to_cpu(dino->di_size),
> >  				lino);
> >  		if (verify_mode)
> >  			return 1;
> > diff --git a/repair/dinode.h b/repair/dinode.h
> > index 61d0736..39d6a72 100644
> > --- a/repair/dinode.h
> > +++ b/repair/dinode.h
> > @@ -46,8 +46,8 @@ process_bmbt_reclist(xfs_mount_t	*mp,
> >  		xfs_ino_t		ino,
> >  		xfs_rfsblock_t		*tot,
> >  		struct blkmap		**blkmapp,
> > -		__uint64_t		*first_key,
> > -		__uint64_t		*last_key,
> > +		uint64_t		*first_key,
> > +		uint64_t		*last_key,
> >  		int			whichfork);
> >  
> >  int
> > diff --git a/repair/dir2.c b/repair/dir2.c
> > index e6415e4..73dff90 100644
> > --- a/repair/dir2.c
> > +++ b/repair/dir2.c
> > @@ -160,7 +160,7 @@ process_sf_dir2(
> >  	int			bad_sfnamelen;
> >  	int			i;
> >  	int			i8;
> > -	__int64_t		ino_dir_size;
> > +	int64_t			ino_dir_size;
> >  	int			ino_off;
> >  	ino_tree_node_t		*irec_p;
> >  	int			junkit;
> > diff --git a/repair/globals.h b/repair/globals.h
> > index 4085ccc..800128a 100644
> > --- a/repair/globals.h
> > +++ b/repair/globals.h
> > @@ -141,7 +141,7 @@ EXTERN int		inodes_per_cluster;
> >  EXTERN unsigned int	glob_agcount;
> >  EXTERN int		chunks_pblock;	/* # of 64-ino chunks per allocation */
> >  EXTERN int		max_symlink_blocks;
> > -EXTERN __int64_t	fs_max_file_offset;
> > +EXTERN int64_t		fs_max_file_offset;
> >  
> >  /* realtime info */
> >  
> > @@ -161,16 +161,16 @@ EXTERN int		full_ino_ex_data;/*
> >  
> >  /* superblock counters */
> >  
> > -EXTERN __uint64_t	sb_icount;	/* allocated (made) inodes */
> > -EXTERN __uint64_t	sb_ifree;	/* free inodes */
> > -EXTERN __uint64_t	sb_fdblocks;	/* free data blocks */
> > -EXTERN __uint64_t	sb_frextents;	/* free realtime extents */
> > +EXTERN uint64_t	sb_icount;	/* allocated (made) inodes */
> > +EXTERN uint64_t	sb_ifree;	/* free inodes */
> > +EXTERN uint64_t	sb_fdblocks;	/* free data blocks */
> > +EXTERN uint64_t	sb_frextents;	/* free realtime extents */
> >  
> >  /* superblock geometry info */
> >  
> >  EXTERN xfs_extlen_t	sb_inoalignmt;
> > -EXTERN __uint32_t	sb_unit;
> > -EXTERN __uint32_t	sb_width;
> > +EXTERN uint32_t	sb_unit;
> > +EXTERN uint32_t	sb_width;
> >  
> >  struct aglock {
> >  	pthread_mutex_t	lock __attribute__((__aligned__(64)));
> > @@ -178,7 +178,7 @@ struct aglock {
> >  EXTERN struct aglock	*ag_locks;
> >  
> >  EXTERN int 		report_interval;
> > -EXTERN __uint64_t 	*prog_rpt_done;
> > +EXTERN uint64_t 	*prog_rpt_done;
> >  
> >  EXTERN int		ag_stride;
> >  EXTERN int		thread_count;
> > diff --git a/repair/incore.c b/repair/incore.c
> > index cb57316..a9191ae 100644
> > --- a/repair/incore.c
> > +++ b/repair/incore.c
> > @@ -179,7 +179,7 @@ get_bmap_ext(
> >  static uint64_t		*rt_bmap;
> >  static size_t		rt_bmap_size;
> >  
> > -/* block records fit into __uint64_t's units */
> > +/* block records fit into uint64_t's units */
> >  #define XR_BB_UNIT	64			/* number of bits/unit */
> >  #define XR_BB		4			/* bits per block record */
> >  #define XR_BB_NUM	(XR_BB_UNIT/XR_BB)	/* number of records per unit */
> > @@ -203,8 +203,8 @@ set_rtbmap(
> >  {
> >  	*(rt_bmap + bno / XR_BB_NUM) =
> >  	 ((*(rt_bmap + bno / XR_BB_NUM) &
> > -	  (~((__uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
> > -	 (((__uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
> > +	  (~((uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
> > +	 (((uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
> >  }
> >  
> >  static void
> > @@ -222,9 +222,9 @@ init_rt_bmap(
> >  		return;
> >  
> >  	rt_bmap_size = roundup(mp->m_sb.sb_rextents / (NBBY / XR_BB),
> > -			       sizeof(__uint64_t));
> > +			       sizeof(uint64_t));
> >  
> > -	rt_bmap = memalign(sizeof(__uint64_t), rt_bmap_size);
> > +	rt_bmap = memalign(sizeof(uint64_t), rt_bmap_size);
> >  	if (!rt_bmap) {
> >  		do_error(
> >  	_("couldn't allocate realtime block map, size = %" PRIu64 "\n"),
> > diff --git a/repair/incore.h b/repair/incore.h
> > index c23a3a3..fd66084 100644
> > --- a/repair/incore.h
> > +++ b/repair/incore.h
> > @@ -257,7 +257,7 @@ typedef xfs_ino_t parent_entry_t;
> >  struct nlink_ops;
> >  
> >  typedef struct parent_list  {
> > -	__uint64_t		pmask;
> > +	uint64_t		pmask;
> >  	parent_entry_t		*pentries;
> >  #ifdef DEBUG
> >  	short			cnt;
> > @@ -265,14 +265,14 @@ typedef struct parent_list  {
> >  } parent_list_t;
> >  
> >  union ino_nlink {
> > -	__uint8_t	*un8;
> > -	__uint16_t	*un16;
> > -	__uint32_t	*un32;
> > +	uint8_t		*un8;
> > +	uint16_t	*un16;
> > +	uint32_t	*un32;
> >  };
> >  
> >  typedef struct ino_ex_data  {
> > -	__uint64_t		ino_reached;	/* bit == 1 if reached */
> > -	__uint64_t		ino_processed;	/* reference checked bit mask */
> > +	uint64_t		ino_reached;	/* bit == 1 if reached */
> > +	uint64_t		ino_processed;	/* reference checked bit mask */
> >  	parent_list_t		*parents;
> >  	union ino_nlink		counted_nlinks;/* counted nlinks in P6 */
> >  } ino_ex_data_t;
> > @@ -281,22 +281,22 @@ typedef struct ino_tree_node  {
> >  	avlnode_t		avl_node;
> >  	xfs_agino_t		ino_startnum;	/* starting inode # */
> >  	xfs_inofree_t		ir_free;	/* inode free bit mask */
> > -	__uint64_t		ir_sparse;	/* sparse inode bitmask */
> > -	__uint64_t		ino_confirmed;	/* confirmed bitmask */
> > -	__uint64_t		ino_isa_dir;	/* bit == 1 if a directory */
> > -	__uint64_t		ino_was_rl;	/* bit == 1 if reflink flag set */
> > -	__uint64_t		ino_is_rl;	/* bit == 1 if reflink flag should be set */
> > -	__uint8_t		nlink_size;
> > +	uint64_t		ir_sparse;	/* sparse inode bitmask */
> > +	uint64_t		ino_confirmed;	/* confirmed bitmask */
> > +	uint64_t		ino_isa_dir;	/* bit == 1 if a directory */
> > +	uint64_t		ino_was_rl;	/* bit == 1 if reflink flag set */
> > +	uint64_t		ino_is_rl;	/* bit == 1 if reflink flag should be set */
> > +	uint8_t			nlink_size;
> >  	union ino_nlink		disk_nlinks;	/* on-disk nlinks, set in P3 */
> >  	union  {
> >  		ino_ex_data_t	*ex_data;	/* phases 6,7 */
> >  		parent_list_t	*plist;		/* phases 2-5 */
> >  	} ino_un;
> > -	__uint8_t		*ftypes;	/* phases 3,6 */
> > +	uint8_t			*ftypes;	/* phases 3,6 */
> >  } ino_tree_node_t;
> >  
> > -#define INOS_PER_IREC	(sizeof(__uint64_t) * NBBY)
> > -#define	IREC_MASK(i)	((__uint64_t)1 << (i))
> > +#define INOS_PER_IREC	(sizeof(uint64_t) * NBBY)
> > +#define	IREC_MASK(i)	((uint64_t)1 << (i))
> >  
> >  void		add_ino_ex_data(xfs_mount_t *mp);
> >  
> > @@ -543,10 +543,10 @@ static inline int inode_is_rl(struct ino_tree_node *irec, int offset)
> >   */
> >  void add_inode_ref(struct ino_tree_node *irec, int offset);
> >  void drop_inode_ref(struct ino_tree_node *irec, int offset);
> > -__uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
> > +uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
> >  
> > -void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, __uint32_t nlinks);
> > -__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
> > +void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, uint32_t nlinks);
> > +uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
> >  
> >  static inline int is_inode_reached(struct ino_tree_node *irec, int offset)
> >  {
> > @@ -567,13 +567,13 @@ static inline void add_inode_reached(struct ino_tree_node *irec, int offset)
> >  static inline void
> >  set_inode_ftype(struct ino_tree_node *irec,
> >  	int		ino_offset,
> > -	__uint8_t	ftype)
> > +	uint8_t		ftype)
> >  {
> >  	if (irec->ftypes)
> >  		irec->ftypes[ino_offset] = ftype;
> >  }
> >  
> > -static inline __uint8_t
> > +static inline uint8_t
> >  get_inode_ftype(
> >  	struct ino_tree_node *irec,
> >  	int		ino_offset)
> > @@ -606,11 +606,11 @@ typedef struct bm_level_state  {
> >  	xfs_fsblock_t		fsbno;
> >  	xfs_fsblock_t		left_fsbno;
> >  	xfs_fsblock_t		right_fsbno;
> > -	__uint64_t		first_key;
> > -	__uint64_t		last_key;
> > +	uint64_t		first_key;
> > +	uint64_t		last_key;
> >  /*
> >  	int			level;
> > -	__uint64_t		prev_last_key;
> > +	uint64_t		prev_last_key;
> >  	xfs_buf_t		*bp;
> >  	xfs_bmbt_block_t	*block;
> >  */
> > diff --git a/repair/incore_ext.c b/repair/incore_ext.c
> > index 7e6786c..0a8138a 100644
> > --- a/repair/incore_ext.c
> > +++ b/repair/incore_ext.c
> > @@ -721,13 +721,13 @@ search_rt_dup_extent(xfs_mount_t *mp, xfs_rtblock_t bno)
> >  	return(ret);
> >  }
> >  
> > -static __uint64_t
> > +static uint64_t
> >  avl64_rt_ext_start(avl64node_t *node)
> >  {
> >  	return(((rt_extent_tree_node_t *) node)->rt_startblock);
> >  }
> >  
> > -static __uint64_t
> > +static uint64_t
> >  avl64_ext_end(avl64node_t *node)
> >  {
> >  	return(((rt_extent_tree_node_t *) node)->rt_startblock +
> > @@ -834,7 +834,7 @@ count_extents(xfs_agnumber_t agno, avltree_desc_t *tree, int whichtree)
> >  int
> >  count_bno_extents_blocks(xfs_agnumber_t agno, uint *numblocks)
> >  {
> > -	__uint64_t nblocks;
> > +	uint64_t nblocks;
> >  	extent_tree_node_t *node;
> >  	int i = 0;
> >  
> > diff --git a/repair/incore_ino.c b/repair/incore_ino.c
> > index 2ec1765..3b6b44d 100644
> > --- a/repair/incore_ino.c
> > +++ b/repair/incore_ino.c
> > @@ -38,7 +38,7 @@ static avltree_desc_t	**inode_uncertain_tree_ptrs;
> >  /* memory optimised nlink counting for all inodes */
> >  
> >  static void *
> > -alloc_nlink_array(__uint8_t nlink_size)
> > +alloc_nlink_array(uint8_t nlink_size)
> >  {
> >  	void *ptr;
> >  
> > @@ -51,10 +51,10 @@ alloc_nlink_array(__uint8_t nlink_size)
> >  static void
> >  nlink_grow_8_to_16(ino_tree_node_t *irec)
> >  {
> > -	__uint16_t	*new_nlinks;
> > +	uint16_t	*new_nlinks;
> >  	int		i;
> >  
> > -	irec->nlink_size = sizeof(__uint16_t);
> > +	irec->nlink_size = sizeof(uint16_t);
> >  
> >  	new_nlinks = alloc_nlink_array(irec->nlink_size);
> >  	for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
> > @@ -76,10 +76,10 @@ nlink_grow_8_to_16(ino_tree_node_t *irec)
> >  static void
> >  nlink_grow_16_to_32(ino_tree_node_t *irec)
> >  {
> > -	__uint32_t	*new_nlinks;
> > +	uint32_t	*new_nlinks;
> >  	int		i;
> >  
> > -	irec->nlink_size = sizeof(__uint32_t);
> > +	irec->nlink_size = sizeof(uint32_t);
> >  
> >  	new_nlinks = alloc_nlink_array(irec->nlink_size);
> >  	for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
> > @@ -104,21 +104,21 @@ void add_inode_ref(struct ino_tree_node *irec, int ino_offset)
> >  	ASSERT(irec->ino_un.ex_data != NULL);
> >  
> >  	switch (irec->nlink_size) {
> > -	case sizeof(__uint8_t):
> > +	case sizeof(uint8_t):
> >  		if (irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] < 0xff) {
> >  			irec->ino_un.ex_data->counted_nlinks.un8[ino_offset]++;
> >  			break;
> >  		}
> >  		nlink_grow_8_to_16(irec);
> >  		/*FALLTHRU*/
> > -	case sizeof(__uint16_t):
> > +	case sizeof(uint16_t):
> >  		if (irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] < 0xffff) {
> >  			irec->ino_un.ex_data->counted_nlinks.un16[ino_offset]++;
> >  			break;
> >  		}
> >  		nlink_grow_16_to_32(irec);
> >  		/*FALLTHRU*/
> > -	case sizeof(__uint32_t):
> > +	case sizeof(uint32_t):
> >  		irec->ino_un.ex_data->counted_nlinks.un32[ino_offset]++;
> >  		break;
> >  	default:
> > @@ -128,20 +128,20 @@ void add_inode_ref(struct ino_tree_node *irec, int ino_offset)
> >  
> >  void drop_inode_ref(struct ino_tree_node *irec, int ino_offset)
> >  {
> > -	__uint32_t	refs = 0;
> > +	uint32_t	refs = 0;
> >  
> >  	ASSERT(irec->ino_un.ex_data != NULL);
> >  
> >  	switch (irec->nlink_size) {
> > -	case sizeof(__uint8_t):
> > +	case sizeof(uint8_t):
> >  		ASSERT(irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] > 0);
> >  		refs = --irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
> >  		break;
> > -	case sizeof(__uint16_t):
> > +	case sizeof(uint16_t):
> >  		ASSERT(irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] > 0);
> >  		refs = --irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
> >  		break;
> > -	case sizeof(__uint32_t):
> > +	case sizeof(uint32_t):
> >  		ASSERT(irec->ino_un.ex_data->counted_nlinks.un32[ino_offset] > 0);
> >  		refs = --irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
> >  		break;
> > @@ -153,16 +153,16 @@ void drop_inode_ref(struct ino_tree_node *irec, int ino_offset)
> >  		irec->ino_un.ex_data->ino_reached &= ~IREC_MASK(ino_offset);
> >  }
> >  
> > -__uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
> > +uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
> >  {
> >  	ASSERT(irec->ino_un.ex_data != NULL);
> >  
> >  	switch (irec->nlink_size) {
> > -	case sizeof(__uint8_t):
> > +	case sizeof(uint8_t):
> >  		return irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
> > -	case sizeof(__uint16_t):
> > +	case sizeof(uint16_t):
> >  		return irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
> > -	case sizeof(__uint32_t):
> > +	case sizeof(uint32_t):
> >  		return irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
> >  	default:
> >  		ASSERT(0);
> > @@ -171,24 +171,24 @@ __uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
> >  }
> >  
> >  void set_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset,
> > -		__uint32_t nlinks)
> > +		uint32_t nlinks)
> >  {
> >  	switch (irec->nlink_size) {
> > -	case sizeof(__uint8_t):
> > +	case sizeof(uint8_t):
> >  		if (nlinks < 0xff) {
> >  			irec->disk_nlinks.un8[ino_offset] = nlinks;
> >  			break;
> >  		}
> >  		nlink_grow_8_to_16(irec);
> >  		/*FALLTHRU*/
> > -	case sizeof(__uint16_t):
> > +	case sizeof(uint16_t):
> >  		if (nlinks < 0xffff) {
> >  			irec->disk_nlinks.un16[ino_offset] = nlinks;
> >  			break;
> >  		}
> >  		nlink_grow_16_to_32(irec);
> >  		/*FALLTHRU*/
> > -	case sizeof(__uint32_t):
> > +	case sizeof(uint32_t):
> >  		irec->disk_nlinks.un32[ino_offset] = nlinks;
> >  		break;
> >  	default:
> > @@ -196,14 +196,14 @@ void set_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset,
> >  	}
> >  }
> >  
> > -__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
> > +uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
> >  {
> >  	switch (irec->nlink_size) {
> > -	case sizeof(__uint8_t):
> > +	case sizeof(uint8_t):
> >  		return irec->disk_nlinks.un8[ino_offset];
> > -	case sizeof(__uint16_t):
> > +	case sizeof(uint16_t):
> >  		return irec->disk_nlinks.un16[ino_offset];
> > -	case sizeof(__uint32_t):
> > +	case sizeof(uint32_t):
> >  		return irec->disk_nlinks.un32[ino_offset];
> >  	default:
> >  		ASSERT(0);
> > @@ -211,11 +211,11 @@ __uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
> >  	return 0;
> >  }
> >  
> > -static __uint8_t *
> > +static uint8_t *
> >  alloc_ftypes_array(
> >  	struct xfs_mount *mp)
> >  {
> > -	__uint8_t	*ptr;
> > +	uint8_t		*ptr;
> >  
> >  	if (!xfs_sb_version_hasftype(&mp->m_sb))
> >  		return NULL;
> > @@ -262,23 +262,23 @@ alloc_ino_node(
> >  	irec->ir_free = (xfs_inofree_t) - 1;
> >  	irec->ir_sparse = 0;
> >  	irec->ino_un.ex_data = NULL;
> > -	irec->nlink_size = sizeof(__uint8_t);
> > +	irec->nlink_size = sizeof(uint8_t);
> >  	irec->disk_nlinks.un8 = alloc_nlink_array(irec->nlink_size);
> >  	irec->ftypes = alloc_ftypes_array(mp);
> >  	return irec;
> >  }
> >  
> >  static void
> > -free_nlink_array(union ino_nlink nlinks, __uint8_t nlink_size)
> > +free_nlink_array(union ino_nlink nlinks, uint8_t nlink_size)
> >  {
> >  	switch (nlink_size) {
> > -	case sizeof(__uint8_t):
> > +	case sizeof(uint8_t):
> >  		free(nlinks.un8);
> >  		break;
> > -	case sizeof(__uint16_t):
> > +	case sizeof(uint16_t):
> >  		free(nlinks.un16);
> >  		break;
> > -	case sizeof(__uint32_t):
> > +	case sizeof(uint32_t):
> >  		free(nlinks.un32);
> >  		break;
> >  	default:
> > @@ -609,7 +609,7 @@ set_inode_parent(
> >  	int			i;
> >  	int			cnt;
> >  	int			target;
> > -	__uint64_t		bitmask;
> > +	uint64_t		bitmask;
> >  	parent_entry_t		*tmp;
> >  
> >  	if (full_ino_ex_data)
> > @@ -699,7 +699,7 @@ set_inode_parent(
> >  xfs_ino_t
> >  get_inode_parent(ino_tree_node_t *irec, int offset)
> >  {
> > -	__uint64_t	bitmask;
> > +	uint64_t	bitmask;
> >  	parent_list_t	*ptbl;
> >  	int		i;
> >  	int		target;
> > @@ -740,15 +740,15 @@ alloc_ex_data(ino_tree_node_t *irec)
> >  	irec->ino_un.ex_data->parents = ptbl;
> >  
> >  	switch (irec->nlink_size) {
> > -	case sizeof(__uint8_t):
> > +	case sizeof(uint8_t):
> >  		irec->ino_un.ex_data->counted_nlinks.un8 =
> >  			alloc_nlink_array(irec->nlink_size);
> >  		break;
> > -	case sizeof(__uint16_t):
> > +	case sizeof(uint16_t):
> >  		irec->ino_un.ex_data->counted_nlinks.un16 =
> >  			alloc_nlink_array(irec->nlink_size);
> >  		break;
> > -	case sizeof(__uint32_t):
> > +	case sizeof(uint32_t):
> >  		irec->ino_un.ex_data->counted_nlinks.un32 =
> >  			alloc_nlink_array(irec->nlink_size);
> >  		break;
> > diff --git a/repair/phase2.c b/repair/phase2.c
> > index c21778b..0085732 100644
> > --- a/repair/phase2.c
> > +++ b/repair/phase2.c
> > @@ -179,7 +179,7 @@ phase2(
> >  
> >  	bad_ino_btree = 0;
> >  
> > -	set_progress_msg(PROG_FMT_SCAN_AG, (__uint64_t) glob_agcount);
> > +	set_progress_msg(PROG_FMT_SCAN_AG, (uint64_t) glob_agcount);
> >  
> >  	scan_ags(mp, scan_threads);
> >  
> > diff --git a/repair/phase3.c b/repair/phase3.c
> > index 0890a27..17b1c28 100644
> > --- a/repair/phase3.c
> > +++ b/repair/phase3.c
> > @@ -122,7 +122,7 @@ phase3(
> >  	else
> >  		do_log(_("        - scan (but don't clear) agi unlinked lists...\n"));
> >  
> > -	set_progress_msg(PROG_FMT_AGI_UNLINKED, (__uint64_t) glob_agcount);
> > +	set_progress_msg(PROG_FMT_AGI_UNLINKED, (uint64_t) glob_agcount);
> >  
> >  	/* first clear the agi unlinked AGI list */
> >  	if (!no_modify) {
> > @@ -142,7 +142,7 @@ phase3(
> >  	do_log(_(
> >  	    "        - process known inodes and perform inode discovery...\n"));
> >  
> > -	set_progress_msg(PROG_FMT_PROCESS_INO, (__uint64_t) mp->m_sb.sb_icount);
> > +	set_progress_msg(PROG_FMT_PROCESS_INO, (uint64_t) mp->m_sb.sb_icount);
> >  
> >  	process_ags(mp);
> >  
> > @@ -152,7 +152,7 @@ phase3(
> >  	 * process newly discovered inode chunks
> >  	 */
> >  	do_log(_("        - process newly discovered inodes...\n"));
> > -	set_progress_msg(PROG_FMT_NEW_INODES, (__uint64_t) glob_agcount);
> > +	set_progress_msg(PROG_FMT_NEW_INODES, (uint64_t) glob_agcount);
> >  
> >  	counts = calloc(sizeof(*counts), mp->m_sb.sb_agcount);
> >  	if (!counts) {
> > diff --git a/repair/phase4.c b/repair/phase4.c
> > index e59464b..cc17ec0 100644
> > --- a/repair/phase4.c
> > +++ b/repair/phase4.c
> > @@ -290,7 +290,7 @@ phase4(xfs_mount_t *mp)
> >  	do_log(_("Phase 4 - check for duplicate blocks...\n"));
> >  	do_log(_("        - setting up duplicate extent list...\n"));
> >  
> > -	set_progress_msg(PROG_FMT_DUP_EXTENT, (__uint64_t) glob_agcount);
> > +	set_progress_msg(PROG_FMT_DUP_EXTENT, (uint64_t) glob_agcount);
> >  
> >  	irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino),
> >  				XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino));
> > @@ -404,7 +404,7 @@ phase4(xfs_mount_t *mp)
> >  	reset_bmaps(mp);
> >  
> >  	do_log(_("        - check for inodes claiming duplicate blocks...\n"));
> > -	set_progress_msg(PROG_FMT_DUP_BLOCKS, (__uint64_t) mp->m_sb.sb_icount);
> > +	set_progress_msg(PROG_FMT_DUP_BLOCKS, (uint64_t) mp->m_sb.sb_icount);
> >  
> >  	/*
> >  	 * ok, now process the inodes -- signal 2-pass check per inode.
> > diff --git a/repair/phase5.c b/repair/phase5.c
> > index 0b833f1..bf86730 100644
> > --- a/repair/phase5.c
> > +++ b/repair/phase5.c
> > @@ -86,9 +86,9 @@ struct agi_stat {
> >  	xfs_agino_t		freecount;
> >  };
> >  
> > -static __uint64_t	*sb_icount_ag;		/* allocated inodes per ag */
> > -static __uint64_t	*sb_ifree_ag;		/* free inodes per ag */
> > -static __uint64_t	*sb_fdblocks_ag;	/* free data blocks per ag */
> > +static uint64_t	*sb_icount_ag;		/* allocated inodes per ag */
> > +static uint64_t	*sb_ifree_ag;		/* free inodes per ag */
> > +static uint64_t	*sb_fdblocks_ag;	/* free data blocks per ag */
> >  
> >  static int
> >  mk_incore_fstree(xfs_mount_t *mp, xfs_agnumber_t agno)
> > @@ -886,10 +886,10 @@ build_freespace_tree(xfs_mount_t *mp, xfs_agnumber_t agno,
> >   */
> >  static void
> >  init_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs,
> > -		__uint64_t *num_inos, __uint64_t *num_free_inos, int finobt)
> > +		uint64_t *num_inos, uint64_t *num_free_inos, int finobt)
> >  {
> > -	__uint64_t		ninos;
> > -	__uint64_t		nfinos;
> > +	uint64_t		ninos;
> > +	uint64_t		nfinos;
> >  	int			rec_nfinos;
> >  	int			rec_ninos;
> >  	ino_tree_node_t		*ino_rec;
> > @@ -2193,10 +2193,10 @@ phase5_func(
> >  	xfs_agnumber_t	agno,
> >  	struct xfs_slab	*lost_fsb)
> >  {
> > -	__uint64_t	num_inos;
> > -	__uint64_t	num_free_inos;
> > -	__uint64_t	finobt_num_inos;
> > -	__uint64_t	finobt_num_free_inos;
> > +	uint64_t	num_inos;
> > +	uint64_t	num_free_inos;
> > +	uint64_t	finobt_num_inos;
> > +	uint64_t	finobt_num_free_inos;
> >  	bt_status_t	bno_btree_curs;
> >  	bt_status_t	bcnt_btree_curs;
> >  	bt_status_t	ino_btree_curs;
> > @@ -2471,7 +2471,7 @@ phase5(xfs_mount_t *mp)
> >  	int			error;
> >  
> >  	do_log(_("Phase 5 - rebuild AG headers and trees...\n"));
> > -	set_progress_msg(PROG_FMT_REBUILD_AG, (__uint64_t )glob_agcount);
> > +	set_progress_msg(PROG_FMT_REBUILD_AG, (uint64_t )glob_agcount);
> >  
> >  #ifdef XR_BLD_FREE_TRACE
> >  	fprintf(stderr, "inobt level 1, maxrec = %d, minrec = %d\n",
> > @@ -2497,15 +2497,15 @@ phase5(xfs_mount_t *mp)
> >  	keep_fsinos(mp);
> >  
> >  	/* allocate per ag counters */
> > -	sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
> > +	sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
> >  	if (sb_icount_ag == NULL)
> >  		do_error(_("cannot alloc sb_icount_ag buffers\n"));
> >  
> > -	sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
> > +	sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
> >  	if (sb_ifree_ag == NULL)
> >  		do_error(_("cannot alloc sb_ifree_ag buffers\n"));
> >  
> > -	sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
> > +	sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
> >  	if (sb_fdblocks_ag == NULL)
> >  		do_error(_("cannot alloc sb_fdblocks_ag buffers\n"));
> >  
> > diff --git a/repair/phase6.c b/repair/phase6.c
> > index 08636dc..373b1a5 100644
> > --- a/repair/phase6.c
> > +++ b/repair/phase6.c
> > @@ -82,7 +82,7 @@ typedef struct dir_hash_ent {
> >  	struct dir_hash_ent	*nextbyhash;	/* next in name bucket */
> >  	struct dir_hash_ent	*nextbyorder;	/* next in order added */
> >  	xfs_dahash_t		hashval;	/* hash value of name */
> > -	__uint32_t		address;	/* offset of data entry */
> > +	uint32_t		address;	/* offset of data entry */
> >  	xfs_ino_t 		inum;		/* inode num of entry */
> >  	short			junkit;		/* name starts with / */
> >  	short			seen;		/* have seen leaf entry */
> > @@ -170,11 +170,11 @@ static int
> >  dir_hash_add(
> >  	xfs_mount_t		*mp,
> >  	dir_hash_tab_t		*hashtab,
> > -	__uint32_t		addr,
> > +	uint32_t		addr,
> >  	xfs_ino_t		inum,
> >  	int			namelen,
> >  	unsigned char		*name,
> > -	__uint8_t		ftype)
> > +	uint8_t			ftype)
> >  {
> >  	xfs_dahash_t		hash = 0;
> >  	int			byaddr;
> > @@ -357,7 +357,7 @@ static void
> >  dir_hash_update_ftype(
> >  	dir_hash_tab_t		*hashtab,
> >  	xfs_dir2_dataptr_t	addr,
> > -	__uint8_t		ftype)
> > +	uint8_t			ftype)
> >  {
> >  	int			i;
> >  	dir_hash_ent_t		*p;
> > @@ -1791,8 +1791,8 @@ longform_dir2_entry_check_data(
> >  
> >  		/* validate ftype field if supported */
> >  		if (xfs_sb_version_hasftype(&mp->m_sb)) {
> > -			__uint8_t dir_ftype;
> > -			__uint8_t ino_ftype;
> > +			uint8_t dir_ftype;
> > +			uint8_t ino_ftype;
> >  
> >  			dir_ftype = M_DIROPS(mp)->data_get_ftype(dep);
> >  			ino_ftype = get_inode_ftype(irec, ino_offset);
> > @@ -2703,8 +2703,8 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
> >  
> >  		/* validate ftype field if supported */
> >  		if (xfs_sb_version_hasftype(&mp->m_sb)) {
> > -			__uint8_t dir_ftype;
> > -			__uint8_t ino_ftype;
> > +			uint8_t dir_ftype;
> > +			uint8_t ino_ftype;
> >  
> >  			dir_ftype = M_DIROPS(mp)->sf_get_ftype(sfep);
> >  			ino_ftype = get_inode_ftype(irec, ino_offset);
> > diff --git a/repair/phase7.c b/repair/phase7.c
> > index 8bce117..4ffb81a 100644
> > --- a/repair/phase7.c
> > +++ b/repair/phase7.c
> > @@ -32,7 +32,7 @@ static void
> >  update_inode_nlinks(
> >  	xfs_mount_t 		*mp,
> >  	xfs_ino_t		ino,
> > -	__uint32_t		nlinks)
> > +	uint32_t		nlinks)
> >  {
> >  	xfs_trans_t		*tp;
> >  	xfs_inode_t		*ip;
> > @@ -104,7 +104,7 @@ do_link_updates(
> >  {
> >  	ino_tree_node_t		*irec;
> >  	int			j;
> > -	__uint32_t		nrefs;
> > +	uint32_t		nrefs;
> >  
> >  	for (irec = findfirst_inode_rec(agno); irec;
> >  	     irec = next_ino_rec(irec)) {
> > @@ -143,7 +143,7 @@ phase7(
> >  	else
> >  		do_log(_("Phase 7 - verify link counts...\n"));
> >  
> > -	set_progress_msg(PROGRESS_FMT_CORR_LINK, (__uint64_t) glob_agcount);
> > +	set_progress_msg(PROGRESS_FMT_CORR_LINK, (uint64_t) glob_agcount);
> >  
> >  	create_work_queue(&wq, mp, scan_threads);
> >  
> > diff --git a/repair/progress.c b/repair/progress.c
> > index 2a09b23..3a2e9a2 100644
> > --- a/repair/progress.c
> > +++ b/repair/progress.c
> > @@ -85,8 +85,8 @@ pthread_t	report_thread;
> >  typedef struct msg_block_s {
> >  	pthread_mutex_t	mutex;
> >  	progress_rpt_t	*format;
> > -	__uint64_t	*done;
> > -	__uint64_t	*total;
> > +	uint64_t	*done;
> > +	uint64_t	*total;
> >  	int		count;
> >  	int		interval;
> >  } msg_block_t;
> > @@ -96,14 +96,14 @@ typedef struct phase_times_s {
> >  	time_t		start;
> >  	time_t		end;
> >  	time_t		duration;
> > -	__uint64_t	item_counts[4];
> > +	uint64_t	item_counts[4];
> >  } phase_times_t;
> >  static phase_times_t phase_times[8];
> >  
> >  static void *progress_rpt_thread(void *);
> >  static int current_phase;
> >  static int running;
> > -static __uint64_t prog_rpt_total;
> > +static uint64_t prog_rpt_total;
> >  
> >  void
> >  init_progress_rpt (void)
> > @@ -113,11 +113,11 @@ init_progress_rpt (void)
> >  	 *  allocate the done vector
> >  	 */
> >  
> > -	if ((prog_rpt_done = (__uint64_t *)
> > -		malloc(sizeof(__uint64_t)*glob_agcount)) == NULL ) {
> > +	if ((prog_rpt_done = (uint64_t *)
> > +		malloc(sizeof(uint64_t)*glob_agcount)) == NULL ) {
> >  		do_error(_("cannot malloc pointer to done vector\n"));
> >  	}
> > -	bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
> > +	bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
> >  
> >  	/*
> >  	 *  Setup comm block, start the thread
> > @@ -165,10 +165,10 @@ progress_rpt_thread (void *p)
> >  	timer_t timerid;
> >  	struct itimerspec timespec;
> >  	char *msgbuf;
> > -	__uint64_t *donep;
> > -	__uint64_t sum;
> > +	uint64_t *donep;
> > +	uint64_t sum;
> >  	msg_block_t *msgp = (msg_block_t *)p;
> > -	__uint64_t percent;
> > +	uint64_t percent;
> >  
> >  	/* It's possible to get here very early w/ no progress msg set */
> >  	if (!msgp->format)
> > @@ -286,7 +286,7 @@ progress_rpt_thread (void *p)
> >  }
> >  
> >  int
> > -set_progress_msg (int report, __uint64_t total)
> > +set_progress_msg (int report, uint64_t total)
> >  {
> >  
> >  	if (!ag_stride)
> > @@ -300,7 +300,7 @@ set_progress_msg (int report, __uint64_t total)
> >  
> >  	/* reset all the accumulative totals */
> >  	if (prog_rpt_done)
> > -		bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
> > +		bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
> >  
> >  	if (pthread_mutex_unlock(&global_msgs.mutex))
> >  		do_error(_("set_progress_msg: cannot unlock progress mutex\n"));
> > @@ -308,14 +308,14 @@ set_progress_msg (int report, __uint64_t total)
> >  	return (0);
> >  }
> >  
> > -__uint64_t
> > +uint64_t
> >  print_final_rpt(void)
> >  {
> >  	int i;
> >  	struct tm *tmp;
> >  	time_t now;
> > -	__uint64_t *donep;
> > -	__uint64_t sum;
> > +	uint64_t *donep;
> > +	uint64_t sum;
> >  	msg_block_t 	*msgp = &global_msgs;
> >  	char		msgbuf[DURATION_BUF_SIZE];
> >  
> > diff --git a/repair/progress.h b/repair/progress.h
> > index 33db834..5152648 100644
> > --- a/repair/progress.h
> > +++ b/repair/progress.h
> > @@ -32,8 +32,8 @@
> >  extern void init_progress_rpt(void);
> >  extern void stop_progress_rpt(void);
> >  extern void summary_report(void);
> > -extern int  set_progress_msg(int report, __uint64_t total);
> > -extern __uint64_t print_final_rpt(void);
> > +extern int  set_progress_msg(int report, uint64_t total);
> > +extern uint64_t print_final_rpt(void);
> >  extern char *timestamp(int end, int phase, char *buf);
> >  extern char *duration(int val, char *buf);
> >  extern int do_parallel;
> > diff --git a/repair/rmap.c b/repair/rmap.c
> > index ab6e583..01d6f0f 100644
> > --- a/repair/rmap.c
> > +++ b/repair/rmap.c
> > @@ -343,7 +343,7 @@ _("Insufficient memory while allocating raw metadata reverse mapping slabs."));
> >  
> >  static int
> >  find_first_zero_bit(
> > -	__uint64_t	mask)
> > +	uint64_t	mask)
> >  {
> >  	int		n;
> >  	int		b = 0;
> > @@ -356,7 +356,7 @@ find_first_zero_bit(
> >  
> >  static int
> >  popcnt(
> > -	__uint64_t	mask)
> > +	uint64_t	mask)
> >  {
> >  	int		n;
> >  	int		b = 0;
> > @@ -1064,14 +1064,14 @@ _("Incorrect reverse-mapping: saw (%u/%u) %slen %u owner %"PRId64" %s%soff \
> >   * Compare the key fields of two rmap records -- positive if key1 > key2,
> >   * negative if key1 < key2, and zero if equal.
> >   */
> > -__int64_t
> > +int64_t
> >  rmap_diffkeys(
> >  	struct xfs_rmap_irec	*kp1,
> >  	struct xfs_rmap_irec	*kp2)
> >  {
> >  	__u64			oa;
> >  	__u64			ob;
> > -	__int64_t		d;
> > +	int64_t			d;
> >  	struct xfs_rmap_irec	tmp;
> >  
> >  	tmp = *kp1;
> > @@ -1081,7 +1081,7 @@ rmap_diffkeys(
> >  	tmp.rm_flags &= ~XFS_RMAP_REC_FLAGS;
> >  	ob = libxfs_rmap_irec_offset_pack(&tmp);
> >  
> > -	d = (__int64_t)kp1->rm_startblock - kp2->rm_startblock;
> > +	d = (int64_t)kp1->rm_startblock - kp2->rm_startblock;
> >  	if (d)
> >  		return d;
> >  
> > @@ -1192,10 +1192,10 @@ fix_inode_reflink_flags(
> >  {
> >  	struct ino_tree_node	*irec;
> >  	int			bit;
> > -	__uint64_t		was;
> > -	__uint64_t		is;
> > -	__uint64_t		diff;
> > -	__uint64_t		mask;
> > +	uint64_t		was;
> > +	uint64_t		is;
> > +	uint64_t		diff;
> > +	uint64_t		mask;
> >  	int			error = 0;
> >  	xfs_agino_t		agino;
> >  
> > diff --git a/repair/rmap.h b/repair/rmap.h
> > index 752ece8..1616ab7 100644
> > --- a/repair/rmap.h
> > +++ b/repair/rmap.h
> > @@ -44,7 +44,7 @@ extern int rmap_init_cursor(xfs_agnumber_t, struct xfs_slab_cursor **);
> >  extern void rmap_avoid_check(void);
> >  extern int rmaps_verify_btree(struct xfs_mount *, xfs_agnumber_t);
> >  
> > -extern __int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
> > +extern int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
> >  		struct xfs_rmap_irec *kp2);
> >  extern void rmap_high_key_from_rec(struct xfs_rmap_irec *rec,
> >  		struct xfs_rmap_irec *key);
> > diff --git a/repair/sb.c b/repair/sb.c
> > index 77e5154..acc9283 100644
> > --- a/repair/sb.c
> > +++ b/repair/sb.c
> > @@ -40,7 +40,7 @@ copy_sb(xfs_sb_t *source, xfs_sb_t *dest)
> >  	xfs_ino_t	uquotino;
> >  	xfs_ino_t	gquotino;
> >  	xfs_ino_t	pquotino;
> > -	__uint16_t	versionnum;
> > +	uint16_t	versionnum;
> >  
> >  	rootino = dest->sb_rootino;
> >  	rbmino = dest->sb_rbmino;
> > @@ -106,8 +106,8 @@ verify_sb_blocksize(xfs_sb_t *sb)
> >  static int
> >  __find_secondary_sb(
> >  	xfs_sb_t	*rsb,
> > -	__uint64_t	start,
> > -	__uint64_t	skip)
> > +	uint64_t	start,
> > +	uint64_t	skip)
> >  {
> >  	xfs_off_t	off;
> >  	xfs_sb_t	*sb;
> > @@ -187,13 +187,13 @@ __find_secondary_sb(
> >  
> >  static int
> >  guess_default_geometry(
> > -	__uint64_t		*agsize,
> > -	__uint64_t		*agcount,
> > +	uint64_t		*agsize,
> > +	uint64_t		*agcount,
> >  	libxfs_init_t		*x)
> >  {
> >  	struct fs_topology	ft;
> >  	int			blocklog;
> > -	__uint64_t		dblocks;
> > +	uint64_t		dblocks;
> >  	int			multidisk;
> >  
> >  	memset(&ft, 0, sizeof(ft));
> > @@ -216,9 +216,9 @@ int
> >  find_secondary_sb(xfs_sb_t *rsb)
> >  {
> >  	int		retval = 0;
> > -	__uint64_t	agcount;
> > -	__uint64_t	agsize;
> > -	__uint64_t	skip;
> > +	uint64_t	agcount;
> > +	uint64_t	agsize;
> > +	uint64_t	skip;
> >  	int		blocklog;
> >  
> >  	/*
> > @@ -229,7 +229,7 @@ find_secondary_sb(xfs_sb_t *rsb)
> >  	do_warn(_("\nattempting to find secondary superblock...\n"));
> >  
> >  	if (verify_sb_blocksize(rsb) == 0) {
> > -		skip = (__uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
> > +		skip = (uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
> >  		if (skip >= XFS_AG_MIN_BYTES && skip <= XFS_AG_MAX_BYTES)
> >  			retval = __find_secondary_sb(rsb, skip, skip);
> >  	}
> > @@ -343,7 +343,7 @@ sb_validate_ino_align(struct xfs_sb *sb)
> >  int
> >  verify_sb(char *sb_buf, xfs_sb_t *sb, int is_primary_sb)
> >  {
> > -	__uint32_t	bsize;
> > +	uint32_t	bsize;
> >  	int		i;
> >  	int		ret;
> >  
> > @@ -399,7 +399,7 @@ verify_sb(char *sb_buf, xfs_sb_t *sb, int is_primary_sb)
> >  		sb->sb_dblocks < XFS_MIN_DBLOCKS(sb))
> >  		return(XR_BAD_FS_SIZE_DATA);
> >  
> > -	if (sb->sb_agblklog != (__uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
> > +	if (sb->sb_agblklog != (uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
> >  		return(XR_BAD_FS_SIZE_DATA);
> >  
> >  	if (sb->sb_inodesize < XFS_DINODE_MIN_SIZE                     ||
> > diff --git a/repair/scan.c b/repair/scan.c
> > index b9ef4dc..447611a 100644
> > --- a/repair/scan.c
> > +++ b/repair/scan.c
> > @@ -42,13 +42,13 @@ struct aghdr_cnts {
> >  	xfs_agnumber_t	agno;
> >  	xfs_extlen_t	agffreeblks;
> >  	xfs_extlen_t	agflongest;
> > -	__uint64_t	agfbtreeblks;
> > -	__uint32_t	agicount;
> > -	__uint32_t	agifreecount;
> > -	__uint64_t	fdblocks;
> > -	__uint64_t	usedblocks;
> > -	__uint64_t	ifreecount;
> > -	__uint32_t	fibtfreecount;
> > +	uint64_t	agfbtreeblks;
> > +	uint32_t	agicount;
> > +	uint32_t	agifreecount;
> > +	uint64_t	fdblocks;
> > +	uint64_t	usedblocks;
> > +	uint64_t	ifreecount;
> > +	uint32_t	fibtfreecount;
> >  };
> >  
> >  void
> > @@ -70,10 +70,10 @@ scan_sbtree(
> >  				xfs_agnumber_t		agno,
> >  				int			suspect,
> >  				int			isroot,
> > -				__uint32_t		magic,
> > +				uint32_t		magic,
> >  				void			*priv),
> >  	int		isroot,
> > -	__uint32_t	magic,
> > +	uint32_t	magic,
> >  	void		*priv,
> >  	const struct xfs_buf_ops *ops)
> >  {
> > @@ -110,23 +110,23 @@ scan_lbtree(
> >  				xfs_fsblock_t		bno,
> >  				xfs_ino_t		ino,
> >  				xfs_rfsblock_t		*tot,
> > -				__uint64_t		*nex,
> > +				uint64_t		*nex,
> >  				blkmap_t		**blkmapp,
> >  				bmap_cursor_t		*bm_cursor,
> >  				int			isroot,
> >  				int			check_dups,
> >  				int			*dirty,
> > -				__uint64_t		magic),
> > +				uint64_t		magic),
> >  	int		type,
> >  	int		whichfork,
> >  	xfs_ino_t	ino,
> >  	xfs_rfsblock_t	*tot,
> > -	__uint64_t	*nex,
> > +	uint64_t	*nex,
> >  	blkmap_t	**blkmapp,
> >  	bmap_cursor_t	*bm_cursor,
> >  	int		isroot,
> >  	int		check_dups,
> > -	__uint64_t	magic,
> > +	uint64_t	magic,
> >  	const struct xfs_buf_ops *ops)
> >  {
> >  	xfs_buf_t	*bp;
> > @@ -179,13 +179,13 @@ scan_bmapbt(
> >  	xfs_fsblock_t		bno,
> >  	xfs_ino_t		ino,
> >  	xfs_rfsblock_t		*tot,
> > -	__uint64_t		*nex,
> > +	uint64_t		*nex,
> >  	blkmap_t		**blkmapp,
> >  	bmap_cursor_t		*bm_cursor,
> >  	int			isroot,
> >  	int			check_dups,
> >  	int			*dirty,
> > -	__uint64_t		magic)
> > +	uint64_t		magic)
> >  {
> >  	int			i;
> >  	int			err;
> > @@ -548,7 +548,7 @@ scan_allocbt(
> >  	xfs_agnumber_t		agno,
> >  	int			suspect,
> >  	int			isroot,
> > -	__uint32_t		magic,
> > +	uint32_t		magic,
> >  	void			*priv)
> >  {
> >  	struct aghdr_cnts	*agcnts = priv;
> > @@ -930,7 +930,7 @@ scan_rmapbt(
> >  	xfs_agnumber_t		agno,
> >  	int			suspect,
> >  	int			isroot,
> > -	__uint32_t		magic,
> > +	uint32_t		magic,
> >  	void			*priv)
> >  {
> >  	const char		*name = "rmap";
> > @@ -1233,7 +1233,7 @@ scan_refcbt(
> >  	xfs_agnumber_t		agno,
> >  	int			suspect,
> >  	int			isroot,
> > -	__uint32_t		magic,
> > +	uint32_t		magic,
> >  	void			*priv)
> >  {
> >  	const char		*name = "refcount";
> > @@ -1939,7 +1939,7 @@ scan_inobt(
> >  	xfs_agnumber_t		agno,
> >  	int			suspect,
> >  	int			isroot,
> > -	__uint32_t		magic,
> > +	uint32_t		magic,
> >  	void			*priv)
> >  {
> >  	struct aghdr_cnts	*agcnts = priv;
> > @@ -2176,7 +2176,7 @@ validate_agf(
> >  	struct aghdr_cnts	*agcnts)
> >  {
> >  	xfs_agblock_t		bno;
> > -	__uint32_t		magic;
> > +	uint32_t		magic;
> >  
> >  	bno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]);
> >  	if (bno != 0 && verify_agbno(mp, agno, bno)) {
> > @@ -2274,7 +2274,7 @@ validate_agi(
> >  {
> >  	xfs_agblock_t		bno;
> >  	int			i;
> > -	__uint32_t		magic;
> > +	uint32_t		magic;
> >  
> >  	bno = be32_to_cpu(agi->agi_root);
> >  	if (bno != 0 && verify_agbno(mp, agno, bno)) {
> > @@ -2499,10 +2499,10 @@ scan_ags(
> >  	int			scan_threads)
> >  {
> >  	struct aghdr_cnts *agcnts;
> > -	__uint64_t	fdblocks = 0;
> > -	__uint64_t	icount = 0;
> > -	__uint64_t	ifreecount = 0;
> > -	__uint64_t	usedblocks = 0;
> > +	uint64_t	fdblocks = 0;
> > +	uint64_t	icount = 0;
> > +	uint64_t	ifreecount = 0;
> > +	uint64_t	usedblocks = 0;
> >  	xfs_agnumber_t	i;
> >  	work_queue_t	wq;
> >  
> > diff --git a/repair/scan.h b/repair/scan.h
> > index ea8c0bf..9bbe1e6 100644
> > --- a/repair/scan.h
> > +++ b/repair/scan.h
> > @@ -30,23 +30,23 @@ int scan_lbtree(
> >  				xfs_fsblock_t		bno,
> >  				xfs_ino_t		ino,
> >  				xfs_rfsblock_t		*tot,
> > -				__uint64_t		*nex,
> > +				uint64_t		*nex,
> >  				struct blkmap		**blkmapp,
> >  				bmap_cursor_t		*bm_cursor,
> >  				int			isroot,
> >  				int			check_dups,
> >  				int			*dirty,
> > -				__uint64_t		magic),
> > +				uint64_t		magic),
> >  	int		type,
> >  	int		whichfork,
> >  	xfs_ino_t	ino,
> >  	xfs_rfsblock_t	*tot,
> > -	__uint64_t	*nex,
> > +	uint64_t	*nex,
> >  	struct blkmap	**blkmapp,
> >  	bmap_cursor_t	*bm_cursor,
> >  	int		isroot,
> >  	int		check_dups,
> > -	__uint64_t	magic,
> > +	uint64_t	magic,
> >  	const struct xfs_buf_ops *ops);
> >  
> >  int scan_bmapbt(
> > @@ -57,13 +57,13 @@ int scan_bmapbt(
> >  	xfs_fsblock_t		bno,
> >  	xfs_ino_t		ino,
> >  	xfs_rfsblock_t		*tot,
> > -	__uint64_t		*nex,
> > +	uint64_t		*nex,
> >  	struct blkmap		**blkmapp,
> >  	bmap_cursor_t		*bm_cursor,
> >  	int			isroot,
> >  	int			check_dups,
> >  	int			*dirty,
> > -	__uint64_t		magic);
> > +	uint64_t		magic);
> >  
> >  void
> >  scan_ags(
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> ---end quoted text---
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-22 20:46             ` Chris Murphy
@ 2017-05-23  3:56               ` Chris Murphy
  2017-05-23  4:04                 ` Eric Sandeen
  2017-05-24  3:19               ` Dave Chinner
  2017-05-24  6:22               ` Chris Murphy
  2 siblings, 1 reply; 27+ messages in thread
From: Chris Murphy @ 2017-05-23  3:56 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Dave Chinner, Darrick J. Wong, xfs, Eric Sandeen

On Mon, May 22, 2017 at 2:46 PM, Chris Murphy <lists@colorremedies.com> wrote:

> Second, I have only been able to reproduce this problem with grubby +
> XFS.

OK so this is just on Fedora/RH systems, which is the example case I
have. The kernel RPM is running a script called new-kernel-pkg which
is part of grubby. It's found here:

https://github.com/rhinstaller/grubby/blob/master/new-kernel-pkg

# make sure changes make it to the disk.
# if /boot is a mountpoint, force the meta data on disk
# to by-pass writeback delay.
# PPC64LE-only to deal with Petitboot issues
if [ "$ARCH" = "ppc64le" ]; then
    sync && mountpoint -q /boot && fsfreeze -f /boot && fsfreeze -u /boot
fi


So why only Petitboot on ppc64 is considered to need this?

Also I put zipl in the bootloader category that doesn't need to be totally
reinstalled, which is incorrect it's more like lilo. I guess I was thinking of
yaboot. In any case the main point remains that the common
bootloaders being used these days depend only on modification of a
bootloader configuration file via the file system that file is located
on.


-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-23  3:56               ` Chris Murphy
@ 2017-05-23  4:04                 ` Eric Sandeen
  2017-05-23 11:44                   ` Dave Chinner
  0 siblings, 1 reply; 27+ messages in thread
From: Eric Sandeen @ 2017-05-23  4:04 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Dave Chinner, Darrick J. Wong, xfs

On 5/22/17 10:56 PM, Chris Murphy wrote:
> On Mon, May 22, 2017 at 2:46 PM, Chris Murphy <lists@colorremedies.com> wrote:
> 
>> Second, I have only been able to reproduce this problem with grubby +
>> XFS.
> 
> OK so this is just on Fedora/RH systems, which is the example case I
> have. The kernel RPM is running a script called new-kernel-pkg which
> is part of grubby. It's found here:
> 
> https://github.com/rhinstaller/grubby/blob/master/new-kernel-pkg
> 
> # make sure changes make it to the disk.
> # if /boot is a mountpoint, force the meta data on disk
> # to by-pass writeback delay.
> # PPC64LE-only to deal with Petitboot issues
> if [ "$ARCH" = "ppc64le" ]; then
>     sync && mountpoint -q /boot && fsfreeze -f /boot && fsfreeze -u /boot
> fi
> 
> 
> So why only Petitboot on ppc64 is considered to need this?

because petitboot essentially a full kernel & userspace, and it is
(may be?) a different endianness than the os and the filesystem it's booting...
so normally it actually /could/ replay the log, but it can't due to the
different endianness.  So, freeze / unfreeze to quiesce, and then
petitboot does mount -o norecovery to ignore the unmount record we leave
lying around on a frozen fs.

Hacks upon hacks.

-Eric

> Also I put zipl in the bootloader category that doesn't need to be totally
> reinstalled, which is incorrect it's more like lilo. I guess I was thinking of
> yaboot. In any case the main point remains that the common
> bootloaders being used these days depend only on modification of a
> bootloader configuration file via the file system that file is located
> on.
> 
> 


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-23  4:04                 ` Eric Sandeen
@ 2017-05-23 11:44                   ` Dave Chinner
  0 siblings, 0 replies; 27+ messages in thread
From: Dave Chinner @ 2017-05-23 11:44 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Chris Murphy, Darrick J. Wong, xfs

On Mon, May 22, 2017 at 11:04:54PM -0500, Eric Sandeen wrote:
> On 5/22/17 10:56 PM, Chris Murphy wrote:
> > On Mon, May 22, 2017 at 2:46 PM, Chris Murphy <lists@colorremedies.com> wrote:
> > 
> >> Second, I have only been able to reproduce this problem with grubby +
> >> XFS.
> > 
> > OK so this is just on Fedora/RH systems, which is the example case I
> > have. The kernel RPM is running a script called new-kernel-pkg which
> > is part of grubby. It's found here:
> > 
> > https://github.com/rhinstaller/grubby/blob/master/new-kernel-pkg
> > 
> > # make sure changes make it to the disk.
> > # if /boot is a mountpoint, force the meta data on disk
> > # to by-pass writeback delay.
> > # PPC64LE-only to deal with Petitboot issues
> > if [ "$ARCH" = "ppc64le" ]; then
> >     sync && mountpoint -q /boot && fsfreeze -f /boot && fsfreeze -u /boot
> > fi
> > 
> > 
> > So why only Petitboot on ppc64 is considered to need this?

> because petitboot essentially a full kernel & userspace, and it is
> (may be?) a different endianness than the os and the filesystem it's booting...
> so normally it actually /could/ replay the log, but it can't due to the
> different endianness.  So, freeze / unfreeze to quiesce, and then
> petitboot does mount -o norecovery to ignore the unmount record we leave
> lying around on a frozen fs.

Actually, IIUC what Stewart told me at LCA earlier this year, what
petitboot does now is far more convoluted and whacky than mount -o
norecovery. It overlays a write-capturing ram disk on top of the
block device, mounts the filesystem and performs log recovery.  All
writes from log recovery go into the ram disk so it never modifies
the underlying block device. It then traverses the recovered
filesystem to find the kernel images, and once they are found it
boots from them, throwing away the ramdisk that contained the
recovered changes from the log.

> Hacks upon hacks.

It's hacks all the way down....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-22 20:46             ` Chris Murphy
  2017-05-23  3:56               ` Chris Murphy
@ 2017-05-24  3:19               ` Dave Chinner
  2017-05-24  8:06                 ` Chris Murphy
  2017-05-24  6:22               ` Chris Murphy
  2 siblings, 1 reply; 27+ messages in thread
From: Dave Chinner @ 2017-05-24  3:19 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Darrick J. Wong, xfs, Eric Sandeen

On Mon, May 22, 2017 at 02:46:42PM -0600, Chris Murphy wrote:
> On Sun, May 21, 2017 at 8:01 PM, Dave Chinner <david@fromorbit.com> wrote:
> > On Fri, May 19, 2017 at 02:00:40PM -0700, Darrick J. Wong wrote:
> >> On Fri, May 19, 2017 at 01:09:31PM -0600, Chris Murphy wrote:
> >> > On Thu, May 18, 2017 at 4:30 PM, Darrick J. Wong
> >> > <darrick.wong@oracle.com> wrote:
> >> > > On Thu, May 18, 2017 at 06:34:05PM +1000, Dave Chinner wrote:
> >> > >> On Wed, May 17, 2017 at 06:32:42PM -0700, Darrick J. Wong wrote:
> >> > >> > Apparently there are certain system software configurations that do odd
> >> > >> > things like update the kernel and reboot without umounting the /boot fs
> >> > >> > or remounting it readonly, either of which would push all the AIL items
> >> > >> > out to disk.  As a result, a subsequent invocation of something like
> >> > >> > grub (which has a frightening willingness to read a fs with a dirty log)
> >> > >> > can read stale disk contents and/or miss files the metadata for which
> >> > >> > have been written to the log but not checkpointed into the filesystem.
> >> > >>
> >> > >> > Granted, most of the time /boot is a separate partition and
> >> > >> > systemd/sysvinit/whatever actually /do/ unmount /boot before rebooting.
> >> > >> > This "fix" is only needed for people who have one giant filesystem.
> >> > >>
> >> > >> Let me guess the series of events: grub calls "sync" and says "I'm
> >> > >
> >> > > dpkg/rpm/systemd/CABEXTRACT.EXE/whatever, but yes :)
> >> >
> >> >
> >> > It has nothing to do with GRUB. The exact same problem would happen
> >> > regardless of bootloader because the thing writing out bootloader
> >> > configuration prior to reboot is grubby, which is not at all in any
> >> > way related to GRUB.
> >
> > Chris, I've told you previously this is wrong (it's incorrect for
> > lilo) and too narrow (grubby is not the only update infrastructure
> > around), but I'll repeat it again because we need to move past your
> > single-distro focus on grubby and discuss the underlying problems.
> 
> 
> And I'm trying to get you to move past your ancient legacy bootloader
> focus and discuss things that matter in 2017.
> 
> First, nothing works like LILO, not even ELILO works like LILO.

Yeah, Elilo just used the lilo config file format and parser and
threw everyhting else away. I learnt how simple it is when I first
started working on ia64 machines back in 2004. Or was it 2005? It's
so long ago now I can't remember exactly.

> Second, I have only been able to reproduce this problem with grubby +
> XFS. If I manually do grub2-mkconfig + reboot -f instead, the problem
> does not happen. It might be that I'm too slow, and the marginal
> amount of extra time permits the new grub.cfg to fully commit, but I
> don't know.

Yup, those are typical writeback/reboot race symptoms.

I think Darrick's traces also hinted at the possibility that
grub2-mkconfig doesn't run sync at the correct time so the new
config file may not have even made it to disk and so it may be that
you are seeing it boot from the old config which was still valid...

> Third, basic bootloader concepts:
> 
> The bootloader is the executable that's loaded by the firmware after POST.

> The bootloader installer is not the bootloader. /sbin/lilo,

Well, yes, it's usually obvious which bootloader part is being
discussed from the context of the discussion. But seeing as you seem
to have trouble with this sort of thing, I've taken the time to
specify which one I'm talking about...

> /sbin/extlinux, /sbin/grub-install are not bootloaders, they are
> bootloader installers. Only lilo totally reinstalls the bootloader
> binary when configurations change. GRUB, extlinux, uboot, zipl don't
> do that. Their configuration files change and that's it, and they do
> not depend on boot sectors for this,

Sure, but they still all depend on writing their bootloader
executable to the boot sector to be able to bootstrap the boot
process.  They are no different to LILO in this respect - the only
difference is that LILO also writes a pointer to the pre-processed
boot config into the boot sector...

> they don't write outside the file
> system to the drive like lilo.

Hmmm - I demonstrated this assertion to be false in the email you
replied to. You've used this reasoning to repeatedly dismiss my
comments with no other technical information, so I hope you just
misread/misunderstood my reply. I'll try again to make it absolutely
clear how lilo works below, because.....

> They depend on the file system.

.... all the bootloaders (except ELILO) depend on the filesystem to
provide them with the physical block mapping information needed to
read the kernel/initramfs to boot them.  The only real difference is
how they get that physical location information. To recap:

The Lilo installer gets the physical location information from the
filesystem via the OS provided FIBMAP ioctl(), which it then writes
it into a file in the filesysetm (boot.map), which it then it maps
with FIBMAP and writes that map into the boot sector on the block
device.  At no point does it "go around the filesystem" to obtain or
write this information to stable storage for the bootloader
executable to use. The bootloader executable then just reads the
block map information directly from the block device to load the
kernel.

The grub installer writes a config file and that's about it. On
boot, the stage 1 loader in the boot sector bootstraps
the larger stage 2 loader. That then loads all the modules needed to
probe the booting block device contents and load the modules needed
to traverse the metadata structure it contains to find the block
map/extent list of the config file.  Then it decodes the block map,
reads the config file direct from the block device and parses it. It
then repeats this metadata traversal and extent list decoding for
each file it needs to read to boot.

IOWs, the information they use is exactly the same, but LILO avoids
all the bootloader executable complexity by doing all the mapping
work n the installer through generic, filesystem agnostic OS
interfaces before reboot. 

In contrast, the "parse the block device" architecture of grub and
similar bootloaders ensures that the bootloader executable is locked
into an endless game of whack-a-mole as filesystems, volume managers
and other storage management applications change formats and
behaviours.....

> > However, IMO problem does indeed lie with the bootloader and not the
> > distro packaging mechanism/scripts, and so we need to talk a bit out
> > the architectural differences between bootloaders like lilo and
> > grub/petitboot and why I consider update durability to be something
> > the bootloader needs to provide, not thrid party packagers or the
> > init system.
> 
> Either the bootloader needs to learn how to read dirty logs,

I don't think anyone wants to expend the time and effort needed to
do this for each filesystem that the grub bootloader supports,
especially as it is not necessary.

> or there
> can be no dirty log entries related to three things: kernel,
> initramfs, and bootloader configuration. If any of those three things
> are not fully committed to the file system metadata,  the bootloader
> will fail to find them.

Yup - I've been trying to tell you that these are the exact
guarantees that freezing the fs will provide the bootloader
installer....

> If GRUB or grubby are not being used, then the bootloader
> configuration file is most likely modified by a script in the kernel
> package. How do you avoid burdening the kernel package from update
> durability when it is responsible for writing the kernel, initramfs,
> and the third most likely thing to modify the bootloader
> configuration?

Solved problem via post-inst package scripts.

$ sudo apt-get install linux-image-amd64
....
Preparing to unpack .../linux-image-4.9.0-3-amd64_4.9.25-1_amd64.deb ...
Unpacking linux-image-4.9.0-3-amd64 (4.9.25-1) ...
Preparing to unpack .../linux-image-amd64_4.9+80_amd64.deb ...
Unpacking linux-image-amd64 (4.9+80) over (4.9+78) ...
Setting up linux-image-4.9.0-3-amd64 (4.9.25-1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.9.0-1-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-4.9.0-1-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-4.9.0-3-amd64
I: /initrd.img is now a symlink to boot/initrd.img-4.9.0-3-amd64
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.9.0-3-amd64
/etc/kernel/postinst.d/zz-runlilo:
Added Linux  *
Added Linux.old
Setting up linux-image-amd64 (4.9+80) ...
$

> > As a result, you do *not* need to call sync or freeze the filesystem
> > after running the lilo command because it has already guaranteed the
> > updated bootloader information is on stable storage.  And because
> > you have to run lilo to update the bootloader, distro package
> > managers *can't fuck it up* because the bootloader has full control
> > of the update process.
> 
> Haha. Well it can't fuck it up because it's doing a total end run
> around the file system.

FYI: the canonical example of "doing a total end run around the
filesystem" is to write your own filesystem parsers to directly walk
filesystem structures on a block device without going through the
supported OS filesystem channels for accessing that filesystem
information.

> Actually GRUB has a functional equivalent, it's just that it's not the
> upstream default, and no distro appears to want to use it by default:

IIRC, that's the "filesystem install" mode and there's good reason
it's not used: LBA 0 of the block device belongs to the filesystem
on that device, not the bootloader. Hence if you have a filesystem
that uses LBA 0 (e.g. XFS), using grub in this mode on that block
device will trash it and then you've got bigger problems....

The Lilo installer avoids this issue by asking the filesystem to map
the mapping file and writing it's LBA to the boot sector, hence
allowing the bootloader info to be placed anywhere in the block
device rather than being fixed to a hard coded location as per the
grub functionality...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-22 20:46             ` Chris Murphy
  2017-05-23  3:56               ` Chris Murphy
  2017-05-24  3:19               ` Dave Chinner
@ 2017-05-24  6:22               ` Chris Murphy
  2017-05-24  6:25                 ` Chris Murphy
  2017-05-25  0:03                 ` Dave Chinner
  2 siblings, 2 replies; 27+ messages in thread
From: Chris Murphy @ 2017-05-24  6:22 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Dave Chinner, Darrick J. Wong, xfs, Eric Sandeen

On Mon, May 22, 2017 at 2:46 PM, Chris Murphy <lists@colorremedies.com> wrote:

>
> Second, I have only been able to reproduce this problem with grubby +
> XFS. If I manually do grub2-mkconfig + reboot -f instead, the problem
> does not happen. It might be that I'm too slow, and the marginal
> amount of extra time permits the new grub.cfg to fully commit, but I
> don't know.

This is wrong. I retested this and 2 for 2 attempts I can reproduce
the problem either with grubby + reboot -f, or grub2-mkconfig + reboot
-f; so I must have been doing a normal reboot and somehow systemd
must've been successful at umounting or remount-ro'ing the file system
before the reboot.

But I did notice something else in both grubby and grub-mkconfig
cases. The initramfs and/or the kernel are variably either missing or
are zero length files. Here's an example from an updated system that
fails to boot due to zero length grub.cfg;

-rw-------. 1 root root 59650987 May 23 18:16
initramfs-0-rescue-a0269ef67a5f4c1ca97e0817ac1c4a6d.img
-rw-------. 1 root root 19764807 May 23 18:16 initramfs-4.11.0-2.fc26.x86_64.img
-rw-r--r--. 1 root root   182704 Feb 10 22:58 memtest86+-5.01
-rw-------. 1 root root  3548950 May  9 09:42 System.map-4.11.0-2.fc26.x86_64
-rw-------. 1 root root        0 May 15 13:46 System.map-4.11.1-300.fc26.x86_64
-rwxr-xr-x. 1 root root  7282776 May 23 18:16
vmlinuz-0-rescue-a0269ef67a5f4c1ca97e0817ac1c4a6d
-rwxr-xr-x. 1 root root  7282776 May  9 09:43 vmlinuz-4.11.0-2.fc26.x86_64
-rwxr-xr-x. 1 root root        0 May 15 13:46 vmlinuz-4.11.1-300.fc26.x86_64

-rw-rw-r--. 1 root root    0 May 23 18:44 grub.cfg

The proper initramfs is not there at all. The kernel is zero bytes.
And as previously reported the grub.cfg is zero bytes, hence failure
in grub. Upon normal mount, all of them appear as you'd expect.

If grubby and grub-mkconfig are to be blamed for not freezing the
system, on the basis that remount-ro or umount cannot be depended on,
then that means non-GRUB and non-grubby setups need their kernel
package postinstall script to fsfreeze.

Consider this scenario on UEFI. The grub.cfg on Fedora/RH systems goes
on the FAT EFI System partition (unlike upstream which calls for it
going on /boot), and it's got a pretty good chance of fully committing
even if systemd fails to remount-ro /boot. So we get a valid grub.cfg
pointing to a new kernel and initramfs that may not be locatable by
the bootloader because it can't read the dirty log. And again it
implicates the kernel package for not having done an fsfreeze, knowing
full well the limitations of the most common bootloaders which don't
read logs.

Something seems really out of order here. The kernel is installed
first, then the initramfs is built, grub.cfg.new is created, grub.cfg
is deleted, grub.cfg.new is renamed to grub.cfg. How is it the first
two items are in the dirty log, not fully committed to fs metadata;
but the grub.cfg is zero length? Why isn't the old one still there as
far as grub is concerned? If that were the case, the old kernel and
initramfs could be booted and then the log replayed to fix up
everything. The ordering here seems pretty screwy.



-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-24  6:22               ` Chris Murphy
@ 2017-05-24  6:25                 ` Chris Murphy
  2017-05-24 23:13                   ` Dave Chinner
  2017-05-25  0:03                 ` Dave Chinner
  1 sibling, 1 reply; 27+ messages in thread
From: Chris Murphy @ 2017-05-24  6:25 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Dave Chinner, Darrick J. Wong, xfs, Eric Sandeen

On Wed, May 24, 2017 at 12:22 AM, Chris Murphy <lists@colorremedies.com> wrote:
> Here's an example from an updated system that
> fails to boot due to zero length grub.cfg;
>
> -rw-------. 1 root root 59650987 May 23 18:16
> initramfs-0-rescue-a0269ef67a5f4c1ca97e0817ac1c4a6d.img
> -rw-------. 1 root root 19764807 May 23 18:16 initramfs-4.11.0-2.fc26.x86_64.img
> -rw-r--r--. 1 root root   182704 Feb 10 22:58 memtest86+-5.01
> -rw-------. 1 root root  3548950 May  9 09:42 System.map-4.11.0-2.fc26.x86_64
> -rw-------. 1 root root        0 May 15 13:46 System.map-4.11.1-300.fc26.x86_64
> -rwxr-xr-x. 1 root root  7282776 May 23 18:16
> vmlinuz-0-rescue-a0269ef67a5f4c1ca97e0817ac1c4a6d
> -rwxr-xr-x. 1 root root  7282776 May  9 09:43 vmlinuz-4.11.0-2.fc26.x86_64
> -rwxr-xr-x. 1 root root        0 May 15 13:46 vmlinuz-4.11.1-300.fc26.x86_64
>
> -rw-rw-r--. 1 root root    0 May 23 18:44 grub.cfg

FWIW this was mounted with -o ro,norecovery following an update that
resulted in the problem of hitting the grub prompt instead of a boot
menu.

-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-24  3:19               ` Dave Chinner
@ 2017-05-24  8:06                 ` Chris Murphy
  0 siblings, 0 replies; 27+ messages in thread
From: Chris Murphy @ 2017-05-24  8:06 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Chris Murphy, Darrick J. Wong, xfs, Eric Sandeen

On Tue, May 23, 2017 at 9:19 PM, Dave Chinner <david@fromorbit.com> wrote:



>
>> they don't write outside the file
>> system to the drive like lilo.
>
> Hmmm - I demonstrated this assertion to be false in the email you
> replied to.

They = grubby, grub-mkconfig. They do not write a block list outside
the file system like lilo does. All they do is modify the bootloader
configuration file, via the file system, they do not write directly to
the block device like lilo.


>
> The Lilo installer gets the physical location information from the
> filesystem via the OS provided FIBMAP ioctl(), which it then writes
> it into a file in the filesysetm (boot.map), which it then it maps
> with FIBMAP and writes that map into the boot sector on the block
> device.  At no point does it "go around the filesystem" to obtain or
> write this information to stable storage for the bootloader
> executable to use. The bootloader executable then just reads the
> block map information directly from the block device to load the
> kernel.


Yes it's basically a block list and it has no idea what a file system
is. i get that. When I say do an end run around the file system, I
mean it writes that block list direct to the block device, not as a
file in the file system. When the computer boots, it reads a sequence
of blocks without any understanding of the file system, again it goes
around the file system.


> The grub installer writes a config file and that's about it.

 grub-install only writes out boot.img to LBA 0, and core.img to the
MBR gap or bios-grub partition, and copies its additional support
modules from /usr to /boot. That's it. No configuration file is
created with grub-install.

grub-mkconfig only writes a config file, it does not modify any binary data.

LILO is combining these functions to make its blocklist, the whole
thing is written out each time.


 On
> boot, the stage 1 loader in the boot sector bootstraps
> the larger stage 2 loader. That then loads all the modules needed to
> probe the booting block device contents and load the modules needed
> to traverse the metadata structure it contains to find the block
> map/extent list of the config file.  Then it decodes the block map,
> reads the config file direct from the block device and parses it. It
> then repeats this metadata traversal and extent list decoding for
> each file it needs to read to boot.
>
> IOWs, the information they use is exactly the same, but LILO avoids
> all the bootloader executable complexity by doing all the mapping
> work n the installer through generic, filesystem agnostic OS
> interfaces before reboot.
>
> In contrast, the "parse the block device" architecture of grub and
> similar bootloaders ensures that the bootloader executable is locked
> into an endless game of whack-a-mole as filesystems, volume managers
> and other storage management applications change formats and
> behaviours.....


Yes, I'm aware.

Here is the difference. I'm accepting reality, and you keep
complaining about reality while pining for the glory days of LILO and
how everything else is Doing It Wrong (TM). It doesn't matter. We have
what we have.



>> > However, IMO problem does indeed lie with the bootloader and not the
>> > distro packaging mechanism/scripts, and so we need to talk a bit out
>> > the architectural differences between bootloaders like lilo and
>> > grub/petitboot and why I consider update durability to be something
>> > the bootloader needs to provide, not thrid party packagers or the
>> > init system.
>>
>> Either the bootloader needs to learn how to read dirty logs,
>
> I don't think anyone wants to expend the time and effort needed to
> do this for each filesystem that the grub bootloader supports,
> especially as it is not necessary.
>
>> or there
>> can be no dirty log entries related to three things: kernel,
>> initramfs, and bootloader configuration. If any of those three things
>> are not fully committed to the file system metadata,  the bootloader
>> will fail to find them.
>
> Yup - I've been trying to tell you that these are the exact
> guarantees that freezing the fs will provide the bootloader
> installer....

Except the bootloader can't do that. And yet you've been trying to pin
the entire problem on grub, and even if that's a generic term, it
isn't the bootloader generally that can do anything about this.

As far as I know, only GRUB comes with a utility for updating its
bootloader configuration file and it could be modified to do fsfreeze.
Other bootloaders depend on the kernel package postinstall script (I
assume) to modify the bootloader configuration. For sure extlinux
doesn't come with such a utility.




>
>> If GRUB or grubby are not being used, then the bootloader
>> configuration file is most likely modified by a script in the kernel
>> package. How do you avoid burdening the kernel package from update
>> durability when it is responsible for writing the kernel, initramfs,
>> and the third most likely thing to modify the bootloader
>> configuration?
>
> Solved problem via post-inst package scripts.

Ergo it is not the problem of the bootloader and no solution can be
found there like I've been saying this whole damn time.

OK so you're saying that every kernel package post install script
needs to do fsfreeze, rather than systemd doing it when remount-ro or
umount fail? Really? You really think they're all going to do this? I
would be shocked if it took systemd folks more than a month to
implement this, and shocked if it took less than a year for either
grubby or GRUB folks, let alone myriad kernel packaging teams to grok
the reason for this. I can just hear it now: What? sync doesn't do it?
Fuck!!! times every distro...

Yeah solved problem. Hilarious.






>> Haha. Well it can't fuck it up because it's doing a total end run
>> around the file system.
>
> FYI: the canonical example of "doing a total end run around the
> filesystem" is to write your own filesystem parsers to directly walk
> filesystem structures on a block device without going through the
> supported OS filesystem channels for accessing that filesystem
> information.

Yeah well you're coming at it from a certain perspective and I'm
coming at it from another. You see the code as the file system. When I
say the file system, i mean the file system volume, the actual
instance of a file system on a drive. That's what's being run around
by writing directly to blocks, and directly reading blocks.


>
>> Actually GRUB has a functional equivalent, it's just that it's not the
>> upstream default, and no distro appears to want to use it by default:
>
> IIRC, that's the "filesystem install" mode and there's good reason
> it's not used: LBA 0 of the block device belongs to the filesystem
> on that device, not the bootloader. Hence if you have a filesystem
> that uses LBA 0 (e.g. XFS), using grub in this mode on that block
> device will trash it and then you've got bigger problems....

No, the baking in of the configuration file is available regardless of
whether the installation happens to the whole block device or to a
partition/volume. The file system install mode is basically block
listing the core.img file rather than it being embedded in the MBR
gap. I am not a fan of this complexity but it still has a bunch of
fanboys from a bygone era...

The first sector of the block device, and each partition, is really
owned by the firmware on x86. It's the boot sector, has been since
ancient times. It is the only sectors the firmware will blindly read
at boot time. It's the original way multiboot worked, jump code in LBA
0 plus an active bit on a partition told the firmware to read and
execute the contents of the first sector at that partition's CHS
address. To switch OS's, you only needed to change the active bit to a
different partition.


-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-24  6:25                 ` Chris Murphy
@ 2017-05-24 23:13                   ` Dave Chinner
  0 siblings, 0 replies; 27+ messages in thread
From: Dave Chinner @ 2017-05-24 23:13 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Darrick J. Wong, xfs, Eric Sandeen

On Wed, May 24, 2017 at 12:25:10AM -0600, Chris Murphy wrote:
> On Wed, May 24, 2017 at 12:22 AM, Chris Murphy <lists@colorremedies.com> wrote:
> > Here's an example from an updated system that
> > fails to boot due to zero length grub.cfg;
> >
> > -rw-------. 1 root root 59650987 May 23 18:16
> > initramfs-0-rescue-a0269ef67a5f4c1ca97e0817ac1c4a6d.img
> > -rw-------. 1 root root 19764807 May 23 18:16 initramfs-4.11.0-2.fc26.x86_64.img
> > -rw-r--r--. 1 root root   182704 Feb 10 22:58 memtest86+-5.01
> > -rw-------. 1 root root  3548950 May  9 09:42 System.map-4.11.0-2.fc26.x86_64
> > -rw-------. 1 root root        0 May 15 13:46 System.map-4.11.1-300.fc26.x86_64
> > -rwxr-xr-x. 1 root root  7282776 May 23 18:16
> > vmlinuz-0-rescue-a0269ef67a5f4c1ca97e0817ac1c4a6d
> > -rwxr-xr-x. 1 root root  7282776 May  9 09:43 vmlinuz-4.11.0-2.fc26.x86_64
> > -rwxr-xr-x. 1 root root        0 May 15 13:46 vmlinuz-4.11.1-300.fc26.x86_64
> >
> > -rw-rw-r--. 1 root root    0 May 23 18:44 grub.cfg
> 
> FWIW this was mounted with -o ro,norecovery following an update that
> resulted in the problem of hitting the grub prompt instead of a boot
> menu.

Yup, if the files were sync()d then the file size updates are still
in the journal which has not been replayed. This is what we've been
saying is the problem all along and that a post-update freeze will
work around. If won't fix the fact that the updates are not
fail-safe (crash before freeze will still leave the config file
update in this state), but it will avoid the failure in the "update
successful, reboot without unmounting" scenario being used here.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot
  2017-05-24  6:22               ` Chris Murphy
  2017-05-24  6:25                 ` Chris Murphy
@ 2017-05-25  0:03                 ` Dave Chinner
  1 sibling, 0 replies; 27+ messages in thread
From: Dave Chinner @ 2017-05-25  0:03 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Darrick J. Wong, xfs, Eric Sandeen

On Wed, May 24, 2017 at 12:22:13AM -0600, Chris Murphy wrote:
> Something seems really out of order here.

Intentionally so.

Filesystems do screwy, complex things to extract maximum performance
whilst maintaining operational ordering.  We use log sequence
numbers to ensure the order of operations is maintained correctly in
the active portion of the journal, but we provide no ordering
guarantees for metadata writeback operations from the journal.

> The kernel is installed
> first, then the initramfs is built, grub.cfg.new is created, grub.cfg
> is deleted, grub.cfg.new is renamed to grub.cfg. How is it the first
> two items are in the dirty log, not fully committed to fs metadata;
> but the grub.cfg is zero length?  Why isn't the old one still there as
> far as grub is concerned? If that were the case, the old kernel and
> initramfs could be booted and then the log replayed to fix up
> everything. The ordering here seems pretty screwy.

By mounting "-o ro,norecovery" what you are seeing is evidence of
metadata being flushed from the journal in optimal IO order rather
than strict sequence order. The filesystem is not in a consistent
state if you haven't recovered the journal. Recovering the journal
(i.e. a normal mount) replays all the recorded changes and intents
in strict sequence order, hence providing the high level operational
ordering semantics we guarantee users.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-05-25  0:04 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-18  1:26 [RFCRAP 0/3?] xfs: OH GOD MY EYES! Darrick J. Wong
2017-05-18  1:30 ` [PATCH 1/3] xfs: remove double-underscore integer types Darrick J. Wong
2017-05-18  6:01   ` Dave Chinner
2017-05-18  6:21     ` Darrick J. Wong
2017-05-18  6:31     ` Christoph Hellwig
2017-05-18  1:31 ` [PATCH 2/3] xfsprogs: " Darrick J. Wong
2017-05-18  6:32   ` Christoph Hellwig
2017-05-23  2:48     ` Darrick J. Wong
2017-05-23  2:24   ` Eric Sandeen
2017-05-18  1:32 ` [PATCH 3/3] xfs: freeze rw filesystems just prior to reboot Darrick J. Wong
2017-05-18  6:28   ` Christoph Hellwig
2017-05-18  8:34   ` Dave Chinner
2017-05-18 22:30     ` Darrick J. Wong
2017-05-19 19:09       ` Chris Murphy
2017-05-19 21:00         ` Darrick J. Wong
2017-05-20  0:27           ` Chris Murphy
2017-05-22  2:07             ` Dave Chinner
     [not found]           ` <20170522020112.GV17542@dastard>
2017-05-22 20:46             ` Chris Murphy
2017-05-23  3:56               ` Chris Murphy
2017-05-23  4:04                 ` Eric Sandeen
2017-05-23 11:44                   ` Dave Chinner
2017-05-24  3:19               ` Dave Chinner
2017-05-24  8:06                 ` Chris Murphy
2017-05-24  6:22               ` Chris Murphy
2017-05-24  6:25                 ` Chris Murphy
2017-05-24 23:13                   ` Dave Chinner
2017-05-25  0:03                 ` Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.