typedef cleanups for xfsprogs
These looks similar to the kernel version send a few days earlier, but there isn't actually any overlap.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 1/8 xfsprogs: remove register keywords
--- libhandle/jdm.c | 8 ++-- repair/avl.c | 130 ++++++++++++++++++++++++++--------------------------- repair/avl.h | 8 ++-- repair/avl64.c | 136 ++++++++++++++++++++++++++++---------------------------- repair/avl64.h | 6 +-- rtcp/xfs_rtcp.c | 2 +- 6 files changed, 145 insertions(+), 145 deletions(-)
libhandle/jdm.c +4 -4
@@ -111,7 +111,7 @@ jdm_delete_filehandle( jdm_filehandle_t *handlep, size_t hlen )intgen_t jdm_open (jdm_fshandle_t *fshp,xfs_bstat_t *statp,intgen_t oflags ) { - registerfshandle_t *fshandlep = (fshandle_t * )fshp; +fshandle_t *fshandlep = (fshandle_t * )fshp;filehandle_t filehandle;intgen_t fd;
@@ -127,7 +127,7 @@ jdm_readlink( jdm_fshandle_t *fshp, xfs_bstat_t *statp, char *bufp, size_t bufsz ) { - registerfshandle_t *fshandlep = (fshandle_t * )fshp; +fshandle_t *fshandlep = (fshandle_t * )fshp;filehandle_t filehandle;intgen_t rval;
@@ -144,7 +144,7 @@ jdm_attr_multi( jdm_fshandle_t *fshp, xfs_bstat_t *statp, char *bufp, int rtrvcnt, int flags) { - registerfshandle_t *fshandlep = (fshandle_t * )fshp; +fshandle_t *fshandlep = (fshandle_t * )fshp;filehandle_t filehandle;int rval;
@@ -162,7 +162,7 @@ jdm_attr_list( jdm_fshandle_t *fshp, char *bufp, size_t bufsz, int flags, struct attrlist_cursor *cursor) { - register fshandle_t *fshandlep = ( fshandle_t * )fshp; + fshandle_t *fshandlep = ( fshandle_t * )fshp;filehandle_t filehandle;int rval;
repair/avl.c +65 -65
249 lines not on this page · raw message
repair/avl.h +4 -4
@@ -89,7 +89,7 @@ avl_findrange( avltree_desc_t *tree, __psunsigned_t value) { - registeravlnode_t *np = tree->avl_root; +avlnode_t *np = tree->avl_root;while (np) {if (value <AVL_START (tree, np)) {
@@ -128,9 +128,9 @@ avl_findadjacent(void avl_findranges ( - registeravltree_desc_t *tree, - register__psunsigned_t start, - register__psunsigned_t end, +avltree_desc_t *tree, +__psunsigned_t start, +__psunsigned_t end,avlnode_t **startp,avlnode_t **endp);
repair/avl64.c +68 -68
262 lines not on this page · raw message
repair/avl64.h +3 -3
@@ -112,9 +112,9 @@ avl64_findadjacent(void avl64_findranges ( - registeravl64tree_desc_t *tree, - register__uint64_t start, - register__uint64_t end, +avl64tree_desc_t *tree, +__uint64_t start, +__uint64_t end,avl64node_t **startp,avl64node_t **endp);
rtcp/xfs_rtcp.c +1 -1
@@ -34,7 +34,7 @@ usage(void)int main (int argc,char **argv) { - registerint c, i, r, errflg =0 ; +int c, i, r, errflg =0 ;struct stat64 s2;int extsize = -1 ;
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/8 xfsprogs: remove __psint_t and __psunsigned_t
In reply to Christoph HellwigReplace them with the standards conform intptr_t and uintptr_t. Note that many uses look rather questionable cargo-cult avoidance of pointer arithmetics, but let's leave that for now and look at it separately.
--- db/bit.c | 8 ++++---- db/check.c | 6 +++--- db/field.c | 8 ++++---- db/field.h | 6 +++--- include/platform_defs.h.in | 36 ------------------------------------ logprint/log_misc.c | 2 +- m4/package_types.m4 | 28 ---------------------------- repair/agheader.c | 2 +- repair/attr_repair.c | 6 +++--- repair/avl.c | 36 ++++++++++++++++++------------------ repair/avl.h | 18 +++++++++--------- repair/dir2.c | 16 ++++++++-------- repair/incore_ext.c | 20 ++++++++++---------- repair/incore_ino.c | 8 ++++---- repair/phase6.c | 30 +++++++++++++++--------------- 15 files changed, 83 insertions(+), 147 deletions(-)
db/bit.c +4 -4
@@ -79,24 +79,24 @@ getbitval( p = (char *)obj +byteize (bitoff); bit =bitoffs (bitoff); signext = (flags &BVSIGNED ) !=0 ; - z4 = ((__psint_t )p &0xf ) ==0 && bit ==0 ; + z4 = ((intptr_t )p &0xf ) ==0 && bit ==0 ;if (nbits ==64 && z4)return be64_to_cpu (*(__be64 *)p); - z3 = ((__psint_t )p &0x7 ) ==0 && bit ==0 ; + z3 = ((intptr_t )p &0x7 ) ==0 && bit ==0 ;if (nbits ==32 && z3) {if (signext)return (__s32 )be32_to_cpu (*(__be32 *)p);else return (__u32 )be32_to_cpu (*(__be32 *)p); } - z2 = ((__psint_t )p &0x3 ) ==0 && bit ==0 ; + z2 = ((intptr_t )p &0x3 ) ==0 && bit ==0 ;if (nbits ==16 && z2) {if (signext)return (__s16 )be16_to_cpu (*(__be16 *)p);else return (__u16 )be16_to_cpu (*(__be16 *)p); } - z1 = ((__psint_t )p &0x1 ) ==0 && bit ==0 ; + z1 = ((intptr_t )p &0x1 ) ==0 && bit ==0 ;if (nbits ==8 && z1) {if (signext)return *(__s8 *)p;
db/check.c +3 -3
@@ -3436,8 +3436,8 @@ process_sf_dir_v2( sfe =xfs_dir2_sf_firstentry (sf); offset =M_DIROPS (mp)->data_first_offset;for (i = sf->count -1 , i8 =0 ; i >=0 ; i--) { -if ((__psint_t )sfe +M_DIROPS (mp)->sf_entsize (sf, sfe->namelen) - - (__psint_t )sf >be64_to_cpu (dip->di_size)) { +if ((intptr_t )sfe +M_DIROPS (mp)->sf_entsize (sf, sfe->namelen) - + (intptr_t )sf >be64_to_cpu (dip->di_size)) {if (!sflag) dbprintf(_("dir %llu bad size in entry at %d\n"), id->ino,
@@ -3478,7 +3478,7 @@ process_sf_dir_v2(M_DIROPS (mp)->sf_entsize (sf, sfe->namelen); sfe =M_DIROPS (mp)->sf_nextentry (sf, sfe); } -if (i <0 && (__psint_t )sfe - (__psint_t )sf != +if (i <0 && (intptr_t )sfe - (intptr_t )sf !=be64_to_cpu (dip->di_size)) {if (!sflag) dbprintf(_("dir %llu size is %lld, should be %u\n"),
db/field.c +4 -4
@@ -373,10 +373,10 @@ bitoffset( abase = (f->flags &FLD_ABASE1 ) !=0 ;ASSERT (fa->ftyp == f->ftyp);ASSERT ((fa->arg &FTARG_SIZE ) ==0 ); -return (int )(__psint_t )f->offset + +return (int )(intptr_t )f->offset + (idx - abase) *fsize (f, obj, startoff, idx); }else -return (int )(__psint_t )f->offset; +return (int )(intptr_t )f->offset; }else return (*f->offset)(obj, startoff, idx); }
@@ -388,7 +388,7 @@ fcount( int startoff) {if (!(f->flags &FLD_COUNT )) -return (int )(__psint_t )f->count; +return (int )(intptr_t )f->count;else return (*f->count)(obj, startoff); }
@@ -421,7 +421,7 @@ fsize( fa = &ftattrtab[f->ftyp];ASSERT (fa->ftyp == f->ftyp);if (!(fa->arg &FTARG_SIZE )) -return (int )(__psint_t )fa->size; +return (int )(intptr_t )fa->size;else return (*fa->size)(obj, startoff, idx); }
db/field.h +3 -3
@@ -183,10 +183,10 @@ typedef enum fldt { } fldt_t;typedef int (*offset_fnc_t )(void *obj,int startoff,int idx); -#define OI (o) ((offset_fnc_t)(__psint_t)(o)) +#define OI (o) ((offset_fnc_t)(intptr_t)(o))typedef int (*count_fnc_t )(void *obj,int startoff); -#define CI (c) ((count_fnc_t)(__psint_t)(c)) +#define CI (c) ((count_fnc_t)(intptr_t)(c))#define C1 CI(1) typedef struct field
@@ -209,7 +209,7 @@ typedef struct field#define FLD_COUNT 16/* count value is a function pointer */ typedef int (*size_fnc_t )(void *obj,int startoff,int idx); -#define SI (s) ((size_fnc_t)(__psint_t)(s)) +#define SI (s) ((size_fnc_t)(intptr_t)(s)) typedef struct ftattr {
include/platform_defs.h.in +0 -36
@@ -87,42 +87,6 @@ typedef struct filldir filldir_t; #undef SIZEOF_CHAR_P #define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT) -/* Check if __psint_t is set to something meaningful */ -#undef HAVE___PSINT_T -#ifndef HAVE___PSINT_T -# if (SIZEOF_CHAR_P * CHAR_BIT) == 32 -typedef int __psint_t; -# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64 -# if BITS_PER_LONG == 64 -typedef long __psint_t; -# else -/* This is a very strange architecture, which has 64 bit pointers but */ -/* not 64 bit longs. So, just punt here and assume long long is OK. */ -typedef long long __psint_t; -# endif -# else -# error Unknown pointer size -# endif -#endif - -/* Check if __psunsigned_t is set to something meaningful */ -#undef HAVE___PSUNSIGNED_T -#ifndef HAVE___PSUNSIGNED_T -# if (SIZEOF_CHAR_P * CHAR_BIT) == 32 -typedef unsigned int __psunsigned_t; -# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64 -# if BITS_PER_LONG == 64 -typedef long __psunsigned_t; -# else -/* This is a very strange architecture, which has 64 bit pointers but */ -/* not 64 bit longs. So, just punt here and assume long long is OK. */ -typedef unsigned long long __psunsigned_t; -# endif -# else -# error Unknown pointer size -# endif -#endif - /* Check whether to define umode_t ourselves. */ #ifndef HAVE_UMODE_T typedef unsigned short umode_t;
logprint/log_misc.c +1 -1
@@ -929,7 +929,7 @@ xlog_print_record( } }else { read_len -= *read_type; - buf = (xfs_caddr_t)((__psint_t)(*partial_buf) + (__psint_t)(*read_type)); + buf = (xfs_caddr_t)((intptr_t )(*partial_buf) + (intptr_t )(*read_type)); ptr = *partial_buf; }if ((ret = (int )read (fd, buf, read_len)) ==-1 ) {
m4/package_types.m4 +0 -28
@@ -1,32 +1,4 @@ # -# Check if we have a type for the pointer's size integer (__psint_t) -# -AC_DEFUN([AC_TYPE_PSINT], - [ AC_MSG_CHECKING([for __psint_t ]) - AC_TRY_COMPILE([ -#include <sys/types.h> -#include <stdlib.h> -#include <stddef.h> - ], [ - __psint_t psint; - ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - -# -# Check if we have a type for the pointer's size unsigned (__psunsigned_t) -# -AC_DEFUN([AC_TYPE_PSUNSIGNED], - [ AC_MSG_CHECKING([for __psunsigned_t ]) - AC_TRY_COMPILE([ -#include <sys/types.h> -#include <stdlib.h> -#include <stddef.h> - ], [ - __psunsigned_t psuint; - ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - -# # Check if we have a type for __u32 # AC_DEFUN([AC_TYPE_U32],
repair/agheader.c +1 -1
@@ -305,7 +305,7 @@ secondary_sb_wack(* be set, and the latter is never updated past * the last field - just zap them both. */ -memset ((void *)((__psint_t )sb + size),0 , +memset ((void *)((intptr_t )sb + size),0 , mp->m_sb.sb_sectsize - size);memset (XFS_BUF_PTR (sbuf) + size,0 , mp->m_sb.sb_sectsize - size);
repair/attr_repair.c +3 -3
@@ -931,7 +931,7 @@ process_shortform_attr(_ ("removing attribute entry %d for inode %" PRIu64"\n" ), i, ino); tempentry = (xfs_attr_sf_entry_t *) - ((__psint_t ) currententry + + ((intptr_t ) currententry +XFS_ATTR_SF_ENTSIZE (currententry));memmove (currententry,tempentry,remainingspace); asf->hdr.count -=1 ;
@@ -946,7 +946,7 @@ process_shortform_attr( }/* Let's get ready for the next entry... */ - nextentry = (xfs_attr_sf_entry_t *)((__psint_t ) nextentry + + nextentry = (xfs_attr_sf_entry_t *)((intptr_t ) nextentry +XFS_ATTR_SF_ENTSIZE (currententry)); currentsize = currentsize +XFS_ATTR_SF_ENTSIZE (currententry);
@@ -1220,7 +1220,7 @@ process_leaf_attr_block( }/* mark the entry used */ - start = (__psint_t )entry - (__psint_t )leaf; + start = (intptr_t )entry - (intptr_t )leaf; stop = start +sizeof (xfs_attr_leaf_entry_t);if (set_da_freemap (mp, attr_freemap, start, stop)) { do_warn(
repair/avl.c +18 -18
@@ -69,8 +69,8 @@ avl_checktree( avlnode_t *root) {avlnode_t *nlast, *nnext, *np; -__psunsigned_t offset =0 ; -__psunsigned_t end; +uintptr_t offset =0 ; +uintptr_t end; nlast = nnext = root;
@@ -589,8 +589,8 @@ attach:avlnode_t *avl_findanyrange (avltree_desc_t *tree, -__psunsigned_t start, -__psunsigned_t end, +uintptr_t start, +uintptr_t end,int checklen) {avlnode_t *np = tree->avl_root;
@@ -660,10 +660,10 @@ avl_findanyrange(avlnode_t *avl_find (avltree_desc_t *tree, -__psunsigned_t value) +uintptr_t value) {avlnode_t *np = tree->avl_root; -__psunsigned_t nvalue; +uintptr_t nvalue;while (np) { nvalue =AVL_START (tree, np);
@@ -887,8 +887,8 @@ staticavlnode_t *avl_insert_find_growth (avltree_desc_t *tree, -__psunsigned_t start,/* range start at start, */ -__psunsigned_t end,/* exclusive */ +uintptr_t start,/* range start at start, */ +uintptr_t end,/* exclusive */ int *growthp)/* OUT */ {avlnode_t *root = tree->avl_root;
@@ -941,7 +941,7 @@ avl_insert_grow( int growth) {avlnode_t *nnext; -__psunsigned_t start =AVL_START (tree, newnode); +uintptr_t start =AVL_START (tree, newnode);if (growth ==AVL_BACK ) {
@@ -983,8 +983,8 @@ avl_insert( avlnode_t *newnode) {avlnode_t *np; -__psunsigned_t start =AVL_START (tree, newnode); -__psunsigned_t end =AVL_END (tree, newnode); +uintptr_t start =AVL_START (tree, newnode); +uintptr_t end =AVL_END (tree, newnode);int growth;ASSERT (newnode);
@@ -1138,16 +1138,16 @@ avlops_t avl_debug_ops = { avl_debug_end, } -static __psunsigned_t +static uintptr_t avl_debug_start (avlnode_t *node) { -return (__psunsigned_t )(struct avl_debug_node *)node->avl_start; +return (uintptr_t )(struct avl_debug_node *)node->avl_start; } -static __psunsigned_t +static uintptr_t avl_debug_end (avlnode_t *node) { -return (__psunsigned_t) +return (uintptr_t ) ((struct avl_debug_node *)node->avl_start + (struct avl_debug_node *)node->avl_size); }
@@ -1283,7 +1283,7 @@ main()avlnode_t *avl_findadjacent (avltree_desc_t *tree, -__psunsigned_t value, +uintptr_t value,int dir) {avlnode_t *np = tree->avl_root;
@@ -1357,8 +1357,8 @@ avl_findadjacent(void avl_findranges (avltree_desc_t *tree, -__psunsigned_t start, -__psunsigned_t end, +uintptr_t start, +uintptr_t end,avlnode_t **startp,avlnode_t **endp) {
repair/avl.h +9 -9
@@ -31,8 +31,8 @@ typedef struct avlnode {* avl-tree operations */ typedef struct avlops { -__psunsigned_t (*avl_start)(avlnode_t *); -__psunsigned_t (*avl_end)(avlnode_t *); +uintptr_t (*avl_start)(avlnode_t *); +uintptr_t (*avl_end)(avlnode_t *); }avlops_t ;#define AVL_START (tree, n) (*(tree)->avl_ops->avl_start)(n)
@@ -87,7 +87,7 @@ avl_init_tree(static inline avlnode_t *avl_findrange (avltree_desc_t *tree, -__psunsigned_t value) +uintptr_t value) {avlnode_t *np = tree->avl_root;
@@ -110,27 +110,27 @@ avl_findrange(avlnode_t *avl_find (avltree_desc_t *tree, -__psunsigned_t value); +uintptr_t value);avlnode_t *avl_findanyrange (avltree_desc_t *tree, -__psunsigned_t start, -__psunsigned_t end, +uintptr_t start, +uintptr_t end,int checklen);avlnode_t *avl_findadjacent (avltree_desc_t *tree, -__psunsigned_t value, +uintptr_t value,int dir);void avl_findranges (avltree_desc_t *tree, -__psunsigned_t start, -__psunsigned_t end, +uintptr_t start, +uintptr_t end,avlnode_t **startp,avlnode_t **endp);
repair/dir2.c +8 -8
@@ -669,7 +669,7 @@ process_sf_dir2_fixi8(int oldsize; newsfp = sfp; - oldsize = (__psint_t)*next_sfep - (__psint_t )sfp; + oldsize = (intptr_t )*next_sfep - (intptr_t )sfp; oldsfp =malloc (oldsize);if (oldsfp ==NULL ) {do_error (_ ("couldn't malloc dir2 shortform copy\n" ));
@@ -874,7 +874,7 @@ _("entry \"%*.*s\" in shortform directory %" PRIu64 " references %s inode %" PRIif (namelen ==0 ) { junkreason =_ ("is zero length" ); bad_sfnamelen =1 ; - }else if ((__psint_t ) sfep - (__psint_t ) sfp + + }else if ((intptr_t ) sfep - (intptr_t ) sfp +M_DIROPS (mp)->sf_entsize (sfp, sfep->namelen) > ino_dir_size) { junkreason =_ ("extends past end of dir" );
@@ -944,15 +944,15 @@ _("entry contains offset out of order in shortform dir %" PRIu64 "\n"), ino_dir_size -= tmp_elen; tmp_sfep = (xfs_dir2_sf_entry_t *) - ((__psint_t ) sfep + tmp_elen); - tmp_len = max_size - ((__psint_t ) tmp_sfep - - (__psint_t ) sfp); + ((intptr_t ) sfep + tmp_elen); + tmp_len = max_size - ((intptr_t ) tmp_sfep + - (intptr_t ) sfp);memmove (sfep, tmp_sfep, tmp_len); sfp->count -=1 ; num_entries--; -memset ((void *) ((__psint_t ) sfep + tmp_len),0 , +memset ((void *) ((intptr_t ) sfep + tmp_len),0 , tmp_elen);/*
@@ -990,7 +990,7 @@ _("would have junked entry \"%s\" in directory inode %" PRIu64 "\n"),* calculate size based on next_sfep. */ next_sfep = (tmp_sfep ==NULL ) - ? (xfs_dir2_sf_entry_t *) ((__psint_t) sfep + ? (xfs_dir2_sf_entry_t *) ((intptr_t) sfep + ((!bad_sfnamelen) ? M_DIROPS(mp)->sf_entsize(sfp, sfep->namelen) : M_DIROPS(mp)->sf_entsize(sfp, namelen)))
@@ -1045,7 +1045,7 @@ _("corrected directory %" PRIu64 " size, was %" PRId64 ", now %" PRIdPTR "\n"), (intptr_t)next_sfep - (intptr_t)sfp); dip->di_size =cpu_to_be64 ( - (__psint_t )next_sfep - (__psint_t )sfp); + (intptr_t )next_sfep - (intptr_t )sfp); *dino_dirty =1 ; *repair =1 ; }
repair/incore_ext.c +10 -10
@@ -498,17 +498,17 @@ get_bcnt_extent(xfs_agnumber_t agno, xfs_agblock_t startblock,return (ext); } -static __psunsigned_t +static uintptr_t avl_ext_start (avlnode_t *node) { -return ((__psunsigned_t) +return ((uintptr_t ) ((extent_tree_node_t *) node)->ex_startblock); } -static __psunsigned_t +static uintptr_t avl_ext_end (avlnode_t *node) { -return ((__psunsigned_t) ( +return ((uintptr_t ) ( ((extent_tree_node_t *) node)->ex_startblock + ((extent_tree_node_t *) node)->ex_blockcount)); }
@@ -517,24 +517,24 @@ avl_ext_end(avlnode_t *node)* convert size to an address for the AVL tree code -- the bigger the size, * the lower the address so the biggest extent will be first in the tree */ -static __psunsigned_t +static uintptr_t avl_ext_bcnt_start (avlnode_t *node) {/* -return((__psunsigned_t) (BCNT_ADDR(((extent_tree_node_t *) +return((uintptr_t) (BCNT_ADDR(((extent_tree_node_t *) node)->ex_blockcount))); */ -return ((__psunsigned_t) ((extent_tree_node_t *)node)->ex_blockcount); +return ((uintptr_t ) ((extent_tree_node_t *)node)->ex_blockcount); } -static __psunsigned_t +static uintptr_t avl_ext_bcnt_end (avlnode_t *node) {/* -return((__psunsigned_t) (BCNT_ADDR(((extent_tree_node_t *) +return((uintptr_t) (BCNT_ADDR(((extent_tree_node_t *) node)->ex_blockcount))); */ -return ((__psunsigned_t) ((extent_tree_node_t *)node)->ex_blockcount); +return ((uintptr_t ) ((extent_tree_node_t *)node)->ex_blockcount); }avlops_t avl_extent_bcnt_tree_ops = {
repair/incore_ino.c +4 -4
@@ -772,16 +772,16 @@ add_ino_ex_data(xfs_mount_t *mp) full_ino_ex_data =1 ; } -static __psunsigned_t +static uintptr_t avl_ino_start (avlnode_t *node) { -return ((__psunsigned_t) ((ino_tree_node_t *) node)->ino_startnum); +return ((uintptr_t ) ((ino_tree_node_t *) node)->ino_startnum); } -static __psunsigned_t +static uintptr_t avl_ino_end (avlnode_t *node) { -return ((__psunsigned_t) ( +return ((uintptr_t ) ( ((ino_tree_node_t *) node)->ino_startnum +XFS_INODES_PER_CHUNK )); }
repair/phase6.c +15 -15
@@ -649,7 +649,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime bitmap inode %libxfs_trans_log_buf (tp, bp,0 , mp->m_sb.sb_blocksize -1 ); - bmp = (xfs_rtword_t *)((__psint_t ) bmp + mp->m_sb.sb_blocksize); + bmp = (xfs_rtword_t *)((intptr_t ) bmp + mp->m_sb.sb_blocksize); bno++; }
@@ -721,7 +721,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inodelibxfs_trans_log_buf (tp, bp,0 , mp->m_sb.sb_blocksize -1 ); - smp = (xfs_suminfo_t *)((__psint_t )smp + mp->m_sb.sb_blocksize); + smp = (xfs_suminfo_t *)((intptr_t )smp + mp->m_sb.sb_blocksize); bno++; }
@@ -2464,12 +2464,12 @@ shortform_dir2_junk(* now move all the remaining entries down over the junked entry and * clear the newly unused bytes at the tail of the directory region. */ - next_len = *max_size - ((__psint_t )next_sfep - (__psint_t )sfp); + next_len = *max_size - ((intptr_t )next_sfep - (intptr_t )sfp); *max_size -= next_elen; *bytes_deleted += next_elen;memmove (sfep, next_sfep, next_len); -memset ((void *)((__psint_t )sfep + next_len),0 , next_elen); +memset ((void *)((intptr_t )sfep + next_len),0 , next_elen); sfp->count -=1 ; *ino_dirty =1 ;
@@ -2559,7 +2559,7 @@ shortform_dir2_entry_check(xfs_mount_t *mp, sfep = next_sfep =xfs_dir2_sf_firstentry (sfp);for (i =0 ; i < sfp->count && max_size > - (__psint_t )next_sfep - (__psint_t )sfp; + (intptr_t )next_sfep - (intptr_t )sfp; sfep = next_sfep, i++) { bad_sfnamelen =0 ;
@@ -2582,8 +2582,8 @@ shortform_dir2_entry_check(xfs_mount_t *mp,if (i == sfp->count -1 ) { namelen = ip->i_d.di_size - - ((__psint_t ) &sfep->name[0 ] - - (__psint_t ) sfp); + ((intptr_t ) &sfep->name[0 ] - + (intptr_t ) sfp); }else {/* * don't process the rest of the directory,
@@ -2591,15 +2591,15 @@ shortform_dir2_entry_check(xfs_mount_t *mp,*/ break ; } - }else if (no_modify && (__psint_t ) sfep - (__psint_t ) sfp + + }else if (no_modify && (intptr_t ) sfep - (intptr_t ) sfp + +M_DIROPS (mp)->sf_entsize (sfp, sfep->namelen) > ip->i_d.di_size) { bad_sfnamelen =1 ;if (i == sfp->count -1 ) { namelen = ip->i_d.di_size - - ((__psint_t ) &sfep->name[0 ] - - (__psint_t ) sfp); + ((intptr_t ) &sfep->name[0 ] - + (intptr_t ) sfp); }else {/* * don't process the rest of the directory,
@@ -2781,7 +2781,7 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),* on next_sfep. */ ASSERT (no_modify || bad_sfnamelen ==0 ); - next_sfep = (struct xfs_dir2_sf_entry *)((__psint_t )sfep + + next_sfep = (struct xfs_dir2_sf_entry *)((intptr_t )sfep + (bad_sfnamelen ?M_DIROPS (mp)->sf_entsize (sfp, namelen) :M_DIROPS (mp)->sf_entsize (sfp, sfep->namelen)));
@@ -2798,8 +2798,8 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"), tmp_sfep = next_sfep;process_sf_dir2_fixi8 (mp, sfp, &tmp_sfep); bytes_deleted += - (__psint_t )next_sfep - - (__psint_t )tmp_sfep; + (intptr_t )next_sfep - + (intptr_t )tmp_sfep; next_sfep = tmp_sfep; }else sfp->i8count = i8;
@@ -2820,9 +2820,9 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),if (ip->i_d.di_size != ip->i_df.if_bytes) {ASSERT (ip->i_df.if_bytes == (xfs_fsize_t) - ((__psint_t ) next_sfep - (__psint_t ) sfp)); + ((intptr_t ) next_sfep - (intptr_t ) sfp)); ip->i_d.di_size = (xfs_fsize_t) - ((__psint_t ) next_sfep - (__psint_t ) sfp); + ((intptr_t ) next_sfep - (intptr_t ) sfp);do_warn (_ ("setting size to %" PRId64" bytes to reflect junked entries\n" ), ip->i_d.di_size);
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/8 xfsprogs: remove the unused inst_t typedef
In reply to Christoph Hellwig--- libxfs/libxfs_priv.h | 1 - 1 file changed, 1 deletion(-)
libxfs/libxfs_priv.h +0 -1
@@ -96,7 +96,6 @@ extern char *progname;#define ASSERT (ex) assert(ex)typedef __uint32_t uint_t ; -typedef __uint32_t inst_t ;/* an instruction */ #ifndef EWRONGFS #define EWRONGFS EINVAL
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 4/8 xfsprogs: remove the uint_t typedef
In reply to Christoph HellwigThis was only used in a few IRIX platform helpers that can use __uint32_t instead.
--- include/irix.h | 10 +++++----- libxfs/libxfs_priv.h | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-)
include/irix.h +5 -5
@@ -294,13 +294,13 @@ static __inline__ void platform_getoptreset(void)static __inline__int platform_uuid_compare (uuid_t *uu1,uuid_t *uu2) { -uint_t status; +__uint32_t status;return uuid_compare (uu1, uu2, &status); }static __inline__void platform_uuid_unparse (uuid_t *uu,char *buffer) { -uint_t status; +__uint32_t status;char *s;uuid_to_string (uu, &s, &status);if (status == uuid_s_ok)
@@ -311,7 +311,7 @@ static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer)static __inline__int platform_uuid_parse (char *buffer,uuid_t *uu) { -uint_t status; +__uint32_t status;uuid_from_string (buffer, uu, &status);return (status == uuid_s_ok); }
@@ -324,13 +324,13 @@ static __inline__ int platform_uuid_is_null(uuid_t *uu)static __inline__void platform_uuid_generate (uuid_t *uu) { -uint_t status; +__uint32_t status;uuid_create (uu, &status); }static __inline__void platform_uuid_clear (uuid_t *uu) { -uint_t status; +__uint32_t status;uuid_create_nil (uu, &status); }
libxfs/libxfs_priv.h +0 -2
@@ -95,8 +95,6 @@ extern char *progname;#undef ASSERT#define ASSERT (ex) assert(ex) -typedef __uint32_t uint_t ; -#ifndef EWRONGFS #define EWRONGFS EINVAL#endif
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 5/8 xfsprogs: remove the uchar_t typedef
In reply to Christoph Hellwig--- db/hash.c | 2 +- db/metadump.c | 42 +++++++++++++++++++++--------------------- include/darwin.h | 1 - include/freebsd.h | 4 ---- include/gnukfreebsd.h | 4 ---- include/linux.h | 5 ----- mkfs/proto.c | 2 +- repair/attr_repair.c | 2 +- 8 files changed, 24 insertions(+), 38 deletions(-)
db/hash.c +1 -1
@@ -52,7 +52,7 @@ hash_f( {xfs_dahash_t hashval; - hashval =libxfs_da_hashname ((uchar_t *)argv[1 ], (int )strlen (argv[1 ])); + hashval =libxfs_da_hashname ((unsigned char *)argv[1 ], (int )strlen (argv[1 ]));dbprintf ("0x%x\n" , hashval);return 0 ; }
db/metadump.c +21 -21
126 lines not on this page · raw message
include/darwin.h +0 -1
@@ -127,7 +127,6 @@ typedef u_int32_t xfs_dev_t;typedef int64_t xfs_daddr_t ;typedef char *xfs_caddr_t ; -typedef unsigned char uchar_t ;#define stat64 stat#define fstat64 fstat#define lseek64 lseek
include/freebsd.h +0 -4
@@ -55,10 +55,6 @@ typedef __int64_t xfs_daddr_t;typedef char *xfs_caddr_t ;typedef off_t loff_t ; -#ifndef _UCHAR_T_DEFINED -typedef unsigned char uchar_t ; -#define _UCHAR_T_DEFINED 1 -#endif typedef enum {B_FALSE ,B_TRUE }boolean_t ;#define O_LARGEFILE 0
include/gnukfreebsd.h +0 -4
@@ -45,10 +45,6 @@ typedef __int64_t xfs_daddr_t;typedef char *xfs_caddr_t ;typedef off_t loff_t ; -#ifndef _UCHAR_T_DEFINED -typedef unsigned char uchar_t ; -#define _UCHAR_T_DEFINED 1 -#endif typedef enum {B_FALSE ,B_TRUE }boolean_t ;#define HAVE_FID 1
include/linux.h +0 -5
@@ -144,11 +144,6 @@ typedef __uint32_t xfs_dev_t;typedef __int64_t xfs_daddr_t ;typedef char *xfs_caddr_t ; -#ifndef _UCHAR_T_DEFINED -typedef unsigned char uchar_t ; -#define _UCHAR_T_DEFINED 1 -#endif -#ifndef _BOOLEAN_T_DEFINEDtypedef enum {B_FALSE ,B_TRUE }boolean_t ;#define _BOOLEAN_T_DEFINED 1
mkfs/proto.c +1 -1
@@ -443,7 +443,7 @@ parseproto( mode |= val; creds.cr_uid = (int )getnum (pp); creds.cr_gid = (int )getnum (pp); - xname.name = (uchar_t *)name; + xname.name = (unsigned char *)name; xname.len = name ?strlen (name) :0 ; xname.type =0 ; tp =libxfs_trans_alloc (mp,0 );
repair/attr_repair.c +1 -1
@@ -1121,7 +1121,7 @@ process_leaf_attr_remote(if (remotep->namelen ==0 ||namecheck ((char *)&remotep->name[0 ], remotep->namelen) ||be32_to_cpu (entry->hashval) != -libxfs_da_hashname ((uchar_t *)&remotep->name[0 ], +libxfs_da_hashname ((unsigned char *)&remotep->name[0 ], remotep->namelen) ||be32_to_cpu (entry->hashval) < last_hashval ||be32_to_cpu (remotep->valueblk) ==0 ) {
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 6/8 xfsprogs: remove boolean_t typedef
In reply to Christoph HellwigOnly one use of this exists, and it's treated like an int anyway by both caller and callee.
--- include/darwin.h | 3 --- include/freebsd.h | 2 -- include/gnukfreebsd.h | 2 -- include/linux.h | 5 ----- logprint/log_misc.c | 2 +- 5 files changed, 1 insertion(+), 13 deletions(-)
include/darwin.h +0 -3
@@ -144,9 +144,6 @@ typedef char* xfs_caddr_t;#define O_SYNC 0#endif -#define B_FALSE 0 -#define B_TRUE 1 -#define ENOATTR 989/* Attribute not found */ #define EFSCORRUPTED 990/* Filesystem is corrupted */ #define EFSBADCRC 991/* Bad CRC detected */
include/freebsd.h +0 -2
@@ -55,8 +55,6 @@ typedef __int64_t xfs_daddr_t;typedef char *xfs_caddr_t ;typedef off_t loff_t ; -typedef enum {B_FALSE ,B_TRUE }boolean_t ; -#define O_LARGEFILE 0#define HAVE_FID 1
include/gnukfreebsd.h +0 -2
@@ -45,8 +45,6 @@ typedef __int64_t xfs_daddr_t;typedef char *xfs_caddr_t ;typedef off_t loff_t ; -typedef enum {B_FALSE ,B_TRUE }boolean_t ; -#define HAVE_FID 1static __inline__int xfsctl (const char *path,int fd,int cmd,void *p)
include/linux.h +0 -5
@@ -144,9 +144,4 @@ typedef __uint32_t xfs_dev_t;typedef __int64_t xfs_daddr_t ;typedef char *xfs_caddr_t ; -#ifndef _BOOLEAN_T_DEFINED -typedef enum {B_FALSE ,B_TRUE }boolean_t ; -#define _BOOLEAN_T_DEFINED 1 -#endif -#endif /* __XFS_LINUX_H__ */
logprint/log_misc.c +1 -1
@@ -641,7 +641,7 @@ xlog_print_trans_inode(int len, int *i, int num_ops, - boolean_t continued) + int continued) { xfs_icdinode_t dino;xlog_op_header_t *op_head;
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 7/8 xfsprogs: remove non-Linux defintions for loff_t
In reply to Christoph HellwigWe don't use loff_t anywhere in xfsprogs, so no need to define it.
--- include/darwin.h | 1 - include/freebsd.h | 1 - include/gnukfreebsd.h | 1 - include/irix.h | 1 - 4 files changed, 4 deletions(-)
include/darwin.h +0 -1
@@ -118,7 +118,6 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)#define __uint16_t u_int16_t#define __uint32_t u_int32_t#define __uint64_t u_int64_t -#define loff_t off_t#define off64_t off_ttypedef off_t xfs_off_t ;
include/freebsd.h +0 -1
@@ -53,7 +53,6 @@ typedef __uint64_t xfs_ino_t;typedef __uint32_t xfs_dev_t ;typedef __int64_t xfs_daddr_t ;typedef char *xfs_caddr_t ; -typedef off_t loff_t ;#define O_LARGEFILE 0
include/gnukfreebsd.h +0 -1
@@ -43,7 +43,6 @@ typedef __uint64_t xfs_ino_t;typedef __uint32_t xfs_dev_t ;typedef __int64_t xfs_daddr_t ;typedef char *xfs_caddr_t ; -typedef off_t loff_t ;#define HAVE_FID 1
include/irix.h +0 -1
@@ -42,7 +42,6 @@#define __int16_t short#define __uint8_t unsigned char#define __uint16_t unsigned short -#define loff_t off64_ttypedef off64_t xfs_off_t ;typedef __int64_t xfs_ino_t ;typedef __int32_t xfs_dev_t ;
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 8/8 xfsprogs: remove xfs_caddr_t
In reply to Christoph Hellwig--- copy/xfs_copy.c | 6 +++--- include/darwin.h | 1 - include/freebsd.h | 1 - include/gnukfreebsd.h | 1 - include/irix.h | 1 - include/libxfs.h | 4 ++-- include/libxlog.h | 4 ++-- include/linux.h | 1 - libxfs/rdwr.c | 6 +++--- libxlog/xfs_log_recover.c | 40 ++++++++++++++++++++-------------------- logprint/log_misc.c | 34 +++++++++++++++++----------------- logprint/log_print_all.c | 4 ++-- 12 files changed, 49 insertions(+), 54 deletions(-)
copy/xfs_copy.c +3 -3
@@ -1141,8 +1141,8 @@ main(int argc, char **argv)return 0 ; } -xfs_caddr_t -next_log_chunk (xfs_caddr_t p,int offset,void *private) +char * +next_log_chunk (char *p,int offset,void *private) {wbuf *buf = (wbuf *)private;
@@ -1165,7 +1165,7 @@ next_log_chunk(xfs_caddr_t p, int offset, void *private)xfs_off_t write_log_header (int fd,wbuf *buf,xfs_mount_t *mp) { -xfs_caddr_t p = buf->data; +char *p = buf->data;xfs_off_t logstart;int offset;
include/darwin.h +0 -1
@@ -124,7 +124,6 @@ typedef off_t xfs_off_t;typedef u_int64_t xfs_ino_t ;typedef u_int32_t xfs_dev_t ;typedef int64_t xfs_daddr_t ; -typedef char *xfs_caddr_t ;#define stat64 stat#define fstat64 fstat
include/freebsd.h +0 -1
@@ -52,7 +52,6 @@ typedef off_t off64_t;typedef __uint64_t xfs_ino_t ;typedef __uint32_t xfs_dev_t ;typedef __int64_t xfs_daddr_t ; -typedef char *xfs_caddr_t ;#define O_LARGEFILE 0
include/gnukfreebsd.h +0 -1
@@ -42,7 +42,6 @@ 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 char *xfs_caddr_t ;#define HAVE_FID 1
include/irix.h +0 -1
@@ -46,7 +46,6 @@ typedef off64_t xfs_off_t;typedef __int64_t xfs_ino_t ;typedef __int32_t xfs_dev_t ;typedef __int64_t xfs_daddr_t ; -typedef char *xfs_caddr_t ;#define xfs_flock64 flock64#define xfs_flock64_t struct flock64
include/libxfs.h +2 -2
@@ -146,11 +146,11 @@ extern void platform_findsizes(char *path, int fd, long long *sz, int *bsz);extern int platform_nproc (void );/* check or write log footer: specify device, log size in blocks & uuid */ -typedef xfs_caddr_t (libxfs_get_block_t )(xfs_caddr_t ,int ,void *); +typedef char *(libxfs_get_block_t )(char *,int ,void *);extern int libxfs_log_clear (struct xfs_buftarg *,xfs_daddr_t ,uint ,uuid_t *,int ,int ,int ); -extern int libxfs_log_header (xfs_caddr_t ,uuid_t *,int ,int ,int , +extern int libxfs_log_header (char *,uuid_t *,int ,int ,int ,libxfs_get_block_t *,void *);
include/libxlog.h +2 -2
@@ -88,7 +88,7 @@ extern int xlog_is_dirty(xfs_mount_t *mp, libxfs_init_t *x, int verbose);extern struct xfs_buf *xlog_get_bp (struct xlog *,int );extern void xlog_put_bp (struct xfs_buf *);extern int xlog_bread (struct xlog *log,xfs_daddr_t blk_no,int nbblks, -xfs_buf_t *bp,xfs_caddr_t *offset); +xfs_buf_t *bp,char **offset);extern int xlog_bread_noalign (struct xlog *log,xfs_daddr_t blk_no,int nbblks,xfs_buf_t *bp);
@@ -101,7 +101,7 @@ extern int xlog_find_tail(struct xlog *log, xfs_daddr_t *head_blk,extern int xlog_test_footer (struct xlog *log);extern int xlog_recover (struct xlog *log,int readonly); -extern void xlog_recover_print_data (xfs_caddr_t p,int len); +extern void xlog_recover_print_data (char *p,int len);extern void xlog_recover_print_logitem (xlog_recover_item_t *item);extern void xlog_recover_print_trans_head (xlog_recover_t *tr);extern int xlog_print_find_oldest (struct xlog *log,xfs_daddr_t *last_blk);
include/linux.h +0 -1
@@ -142,6 +142,5 @@ typedef loff_t xfs_off_t;typedef __uint64_t xfs_ino_t ;typedef __uint32_t xfs_dev_t ;typedef __int64_t xfs_daddr_t ; -typedef char *xfs_caddr_t ;#endif /* __XFS_LINUX_H__ */
libxfs/rdwr.c +3 -3
@@ -132,7 +132,7 @@ static void unmount_record(void *p)memcpy ((char *)p +sizeof (xlog_op_header_t), &magic,sizeof (magic)); } -static xfs_caddr_t next (xfs_caddr_t ptr,int offset,void *private) +static char *next (char *ptr,int offset,void *private) {xfs_buf_t *buf = (xfs_buf_t *)private;
@@ -173,7 +173,7 @@ libxfs_log_clear( int libxfs_log_header( - xfs_caddr_t caddr, + char *caddr, uuid_t *fs_uuid, int version, int sunit,
@@ -182,7 +182,7 @@ libxfs_log_header( void *private) {xlog_rec_header_t *head = (xlog_rec_header_t *)caddr; -xfs_caddr_t p = caddr; +char *p = caddr;__be32 cycle_lsn;int i, len;
libxlog/xfs_log_recover.c +20 -20
@@ -93,7 +93,7 @@ xlog_put_bp(* Return the address of the start of the given block number's data * in a log buffer. The buffer covers a log sector-aligned region. */ -STATIC xfs_caddr_t +STATIC char * xlog_align( struct xlog *log, xfs_daddr_t blk_no,
@@ -143,7 +143,7 @@ xlog_bread(xfs_daddr_t blk_no, int nbblks, struct xfs_buf *bp, - xfs_caddr_t *offset) + char **offset) { int error;
@@ -165,9 +165,9 @@ xlog_bread_offset(xfs_daddr_t blk_no,/* block to read from */ int nbblks, /* blocks to read */ struct xfs_buf *bp, - xfs_caddr_t offset) + char *offset) { - xfs_caddr_t orig_offset = bp->b_addr; + char *orig_offset = bp->b_addr;int orig_len = bp->b_bcount;int error, error2;
@@ -198,7 +198,7 @@ xlog_find_cycle_start(xfs_daddr_t *last_blk, uint cycle) { -xfs_caddr_t offset; + char *offset;xfs_daddr_t mid_blk;xfs_daddr_t end_blk;uint mid_cycle;
@@ -245,7 +245,7 @@ xlog_find_verify_cycle(uint cycle;xfs_buf_t *bp;xfs_daddr_t bufblks; -xfs_caddr_t buf =NULL ; +char *buf =NULL ;int error =0 ;/*
@@ -311,7 +311,7 @@ xlog_find_verify_log_record( {xfs_daddr_t i;xfs_buf_t *bp; -xfs_caddr_t offset =NULL ; +char *offset =NULL ;xlog_rec_header_t *head =NULL ;int error =0 ;int smallmem =0 ;
@@ -418,7 +418,7 @@ xlog_find_head( xfs_daddr_t *return_head_blk) {xfs_buf_t *bp; -xfs_caddr_t offset; +char *offset;xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk;int num_scan_bblks;uint first_half_cycle, last_half_cycle;
@@ -691,7 +691,7 @@ xlog_find_tail( {xlog_rec_header_t *rhead;xlog_op_header_t *op_head; -xfs_caddr_t offset =NULL ; +char *offset =NULL ;xfs_buf_t *bp;int error, i, found;xfs_daddr_t umount_data_blk;
@@ -899,7 +899,7 @@ xlog_find_zeroed( xfs_daddr_t *blk_no) {xfs_buf_t *bp; -xfs_caddr_t offset; +char *offset;uint first_cycle, last_cycle;xfs_daddr_t new_blk, last_blk, start_blk;xfs_daddr_t num_scan_bblks;
@@ -1041,17 +1041,17 @@ STATIC intxlog_recover_add_to_cont_trans ( struct xlog *log, struct xlog_recover *trans, - xfs_caddr_t dp, + char *dp, int len) { xlog_recover_item_t *item; -xfs_caddr_t ptr, old_ptr; +char *ptr, *old_ptr;int old_len;if (list_empty (&trans->r_itemq)) {/* finish copying rest of trans header */ xlog_recover_add_item (&trans->r_itemq); - ptr = (xfs_caddr_t ) &trans->r_theader + + ptr = (char *) &trans->r_theader +sizeof (xfs_trans_header_t) - len;memcpy (ptr, dp, len);/* d, s, l */ return 0 ;
@@ -1087,12 +1087,12 @@ STATIC intxlog_recover_add_to_trans ( struct xlog *log, struct xlog_recover *trans, - xfs_caddr_t dp, + char *dp, int len) { xfs_inode_log_format_t *in_f; /* any will do */xlog_recover_item_t *item; -xfs_caddr_t ptr; +char *ptr;if (!len)return 0 ;
@@ -1219,10 +1219,10 @@ xlog_recover_process_data(struct xlog *log, struct hlist_head rhash[], struct xlog_rec_header *rhead, - xfs_caddr_t dp, + char *dp, int pass) { - xfs_caddr_t lp; + char *lp;int num_logops;xlog_op_header_t *ohead;xlog_recover_t *trans;
@@ -1322,7 +1322,7 @@ xlog_recover_process_data( STATIC intxlog_unpack_data_crc (struct xlog_rec_header *rhead, -xfs_caddr_t dp, +char *dp,struct xlog *log) {__le32 crc;
@@ -1352,7 +1352,7 @@ xlog_unpack_data_crc( STATIC intxlog_unpack_data (struct xlog_rec_header *rhead, -xfs_caddr_t dp, +char *dp,struct xlog *log) {int i, j, k;
@@ -1434,7 +1434,7 @@ xlog_do_recovery_pass( {xlog_rec_header_t *rhead;xfs_daddr_t blk_no; -xfs_caddr_t offset; +char *offset;xfs_buf_t *hbp, *dbp;int error =0 , h_size;int bblks, split_bblks;
logprint/log_misc.c +17 -17
@@ -119,7 +119,7 @@ print_stars(void)void xlog_print_op_header (xlog_op_header_t *op_head,int i, -xfs_caddr_t *ptr) +char **ptr) {xlog_op_header_t hbuf;
@@ -208,10 +208,10 @@ xlog_print_find_tid(xlog_tid_t tid, uint was_cont) }/* xlog_print_find_tid */ int -xlog_print_trans_header (xfs_caddr_t *ptr,int len) +xlog_print_trans_header (char **ptr,int len) {xfs_trans_header_t *h; -xfs_caddr_t cptr = *ptr; +char *cptr = *ptr;__uint32_t magic;char *magic_c = (char *)&magic;
@@ -240,7 +240,7 @@ xlog_print_trans_header(xfs_caddr_t *ptr, int len)int -xlog_print_trans_buffer (xfs_caddr_t *ptr,int len,int *i,int num_ops) +xlog_print_trans_buffer (char **ptr,int len,int *i,int num_ops) {xfs_buf_log_format_t *f;xfs_agi_t *agi;
@@ -466,7 +466,7 @@ xlog_print_trans_buffer(xfs_caddr_t *ptr, int len, int *i, int num_ops)int -xlog_print_trans_efd (xfs_caddr_t *ptr,uint len) +xlog_print_trans_efd (char **ptr,uint len) {xfs_efd_log_format_t *f;xfs_efd_log_format_t lbuf;
@@ -496,7 +496,7 @@ xlog_print_trans_efd(xfs_caddr_t *ptr, uint len)int xlog_print_trans_efi ( -xfs_caddr_t *ptr, +char **ptr,uint src_len,int continued) {
@@ -560,7 +560,7 @@ error:int -xlog_print_trans_qoff (xfs_caddr_t *ptr,uint len) +xlog_print_trans_qoff (char **ptr,uint len) {xfs_qoff_logformat_t *f;xfs_qoff_logformat_t lbuf;
@@ -637,7 +637,7 @@ xlog_print_dir2_sf( int xlog_print_trans_inode( struct xlog *log, - xfs_caddr_t *ptr, + char **ptr, int len, int *i, int num_ops,
@@ -778,7 +778,7 @@ xlog_print_trans_inode(int -xlog_print_trans_dquot (xfs_caddr_t *ptr,int len,int *i,int num_ops) +xlog_print_trans_dquot (char **ptr,int len,int *i,int num_ops) {xfs_dq_logformat_t *f;xfs_dq_logformat_t lbuf = {0 };
@@ -834,7 +834,7 @@ xlog_print_trans_dquot(xfs_caddr_t *ptr, int len, int *i, int num_ops) STATIC intxlog_print_trans_icreate ( -xfs_caddr_t *ptr, +char **ptr,int len,int *i,int num_ops)
@@ -886,7 +886,7 @@ xlog_print_lseek(struct xlog *log, int fd, xfs_daddr_t blkno, int whence)void -print_lsn (xfs_caddr_t string, +print_lsn (char *string,__be64 *lsn) { printf("%s: %u,%u", string,
@@ -901,12 +901,12 @@ xlog_print_record(int num_ops, int len, int *read_type, - xfs_caddr_t *partial_buf, + char **partial_buf, xlog_rec_header_t *rhead, xlog_rec_ext_header_t *xhdrs, int bad_hdr_warn) { - xfs_caddr_t buf, ptr; + char *buf, *ptr;int read_len, skip, lost_context =0 ;int ret, n, i, j, k;
@@ -923,13 +923,13 @@ xlog_print_record(/* read_type => don't malloc() new buffer, use old one */ if (*read_type ==FULL_READ ) { -if ((ptr = buf = (xfs_caddr_t )malloc (read_len)) ==NULL ) { +if ((ptr = buf =malloc (read_len)) ==NULL ) {fprintf (stderr,_ ("%s: xlog_print_record: malloc failed\n" ), progname);exit (1 ); } }else { read_len -= *read_type; - buf = (xfs_caddr_t)((intptr_t )(*partial_buf) + (intptr_t )(*read_type)); + buf = (char *)((intptr_t )(*partial_buf) + (intptr_t )(*read_type)); ptr = *partial_buf; }if ((ret = (int )read (fd, buf, read_len)) ==-1 ) {
@@ -1220,7 +1220,7 @@ print_xlog_bad_zeroed(xfs_daddr_t blkno) }/* print_xlog_bad_zeroed */ static void -print_xlog_bad_header (xfs_daddr_t blkno,xfs_caddr_t buf) +print_xlog_bad_header (xfs_daddr_t blkno,char *buf) {print_stars (); printf(_("* ERROR: header cycle=%-11d block=%-21lld *\n"),
@@ -1358,7 +1358,7 @@ void xfs_log_print(struct xlog *log,xfs_daddr_t block_end =0 , block_start, blkno, error;xfs_daddr_t zeroed_blkno =0 , cleared_blkno =0 ;int read_type =FULL_READ ; -xfs_caddr_t partial_buf; +char *partial_buf;int zeroed =0 ;int cleared =0 ;int first_hdr_found =0 ;
logprint/log_print_all.c +2 -2
@@ -57,7 +57,7 @@ xlog_print_find_oldest(void xlog_recover_print_data ( -xfs_caddr_t p, +char *p,int len) {if (print_data) {
@@ -85,7 +85,7 @@ xlog_recover_print_buffer(xfs_agi_t *agi;xfs_agf_t *agf;xfs_buf_log_format_t *f; -xfs_caddr_t p; +char *p;int len, num, i;xfs_daddr_t blkno;xfs_disk_dquot_t *ddq;
Signature · 6 lines
1.9.1 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 2/8] xfsprogs: remove __psint_t and __psunsigned_t
In reply to Christoph HellwigQuoted 14 lines · Christoph Hellwig
Replace them with the standards conform
intptr_tanduintptr_t. Note that many uses look rather questionable cargo-cult avoidance of pointer arithmetics, but let's leave that for now and look at it separately.Signed-off-by Christoph Hellwig <[email protected]>--- db/bit.c | 8 ++++---- db/check.c | 6 +++--- db/field.c | 8 ++++---- db/field.h | 6 +++--- include/platform_defs.h.in | 36 ------------------------------------ logprint/log_misc.c | 2 +- m4/package_types.m4 | 28 ---------------------------- repair/agheader.c | 2 +-
Quoted 8 lines
repair/attr_repair.c | 6 +++--- repair/avl.c | 36 ++++++++++++++++++------------------ repair/avl.h | 18 +++++++++--------- repair/dir2.c | 16 ++++++++-------- repair/incore_ext.c | 20 ++++++++++---------- repair/incore_ino.c | 8 ++++---- repair/phase6.c | 30 +++++++++++++++--------------- 15 files changed, 83 insertions(+), 147 deletions(-)
there's a couple of extra bits that need to be removed in configure.ac. I'll clean them up before committing:
....
autoconf
configure.ac:119: error: possibly undefined macro: AC_TYPE_PSINT
If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation.
configure.ac:120: error: possibly undefined macro: AC_TYPE_PSUNSIGNED Makefile:87: recipe for target 'configure' failed
make: *** [configure] Error 1
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs