libxfs/linux.c: Replace use of ustat by stat
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/6 Move from __uint*_t types to uint*_t and likewise for __int*_t
The uint*_t and int*_t are defined by C99 and should be prefered over the less portable __uint*_t and __int*_t variants. The necessary <stdint.h> include is in platformdefs.h, which gets included in most places via libxfs.h. In the public headers <stdint.h> is included in <xfs/xfs_types.h>.
--- 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 | 30 ++++---- db/io.c | 4 +- db/io.h | 8 +- db/metadump.c | 12 +-- db/sb.c | 6 +- fsr/xfs_fsr.c | 2 +- include/darwin.h | 9 --- include/freebsd.h | 6 +- include/gnukfreebsd.h | 6 +- include/irix.h | 28 +++---- 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 | 20 ++--- libhandle/handle.c | 2 +- libhandle/jdm.c | 2 +- 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 | 14 ++-- libxfs/xfs_alloc_btree.c | 10 +-- libxfs/xfs_attr_remote.c | 8 +- libxfs/xfs_attr_sf.h | 18 ++--- libxfs/xfs_bit.h | 24 +++--- libxfs/xfs_bmap_btree.c | 8 +- libxfs/xfs_btree.c | 12 +-- libxfs/xfs_btree.h | 14 ++-- libxfs/xfs_cksum.h | 14 ++-- libxfs/xfs_da_btree.c | 2 +- libxfs/xfs_da_btree.h | 8 +- libxfs/xfs_da_format.c | 24 +++--- libxfs/xfs_da_format.h | 60 +++++++-------- libxfs/xfs_dir2.h | 8 +- libxfs/xfs_dir2_leaf.c | 12 +-- libxfs/xfs_dir2_priv.h | 2 +- libxfs/xfs_format.h | 98 ++++++++++++------------ libxfs/xfs_fs.h | 12 +-- libxfs/xfs_ialloc.c | 6 +- libxfs/xfs_ialloc_btree.c | 4 +- libxfs/xfs_inode_buf.c | 2 +- libxfs/xfs_log_format.h | 190 +++++++++++++++++++++++----------------------- libxfs/xfs_quota_defs.h | 4 +- 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 | 88 ++++++++++----------- quota/edit.c | 64 ++++++++-------- quota/free.c | 44 +++++------ quota/quot.c | 24 +++--- quota/quota.c | 4 +- quota/quota.h | 12 +-- quota/report.c | 2 +- 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/dino_chunks.c | 2 +- repair/dinode.c | 38 +++++----- repair/dinode.h | 4 +- repair/dir2.c | 2 +- repair/globals.h | 16 ++-- repair/incore.c | 10 +-- repair/incore.h | 42 +++++----- 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 | 40 +++++----- repair/phase6.c | 18 ++--- repair/phase7.c | 6 +- repair/progress.c | 30 ++++---- repair/progress.h | 4 +- repair/sb.c | 10 +-- repair/scan.c | 42 +++++----- repair/scan.h | 12 +-- 103 files changed, 870 insertions(+), 883 deletions(-)
copy/xfs_copy.c +7 -7
@@ -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;
@@ -303,7 +303,7 @@ usage(void) }void -init_bar (__uint64_t source_blocks) +init_bar (uint64_t source_blocks) {int i;
@@ -312,7 +312,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% " ,
@@ -522,8 +522,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;
@@ -939,8 +939,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;
copy/xfs_copy.h +1 -1
@@ -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;
db/attr.c +4 -4
@@ -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 }
db/attrshort.c +2 -2
@@ -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 },
db/bit.c +2 -2
@@ -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;
db/bit.h +1 -1
@@ -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);
db/block.c +4 -4
@@ -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 ;
db/check.c +9 -9
@@ -112,8 +112,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;
@@ -122,10 +122,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;
@@ -1173,7 +1173,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;
@@ -2991,7 +2991,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 )
@@ -3004,7 +3004,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 ;
db/convert.c +14 -14
@@ -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;
db/faddr.c +7 -7
@@ -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 ); }
db/field.c +22 -22
99 lines not on this page · raw message
db/fprint.c +4 -4
@@ -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 (" " ); }
db/frag.c +4 -4
@@ -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;
@@ -306,8 +306,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;
db/inode.c +15 -15
@@ -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 }
db/io.c +2 -2
@@ -487,7 +487,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)
@@ -495,7 +495,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 ) {
db/io.h +4 -4
@@ -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);
db/metadump.c +6 -6
@@ -175,7 +175,7 @@ write_index(void)static int write_buf_segment (char *data, -__int64_t off, +int64_t off,int len) {int i;
@@ -1093,7 +1093,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);
@@ -1159,7 +1159,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;
@@ -1196,7 +1196,7 @@ static voidprocess_sf_symlink ( xfs_dinode_t *dip) { -__uint64_t len; +uint64_t len;char *buf; len =be64_to_cpu (dip->di_size);
@@ -1468,7 +1468,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;
@@ -2106,7 +2106,7 @@ done:return success; } -static __uint32_t inodes_copied =0 ; +static uint32_t inodes_copied =0 ;static int copy_inode_chunk(
db/sb.c +3 -3
@@ -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;
@@ -708,8 +708,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 */
fsr/xfs_fsr.c +1 -1
@@ -57,7 +57,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"
include/darwin.h +0 -9
@@ -125,15 +125,6 @@ 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 off64_t off_ttypedef off_t xfs_off_t ;
include/freebsd.h +3 -3
@@ -50,9 +50,9 @@typedef off_t xfs_off_t ;typedef off_t off64_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 unsigned char __u8 ;typedef signed char __s8 ;
include/gnukfreebsd.h +3 -3
@@ -39,9 +39,9 @@#define EFSBADCRC 991/* 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 unsigned char __u8 ;typedef signed char __s8 ;
include/irix.h +12 -16
@@ -39,14 +39,10 @@#include <sys/fs/xfs_itable.h> #include <mntent.h> -#define __int8_t char -#define __int16_t short -#define __uint8_t unsigned char -#define __uint16_t unsigned shorttypedef off64_t xfs_off_t ; -typedef __int64_t xfs_ino_t ; -typedef __int32_t xfs_dev_t ; -typedef __int64_t xfs_daddr_t ; +typedef int64_t xfs_ino_t ; +typedef int32_t xfs_dev_t ; +typedef int64_t xfs_daddr_t ;typedef unsigned char __u8 ;typedef signed char __s8 ;
@@ -63,17 +59,17 @@ typedef signed long long int __s64;#define EFSBADCRC 991/* Bad CRC detected */ typedef struct xfs_error_injection { -__int32_t fd; -__int32_t errtag; +int32_t fd; +int32_t errtag; }xfs_error_injection_t ;/* --- xfs_fsop_*req - request data structures --- */ typedef struct xfs_fsop_bulkreq {ino64_t *lastip; -__int32_t icount; +int32_t icount;xfs_bstat_t *ubuffer; -__int32_t *ocount; +int32_t *ocount; }xfs_fsop_bulkreq_t ; typedef struct xfs_fsop_handlereq {
@@ -302,13 +298,13 @@ static __inline__ void platform_getoptreset(void)static __inline__int platform_uuid_compare (uuid_t *uu1,uuid_t *uu2) { -__uint32_t status; +uint32_t status;return uuid_compare (uu1, uu2, &status); }static __inline__void platform_uuid_unparse (uuid_t *uu,char *buffer) { -__uint32_t status; +uint32_t status;char *s;uuid_to_string (uu, &s, &status);if (status == uuid_s_ok)
@@ -319,7 +315,7 @@ static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer)static __inline__int platform_uuid_parse (char *buffer,uuid_t *uu) { -__uint32_t status; +uint32_t status;uuid_from_string (buffer, uu, &status);return (status == uuid_s_ok); }
@@ -332,13 +328,13 @@ static __inline__ int platform_uuid_is_null(uuid_t *uu)static __inline__void platform_uuid_generate (uuid_t *uu) { -__uint32_t status; +uint32_t status;uuid_create (uu, &status); }static __inline__void platform_uuid_clear (uuid_t *uu) { -__uint32_t status; +uint32_t status;uuid_create_nil (uu, &status); }
include/linux.h +4 -4
@@ -124,7 +124,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;
@@ -142,9 +142,9 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)#define EFSBADCRC EBADMSG/* Bad CRC detected */ 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 uint64_t xfs_ino_t ; +typedef uint32_t xfs_dev_t ; +typedef int64_t xfs_daddr_t ;/** * Abstraction of mountpoints.
include/xfs_arch.h +11 -11
@@ -240,39 +240,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 );
include/xfs_inode.h +2 -2
@@ -77,8 +77,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 ); } typedef struct cred {
include/xfs_log_recover.h +1 -1
@@ -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)
include/xfs_metadump.h +2 -2
@@ -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 ;
include/xfs_mount.h +10 -10
@@ -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 */
@@ -78,7 +78,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 */
@@ -118,12 +118,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 */
libhandle/handle.c +1 -1
@@ -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 ) {
libhandle/jdm.c +1 -1
@@ -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;
libxfs/darwin.c +1 -1
@@ -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 stat64 st;if (fstat64 (fd, &st) <0 ) {
libxfs/freebsd.c +1 -1
@@ -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 ) {
libxfs/init.c +1 -1
@@ -529,7 +529,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 );
libxfs/irix.c +1 -1
@@ -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 stat64 *s,int verbose)
libxfs/libxfs_priv.h +2 -2
@@ -307,8 +307,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);
libxfs/linux.c +1 -1
@@ -133,7 +133,7 @@ void platform_findsizes(char *path, int fd, long long *sz, int *bsz) {struct stat64 st; -__uint64_t size; +uint64_t size;int error;if (fstat64 (fd, &st) <0 ) {
libxfs/logitem.c +1 -1
@@ -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); }
libxfs/radix-tree.c +4 -4
@@ -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 )); }/*
libxfs/rdwr.c +3 -3
@@ -116,9 +116,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 );
libxfs/util.c +7 -7
@@ -160,16 +160,16 @@ libxfs_trans_ichgtime( tv.tv_sec = stv.tv_sec; tv.tv_nsec = stv.tv_usec *1000 ;if (flags &XFS_ICHGTIME_MOD ) { - ip->i_d.di_mtime.t_sec = (__int32_t )tv.tv_sec; - ip->i_d.di_mtime.t_nsec = (__int32_t )tv.tv_nsec; + ip->i_d.di_mtime.t_sec = (int32_t )tv.tv_sec; + ip->i_d.di_mtime.t_nsec = (int32_t )tv.tv_nsec; }if (flags &XFS_ICHGTIME_CHG ) { - ip->i_d.di_ctime.t_sec = (__int32_t )tv.tv_sec; - ip->i_d.di_ctime.t_nsec = (__int32_t )tv.tv_nsec; + ip->i_d.di_ctime.t_sec = (int32_t )tv.tv_sec; + ip->i_d.di_ctime.t_nsec = (int32_t )tv.tv_nsec; }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; } }
@@ -219,7 +219,7 @@ libxfs_ialloc(return error;ASSERT (ip !=NULL ); - ip->i_d.di_mode = (__uint16_t )mode; + ip->i_d.di_mode = (uint16_t )mode; ip->i_d.di_onlink =0 ; ip->i_d.di_nlink = nlink;ASSERT (ip->i_d.di_nlink == nlink);
libxfs/xfs_alloc_btree.c +5 -5
@@ -246,25 +246,25 @@ xfs_allocbt_init_ptr_from_cur( ptr->s = agf->agf_roots[cur->bc_btnum]; } -STATIC __int64_t +STATIC int64_txfs_allocbt_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;if (cur->bc_btnum ==XFS_BTNUM_BNO ) { -return (__int64_t )be32_to_cpu (kp->ar_startblock) - +return (int64_t )be32_to_cpu (kp->ar_startblock) - rec->ar_startblock; } - 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 bool
libxfs/xfs_attr_remote.c +4 -4
@@ -247,7 +247,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;
@@ -295,7 +295,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;
@@ -349,7 +349,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_ta *dst = args->value;int valuelen;int nmap;int error;
@@ -415,7 +415,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;
libxfs/xfs_attr_sf.h +9 -9
@@ -34,10 +34,10 @@ typedef struct xfs_attr_shortform {__u8 count;/* count of active entries */ } 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;typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t ;
@@ -47,10 +47,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 ;
@@ -58,7 +58,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 */ \
libxfs/xfs_bit.h +12 -12
@@ -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)
libxfs/xfs_bmap_btree.c +4 -4
@@ -95,8 +95,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;
@@ -624,12 +624,12 @@ xfs_bmbt_init_ptr_from_cur( ptr->l =0 ; } -STATIC __int64_t +STATIC int64_txfs_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; }
libxfs/xfs_btree.c +6 -6
@@ -38,7 +38,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 ,XFS_BMAP_MAGIC ,XFS_IBT_MAGIC ,XFS_FIBT_MAGIC }, {XFS_ABTB_CRC_MAGIC ,XFS_ABTC_CRC_MAGIC ,
@@ -673,14 +673,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 );/*
@@ -1711,7 +1711,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 */
@@ -3992,7 +3992,7 @@ static intxfs_btree_block_change_owner ( struct xfs_btree_cur *cur, int level, - __uint64_t new_owner, + uint64_t new_owner, struct list_head *buffer_list) { struct xfs_btree_block *block;
@@ -4039,7 +4039,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) {union xfs_btree_ptr lptr;
libxfs/xfs_btree.h +7 -7
@@ -159,7 +159,7 @@ struct xfs_btree_ops { union xfs_btree_ptr *ptr);/* 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);const struct xfs_buf_ops *buf_ops;
@@ -202,11 +202,11 @@ typedef struct xfs_btree_cur } 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 */ union { struct { /* needed for BNO, CNT, INO */
@@ -315,7 +315,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 */
@@ -393,7 +393,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);/*
@@ -419,7 +419,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); }
libxfs/xfs_cksum.h +7 -7
@@ -1,18 +1,18 @@#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 * inside it. The offset of the 32bit crc fields is passed as the * cksum_offset parameter. */ -static inline __uint32_t +static inline uint32_t xfs_start_cksum (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);
@@ -33,7 +33,7 @@ xfs_start_cksum(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); }
@@ -44,7 +44,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 (buffer, length, cksum_offset); +uint32_t crc =xfs_start_cksum (buffer, length, cksum_offset); *(__le32 *)(buffer + cksum_offset) =xfs_end_cksum (crc); }
@@ -55,7 +55,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 (buffer, length, cksum_offset); +uint32_t crc =xfs_start_cksum (buffer, length, cksum_offset);return *(__le32 *)(buffer + cksum_offset) ==xfs_end_cksum (crc); }
libxfs/xfs_da_btree.c +1 -1
@@ -1943,7 +1943,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;
libxfs/xfs_da_btree.h +4 -4
@@ -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 @@ xfs_daddr_t 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);
libxfs/xfs_da_format.c +12 -12
@@ -50,7 +50,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 *
@@ -78,7 +78,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) {
@@ -88,16 +88,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 )
@@ -108,7 +108,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 );
@@ -230,7 +230,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
@@ -247,7 +247,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) {
@@ -257,16 +257,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 ;
@@ -276,7 +276,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 );
libxfs/xfs_da_format.h +30 -30
130 lines not on this page · raw message
libxfs/xfs_dir2.h +4 -4
@@ -45,9 +45,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,
@@ -58,9 +58,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);
libxfs/xfs_dir2_leaf.c +6 -6
@@ -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;
libxfs/xfs_dir2_priv.h +1 -1
@@ -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,
libxfs/xfs_format.h +49 -49
198 lines not on this page · raw message
libxfs/xfs_fs.h +6 -6
@@ -319,10 +319,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; }/*
@@ -472,10 +472,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 */
@@ -565,7 +565,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 */
libxfs/xfs_ialloc.c +3 -3
@@ -133,9 +133,9 @@ xfs_inobt_get_rec( STATIC intxfs_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) {
libxfs/xfs_ialloc_btree.c +2 -2
@@ -205,12 +205,12 @@ xfs_finobt_init_ptr_from_cur( ptr->s = agi->agi_free_root; } -STATIC __int64_t +STATIC int64_txfs_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; }
libxfs/xfs_inode_buf.c +1 -1
@@ -325,7 +325,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 ;
libxfs/xfs_log_format.h +95 -95
309 lines not on this page · raw message
libxfs/xfs_quota_defs.h +2 -2
@@ -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.
libxfs/xfs_rtbitmap.c +1 -1
@@ -978,7 +978,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 *)&mp->m_rbmip->i_d.di_atime =0 ; + *(uint64_t *)&mp->m_rbmip->i_d.di_atime =0 ;xfs_trans_log_inode (tp, mp->m_rbmip,XFS_ILOG_CORE ); }return 0 ;
libxfs/xfs_sb.c +2 -2
@@ -417,7 +417,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)) {
@@ -712,7 +712,7 @@ xfs_sb_mount_common( mp->m_bmap_dmnr[1 ] = mp->m_bmap_dmxr[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;
libxfs/xfs_types.h +23 -23
64 lines not on this page · raw message
logprint/log_misc.c +3 -3
@@ -212,12 +212,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
@@ -247,7 +247,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;
mdrestore/xfs_mdrestore.c +1 -1
@@ -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,
mkfs/proto.c +1 -1
@@ -655,7 +655,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 *)&rbmip->i_d.di_atime =0 ; + *(uint64_t *)&rbmip->i_d.di_atime =0 ;libxfs_trans_log_inode (tp, rbmip,XFS_ILOG_CORE );libxfs_log_sb (tp); mp->m_rbmip = rbmip;
mkfs/xfs_mkfs.c +44 -44
231 lines not on this page · raw message
quota/edit.c +32 -32
127 lines not on this page · raw message
quota/free.c +22 -22
66 lines not on this page · raw message
quota/quot.c +12 -12
@@ -25,17 +25,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
@@ -83,8 +83,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 ;
@@ -202,7 +202,7 @@ qcompare(return 0 ; } -typedef char *(*idtoname_t )(__uint32_t ); +typedef char *(*idtoname_t )(uint32_t );static void quot_report_mount_any_type(
@@ -290,7 +290,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);
quota/quota.c +2 -2
@@ -51,7 +51,7 @@ quota_help(void) static int quota_mount( FILE *fp, - __uint32_t id, + uint32_t id, char *name, uint form, uint type,
@@ -180,7 +180,7 @@ quota_mount( static void quota( FILE *fp, - __uint32_t id, + uint32_t id, char *name, uint form, uint type,
quota/quota.h +6 -6
@@ -51,9 +51,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);
@@ -78,7 +78,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 *);
quota/report.c +1 -1
@@ -289,7 +289,7 @@ report_header( static int report_mount( FILE *fp, - __uint32_t id, + uint32_t id, char *name, uint form, uint type,
quota/state.c +1 -1
@@ -135,7 +135,7 @@ static voidstate_timelimit (FILE *fp, uint form, - __uint32_t timelimit) + uint32_t timelimit) { fprintf(fp, _("%s grace time: %s\n"), form_to_string(form),
quota/util.c +33 -33
62 lines not on this page · raw message
repair/incore.h +21 -21
42 lines not on this page · raw message
repair/incore_ino.c +36 -36
72 lines not on this page · raw message
repair/scan.c +21 -21
42 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 6 lines
2.4.10 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Part of the diff is not shown here. View the raw message.
Re: [PATCH 1/6] Move from __uint*_t types to uint*_t and likewise for __int*_t
Quoted 7 lines · Felix Janda
The uint*_t and int*_t are defined by C99 and should be prefered over the less portable __uint*_t and __int*_t variants. The necessary <
stdint.h> include is inplatformdefs.h, which gets included in most places vialibxfs.h. In the public headers <stdint.h> is included in <xfs/xfs_types.h>.Signed-off-by Felix Janda <[email protected]>
I can't apply this straight off. Most of the libxfs code that is changed is shared with the kernel code, and so the definitions of the variables need to be the same as the kernel code. There are reasons for the kernel code using __[u]int*_t type variants (e.g. I think the endian conversion static checker requires the __ variants for host order variables), and so before making sweeping changes like this we need to ensure that we can make the equivalent changes to the kernel code as well...
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 1/6] Move from __uint*_t types to uint*_t and likewise for __int*_t
Quoted 9 lines · Dave Chinner
Quoted 7 lines · Felix Janda
The uint*_t and int*_t are defined by C99 and should be prefered over the less portable __uint*_t and __int*_t variants. The necessary <
stdint.h> include is inplatformdefs.h, which gets included in most places vialibxfs.h. In the public headers <stdint.h> is included in <xfs/xfs_types.h>.Signed-off-by Felix Janda <[email protected]>
Quoted 8 lines
I can't apply this straight off. Most of the libxfs code that is changed is shared with the kernel code, and so the definitions of the variables need to be the same as the kernel code. There are reasons for the kernel code using __[u]int*_t type variants (e.g. I think the endian conversion static checker requires the __ variants for host order variables), and so before making sweeping changes like this we need to ensure that we can make the equivalent changes to the kernel code as well...
Thanks for the review!
Sorry, I was not aware about this difference between the types.
The simplest fix for musl would be to add defines or something similar to linux.h.
On the other hand, on the long run it would be preferable to use the stdint types (consistently).
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 1/6] Move from __uint*_t types to uint*_t and likewise for __int*_t
Quoted 21 lines · Felix Janda
Quoted 9 lines · Dave Chinner
Quoted 7 lines · Felix Janda
The uint*_t and int*_t are defined by C99 and should be prefered over the less portable __uint*_t and __int*_t variants. The necessary <
stdint.h> include is inplatformdefs.h, which gets included in most places vialibxfs.h. In the public headers <stdint.h> is included in <xfs/xfs_types.h>.Signed-off-by Felix Janda <[email protected]>Quoted 8 lines
I can't apply this straight off. Most of the libxfs code that is changed is shared with the kernel code, and so the definitions of the variables need to be the same as the kernel code. There are reasons for the kernel code using __[u]int*_t type variants (e.g. I think the endian conversion static checker requires the __ variants for host order variables), and so before making sweeping changes like this we need to ensure that we can make the equivalent changes to the kernel code as well...
Thanks for the review!
Quoted 7 lines
Sorry, I was not aware about this difference between the types.
The simplest fix for musl would be to add defines or something similar to
linux.h.On the other hand, on the long run it would be preferable to use the stdint types (consistently).
Right, that's definitely the better solution. We can't just jump there in one go. :/
FWIW, changing everything outside libxfs/ and include/ should be ok to do straight away; it's just the libxfs stuff that we have other constraints on.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 1/6] Move from __uint*_t types to uint*_t and likewise for __int*_t
In reply to Dave ChinnerQuoted 8 lines · Dave Chinner
I can't apply this straight off. Most of the libxfs code that is changed is shared with the kernel code, and so the definitions of the variables need to be the same as the kernel code. There are reasons for the kernel code using __[u]int*_t type variants (e.g. I think the endian conversion static checker requires the __ variants for host order variables), and so before making sweeping changes like this we need to ensure that we can make the equivalent changes to the kernel code as well...
There is no functional requirement for these types. I'm not sure if they are an IRIXism, or something that was added during the early Linux port, but they certainly aren't nessecary.
I'd love to kill them in favour or either the kernel __u/s types or the C99 types which are like the urrent ones just without the __ prefix.
Maybe we should get an agreement which ones we want and ask Felix for a patch to the kernel tree?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 1/6] Move from __uint*_t types to uint*_t and likewise for __int*_t
Quoted 14 lines · Christoph Hellwig
Quoted 8 lines · Dave Chinner
I can't apply this straight off. Most of the libxfs code that is changed is shared with the kernel code, and so the definitions of the variables need to be the same as the kernel code. There are reasons for the kernel code using __[u]int*_t type variants (e.g. I think the endian conversion static checker requires the __ variants for host order variables), and so before making sweeping changes like this we need to ensure that we can make the equivalent changes to the kernel code as well...
There is no functional requirement for these types. I'm not sure if they are an IRIXism, or something that was added during the early Linux port, but they certainly aren't nessecary.
Quoted 5 lines
I'd love to kill them in favour or either the kernel __u/s types or the C99 types which are like the urrent ones just without the __ prefix.
Maybe we should get an agreement which ones we want and ask Felix for a patch to the kernel tree?
Either way is fine by me, but it's not a small patch - there's ~600 variables declared in fs/xfs with the __[u]int*_t types.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/6 libxfs/linux.c: Replace use of ustat by stat
In reply to a message not in the archiveustat has been used to check whether a device file is mounted. The function is deprecated and not supported by uclibc and musl. Now do the check using the *mntent functions.
Based on patch by Natanael Copa <[email protected]>.
--- libxfs/linux.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
libxfs/linux.c +20 -9
@@ -16,11 +16,8 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#define ustat __kernel_ustat#include <mntent.h> #include <sys/stat.h> -#undef ustat -#include <sys/ustat.h> #include <sys/mount.h> #include <sys/ioctl.h> #include <sys/sysinfo.h>
@@ -51,9 +48,10 @@ static int max_block_alignment;int platform_check_ismounted (char *name,char *block,struct stat64 *s,int verbose) { -/* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */ -struct ustat ust[2 ]; -struct stat64 st; +FILE *f; +struct stat64 st, mst; +struct mntent *mnt; +char mounts[MAXPATHLEN ];if (!s) {if (stat64 (block, &st) <0 )
@@ -63,14 +61,27 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) s = &st; } -if (ustat (s->st_rdev, ust) >=0 ) { +strcpy (mounts, (!access (PROC_MOUNTED ,R_OK )) ?PROC_MOUNTED :MOUNTED ); +if ((f =setmntent (mounts,"r" )) ==NULL ) { +fprintf (stderr, +_ ("%s: %s possibly contains a mounted filesystem\n" ), + progname, name); +return 1 ; + } +while ((mnt =getmntent (f)) !=NULL ) { +if (stat64 (mnt->mnt_dir, &mst) <0 ) +continue ; +if (mst.st_dev != s->st_rdev) +continue ; +if (verbose)fprintf (stderr,_ ("%s: %s contains a mounted filesystem\n" ), progname, name); -return 1 ; +break ; } -return 0 ; +endmntent (f); +return mnt ==NULL ; }int
Signature · 6 lines
2.4.10 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 3 lines · Felix Janda
ustat has been used to check whether a device file is mounted. The function is deprecated and not supported by uclibc and musl. Now do the check using the *mntent functions.
Which will cause problems with builds on other platforms. Why not just use statfs() instead?
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 6 lines · Dave Chinner
Quoted 3 lines · Felix Janda
ustat has been used to check whether a device file is mounted. The function is deprecated and not supported by uclibc and musl. Now do the check using the *mntent functions.
Which will cause problems with builds on other platforms.
This is the linux specific code...
Quoted 2 lines
Why not
just usestatfs()instead?
Since it does not have the functionality which ustat is used for.
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Felix Janda
ustat has been used to check whether a device file is mounted. The function is deprecated and not supported by uclibc and musl. Now do the check using the *mntent functions.
Based on patch by Natanael Copa <[email protected]>.
Signed-off-by Felix Janda <[email protected]>
ustat is a lot more efficient in checking for the mountedness than this loop, so I'd really prefer not to do this unconditionally.
As far as Linux is concerned the best thing we could do is to use O_EXCL for any open of a device file, as Linux overloadds O_EXCL behavior for block devices so that any other O_EXCL open will be rejected if one has the file open.
But that might be a major pain to find into the cross platform framework..
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · Felix Janda
ustat has been used to check whether a device file is mounted. The function is deprecated and not supported by uclibc and musl. Now do the check using the *mntent functions.
Based on patch by Natanael Copa <[email protected]>.
Signed-off-by Felix Janda <[email protected]>ustat is a lot more efficient in checking for the mountedness than this loop, so I'd really prefer not to do this unconditionally.
Is this really performance relevant?
Notice that linux's platform_check_iswritable does something very similar. I've tried to make it consistent with the version from freebsd.c.
Quoted 7 lines
As far as Linux is concerned the best thing we could do is to use
O_EXCLfor any open of a device file, as Linux overloaddsO_EXCLbehavior for block devices so that any otherO_EXCLopen will be rejected if one has the file open.But that might be a major pain to find into the cross platform framework..
Hmm, so we couldn't we use for linux just something like
intplatform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
{
int fd = open(block, O_EXCL);
int e = errno;
if (fd != -1) close(fd);
if (e == EBUSY) {
if (verbose)
fprintf(stderr, _("%s: %s contains a mounted filesystem\n"), progname, name);
return 1;
}
return 0;
}Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 1 line · Felix Janda
Is this really performance relevant?
I'm not entirely sure. There are systems with giant amounts of mounted file systems, in which case iterating each of them and requiring multiple syscalls each might not be a good idea.
Quoted 4 lines
Hmm, so we couldn't we use for linux just something like
int
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
Quoted 12 lines
{
int fd = open(block, O_EXCL);
int e = errno;
if (fd != -1) close(fd);
if (e == EBUSY) {
if (verbose)
fprintf(stderr, _("%s: %s contains a mounted filesystem\n"), progname, name);
return 1;
}
return 0;Please give me a couple of days to come up with an idea to use O_EXCL on Linux and work around it on other platforms in a more integrated way.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 6 lines · Christoph Hellwig
Quoted 1 line · Felix Janda
Is this really performance relevant?
I'm not entirely sure. There are systems with giant amounts of mounted file systems, in which case iterating each of them and requiring multiple syscalls each might not be a good idea.
Of course, it is not very elegant...
Quoted 15 lines
Quoted 15 lines
Hmm, so we couldn't we use for linux just something like
int
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose){ int fd = open(block, O_EXCL); int e = errno; if (fd != -1) close(fd); if (e == EBUSY) { if (verbose) fprintf(stderr, _("%s: %s contains a mounted filesystem\n"), progname, name); return 1; }
Quoted 4 lines
Quoted 1 line
return 0;Please give me a couple of days to come up with an idea to use
O_EXCLon Linux and work around it on other platforms in a more integrated way.
No problem. Thank you!
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 22 lines · Christoph Hellwig
Quoted 1 line · Felix Janda
Is this really performance relevant?
I'm not entirely sure. There are systems with giant amounts of mounted file systems, in which case iterating each of them and requiring multiple syscalls each might not be a good idea.
Quoted 15 lines
Hmm, so we couldn't we use for linux just something like
int
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose){ int fd = open(block, O_EXCL); int e = errno; if (fd != -1) close(fd); if (e == EBUSY) { if (verbose) fprintf(stderr, _("%s: %s contains a mounted filesystem\n"), progname, name); return 1; }
Quoted 4 lines
Quoted 1 line
return 0;Please give me a couple of days to come up with an idea to use
O_EXCLon Linux and work around it on other platforms in a more integrated way.
Ping?
Thanks,
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Sorr for not getting back to you. It turns out that simply using O_EXCL is fairly easy, but fitting it into a portabilitity framework isn't. So I think I'll have to give up on that attempt for now.
That being said I think ustat fits pretty well for this use case, so getting rid of it might need a little more justification.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Ok, this has become a bit more urgent:
Building on F24 on arm64, I noticed this:
../libxfs/.libs/libxfs.a(linux.o): In function `platform_check_ismounted':/root/sandeen/xfsprogs-dev/libxfs/linux.c:66: warning: ustat is not implemented and will always fail
And lo:
# xfs_metadump -o /dev/sda3 dump # mount /dev/sda3 /mnt/scratch # xfs_mdrestore dump /dev/sda3 # echo $? 0 #
Are we scared yet?
(I independently rewrote Felix's patch after seeing the above, then searched and found this old thread)
We need to fix this, now. Performance issues or not I'd advocate for taking this patch, unless hch made any progress on the O_EXCL approach.
Quoted 2 lines · hch
That being said I think ustat fits pretty well for this use case, so getting rid of it might need a little more justification.
but it looks like that ship has sailed.
So for this patch I'll add:
-Eric
Quoted 63 lines · Felix Janda
ustat has been used to check whether a device file is mounted. The function is deprecated and not supported by uclibc and musl. Now do the check using the *mntent functions.
Based on patch by Natanael Copa <[email protected]>.
Signed-off-by Felix Janda <[email protected]>--- libxfs/linux.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)libxfs/linux.c +17
-7@@ -16,11 +16,8 @@* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#define ustat __kernel_ustat#include <mntent.h> #include <sys/stat.h> -#undef ustat -#include <sys/ustat.h> #include <sys/mount.h> #include <sys/ioctl.h> #include <sys/sysinfo.h> @@ -51,9 +48,10 @@ static int max_block_alignment;int platform_check_ismounted (char *name,char *block,struct stat64 *s,int verbose) { -/* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */ -struct ustat ust[2 ]; -struct stat64 st; +FILE *f; +struct stat64 st, mst; +struct mntent *mnt; +char mounts[MAXPATHLEN ];if (!s) {if (stat64 (block, &st) <0 )@@ -63,14 +61,27 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) s = &st; } -if (ustat (s->st_rdev, ust) >=0 ) { +strcpy (mounts, (!access (PROC_MOUNTED ,R_OK )) ?PROC_MOUNTED :MOUNTED ); +if ((f =setmntent (mounts,"r" )) ==NULL ) { +fprintf (stderr, +_ ("%s: %s possibly contains a mounted filesystem\n" ), + progname, name); +return 1 ; + } +while ((mnt =getmntent (f)) !=NULL ) { +if (stat64 (mnt->mnt_dir, &mst) <0 ) +continue ; +if (mst.st_dev != s->st_rdev) +continue ; +if (verbose) fprintf(stderr, _("%s: %s contains a mounted filesystem\n"),
libxfs/linux.c platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) · line 87
Quoted 10 lines
libxfs/linux.c +3
-2progname, name); -return 1 ; +break ; } -return 0 ; +endmntent (f); +return mnt ==NULL ; }int
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Felix Janda
ustat has been used to check whether a device file is mounted. The function is deprecated and not supported by uclibc and musl. Now do the check using the *mntent functions.
Based on patch by Natanael Copa <[email protected]>.
Signed-off-by Felix Janda <[email protected]>
So, nobody has bothered to actually test this patch...
$ sudo mkfs.xfs -f -m rmapbt=1 -i sparse=1 -b size=1k /dev/sdc specified blocksize 1024 is less than device physical sector size 4096 switching to logical sector size 512 Usage: mkfs.xfs /* blocksize */ [-b log=n|size=num] /* metadata */ [-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1] .... $ sudo xfs_db /dev/sdc
fatal error -- couldn't initialize XFS library
$
And so on. Basic sanity testing fails.
Quoted 18 lines
libxfs/linux.c +13
-1@@ -63,14 +61,27 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) s = &st; } -if (ustat (s->st_rdev, ust) >=0 ) { +strcpy (mounts, (!access (PROC_MOUNTED ,R_OK )) ?PROC_MOUNTED :MOUNTED ); +if ((f =setmntent (mounts,"r" )) ==NULL ) { +fprintf (stderr, +_ ("%s: %s possibly contains a mounted filesystem\n" ), + progname, name); +return 1 ; + } +while ((mnt =getmntent (f)) !=NULL ) { +if (stat64 (mnt->mnt_dir, &mst) <0 ) +continue ; +if (mst.st_dev != s->st_rdev) +continue ; +
libxfs/linux.c platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) · line 84
Quoted 10 lines
libxfs/linux.c +3
-2if (verbose)fprintf (stderr,_ ("%s: %s contains a mounted filesystem\n" ), progname, name); -return 1 ; +break ; } -return 0 ; +endmntent (f); +return mnt ==NULL ;
Because that return statement has the wrong logic. It should be:
+ return mnt != NULL;
to return the correct values.
In future, please do more than a compile test on your patches before sending them to the list for review, no matter how simple and obviously correct you think they are!
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/6 fsr/xfs_fsr.c: Include <paths.h> for _PATH_MOUNTED
In reply to a message not in the archiveFixes a compilation failure with musl libc
--- fsr/xfs_fsr.c | 1 + 1 file changed, 1 insertion(+)
fsr/xfs_fsr.c +1 -0
@@ -31,6 +31,7 @@#include <sys/wait.h> #include <sys/statvfs.h> #include <sys/xattr.h> +#include <paths.h> #ifndef XFS_XFLAG_NODEFRAG #define XFS_XFLAG_NODEFRAG 0x00002000/* src dependancy, remove later */
Signature · 6 lines
2.4.10 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 3/6] fsr/xfs_fsr.c: Include <paths.h> for _PATH_MOUNTED
Quoted 3 lines · Felix Janda
Fixes a compilation failure with musl libc
Signed-off-by Felix Janda <[email protected]>
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 4/6 linux.h: Use off64_t instead of loff_t
In reply to a message not in the archiveThese are equivalent on glibc, while musl does not know loff_t.
In the long run, it would be preferable to enable transparent LFS so that off64_t could be replaced by off_t.
--- include/linux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux.h +1 -1
@@ -141,7 +141,7 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)#define EFSCORRUPTED EUCLEAN/* Filesystem is corrupted */ #define EFSBADCRC EBADMSG/* Bad CRC detected */ -typedef loff_t xfs_off_t ; +typedef off64_t xfs_off_t ;typedef uint64_t xfs_ino_t ;typedef uint32_t xfs_dev_t ;typedef int64_t xfs_daddr_t ;
Signature · 6 lines
2.4.10 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 4/6] linux.h: Use off64_t instead of loff_t
Quoted 6 lines · Felix Janda
These are equivalent on glibc, while musl does not know
loff_t.In the long run, it would be preferable to enable transparent LFS so that
off64_tcould be replaced byoff_t.Signed-off-by Felix Janda <[email protected]>
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 5/6 include/linux.h: Include <stdio.h> for fprintf and stderr
In reply to a message not in the archive--- include/linux.h | 1 + 1 file changed, 1 insertion(+)
include/linux.h +1 -0
@@ -29,6 +29,7 @@#include <errno.h> #include <endian.h> #include <stdbool.h> +#include <stdio.h> #include <asm/types.h> #include <mntent.h>
Signature · 6 lines
2.4.10 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 5/6] include/linux.h: Include <stdio.h> for fprintf and stderr
Quoted 1 line · Felix Janda
Signed-off-by Felix Janda <[email protected]>
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 6/6 Add configure check for members of dirent for use in io/readdir.c
In reply to a message not in the archive--- configure.ac | 7 +++++++ include/builddefs.in | 4 ++++ io/Makefile | 10 ++++++++++ 3 files changed, 21 insertions(+)
configure.ac +7 -0
@@ -135,5 +135,12 @@ AC_CHECK_SIZEOF([char *]) AC_TYPE_UMODE_T AC_MANUAL_FORMAT +AC_CHECK_MEMBERS([struct dirent.d_reclen],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_reclen) +AC_CHECK_MEMBERS([struct dirent.d_off],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_off) +AC_CHECK_MEMBERS([struct dirent.d_type],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_type) + AC_CONFIG_FILES([include/builddefs]) AC_OUTPUT
include/builddefs.in +4 -0
@@ -109,6 +109,10 @@ HAVE_FLS = @have_fls@ HAVE_FSETXATTR = @have_fsetxattr@ HAVE_MREMAP = @have_mremap@ +HAVE_STRUCT_DIRENT_D_RECLEN = @ac_cv_member_struct_dirent_d_reclen@ +HAVE_STRUCT_DIRENT_D_OFF = @ac_cv_member_struct_dirent_d_off@ +HAVE_STRUCT_DIRENT_D_TYPE = @ac_cv_member_struct_dirent_d_type@ + GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
io/Makefile +10 -0
@@ -94,6 +94,16 @@ ifeq ($(HAVE_MREMAP),yes) LCFLAGS += -DHAVE_MREMAP endif +ifeq ($(HAVE_STRUCT_DIRENT_D_RECLEN),yes) +LCFLAGS += -D_DIRENT_HAVE_D_RECLEN +endif +ifeq ($(HAVE_STRUCT_DIRENT_D_OFF),yes) +LCFLAGS += -D_DIRENT_HAVE_D_OFF +endif +ifeq ($(HAVE_STRUCT_DIRENT_D_TYPE),yes) +LCFLAGS += -D_DIRENT_HAVE_D_TYPE +endif + default: depend $(LTCOMMAND) include $(BUILDRULES)
Signature · 6 lines
2.4.10 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 6/6] Add configure check for members of dirent for use in io/readdir.c
Quoted 44 lines · Felix Janda
Signed-off-by Felix Janda <[email protected]>--- configure.ac | 7 +++++++ include/builddefs.in | 4 ++++ io/Makefile | 10 ++++++++++ 3 files changed, 21 insertions(+)configure.ac +7
-0@@ -135,5 +135,12 @@ AC_CHECK_SIZEOF([char *]) AC_TYPE_UMODE_T AC_MANUAL_FORMAT +AC_CHECK_MEMBERS([struct dirent.d_reclen],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_reclen) +AC_CHECK_MEMBERS([struct dirent.d_off],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_off) +AC_CHECK_MEMBERS([struct dirent.d_type],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_type) + AC_CONFIG_FILES([include/builddefs]) AC_OUTPUTinclude/builddefs.in +4
-0@@ -109,6 +109,10 @@ HAVE_FLS = @have_fls@ HAVE_FSETXATTR = @have_fsetxattr@ HAVE_MREMAP = @have_mremap@ +HAVE_STRUCT_DIRENT_D_RECLEN = @ac_cv_member_struct_dirent_d_reclen@ +HAVE_STRUCT_DIRENT_D_OFF = @ac_cv_member_struct_dirent_d_off@ +HAVE_STRUCT_DIRENT_D_TYPE = @ac_cv_member_struct_dirent_d_type@ + GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-declio/Makefile +0
-0
io/Makefile ifeq ($(HAVE_MREMAP),yes) · line 99
Quoted 6 lines
io/Makefile +3
-0@@ -94,6 +94,16 @@ ifeq ($(HAVE_MREMAP),yes) LCFLAGS += -DHAVE_MREMAP endif +ifeq ($(HAVE_STRUCT_DIRENT_D_RECLEN),yes) +LCFLAGS += -D_DIRENT_HAVE_D_RECLEN +endif
The C library should be defining these if those fields are supported, right?
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 6/6] Add configure check for members of dirent for use in io/readdir.c
Quoted 48 lines · Dave Chinner
Quoted 47 lines · Felix Janda
Signed-off-by Felix Janda <[email protected]>--- configure.ac | 7 +++++++ include/builddefs.in | 4 ++++ io/Makefile | 10 ++++++++++ 3 files changed, 21 insertions(+)configure.ac +7
-0@@ -135,5 +135,12 @@ AC_CHECK_SIZEOF([char *]) AC_TYPE_UMODE_T AC_MANUAL_FORMAT +AC_CHECK_MEMBERS([struct dirent.d_reclen],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_reclen) +AC_CHECK_MEMBERS([struct dirent.d_off],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_off) +AC_CHECK_MEMBERS([struct dirent.d_type],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_type) + AC_CONFIG_FILES([include/builddefs]) AC_OUTPUTinclude/builddefs.in +4
-0@@ -109,6 +109,10 @@ HAVE_FLS = @have_fls@ HAVE_FSETXATTR = @have_fsetxattr@ HAVE_MREMAP = @have_mremap@ +HAVE_STRUCT_DIRENT_D_RECLEN = @ac_cv_member_struct_dirent_d_reclen@ +HAVE_STRUCT_DIRENT_D_OFF = @ac_cv_member_struct_dirent_d_off@ +HAVE_STRUCT_DIRENT_D_TYPE = @ac_cv_member_struct_dirent_d_type@ + GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-declio/Makefile +0
-0@@ -94,6 +94,16 @@ ifeq ($(HAVE_MREMAP),yes) LCFLAGS += -DHAVE_MREMAP endif
Quoted 6 lines
io/Makefile ifeq ($(HAVE_MREMAP),yes) · line 99
Quoted 3 lines
io/Makefile +3
-0+ifeq ($(HAVE_STRUCT_DIRENT_D_RECLEN),yes) +LCFLAGS += -D_DIRENT_HAVE_D_RECLEN +endifThe C library should be defining these if those fields are supported, right?
It is strongly advised not to use these non-standard fields of dirent. These macros are a feature of glibc. See also
https://seiscode.iris.washington.edu/issues/676
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 6/6] Add configure check for members of dirent for use in io/readdir.c
Quoted 49 lines · Felix Janda
Quoted 48 lines · Dave Chinner
Quoted 47 lines · Felix Janda
Signed-off-by Felix Janda <[email protected]>--- configure.ac | 7 +++++++ include/builddefs.in | 4 ++++ io/Makefile | 10 ++++++++++ 3 files changed, 21 insertions(+)configure.ac +7
-0@@ -135,5 +135,12 @@ AC_CHECK_SIZEOF([char *]) AC_TYPE_UMODE_T AC_MANUAL_FORMAT +AC_CHECK_MEMBERS([struct dirent.d_reclen],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_reclen) +AC_CHECK_MEMBERS([struct dirent.d_off],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_off) +AC_CHECK_MEMBERS([struct dirent.d_type],[],[],[[#include <dirent.h>]]) +AC_SUBST(ac_cv_member_struct_dirent_d_type) + AC_CONFIG_FILES([include/builddefs]) AC_OUTPUTinclude/builddefs.in +4
-0@@ -109,6 +109,10 @@ HAVE_FLS = @have_fls@ HAVE_FSETXATTR = @have_fsetxattr@ HAVE_MREMAP = @have_mremap@ +HAVE_STRUCT_DIRENT_D_RECLEN = @ac_cv_member_struct_dirent_d_reclen@ +HAVE_STRUCT_DIRENT_D_OFF = @ac_cv_member_struct_dirent_d_off@ +HAVE_STRUCT_DIRENT_D_TYPE = @ac_cv_member_struct_dirent_d_type@ + GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-declio/Makefile +0
-0@@ -94,6 +94,16 @@ ifeq ($(HAVE_MREMAP),yes) LCFLAGS += -DHAVE_MREMAP endif
Quoted 8 lines
Quoted 6 lines
io/Makefile ifeq ($(HAVE_MREMAP),yes) · line 99
Quoted 3 lines
io/Makefile +3
-0+ifeq ($(HAVE_STRUCT_DIRENT_D_RECLEN),yes) +LCFLAGS += -D_DIRENT_HAVE_D_RECLEN +endifThe C library should be defining these if those fields are supported, right?
It is strongly advised not to use these non-standard fields of dirent.
We're not writing POSIX applications here - this is a diagnostic tool so if we are running on linux we need to expose them.
If we've got linux C libraries that don't provide feature macros for the fields in the linux_dirent eposed by readdir(3), then I guess we're stuck with having to play autoconf games, eh?
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 6/6] Add configure check for members of dirent for use in io/readdir.c
In reply to Felix JandaI think we're having a deeper issue here. For an LFS build we absolutely should have these values as the kernel dirent64 has them.
Either we manage to not pull in the LFS version of readdir/getdents or musl is doing something inredibly stupid. Can you investigate if and why we're not using the LFS getdents64 here?
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 6/6] Add configure check for members of dirent for use in io/readdir.c
Quoted 6 lines · Christoph Hellwig
I think we're having a deeper issue here. For an LFS build we absolutely should have these values as the kernel dirent64 has them.
Either we manage to not pull in the LFS version of readdir/getdents or musl is doing something inredibly stupid. Can you investigate if and why we're not using the LFS getdents64 here?
With musl you always have LFS. However still musl does not define the _DIRENT_HAVE_*. You can see the full dirent.h at:
http://git.musl-libc.org/cgit/musl/tree/include/dirent.h
I will ask on the musl list whether these constants can be added. So you can disregard this patch.
However notice that these constants are not defined when not on linux or with glibc, e.g. freebsd (without k). On these systems the code in io/readdir.c just happens to have worked because either dirent.d_namelen exists or nobody has tested it on these systems.
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 6/6] Add configure check for members of dirent for use in io/readdir.c
Quoted 8 lines · Felix Janda
Quoted 6 lines · Christoph Hellwig
I think we're having a deeper issue here. For an LFS build we absolutely should have these values as the kernel dirent64 has them.
Either we manage to not pull in the LFS version of readdir/getdents or musl is doing something inredibly stupid. Can you investigate if and why we're not using the LFS getdents64 here?
Quoted 7 lines
With musl you always have LFS. However still musl does not define the _DIRENT_HAVE_*. You can see the full
dirent.hat:http://git.musl-libc.org/cgit/musl/tree/include/dirent.h
I will ask on the musl list whether these constants can be added. So you can disregard this patch.
Oh, ok. That's a little weird, but I guess working around that with a new autoconf test is fine.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 6/6] Add configure check for members of dirent for use in io/readdir.c
Quoted 12 lines · Christoph Hellwig
Quoted 11 lines · Felix Janda
Quoted 6 lines · Christoph Hellwig
I think we're having a deeper issue here. For an LFS build we absolutely should have these values as the kernel dirent64 has them.
Either we manage to not pull in the LFS version of readdir/getdents or musl is doing something inredibly stupid. Can you investigate if and why we're not using the LFS getdents64 here?
With musl you always have LFS. However still musl does not define the _DIRENT_HAVE_*. You can see the full
dirent.hat:
Quoted 7 lines
Quoted 4 lines
http://git.musl-libc.org/cgit/musl/tree/include/dirent.h
I will ask on the musl list whether these constants can be added. So you can disregard this patch.
Oh, ok. That's a little weird, but I guess working around that with a new autoconf test is fine.
Actually, it should also be useful for other systems. For example, on FreeBSD dirent has d_type (but does not declare _DIRENT_HAVE_D_TYPE), but currently dump_dirent() does not print it.
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs