From 919dbc78e863007cf5f04000e1ca42391f0221ea Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 3 Aug 2015 10:17:02 +1000 Subject: [PATCH] xfsprogs: use "unsigned short" instead of ushort Android's bionic libc doesn't define ushort. There isn't a real benefit (other than perhaps conciseness) to use ushort over "unsigned short", and it's only used in a handful of files in xfsprogs. So change over to using unsigned short everywhere. Signed-off-by: Theodore Ts'o Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- include/xfs_log_recover.h | 2 +- libxfs/logitem.c | 2 +- libxfs/xfs_ialloc.c | 4 ++-- libxfs/xfs_inode_buf.h | 4 ++-- libxfs/xfs_log_format.h | 4 ++-- logprint/log_misc.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/xfs_log_recover.h b/include/xfs_log_recover.h index 1c55ccbb3..2fea63d37 100644 --- a/include/xfs_log_recover.h +++ b/include/xfs_log_recover.h @@ -52,7 +52,7 @@ typedef struct xlog_recover { struct list_head r_itemq; /* q for items */ } xlog_recover_t; -#define ITEM_TYPE(i) (*(ushort *)(i)->ri_buf[0].i_addr) +#define ITEM_TYPE(i) (*(unsigned short *)(i)->ri_buf[0].i_addr) /* * This is the number of entries in the l_buf_cancel_table used during diff --git a/libxfs/logitem.c b/libxfs/logitem.c index ea85e7293..7e93f609e 100644 --- a/libxfs/logitem.c +++ b/libxfs/logitem.c @@ -122,7 +122,7 @@ xfs_buf_item_init( 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_len = (ushort)BTOBB(XFS_BUF_COUNT(bp)); + bip->bli_format.blf_len = (unsigned short)BTOBB(XFS_BUF_COUNT(bp)); XFS_BUF_SET_FSPRIVATE(bp, bip); } diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c index 05ecd0617..eebf5eed3 100644 --- a/libxfs/xfs_ialloc.c +++ b/libxfs/xfs_ialloc.c @@ -2333,7 +2333,7 @@ xfs_imap( imap->im_blkno = XFS_AGB_TO_DADDR(mp, agno, agbno); imap->im_len = XFS_FSB_TO_BB(mp, 1); - imap->im_boffset = (ushort)(offset << mp->m_sb.sb_inodelog); + imap->im_boffset = (unsigned short)(offset << mp->m_sb.sb_inodelog); return 0; } @@ -2361,7 +2361,7 @@ out_map: imap->im_blkno = XFS_AGB_TO_DADDR(mp, agno, cluster_agbno); imap->im_len = XFS_FSB_TO_BB(mp, blks_per_cluster); - imap->im_boffset = (ushort)(offset << mp->m_sb.sb_inodelog); + imap->im_boffset = (unsigned short)(offset << mp->m_sb.sb_inodelog); /* * If the inode number maps to a block outside the bounds diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index dd3803475..56bc65e44 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -28,8 +28,8 @@ struct xfs_icdinode; */ struct xfs_imap { xfs_daddr_t im_blkno; /* starting BB of inode chunk */ - ushort im_len; /* length in BBs of inode chunk */ - ushort im_boffset; /* inode offset in block in bytes */ + unsigned short im_len; /* length in BBs of inode chunk */ + unsigned short im_boffset; /* inode offset in block in bytes */ }; int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *, diff --git a/libxfs/xfs_log_format.h b/libxfs/xfs_log_format.h index 265314690..db8ceebf4 100644 --- a/libxfs/xfs_log_format.h +++ b/libxfs/xfs_log_format.h @@ -456,8 +456,8 @@ static inline uint xfs_icdinode_size(int version) typedef struct xfs_buf_log_format { unsigned short blf_type; /* buf log item type indicator */ unsigned short blf_size; /* size of this item */ - ushort blf_flags; /* misc state */ - ushort blf_len; /* number of blocks in this buf */ + 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 */ unsigned int blf_map_size; /* used size of data bitmap in words */ unsigned int blf_data_map[XFS_BLF_DATAMAP_SIZE]; /* dirty bitmap */ diff --git a/logprint/log_misc.c b/logprint/log_misc.c index 7eb9a607f..d76145c04 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -254,7 +254,7 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops) xfs_buf_log_format_t lbuf; int size, blen, map_size, struct_size; __be64 x, y; - ushort flags; + unsigned short flags; /* * memmove to ensure 8-byte alignment for the long longs in -- 2.39.5