xfs
[Top] [All Lists]

[PATCH 08/17] xfs: remove uchar_t/ushort_t/uint_t/ulong_t types

To: xfs@xxxxxxxxxxx
Subject: [PATCH 08/17] xfs: remove uchar_t/ushort_t/uint_t/ulong_t types
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 26 Jan 2009 02:31:44 -0500
References: <20090126073136.384490000@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.47-1
Just another set of types obsfucating the code, remove them.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- xfs.orig/fs/xfs/linux-2.6/xfs_super.c       2009-01-24 17:58:57.163785983 
+0100
+++ xfs/fs/xfs/linux-2.6/xfs_super.c    2009-01-25 06:19:23.173491868 +0100
@@ -180,7 +180,7 @@ xfs_parseargs(
        int                     dswidth = 0;
        int                     iosize = 0;
        int                     dmapi_implies_ikeep = 1;
-       uchar_t                 iosizelog = 0;
+       __uint8_t               iosizelog = 0;
 
        /*
         * Copy binary VFS mount flags we are interested in.
Index: xfs/fs/xfs/xfs_ag.h
===================================================================
--- xfs.orig/fs/xfs/xfs_ag.h    2009-01-21 21:03:27.838294778 +0100
+++ xfs/fs/xfs/xfs_ag.h 2009-01-24 18:40:10.116428891 +0100
@@ -223,8 +223,8 @@ typedef struct xfs_perag
                be32_to_cpu((a)->agf_levels[XFS_BTNUM_CNTi]), mp))
 #define        XFS_MIN_FREELIST_PAG(pag,mp)    \
        (XFS_MIN_FREELIST_RAW(          \
-               (uint_t)(pag)->pagf_levels[XFS_BTNUM_BNOi], \
-               (uint_t)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp))
+               (unsigned int)(pag)->pagf_levels[XFS_BTNUM_BNOi], \
+               (unsigned int)(pag)->pagf_levels[XFS_BTNUM_CNTi], mp))
 
 #define XFS_AGB_TO_FSB(mp,agno,agbno)  \
        (((xfs_fsblock_t)(agno) << (mp)->m_sb.sb_agblklog) | (agbno))
Index: xfs/fs/xfs/xfs_da_btree.c
===================================================================
--- xfs.orig/fs/xfs/xfs_da_btree.c      2009-01-24 18:13:02.655903952 +0100
+++ xfs/fs/xfs/xfs_da_btree.c   2009-01-24 18:40:10.117429298 +0100
@@ -1503,7 +1503,7 @@ xfs_da_path_shift(xfs_da_state_t *state,
  * This is implemented with some source-level loop unrolling.
  */
 xfs_dahash_t
-xfs_da_hashname(const uchar_t *name, int namelen)
+xfs_da_hashname(const __uint8_t *name, int namelen)
 {
        xfs_dahash_t hash;
 
Index: xfs/fs/xfs/xfs_da_btree.h
===================================================================
--- xfs.orig/fs/xfs/xfs_da_btree.h      2009-01-21 21:03:27.847295087 +0100
+++ xfs/fs/xfs/xfs_da_btree.h   2009-01-24 18:40:10.118428797 +0100
@@ -91,9 +91,9 @@ enum xfs_dacmp {
  * Structure to ease passing around component names.
  */
 typedef struct xfs_da_args {
-       const uchar_t   *name;          /* string (maybe not NULL terminated) */
+       const __uint8_t *name;          /* string (maybe not NULL terminated) */
        int             namelen;        /* length of string (maybe no NULL) */
-       uchar_t         *value;         /* set of bytes (maybe contain NULLs) */
+       __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 */
@@ -251,7 +251,7 @@ xfs_daddr_t xfs_da_reada_buf(struct xfs_
 int    xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
                                          xfs_dabuf_t *dead_buf);
 
-uint xfs_da_hashname(const uchar_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 char *name, int len);
 
Index: xfs/fs/xfs/xfs_log_priv.h
===================================================================
--- xfs.orig/fs/xfs/xfs_log_priv.h      2009-01-21 21:03:27.863295380 +0100
+++ xfs/fs/xfs/xfs_log_priv.h   2009-01-24 18:40:10.118428797 +0100
@@ -359,7 +359,7 @@ typedef struct xlog_in_core {
        int                     ic_size;
        int                     ic_offset;
        int                     ic_bwritecnt;
-       ushort_t                ic_state;
+       unsigned short          ic_state;
        char                    *ic_datap;      /* pointer to iclog data */
 #ifdef XFS_LOG_TRACE
        struct ktrace           *ic_trace;
Index: xfs/fs/xfs/xfs_log_recover.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log_recover.c   2009-01-21 21:03:27.864295019 +0100
+++ xfs/fs/xfs/xfs_log_recover.c        2009-01-25 06:19:48.044397387 +0100
@@ -192,11 +192,11 @@ xlog_header_check_dump(
 
        cmn_err(CE_DEBUG, "%s:  SB : uuid = ", __func__);
        for (b = 0; b < 16; b++)
-               cmn_err(CE_DEBUG, "%02x", ((uchar_t *)&mp->m_sb.sb_uuid)[b]);
+               cmn_err(CE_DEBUG, "%02x", ((__uint8_t *)&mp->m_sb.sb_uuid)[b]);
        cmn_err(CE_DEBUG, ", fmt = %d\n", XLOG_FMT);
        cmn_err(CE_DEBUG, "    log : uuid = ");
        for (b = 0; b < 16; b++)
-               cmn_err(CE_DEBUG, "%02x",((uchar_t *)&head->h_fs_uuid)[b]);
+               cmn_err(CE_DEBUG, "%02x", ((__uint8_t *)&head->h_fs_uuid)[b]);
        cmn_err(CE_DEBUG, ", fmt = %d\n", be32_to_cpu(head->h_fmt));
 }
 #else
Index: xfs/fs/xfs/xfs_types.h
===================================================================
--- xfs.orig/fs/xfs/xfs_types.h 2009-01-22 00:54:49.351809660 +0100
+++ xfs/fs/xfs/xfs_types.h      2009-01-24 18:40:10.120456918 +0100
@@ -21,14 +21,6 @@
 #ifdef __KERNEL__
 
 /*
- * POSIX Extensions
- */
-typedef unsigned char          uchar_t;
-typedef unsigned short         ushort_t;
-typedef unsigned int           uint_t;
-typedef unsigned long          ulong_t;
-
-/*
  * Additional type declarations for XFS
  */
 typedef signed char            __int8_t;

<Prev in Thread] Current Thread [Next in Thread>