xfs_agblock_t first_agbno;
-__uint64_t barcount[11];
+uint64_t barcount[11];
unsigned int num_targets;
target_control *target;
}
void
-init_bar(__uint64_t source_blocks)
+init_bar(uint64_t source_blocks)
{
int i;
}
int
-bump_bar(int tenths, __uint64_t numblocks)
+bump_bar(int tenths, uint64_t numblocks)
{
static char *bar[11] = {
" 0% ",
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;
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;
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;
{ "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 }
{ "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 },
}
}
-__int64_t
+int64_t
getbitval(
void *obj,
int bitoff,
int bit;
int i;
char *p;
- __int64_t rval;
+ int64_t rval;
int signext;
int z1, z2, z3, z4;
#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);
}
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;
}
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]);
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;
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;
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;
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;
}
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)
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;
#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))))
(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,
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;
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);
{ "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) {
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:
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;
cval_t cvals[NCTS] = {};
int i;
int mask;
- __uint64_t v;
+ uint64_t v;
ctype_t wtype;
/* move past the "convert" command */
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') {
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;
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;
}
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);
}
{
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;
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);
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);
}
attr_sf_entry_size, FTARG_SIZE, NULL, attr_sf_entry_flds },
{ FLDT_ATTR_SF_HDR, "attr_sf_hdr", NULL, (char *)attr_sf_hdr_flds,
SI(bitsz(struct xfs_attr_sf_hdr)), 0, NULL, attr_sf_hdr_flds },
- { FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
+ { FLDT_ATTRBLOCK, "attrblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
fa_attrblock, NULL },
{ FLDT_ATTRSHORT, "attrshort", NULL, (char *)attr_shortform_flds,
attrshort_size, FTARG_SIZE, NULL, attr_shortform_flds },
SI(bitsz(struct xfs_refcount_rec)), 0, NULL, refcbt_rec_flds },
/* CRC field */
- { FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(__uint32_t)),
+ { FLDT_CRC, "crc", fp_crc, "%#x (%s)", SI(bitsz(uint32_t)),
0, NULL, NULL },
{ FLDT_DEV, "dev", fp_num, "%#x", SI(bitsz(xfs_dev_t)), 0, NULL, NULL },
{ FLDT_DINODE_CORE, "dinode_core", NULL, (char *)inode_core_flds,
SI(bitsz(xfs_dinode_t)), 0, NULL, inode_core_flds },
{ FLDT_DINODE_FMT, "dinode_fmt", fp_dinode_fmt, NULL,
- SI(bitsz(__int8_t)), 0, NULL, NULL },
+ SI(bitsz(int8_t)), 0, NULL, NULL },
{ FLDT_DINODE_U, "dinode_u", NULL, (char *)inode_u_flds, inode_u_size,
FTARG_SIZE|FTARG_OKEMPTY, NULL, inode_u_flds },
{ FLDT_DINODE_V3, "dinode_v3", NULL, (char *)inode_v3_flds,
{ FLDT_DA3_NODE_HDR, "dir_node_hdr", NULL, (char *)da3_node_hdr_flds,
SI(bitsz(struct xfs_da3_node_hdr)), 0, NULL, da3_node_hdr_flds },
- { FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(__uint32_t)), 0,
+ { FLDT_DIRBLOCK, "dirblock", fp_num, "%u", SI(bitsz(uint32_t)), 0,
fa_dirblock, NULL },
{ FLDT_DISK_DQUOT, "disk_dquot", NULL, (char *)disk_dquot_flds,
SI(bitsz(xfs_disk_dquot_t)), 0, NULL, disk_dquot_flds },
FTARG_SIZE, NULL, inode_crc_flds },
{ FLDT_INOFREE, "inofree", fp_num, "%#llx", SI(bitsz(xfs_inofree_t)), 0,
NULL, NULL },
- { FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(__int16_t)),
+ { FLDT_INT16D, "int16d", fp_num, "%d", SI(bitsz(int16_t)),
FTARG_SIGNED, NULL, NULL },
- { FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(__int32_t)),
+ { FLDT_INT32D, "int32d", fp_num, "%d", SI(bitsz(int32_t)),
FTARG_SIGNED, NULL, NULL },
- { FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(__int64_t)),
+ { FLDT_INT64D, "int64d", fp_num, "%lld", SI(bitsz(int64_t)),
FTARG_SIGNED, NULL, NULL },
- { FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(__int8_t)), FTARG_SIGNED,
+ { FLDT_INT8D, "int8d", fp_num, "%d", SI(bitsz(int8_t)), FTARG_SIGNED,
NULL, NULL },
- { FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(__int32_t)), FTARG_SIGNED,
+ { FLDT_NSEC, "nsec", fp_num, "%09d", SI(bitsz(int32_t)), FTARG_SIGNED,
NULL, NULL },
{ FLDT_QCNT, "qcnt", fp_num, "%llu", SI(bitsz(xfs_qcnt_t)), 0, NULL,
NULL },
{ FLDT_SYMLINK_CRC, "symlink", NULL, (char *)symlink_crc_flds,
symlink_size, FTARG_SIZE, NULL, symlink_crc_flds },
- { FLDT_TIME, "time", fp_time, NULL, SI(bitsz(__int32_t)), FTARG_SIGNED,
+ { FLDT_TIME, "time", fp_time, NULL, SI(bitsz(int32_t)), FTARG_SIGNED,
NULL, NULL },
{ FLDT_TIMESTAMP, "timestamp", NULL, (char *)timestamp_flds,
SI(bitsz(xfs_timestamp_t)), 0, NULL, timestamp_flds },
{ FLDT_UINT1, "uint1", fp_num, "%u", SI(1), 0, NULL, NULL },
- { FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(__uint16_t)), 0, NULL,
+ { FLDT_UINT16D, "uint16d", fp_num, "%u", SI(bitsz(uint16_t)), 0, NULL,
NULL },
- { FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(__uint16_t)), 0,
+ { FLDT_UINT16O, "uint16o", fp_num, "%#o", SI(bitsz(uint16_t)), 0,
NULL, NULL },
- { FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(__uint16_t)), 0,
+ { FLDT_UINT16X, "uint16x", fp_num, "%#x", SI(bitsz(uint16_t)), 0,
NULL, NULL },
- { FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(__uint32_t)), 0, NULL,
+ { FLDT_UINT32D, "uint32d", fp_num, "%u", SI(bitsz(uint32_t)), 0, NULL,
NULL },
- { FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(__uint32_t)), 0,
+ { FLDT_UINT32O, "uint32o", fp_num, "%#o", SI(bitsz(uint32_t)), 0,
NULL, NULL },
- { FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(__uint32_t)), 0,
+ { FLDT_UINT32X, "uint32x", fp_num, "%#x", SI(bitsz(uint32_t)), 0,
NULL, NULL },
- { FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(__uint64_t)), 0,
+ { FLDT_UINT64D, "uint64d", fp_num, "%llu", SI(bitsz(uint64_t)), 0,
NULL, NULL },
- { FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(__uint64_t)), 0,
+ { FLDT_UINT64O, "uint64o", fp_num, "%#llo", SI(bitsz(uint64_t)), 0,
NULL, NULL },
- { FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(__uint64_t)), 0,
+ { FLDT_UINT64X, "uint64x", fp_num, "%#llx", SI(bitsz(uint64_t)), 0,
NULL, NULL },
- { FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(__uint8_t)), 0, NULL,
+ { FLDT_UINT8D, "uint8d", fp_num, "%u", SI(bitsz(uint8_t)), 0, NULL,
NULL },
- { FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(__uint8_t)), 0, NULL,
+ { FLDT_UINT8O, "uint8o", fp_num, "%#o", SI(bitsz(uint8_t)), 0, NULL,
NULL },
- { FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(__uint8_t)), 0, NULL,
+ { FLDT_UINT8X, "uint8x", fp_num, "%#x", SI(bitsz(uint8_t)), 0, NULL,
NULL },
{ FLDT_UUID, "uuid", fp_uuid, NULL, SI(bitsz(uuid_t)), 0, NULL, NULL },
{ FLDT_ZZZ, NULL }
int bitpos;
int i;
int isnull;
- __int64_t val;
+ int64_t val;
for (i = 0, bitpos = bit;
i < count && !seenint();
else if (size > 32)
dbprintf(fmtstr, val);
else
- dbprintf(fmtstr, (__int32_t)val);
+ dbprintf(fmtstr, (int32_t)val);
if (i < count - 1)
dbprintf(" ");
}
{
int bitpos;
int i;
- __int64_t val;
+ int64_t val;
char *ok;
switch (iocur_crc_valid()) {
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(" ");
}
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;
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;
{ "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 }
{ "inumber", FLDT_INO, OI(COFF(ino)), C1, 0, TYP_NONE },
{ "uuid", FLDT_UUID, OI(COFF(uuid)), C1, 0, TYP_NONE },
{ "reflink", FLDT_UINT1,
- OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
+ OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_REFLINK_BIT-1), C1,
0, TYP_NONE },
{ "cowextsz", FLDT_UINT1,
- OI(COFF(flags2) + bitsz(__uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
+ OI(COFF(flags2) + bitsz(uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT-1), C1,
0, TYP_NONE },
{ NULL }
};
struct xfs_buf *bp;
xfs_ino_t dirino;
xfs_ino_t ino;
- __uint16_t mode;
+ uint16_t mode;
const struct xfs_buf_ops *ops = type ? type->bops : NULL;
if (iocur_sp < 0) {
} 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 */
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 */
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 *type, xfs_daddr_t blknum,
int len, int ring_add, bbmap_t *bbmap);
static int
write_buf_segment(
char *data,
- __int64_t off,
+ int64_t off,
int len)
{
int i;
{
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);
static void
obfuscate_path_components(
char *buf,
- __uint64_t len)
+ uint64_t len)
{
unsigned char *comp = (unsigned char *)buf;
unsigned char *end = comp + len;
process_sf_symlink(
xfs_dinode_t *dip)
{
- __uint64_t len;
+ uint64_t len;
char *buf;
len = be64_to_cpu(dip->di_size);
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;
return success;
}
-static __uint32_t inodes_copied = 0;
+static uint32_t inodes_copied;
static int
copy_inode_chunk(
}
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;
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 */
int outmap_size = 0;
int RealUid;
int tmp_agi;
-static __int64_t minimumfree = 2048;
+static int64_t minimumfree = 2048;
#define MNTTYPE_XFS "xfs"
typedef unsigned long long int __u64;
typedef signed long long int __s64;
-#define __int8_t int8_t
-#define __int16_t int16_t
-#define __int32_t int32_t
-#define __int32_t int32_t
-#define __int64_t int64_t
-#define __uint8_t u_int8_t
-#define __uint16_t u_int16_t
-#define __uint32_t u_int32_t
-#define __uint64_t u_int64_t
+#define int8_t int8_t
+#define int16_t int16_t
+#define int32_t int32_t
+#define int32_t int32_t
+#define int64_t int64_t
+#define uint8_t u_int8_t
+#define uint16_t u_int16_t
+#define uint32_t u_int32_t
+#define uint64_t u_int64_t
typedef off_t xfs_off_t;
typedef u_int64_t xfs_ino_t;
typedef signed long long int __s64;
typedef off_t xfs_off_t;
-typedef __uint64_t xfs_ino_t;
-typedef __uint32_t xfs_dev_t;
-typedef __int64_t xfs_daddr_t;
+typedef uint64_t xfs_ino_t;
+typedef uint32_t xfs_dev_t;
+typedef int64_t xfs_daddr_t;
typedef __u32 xfs_nlink_t;
#define O_LARGEFILE 0
typedef signed long long int __s64;
typedef off_t xfs_off_t;
-typedef __uint64_t xfs_ino_t;
-typedef __uint32_t xfs_dev_t;
-typedef __int64_t xfs_daddr_t;
+typedef uint64_t xfs_ino_t;
+typedef uint32_t xfs_dev_t;
+typedef int64_t xfs_daddr_t;
typedef __u32 xfs_nlink_t;
#define HAVE_FID 1
extern void
calc_default_ag_geometry(
int blocklog,
- __uint64_t dblocks,
+ uint64_t dblocks,
int multidisk,
- __uint64_t *agsize,
- __uint64_t *agcount);
+ uint64_t *agsize,
+ uint64_t *agcount);
extern int
check_overwrite(
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;
#define EFSBADCRC EBADMSG /* Bad CRC detected */
typedef off_t xfs_off_t;
-typedef __uint64_t xfs_ino_t;
-typedef __uint32_t xfs_dev_t;
-typedef __int64_t xfs_daddr_t;
+typedef uint64_t xfs_ino_t;
+typedef uint32_t xfs_dev_t;
+typedef int64_t xfs_daddr_t;
typedef __u32 xfs_nlink_t;
/**
*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);
static inline void
xfs_set_projid(struct xfs_icdinode *id, prid_t projid)
{
- id->di_projid_hi = (__uint16_t) (projid >> 16);
- id->di_projid_lo = (__uint16_t) (projid & 0xffff);
+ id->di_projid_hi = (uint16_t) (projid >> 16);
+ id->di_projid_lo = (uint16_t) (projid & 0xffff);
}
static inline bool xfs_is_reflink_inode(struct xfs_inode *ip)
#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)
typedef struct xfs_metablock {
__be32 mb_magic;
__be16 mb_count;
- __uint8_t mb_blocklog;
- __uint8_t mb_info;
+ uint8_t mb_blocklog;
+ uint8_t mb_info;
/* followed by an array of xfs_daddr_t */
} xfs_metablock_t;
#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 */
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 */
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 */
struct xfs_ag_resv pag_agfl_resv;
/* reference count */
- __uint8_t pagf_refcount_level;
+ uint8_t pagf_refcount_level;
} xfs_perag_t;
static inline struct xfs_ag_resv *
{
char hbuf [MAXHANSIZ];
int ret;
- __uint32_t handlen;
+ uint32_t handlen;
xfs_fsop_handlereq_t hreq;
if (opcode == XFS_IOC_FD_TO_HANDLE) {
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;
#endif /* ENABLE_BLKID */
#include "xfs_multidisk.h"
-#define TERABYTES(count, blog) ((__uint64_t)(count) << (40 - (blog)))
-#define GIGABYTES(count, blog) ((__uint64_t)(count) << (30 - (blog)))
-#define MEGABYTES(count, blog) ((__uint64_t)(count) << (20 - (blog)))
+#define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog)))
+#define GIGABYTES(count, blog) ((uint64_t)(count) << (30 - (blog)))
+#define MEGABYTES(count, blog) ((uint64_t)(count) << (20 - (blog)))
void
calc_default_ag_geometry(
int blocklog,
- __uint64_t dblocks,
+ uint64_t dblocks,
int multidisk,
- __uint64_t *agsize,
- __uint64_t *agcount)
+ uint64_t *agsize,
+ uint64_t *agcount)
{
- __uint64_t blocks = 0;
+ uint64_t blocks = 0;
int shift = 0;
/*
void
platform_findsizes(char *path, int fd, long long *sz, int *bsz)
{
- __uint64_t size;
+ uint64_t size;
struct stat st;
if (fstat(fd, &st) < 0) {
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) {
* 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);
int platform_has_uuid = 0;
extern char *progname;
-extern __int64_t findsize(char *);
+extern int64_t findsize(char *);
int
platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
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);
platform_findsizes(char *path, int fd, long long *sz, int *bsz)
{
struct stat st;
- __uint64_t size;
+ uint64_t size;
int error;
if (fstat(fd, &st) < 0) {
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);
}
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));
}
/*
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);
if (flags & XFS_ICHGTIME_CHG)
VFS_I(ip)->i_ctime = tv;
if (flags & XFS_ICHGTIME_CREATE) {
- ip->i_d.di_crtime.t_sec = (__int32_t)tv.tv_sec;
- ip->i_d.di_crtime.t_nsec = (__int32_t)tv.tv_nsec;
+ ip->i_d.di_crtime.t_sec = (int32_t)tv.tv_sec;
+ ip->i_d.di_crtime.t_nsec = (int32_t)tv.tv_nsec;
}
}
ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid));
VFS_I(ip)->i_version = 1;
ip->i_d.di_flags2 = 0;
- ip->i_d.di_crtime.t_sec = (__int32_t)VFS_I(ip)->i_mtime.tv_sec;
- ip->i_d.di_crtime.t_nsec = (__int32_t)VFS_I(ip)->i_mtime.tv_nsec;
+ ip->i_d.di_crtime.t_sec = (int32_t)VFS_I(ip)->i_mtime.tv_sec;
+ ip->i_d.di_crtime.t_nsec = (int32_t)VFS_I(ip)->i_mtime.tv_nsec;
}
flags = XFS_ILOG_CORE;
{
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
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;
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,
mp->m_sb.sb_rbmino = rbmip->i_ino;
rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
- *(__uint64_t *)&VFS_I(rbmip)->i_atime = 0;
+ *(uint64_t *)&VFS_I(rbmip)->i_atime = 0;
libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
libxfs_log_sb(tp);
mp->m_rbmip = rbmip;
},
};
-#define TERABYTES(count, blog) ((__uint64_t)(count) << (40 - (blog)))
-#define GIGABYTES(count, blog) ((__uint64_t)(count) << (30 - (blog)))
-#define MEGABYTES(count, blog) ((__uint64_t)(count) << (20 - (blog)))
+#define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog)))
+#define GIGABYTES(count, blog) ((uint64_t)(count) << (30 - (blog)))
+#define MEGABYTES(count, blog) ((uint64_t)(count) << (20 - (blog)))
/*
* Use this macro before we have superblock and mount structure
xfs_rfsblock_t *logblocks,
int blocklog)
{
- __uint64_t tmp_logblocks;
+ uint64_t tmp_logblocks;
/*
* Make sure that the log size is a multiple of the stripe unit
xfs_mount_t *mp,
int lsflag,
xfs_fsblock_t logstart,
- __uint64_t agsize,
+ uint64_t agsize,
int sunit,
xfs_rfsblock_t *logblocks,
int blocklog,
}
void
-validate_log_size(__uint64_t logblocks, int blocklog, int min_logblocks)
+validate_log_size(uint64_t logblocks, int blocklog, int min_logblocks)
{
if (logblocks < min_logblocks) {
fprintf(stderr,
static int
calc_default_imaxpct(
int blocklog,
- __uint64_t dblocks)
+ uint64_t dblocks)
{
/*
* This returns the % of the disk space that is used for
static void
validate_ag_geometry(
int blocklog,
- __uint64_t dblocks,
- __uint64_t agsize,
- __uint64_t agcount)
+ uint64_t dblocks,
+ uint64_t agsize,
+ uint64_t agcount)
{
if (agsize < XFS_AG_MIN_BLOCKS(blocklog)) {
fprintf(stderr,
{
void *buf;
xfs_sb_t sb;
- __uint32_t bsize;
+ uint32_t bsize;
int i;
xfs_off_t off;
i != sb.sb_blocklog)
goto done;
- if (sb.sb_dblocks > ((__uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
- sb.sb_dblocks < ((__uint64_t)(sb.sb_agcount - 1) *
+ if (sb.sb_dblocks > ((uint64_t)sb.sb_agcount * sb.sb_agblocks) ||
+ sb.sb_dblocks < ((uint64_t)(sb.sb_agcount - 1) *
sb.sb_agblocks + XFS_MIN_AG_BLOCKS))
goto done;
}
static void
-discard_blocks(dev_t dev, __uint64_t nsectors)
+discard_blocks(dev_t dev, uint64_t nsectors)
{
int fd;
int argc,
char **argv)
{
- __uint64_t agcount;
+ uint64_t agcount;
xfs_agf_t *agf;
xfs_agi_t *agi;
xfs_agnumber_t agno;
- __uint64_t agsize;
+ uint64_t agsize;
xfs_alloc_rec_t *arec;
struct xfs_btree_block *block;
int blflag;
char *rtsize;
xfs_sb_t *sbp;
int sectorlog;
- __uint64_t sector_mask;
+ uint64_t sector_mask;
int slflag;
int ssflag;
- __uint64_t tmp_agsize;
+ uint64_t tmp_agsize;
uuid_t uuid;
int worst_freelist;
libxfs_init_t xi;
if (dsize) {
- __uint64_t dbytes;
+ uint64_t dbytes;
dbytes = getnum(dsize, &dopts, D_SIZE);
if (dbytes % XFS_MIN_BLOCKSIZE) {
}
if (logsize) {
- __uint64_t logbytes;
+ uint64_t logbytes;
logbytes = getnum(logsize, &lopts, L_SIZE);
if (logbytes % XFS_MIN_BLOCKSIZE) {
(long long)(logblocks << blocklog));
}
if (rtsize) {
- __uint64_t rtbytes;
+ uint64_t rtbytes;
rtbytes = getnum(rtsize, &ropts, R_SIZE);
if (rtbytes % XFS_MIN_BLOCKSIZE) {
* If specified, check rt extent size against its constraints.
*/
if (rtextsize) {
- __uint64_t rtextbytes;
+ uint64_t rtextbytes;
rtextbytes = getnum(rtextsize, &ropts, R_EXTSIZE);
if (rtextbytes % blocksize) {
* and the underlying volume is striped, then set rtextblocks
* to the stripe width.
*/
- __uint64_t rswidth;
- __uint64_t rtextbytes;
+ uint64_t rswidth;
+ uint64_t rtextbytes;
if (!norsflag && !xi.risfile && !(!rtsize && xi.disfile))
rswidth = ft.rtswidth;
* multiple of the sector size, or 1024, whichever is larger.
*/
- sector_mask = (__uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
+ sector_mask = (uint64_t)-1 << (MAX(sectorlog, 10) - BBSHIFT);
xi.dsize &= sector_mask;
xi.rtsize &= sector_mask;
- xi.logBBsize &= (__uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
+ xi.logBBsize &= (uint64_t)-1 << (MAX(lsectorlog, 10) - BBSHIFT);
/* don't do discards on print-only runs or on files */
mp = &mbuf;
sbp = &mp->m_sb;
memset(mp, 0, sizeof(xfs_mount_t));
- sbp->sb_blocklog = (__uint8_t)blocklog;
- sbp->sb_sectlog = (__uint8_t)sectorlog;
- sbp->sb_agblklog = (__uint8_t)libxfs_log2_roundup((unsigned int)agsize);
+ sbp->sb_blocklog = (uint8_t)blocklog;
+ sbp->sb_sectlog = (uint8_t)sectorlog;
+ sbp->sb_agblklog = (uint8_t)libxfs_log2_roundup((unsigned int)agsize);
sbp->sb_agblocks = (xfs_agblock_t)agsize;
mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
sbp->sb_agcount = (xfs_agnumber_t)agcount;
sbp->sb_rbmblocks = nbmblocks;
sbp->sb_logblocks = (xfs_extlen_t)logblocks;
- sbp->sb_sectsize = (__uint16_t)sectorsize;
- sbp->sb_inodesize = (__uint16_t)isize;
- sbp->sb_inopblock = (__uint16_t)(blocksize / isize);
- sbp->sb_sectlog = (__uint8_t)sectorlog;
- sbp->sb_inodelog = (__uint8_t)inodelog;
- sbp->sb_inopblog = (__uint8_t)(blocklog - inodelog);
+ sbp->sb_sectsize = (uint16_t)sectorsize;
+ sbp->sb_inodesize = (uint16_t)isize;
+ sbp->sb_inopblock = (uint16_t)(blocksize / isize);
+ sbp->sb_sectlog = (uint8_t)sectorlog;
+ sbp->sb_inodelog = (uint8_t)inodelog;
+ sbp->sb_inopblog = (uint8_t)(blocklog - inodelog);
sbp->sb_rextslog =
- (__uint8_t)(rtextents ?
+ (uint8_t)(rtextents ?
libxfs_highbit32((unsigned int)rtextents) : 0);
sbp->sb_inprogress = 1; /* mkfs is in progress */
sbp->sb_imax_pct = imaxpct;
} else
sbp->sb_inoalignmt = 0;
if (lsectorsize != BBSIZE || sectorsize != BBSIZE) {
- sbp->sb_logsectlog = (__uint8_t)lsectorlog;
- sbp->sb_logsectsize = (__uint16_t)lsectorsize;
+ sbp->sb_logsectlog = (uint8_t)lsectorlog;
+ sbp->sb_logsectsize = (uint16_t)lsectorsize;
} else {
sbp->sb_logsectlog = 0;
sbp->sb_logsectsize = 0;
static void
set_limits(
- __uint32_t id,
+ uint32_t id,
uint type,
uint mask,
char *dev,
- __uint64_t *bsoft,
- __uint64_t *bhard,
- __uint64_t *isoft,
- __uint64_t *ihard,
- __uint64_t *rtbsoft,
- __uint64_t *rtbhard)
+ uint64_t *bsoft,
+ uint64_t *bhard,
+ uint64_t *isoft,
+ uint64_t *ihard,
+ uint64_t *rtbsoft,
+ uint64_t *rtbhard)
{
fs_disk_quota_t d;
char *name,
uint type,
uint mask,
- __uint64_t *bsoft,
- __uint64_t *bhard,
- __uint64_t *isoft,
- __uint64_t *ihard,
- __uint64_t *rtbsoft,
- __uint64_t *rtbhard)
+ uint64_t *bsoft,
+ uint64_t *bhard,
+ uint64_t *isoft,
+ uint64_t *ihard,
+ uint64_t *rtbsoft,
+ uint64_t *rtbhard)
{
uid_t uid = uid_from_string(name);
char *name,
uint type,
uint mask,
- __uint64_t *bsoft,
- __uint64_t *bhard,
- __uint64_t *isoft,
- __uint64_t *ihard,
- __uint64_t *rtbsoft,
- __uint64_t *rtbhard)
+ uint64_t *bsoft,
+ uint64_t *bhard,
+ uint64_t *isoft,
+ uint64_t *ihard,
+ uint64_t *rtbsoft,
+ uint64_t *rtbhard)
{
gid_t gid = gid_from_string(name);
char *name,
uint type,
uint mask,
- __uint64_t *bsoft,
- __uint64_t *bhard,
- __uint64_t *isoft,
- __uint64_t *ihard,
- __uint64_t *rtbsoft,
- __uint64_t *rtbhard)
+ uint64_t *bsoft,
+ uint64_t *bhard,
+ uint64_t *isoft,
+ uint64_t *ihard,
+ uint64_t *rtbsoft,
+ uint64_t *rtbhard)
{
prid_t prid = prid_from_string(name);
int length,
uint blocksize,
uint sectorsize,
- __uint64_t *value)
+ uint64_t *value)
{
long long v;
char *s = string;
progname, s);
return 0;
}
- *value = (__uint64_t)v >> 9; /* syscalls use basic blocks */
+ *value = (uint64_t)v >> 9; /* syscalls use basic blocks */
if (v > 0 && *value == 0)
fprintf(stderr, _("%s: Warning: `%s' in quota blocks is 0 (unlimited).\n"), progname, s);
return 1;
char *string,
const char *prefix,
int length,
- __uint64_t *value)
+ uint64_t *value)
{
char *sp, *s = string;
char **argv)
{
char *name;
- __uint64_t bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
+ uint64_t bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
int c, type = 0, mask = 0, flags = 0;
uint bsize, ssize, endoptions;
char *dev = NULL;
uint mask;
int cnt;
- __uint32_t id;
- __uint64_t bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
+ uint32_t id;
+ uint64_t bsoft, bhard, isoft, ihard, rtbsoft, rtbhard;
while (fgets(buffer, sizeof(buffer), fp) != NULL) {
if (strncmp("fs = ", buffer, 5) == 0) {
static void
set_warnings(
- __uint32_t id,
+ uint32_t id,
uint type,
uint mask,
char *dev,
static int
mount_free_space_data(
struct fs_path *mount,
- __uint64_t *bcount,
- __uint64_t *bused,
- __uint64_t *bfree,
- __uint64_t *icount,
- __uint64_t *iused,
- __uint64_t *ifree,
- __uint64_t *rcount,
- __uint64_t *rused,
- __uint64_t *rfree)
+ uint64_t *bcount,
+ uint64_t *bused,
+ uint64_t *bfree,
+ uint64_t *icount,
+ uint64_t *iused,
+ uint64_t *ifree,
+ uint64_t *rcount,
+ uint64_t *rused,
+ uint64_t *rfree)
{
struct xfs_fsop_counts fscounts;
struct xfs_fsop_geom fsgeo;
struct statfs st;
- __uint64_t logsize, count, free;
+ uint64_t logsize, count, free;
int fd;
if ((fd = open(mount->fs_dir, O_RDONLY)) < 0) {
static int
projects_free_space_data(
struct fs_path *path,
- __uint64_t *bcount,
- __uint64_t *bused,
- __uint64_t *bfree,
- __uint64_t *icount,
- __uint64_t *iused,
- __uint64_t *ifree,
- __uint64_t *rcount,
- __uint64_t *rused,
- __uint64_t *rfree)
+ uint64_t *bcount,
+ uint64_t *bused,
+ uint64_t *bfree,
+ uint64_t *icount,
+ uint64_t *iused,
+ uint64_t *ifree,
+ uint64_t *rcount,
+ uint64_t *rused,
+ uint64_t *rfree)
{
fs_quota_stat_t qfs;
fs_disk_quota_t d;
fs_path_t *path,
uint flags)
{
- __uint64_t bcount, bused, bfree;
- __uint64_t icount, iused, ifree;
- __uint64_t rcount, rused, rfree;
+ uint64_t bcount, bused, bfree;
+ uint64_t icount, iused, ifree;
+ uint64_t rcount, rused, rfree;
char a[8], s[8], u[8], p[8];
int count;
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
{
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;
return 0;
}
-typedef char *(*idtoname_t)(__uint32_t);
+typedef char *(*idtoname_t)(uint32_t);
static void
quot_report_mount_any_type(
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);
static int
quota_mount(
FILE *fp,
- __uint32_t id,
+ uint32_t id,
char *name,
uint form,
uint type,
static void
quota(
FILE *fp,
- __uint32_t id,
+ uint32_t id,
char *name,
uint form,
uint type,
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);
* 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 *);
static int
report_mount(
FILE *fp,
- __uint32_t id,
+ uint32_t id,
char *name,
- __uint32_t *oid,
+ uint32_t *oid,
uint form,
uint type,
fs_path_t *mount,
state_timelimit(
FILE *fp,
uint form,
- __uint32_t timelimit)
+ uint32_t timelimit)
{
fprintf(fp, _("%s grace time: %s\n"),
form_to_string(form),
size_t size,
const char *fmt_round,
const char *fmt_not_round,
- __uint64_t value,
- __uint64_t divisor)
+ uint64_t value,
+ uint64_t divisor)
{
double v = (double)value / divisor;
}
/* Basic blocks (512) bytes are returned from quotactl */
-#define BBS_TO_EXABYTES(bbs) ((__uint64_t)(bbs)>>51)
-#define BBS_TO_PETABYTES(bbs) ((__uint64_t)(bbs)>>41)
-#define BBS_TO_TERABYTES(bbs) ((__uint64_t)(bbs)>>31)
-#define BBS_TO_GIGABYTES(bbs) ((__uint64_t)(bbs)>>21)
-#define BBS_TO_MEGABYTES(bbs) ((__uint64_t)(bbs)>>11)
-#define BBS_TO_KILOBYTES(bbs) ((__uint64_t)(bbs)>>1)
-
-#define BBEXABYTE ((__uint64_t)1<<51)
-#define BBPETABYTE ((__uint64_t)1<<41)
-#define BBTERABYTE ((__uint64_t)1<<31)
-#define BBGIGABYTE ((__uint64_t)1<<21)
-#define BBMEGABYTE ((__uint64_t)1<<11)
-#define BBKILOBYTE ((__uint64_t)1<< 1)
+#define BBS_TO_EXABYTES(bbs) ((uint64_t)(bbs)>>51)
+#define BBS_TO_PETABYTES(bbs) ((uint64_t)(bbs)>>41)
+#define BBS_TO_TERABYTES(bbs) ((uint64_t)(bbs)>>31)
+#define BBS_TO_GIGABYTES(bbs) ((uint64_t)(bbs)>>21)
+#define BBS_TO_MEGABYTES(bbs) ((uint64_t)(bbs)>>11)
+#define BBS_TO_KILOBYTES(bbs) ((uint64_t)(bbs)>>1)
+
+#define BBEXABYTE ((uint64_t)1<<51)
+#define BBPETABYTE ((uint64_t)1<<41)
+#define BBTERABYTE ((uint64_t)1<<31)
+#define BBGIGABYTE ((uint64_t)1<<21)
+#define BBMEGABYTE ((uint64_t)1<<11)
+#define BBKILOBYTE ((uint64_t)1<< 1)
char *
bbs_to_string(
- __uint64_t v,
+ uint64_t v,
char *sp,
uint size)
{
return sp;
}
-#define THOUSAND ((__uint64_t)1000)
-#define MILLION ((__uint64_t)1000*1000)
-#define BILLION ((__uint64_t)1000*1000*1000)
-#define TRILLION ((__uint64_t)1000*1000*1000*1000)
-#define GAZILLION ((__uint64_t)1000*1000*1000*1000*1000)
-#define RIDICULOUS ((__uint64_t)1000*1000*1000*1000*1000*1000)
-#define STOPALREADY ((__uint64_t)1000*1000*1000*1000*1000*1000*1000)
+#define THOUSAND ((uint64_t)1000)
+#define MILLION ((uint64_t)1000*1000)
+#define BILLION ((uint64_t)1000*1000*1000)
+#define TRILLION ((uint64_t)1000*1000*1000*1000)
+#define GAZILLION ((uint64_t)1000*1000*1000*1000*1000)
+#define RIDICULOUS ((uint64_t)1000*1000*1000*1000*1000*1000)
+#define STOPALREADY ((uint64_t)1000*1000*1000*1000*1000*1000*1000)
char *
num_to_string(
- __uint64_t v,
+ uint64_t v,
char *sp,
uint size)
{
char *
pct_to_string(
- __uint64_t portion,
- __uint64_t whole,
+ uint64_t portion,
+ uint64_t whole,
char *buf,
uint size)
{
#define IDMASK (NID-1)
typedef struct {
- __uint32_t id;
+ uint32_t id;
char name[NMAX+1];
} idcache_t;
static idcache_t *
getnextpwent(
- __uint32_t id,
+ uint32_t id,
int byid)
{
struct passwd *pw;
static idcache_t *
getnextgrent(
- __uint32_t id,
+ uint32_t id,
int byid)
{
struct group *gr;
static idcache_t *
getnextprent(
- __uint32_t id,
+ uint32_t id,
int byid)
{
fs_project_t *pr;
char *
uid_to_name(
- __uint32_t id)
+ uint32_t id)
{
idcache_t *ncp, *idp;
char *
gid_to_name(
- __uint32_t id)
+ uint32_t id)
{
idcache_t *ncp, *idp;
char *
prid_to_name(
- __uint32_t id)
+ uint32_t id)
{
idcache_t *ncp, *idp;
D - 0) look at references to XFS_INODES_PER_CHUNK. change the
- ones that really mean sizeof(__uint64_t)*NBBY to
+ ones that really mean sizeof(uint64_t)*NBBY to
something else (like that only defined as a constant
INOS_PER_IREC. this isn't as important since
XFS_INODES_PER_CHUNK will never chang
/*
* these types should match the superblock types
*/
- __uint32_t sb_blocksize; /* blocksize (bytes) */
+ uint32_t sb_blocksize; /* blocksize (bytes) */
xfs_rfsblock_t sb_dblocks; /* # data blocks */
xfs_rfsblock_t sb_rblocks; /* # realtime blocks */
xfs_rtblock_t sb_rextents; /* # realtime extents */
xfs_agnumber_t sb_agcount; /* # of ags */
xfs_extlen_t sb_rbmblocks; /* # of rt bitmap blocks */
xfs_extlen_t sb_logblocks; /* # of log blocks */
- __uint16_t sb_sectsize; /* volume sector size (bytes) */
- __uint16_t sb_inodesize; /* inode size (bytes) */
- __uint8_t sb_imax_pct; /* max % of fs for inode space */
+ uint16_t sb_sectsize; /* volume sector size (bytes) */
+ uint16_t sb_inodesize; /* inode size (bytes) */
+ uint8_t sb_imax_pct; /* max % of fs for inode space */
/*
* these don't have to match the superblock types but are placed
/*
* fields after this point have to be checked manually in compare_sb()
*/
- __uint8_t sb_shared_vn; /* shared version number */
+ uint8_t sb_shared_vn; /* shared version number */
xfs_extlen_t sb_inoalignmt; /* inode chunk alignment, fsblocks */
- __uint32_t sb_unit; /* stripe or raid unit */
- __uint32_t sb_width; /* stripe or width unit */
+ uint32_t sb_unit; /* stripe or raid unit */
+ uint32_t sb_width; /* stripe or width unit */
/*
* these don't have to match, they track superblock properties
#define ACL_WRITE 02
#define ACL_EXECUTE 01
-typedef __uint16_t xfs_acl_perm_t;
-typedef __int32_t xfs_acl_type_t;
-typedef __int32_t xfs_acl_tag_t;
-typedef __int32_t xfs_acl_id_t;
+typedef uint16_t xfs_acl_perm_t;
+typedef int32_t xfs_acl_type_t;
+typedef int32_t xfs_acl_tag_t;
+typedef int32_t xfs_acl_id_t;
/*
* "icacl" = in-core ACL. There is no equivalent in the XFS kernel code,
};
struct xfs_icacl {
- __int32_t acl_cnt;
+ int32_t acl_cnt;
struct xfs_icacl_entry acl_entry[0];
};
*/
#define XFS_MAC_MAX_SETS 250
typedef struct xfs_mac_label {
- __uint8_t ml_msen_type; /* MSEN label type */
- __uint8_t ml_mint_type; /* MINT label type */
- __uint8_t ml_level; /* Hierarchical level */
- __uint8_t ml_grade; /* Hierarchical grade */
- __uint16_t ml_catcount; /* Category count */
- __uint16_t ml_divcount; /* Division count */
+ uint8_t ml_msen_type; /* MSEN label type */
+ uint8_t ml_mint_type; /* MINT label type */
+ uint8_t ml_level; /* Hierarchical level */
+ uint8_t ml_grade; /* Hierarchical grade */
+ uint16_t ml_catcount; /* Category count */
+ uint16_t ml_divcount; /* Division count */
/* Category set, then Division set */
- __uint16_t ml_list[XFS_MAC_MAX_SETS];
+ uint16_t ml_list[XFS_MAC_MAX_SETS];
} xfs_mac_label_t;
/* MSEN label type names. Choose an upper case ASCII character. */
/*
* Capabilities (IRIX)
*/
-typedef __uint64_t xfs_cap_value_t;
+typedef uint64_t xfs_cap_value_t;
typedef struct xfs_cap_set {
xfs_cap_value_t cap_effective; /* use in capability checks */
avl64node_t *root)
{
avl64node_t *nlast, *nnext, *np;
- __uint64_t offset = 0;
- __uint64_t end;
+ uint64_t offset = 0;
+ uint64_t end;
nlast = nnext = root;
avl64node_t *
avl64_findanyrange(
avl64tree_desc_t *tree,
- __uint64_t start,
- __uint64_t end,
+ uint64_t start,
+ uint64_t end,
int checklen)
{
avl64node_t *np = tree->avl_root;
avl64node_t *
avl64_findrange(
avl64tree_desc_t *tree,
- __uint64_t value)
+ uint64_t value)
{
avl64node_t *np = tree->avl_root;
avl64node_t *
avl64_find(
avl64tree_desc_t *tree,
- __uint64_t value)
+ uint64_t value)
{
avl64node_t *np = tree->avl_root;
- __uint64_t nvalue;
+ uint64_t nvalue;
while (np) {
nvalue = AVL_START(tree, np);
avl64node_t *
avl64_insert_find_growth(
avl64tree_desc_t *tree,
- __uint64_t start, /* range start at start, */
- __uint64_t end, /* exclusive */
+ uint64_t start, /* range start at start, */
+ uint64_t end, /* exclusive */
int *growthp) /* OUT */
{
avl64node_t *root = tree->avl_root;
int growth)
{
avl64node_t *nnext;
- __uint64_t start = AVL_START(tree, newnode);
+ uint64_t start = AVL_START(tree, newnode);
if (growth == AVL_BACK) {
avl64node_t *newnode)
{
avl64node_t *np;
- __uint64_t start = AVL_START(tree, newnode);
- __uint64_t end = AVL_END(tree, newnode);
+ uint64_t start = AVL_START(tree, newnode);
+ uint64_t end = AVL_END(tree, newnode);
int growth;
ASSERT(newnode);
avl_debug_end,
}
-static __uint64_t
+static uint64_t
avl64_debug_start(avl64node_t *node)
{
- return (__uint64_t)(struct avl_debug_node *)node->avl_start;
+ return (uint64_t)(struct avl_debug_node *)node->avl_start;
}
-static __uint64_t
+static uint64_t
avl64_debug_end(avl64node_t *node)
{
- return (__uint64_t)
+ return (uint64_t)
((struct avl_debug_node *)node->avl_start +
(struct avl_debug_node *)node->avl_size);
}
avl64node_t *
avl64_findadjacent(
avl64tree_desc_t *tree,
- __uint64_t value,
+ uint64_t value,
int dir)
{
avl64node_t *np = tree->avl_root;
void
avl64_findranges(
avl64tree_desc_t *tree,
- __uint64_t start,
- __uint64_t end,
+ uint64_t start,
+ uint64_t end,
avl64node_t **startp,
avl64node_t **endp)
{
* avl-tree operations
*/
typedef struct avl64ops {
- __uint64_t (*avl_start)(avl64node_t *);
- __uint64_t (*avl_end)(avl64node_t *);
+ uint64_t (*avl_start)(avl64node_t *);
+ uint64_t (*avl_end)(avl64node_t *);
} avl64ops_t;
/*
avl64node_t *
avl64_findrange(
avl64tree_desc_t *tree,
- __uint64_t value);
+ uint64_t value);
avl64node_t *
avl64_find(
avl64tree_desc_t *tree,
- __uint64_t value);
+ uint64_t value);
avl64node_t *
avl64_findanyrange(
avl64tree_desc_t *tree,
- __uint64_t start,
- __uint64_t end,
+ uint64_t start,
+ uint64_t end,
int checklen);
avl64node_t *
avl64_findadjacent(
avl64tree_desc_t *tree,
- __uint64_t value,
+ uint64_t value,
int dir);
void
avl64_findranges(
avl64tree_desc_t *tree,
- __uint64_t start,
- __uint64_t end,
+ uint64_t start,
+ uint64_t end,
avl64node_t **startp,
avl64node_t **endp);
case XR_E_FREE1:
do_warn(
_("%s fork in ino %" PRIu64 " claims free block %" PRIu64 "\n"),
- forkname, ino, (__uint64_t) b);
+ forkname, ino, (uint64_t) b);
/* fall through ... */
case XR_E_INUSE1: /* seen by rmap */
case XR_E_UNKNOWN:
int type,
int *dirty,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
blkmap_t **blkmapp,
int whichfork,
int check_dups)
int level;
int numrecs;
bmap_cursor_t cursor;
- __uint64_t magic;
+ uint64_t magic;
dib = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
lino = XFS_AGINO_TO_INO(mp, agno, ino);
int type,
int *dirty,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
blkmap_t **blkmapp,
int whichfork,
int check_dups)
do_warn(
_("mismatch between format (%d) and size (%" PRId64 ") in symlink ino %" PRIu64 "\n"),
dino->di_format,
- (__int64_t)be64_to_cpu(dino->di_size), lino);
+ (int64_t)be64_to_cpu(dino->di_size), lino);
return 1;
}
if (dino->di_format == XFS_DINODE_FMT_LOCAL) {
do_warn(
_("mismatch between format (%d) and size (%" PRId64 ") in symlink inode %" PRIu64 "\n"),
dino->di_format,
- (__int64_t)be64_to_cpu(dino->di_size), lino);
+ (int64_t)be64_to_cpu(dino->di_size), lino);
return 1;
}
case XR_INO_CHRDEV:
do_warn(
_("size of character device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
- (__int64_t)be64_to_cpu(dino->di_size));
+ (int64_t)be64_to_cpu(dino->di_size));
break;
case XR_INO_BLKDEV:
do_warn(
_("size of block device inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
- (__int64_t)be64_to_cpu(dino->di_size));
+ (int64_t)be64_to_cpu(dino->di_size));
break;
case XR_INO_SOCK:
do_warn(
_("size of socket inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
- (__int64_t)be64_to_cpu(dino->di_size));
+ (int64_t)be64_to_cpu(dino->di_size));
break;
case XR_INO_FIFO:
do_warn(
_("size of fifo inode %" PRIu64 " != 0 (%" PRId64 " bytes)\n"), lino,
- (__int64_t)be64_to_cpu(dino->di_size));
+ (int64_t)be64_to_cpu(dino->di_size));
break;
default:
do_warn(_("Internal error - process_misc_ino_types, "
break;
case XR_INO_RTBITMAP:
- if (size != (__int64_t)mp->m_sb.sb_rbmblocks *
+ if (size != (int64_t)mp->m_sb.sb_rbmblocks *
mp->m_sb.sb_blocksize) {
do_warn(
_("realtime bitmap inode %" PRIu64 " has bad size %" PRId64 " (should be %" PRIu64 ")\n"),
lino, size,
- (__int64_t) mp->m_sb.sb_rbmblocks *
+ (int64_t) mp->m_sb.sb_rbmblocks *
mp->m_sb.sb_blocksize);
return 1;
}
process_inode_blocks_and_extents(
xfs_dinode_t *dino,
xfs_rfsblock_t nblocks,
- __uint64_t nextents,
- __uint64_t anextents,
+ uint64_t nextents,
+ uint64_t anextents,
xfs_ino_t lino,
int *dirty)
{
int type,
int *dirty,
xfs_rfsblock_t *totblocks,
- __uint64_t *nextents,
+ uint64_t *nextents,
blkmap_t **dblkmap,
int check_dups)
{
int type,
int *dirty,
xfs_rfsblock_t *atotblocks,
- __uint64_t *anextents,
+ uint64_t *anextents,
int check_dups,
int extra_attr_check,
int *retval)
int di_mode;
int type;
int retval = 0;
- __uint64_t nextents;
- __uint64_t anextents;
+ uint64_t nextents;
+ uint64_t anextents;
xfs_ino_t lino;
const int is_free = 0;
const int is_used = 1;
if (!uncertain)
do_warn(
_("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
- (__int64_t)be64_to_cpu(dino->di_size),
+ (int64_t)be64_to_cpu(dino->di_size),
lino);
if (verify_mode)
return 1;
xfs_ino_t ino,
xfs_rfsblock_t *tot,
struct blkmap **blkmapp,
- __uint64_t *first_key,
- __uint64_t *last_key,
+ uint64_t *first_key,
+ uint64_t *last_key,
int whichfork);
int
int bad_sfnamelen;
int i;
int i8;
- __int64_t ino_dir_size;
+ int64_t ino_dir_size;
int ino_off;
ino_tree_node_t *irec_p;
int junkit;
EXTERN unsigned int glob_agcount;
EXTERN int chunks_pblock; /* # of 64-ino chunks per allocation */
EXTERN int max_symlink_blocks;
-EXTERN __int64_t fs_max_file_offset;
+EXTERN int64_t fs_max_file_offset;
/* realtime info */
/* superblock counters */
-EXTERN __uint64_t sb_icount; /* allocated (made) inodes */
-EXTERN __uint64_t sb_ifree; /* free inodes */
-EXTERN __uint64_t sb_fdblocks; /* free data blocks */
-EXTERN __uint64_t sb_frextents; /* free realtime extents */
+EXTERN uint64_t sb_icount; /* allocated (made) inodes */
+EXTERN uint64_t sb_ifree; /* free inodes */
+EXTERN uint64_t sb_fdblocks; /* free data blocks */
+EXTERN uint64_t sb_frextents; /* free realtime extents */
/* superblock geometry info */
EXTERN xfs_extlen_t sb_inoalignmt;
-EXTERN __uint32_t sb_unit;
-EXTERN __uint32_t sb_width;
+EXTERN uint32_t sb_unit;
+EXTERN uint32_t sb_width;
struct aglock {
pthread_mutex_t lock __attribute__((__aligned__(64)));
};
EXTERN struct aglock *ag_locks;
-EXTERN int report_interval;
-EXTERN __uint64_t *prog_rpt_done;
+EXTERN int report_interval;
+EXTERN uint64_t *prog_rpt_done;
EXTERN int ag_stride;
EXTERN int thread_count;
static uint64_t *rt_bmap;
static size_t rt_bmap_size;
-/* block records fit into __uint64_t's units */
+/* block records fit into uint64_t's units */
#define XR_BB_UNIT 64 /* number of bits/unit */
#define XR_BB 4 /* bits per block record */
#define XR_BB_NUM (XR_BB_UNIT/XR_BB) /* number of records per unit */
{
*(rt_bmap + bno / XR_BB_NUM) =
((*(rt_bmap + bno / XR_BB_NUM) &
- (~((__uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
- (((__uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
+ (~((uint64_t) XR_BB_MASK << ((bno % XR_BB_NUM) * XR_BB)))) |
+ (((uint64_t) state) << ((bno % XR_BB_NUM) * XR_BB)));
}
static void
return;
rt_bmap_size = roundup(mp->m_sb.sb_rextents / (NBBY / XR_BB),
- sizeof(__uint64_t));
+ sizeof(uint64_t));
- rt_bmap = memalign(sizeof(__uint64_t), rt_bmap_size);
+ rt_bmap = memalign(sizeof(uint64_t), rt_bmap_size);
if (!rt_bmap) {
do_error(
_("couldn't allocate realtime block map, size = %" PRIu64 "\n"),
struct nlink_ops;
typedef struct parent_list {
- __uint64_t pmask;
+ uint64_t pmask;
parent_entry_t *pentries;
#ifdef DEBUG
short cnt;
} parent_list_t;
union ino_nlink {
- __uint8_t *un8;
- __uint16_t *un16;
- __uint32_t *un32;
+ uint8_t *un8;
+ uint16_t *un16;
+ uint32_t *un32;
};
typedef struct ino_ex_data {
- __uint64_t ino_reached; /* bit == 1 if reached */
- __uint64_t ino_processed; /* reference checked bit mask */
+ uint64_t ino_reached; /* bit == 1 if reached */
+ uint64_t ino_processed; /* reference checked bit mask */
parent_list_t *parents;
union ino_nlink counted_nlinks;/* counted nlinks in P6 */
} ino_ex_data_t;
avlnode_t avl_node;
xfs_agino_t ino_startnum; /* starting inode # */
xfs_inofree_t ir_free; /* inode free bit mask */
- __uint64_t ir_sparse; /* sparse inode bitmask */
- __uint64_t ino_confirmed; /* confirmed bitmask */
- __uint64_t ino_isa_dir; /* bit == 1 if a directory */
- __uint64_t ino_was_rl; /* bit == 1 if reflink flag set */
- __uint64_t ino_is_rl; /* bit == 1 if reflink flag should be set */
- __uint8_t nlink_size;
+ uint64_t ir_sparse; /* sparse inode bitmask */
+ uint64_t ino_confirmed; /* confirmed bitmask */
+ uint64_t ino_isa_dir; /* bit == 1 if a directory */
+ uint64_t ino_was_rl; /* bit == 1 if reflink flag set */
+ uint64_t ino_is_rl; /* bit == 1 if reflink flag should be set */
+ uint8_t nlink_size;
union ino_nlink disk_nlinks; /* on-disk nlinks, set in P3 */
union {
ino_ex_data_t *ex_data; /* phases 6,7 */
parent_list_t *plist; /* phases 2-5 */
} ino_un;
- __uint8_t *ftypes; /* phases 3,6 */
+ uint8_t *ftypes; /* phases 3,6 */
} ino_tree_node_t;
-#define INOS_PER_IREC (sizeof(__uint64_t) * NBBY)
-#define IREC_MASK(i) ((__uint64_t)1 << (i))
+#define INOS_PER_IREC (sizeof(uint64_t) * NBBY)
+#define IREC_MASK(i) ((uint64_t)1 << (i))
void add_ino_ex_data(xfs_mount_t *mp);
*/
void add_inode_ref(struct ino_tree_node *irec, int offset);
void drop_inode_ref(struct ino_tree_node *irec, int offset);
-__uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
+uint32_t num_inode_references(struct ino_tree_node *irec, int offset);
-void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, __uint32_t nlinks);
-__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
+void set_inode_disk_nlinks(struct ino_tree_node *irec, int offset, uint32_t nlinks);
+uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int offset);
static inline int is_inode_reached(struct ino_tree_node *irec, int offset)
{
static inline void
set_inode_ftype(struct ino_tree_node *irec,
int ino_offset,
- __uint8_t ftype)
+ uint8_t ftype)
{
if (irec->ftypes)
irec->ftypes[ino_offset] = ftype;
}
-static inline __uint8_t
+static inline uint8_t
get_inode_ftype(
struct ino_tree_node *irec,
int ino_offset)
xfs_fsblock_t fsbno;
xfs_fsblock_t left_fsbno;
xfs_fsblock_t right_fsbno;
- __uint64_t first_key;
- __uint64_t last_key;
+ uint64_t first_key;
+ uint64_t last_key;
/*
int level;
- __uint64_t prev_last_key;
+ uint64_t prev_last_key;
xfs_buf_t *bp;
xfs_bmbt_block_t *block;
*/
return(ret);
}
-static __uint64_t
+static uint64_t
avl64_rt_ext_start(avl64node_t *node)
{
return(((rt_extent_tree_node_t *) node)->rt_startblock);
}
-static __uint64_t
+static uint64_t
avl64_ext_end(avl64node_t *node)
{
return(((rt_extent_tree_node_t *) node)->rt_startblock +
int
count_bno_extents_blocks(xfs_agnumber_t agno, uint *numblocks)
{
- __uint64_t nblocks;
+ uint64_t nblocks;
extent_tree_node_t *node;
int i = 0;
/* memory optimised nlink counting for all inodes */
static void *
-alloc_nlink_array(__uint8_t nlink_size)
+alloc_nlink_array(uint8_t nlink_size)
{
void *ptr;
static void
nlink_grow_8_to_16(ino_tree_node_t *irec)
{
- __uint16_t *new_nlinks;
+ uint16_t *new_nlinks;
int i;
- irec->nlink_size = sizeof(__uint16_t);
+ irec->nlink_size = sizeof(uint16_t);
new_nlinks = alloc_nlink_array(irec->nlink_size);
for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
static void
nlink_grow_16_to_32(ino_tree_node_t *irec)
{
- __uint32_t *new_nlinks;
+ uint32_t *new_nlinks;
int i;
- irec->nlink_size = sizeof(__uint32_t);
+ irec->nlink_size = sizeof(uint32_t);
new_nlinks = alloc_nlink_array(irec->nlink_size);
for (i = 0; i < XFS_INODES_PER_CHUNK; i++)
ASSERT(irec->ino_un.ex_data != NULL);
switch (irec->nlink_size) {
- case sizeof(__uint8_t):
+ case sizeof(uint8_t):
if (irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] < 0xff) {
irec->ino_un.ex_data->counted_nlinks.un8[ino_offset]++;
break;
}
nlink_grow_8_to_16(irec);
/*FALLTHRU*/
- case sizeof(__uint16_t):
+ case sizeof(uint16_t):
if (irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] < 0xffff) {
irec->ino_un.ex_data->counted_nlinks.un16[ino_offset]++;
break;
}
nlink_grow_16_to_32(irec);
/*FALLTHRU*/
- case sizeof(__uint32_t):
+ case sizeof(uint32_t):
irec->ino_un.ex_data->counted_nlinks.un32[ino_offset]++;
break;
default:
void drop_inode_ref(struct ino_tree_node *irec, int ino_offset)
{
- __uint32_t refs = 0;
+ uint32_t refs = 0;
ASSERT(irec->ino_un.ex_data != NULL);
switch (irec->nlink_size) {
- case sizeof(__uint8_t):
+ case sizeof(uint8_t):
ASSERT(irec->ino_un.ex_data->counted_nlinks.un8[ino_offset] > 0);
refs = --irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
break;
- case sizeof(__uint16_t):
+ case sizeof(uint16_t):
ASSERT(irec->ino_un.ex_data->counted_nlinks.un16[ino_offset] > 0);
refs = --irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
break;
- case sizeof(__uint32_t):
+ case sizeof(uint32_t):
ASSERT(irec->ino_un.ex_data->counted_nlinks.un32[ino_offset] > 0);
refs = --irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
break;
irec->ino_un.ex_data->ino_reached &= ~IREC_MASK(ino_offset);
}
-__uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
+uint32_t num_inode_references(struct ino_tree_node *irec, int ino_offset)
{
ASSERT(irec->ino_un.ex_data != NULL);
switch (irec->nlink_size) {
- case sizeof(__uint8_t):
+ case sizeof(uint8_t):
return irec->ino_un.ex_data->counted_nlinks.un8[ino_offset];
- case sizeof(__uint16_t):
+ case sizeof(uint16_t):
return irec->ino_un.ex_data->counted_nlinks.un16[ino_offset];
- case sizeof(__uint32_t):
+ case sizeof(uint32_t):
return irec->ino_un.ex_data->counted_nlinks.un32[ino_offset];
default:
ASSERT(0);
}
void set_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset,
- __uint32_t nlinks)
+ uint32_t nlinks)
{
switch (irec->nlink_size) {
- case sizeof(__uint8_t):
+ case sizeof(uint8_t):
if (nlinks < 0xff) {
irec->disk_nlinks.un8[ino_offset] = nlinks;
break;
}
nlink_grow_8_to_16(irec);
/*FALLTHRU*/
- case sizeof(__uint16_t):
+ case sizeof(uint16_t):
if (nlinks < 0xffff) {
irec->disk_nlinks.un16[ino_offset] = nlinks;
break;
}
nlink_grow_16_to_32(irec);
/*FALLTHRU*/
- case sizeof(__uint32_t):
+ case sizeof(uint32_t):
irec->disk_nlinks.un32[ino_offset] = nlinks;
break;
default:
}
}
-__uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
+uint32_t get_inode_disk_nlinks(struct ino_tree_node *irec, int ino_offset)
{
switch (irec->nlink_size) {
- case sizeof(__uint8_t):
+ case sizeof(uint8_t):
return irec->disk_nlinks.un8[ino_offset];
- case sizeof(__uint16_t):
+ case sizeof(uint16_t):
return irec->disk_nlinks.un16[ino_offset];
- case sizeof(__uint32_t):
+ case sizeof(uint32_t):
return irec->disk_nlinks.un32[ino_offset];
default:
ASSERT(0);
return 0;
}
-static __uint8_t *
+static uint8_t *
alloc_ftypes_array(
struct xfs_mount *mp)
{
- __uint8_t *ptr;
+ uint8_t *ptr;
if (!xfs_sb_version_hasftype(&mp->m_sb))
return NULL;
irec->ir_free = (xfs_inofree_t) - 1;
irec->ir_sparse = 0;
irec->ino_un.ex_data = NULL;
- irec->nlink_size = sizeof(__uint8_t);
+ irec->nlink_size = sizeof(uint8_t);
irec->disk_nlinks.un8 = alloc_nlink_array(irec->nlink_size);
irec->ftypes = alloc_ftypes_array(mp);
return irec;
}
static void
-free_nlink_array(union ino_nlink nlinks, __uint8_t nlink_size)
+free_nlink_array(union ino_nlink nlinks, uint8_t nlink_size)
{
switch (nlink_size) {
- case sizeof(__uint8_t):
+ case sizeof(uint8_t):
free(nlinks.un8);
break;
- case sizeof(__uint16_t):
+ case sizeof(uint16_t):
free(nlinks.un16);
break;
- case sizeof(__uint32_t):
+ case sizeof(uint32_t):
free(nlinks.un32);
break;
default:
int i;
int cnt;
int target;
- __uint64_t bitmask;
+ uint64_t bitmask;
parent_entry_t *tmp;
if (full_ino_ex_data)
xfs_ino_t
get_inode_parent(ino_tree_node_t *irec, int offset)
{
- __uint64_t bitmask;
+ uint64_t bitmask;
parent_list_t *ptbl;
int i;
int target;
irec->ino_un.ex_data->parents = ptbl;
switch (irec->nlink_size) {
- case sizeof(__uint8_t):
+ case sizeof(uint8_t):
irec->ino_un.ex_data->counted_nlinks.un8 =
alloc_nlink_array(irec->nlink_size);
break;
- case sizeof(__uint16_t):
+ case sizeof(uint16_t):
irec->ino_un.ex_data->counted_nlinks.un16 =
alloc_nlink_array(irec->nlink_size);
break;
- case sizeof(__uint32_t):
+ case sizeof(uint32_t):
irec->ino_un.ex_data->counted_nlinks.un32 =
alloc_nlink_array(irec->nlink_size);
break;
bad_ino_btree = 0;
- set_progress_msg(PROG_FMT_SCAN_AG, (__uint64_t) glob_agcount);
+ set_progress_msg(PROG_FMT_SCAN_AG, (uint64_t) glob_agcount);
scan_ags(mp, scan_threads);
else
do_log(_(" - scan (but don't clear) agi unlinked lists...\n"));
- set_progress_msg(PROG_FMT_AGI_UNLINKED, (__uint64_t) glob_agcount);
+ set_progress_msg(PROG_FMT_AGI_UNLINKED, (uint64_t) glob_agcount);
/* first clear the agi unlinked AGI list */
if (!no_modify) {
do_log(_(
" - process known inodes and perform inode discovery...\n"));
- set_progress_msg(PROG_FMT_PROCESS_INO, (__uint64_t) mp->m_sb.sb_icount);
+ set_progress_msg(PROG_FMT_PROCESS_INO, (uint64_t) mp->m_sb.sb_icount);
process_ags(mp);
* process newly discovered inode chunks
*/
do_log(_(" - process newly discovered inodes...\n"));
- set_progress_msg(PROG_FMT_NEW_INODES, (__uint64_t) glob_agcount);
+ set_progress_msg(PROG_FMT_NEW_INODES, (uint64_t) glob_agcount);
counts = calloc(sizeof(*counts), mp->m_sb.sb_agcount);
if (!counts) {
do_log(_("Phase 4 - check for duplicate blocks...\n"));
do_log(_(" - setting up duplicate extent list...\n"));
- set_progress_msg(PROG_FMT_DUP_EXTENT, (__uint64_t) glob_agcount);
+ set_progress_msg(PROG_FMT_DUP_EXTENT, (uint64_t) glob_agcount);
irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino),
XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino));
reset_bmaps(mp);
do_log(_(" - check for inodes claiming duplicate blocks...\n"));
- set_progress_msg(PROG_FMT_DUP_BLOCKS, (__uint64_t) mp->m_sb.sb_icount);
+ set_progress_msg(PROG_FMT_DUP_BLOCKS, (uint64_t) mp->m_sb.sb_icount);
/*
* ok, now process the inodes -- signal 2-pass check per inode.
xfs_agino_t freecount;
};
-static __uint64_t *sb_icount_ag; /* allocated inodes per ag */
-static __uint64_t *sb_ifree_ag; /* free inodes per ag */
-static __uint64_t *sb_fdblocks_ag; /* free data blocks per ag */
+static uint64_t *sb_icount_ag; /* allocated inodes per ag */
+static uint64_t *sb_ifree_ag; /* free inodes per ag */
+static uint64_t *sb_fdblocks_ag; /* free data blocks per ag */
static int
mk_incore_fstree(xfs_mount_t *mp, xfs_agnumber_t agno)
*/
static void
init_ino_cursor(xfs_mount_t *mp, xfs_agnumber_t agno, bt_status_t *btree_curs,
- __uint64_t *num_inos, __uint64_t *num_free_inos, int finobt)
+ uint64_t *num_inos, uint64_t *num_free_inos, int finobt)
{
- __uint64_t ninos;
- __uint64_t nfinos;
+ uint64_t ninos;
+ uint64_t nfinos;
int rec_nfinos;
int rec_ninos;
ino_tree_node_t *ino_rec;
xfs_agnumber_t agno,
struct xfs_slab *lost_fsb)
{
- __uint64_t num_inos;
- __uint64_t num_free_inos;
- __uint64_t finobt_num_inos;
- __uint64_t finobt_num_free_inos;
+ uint64_t num_inos;
+ uint64_t num_free_inos;
+ uint64_t finobt_num_inos;
+ uint64_t finobt_num_free_inos;
bt_status_t bno_btree_curs;
bt_status_t bcnt_btree_curs;
bt_status_t ino_btree_curs;
int error;
do_log(_("Phase 5 - rebuild AG headers and trees...\n"));
- set_progress_msg(PROG_FMT_REBUILD_AG, (__uint64_t )glob_agcount);
+ set_progress_msg(PROG_FMT_REBUILD_AG, (uint64_t)glob_agcount);
#ifdef XR_BLD_FREE_TRACE
fprintf(stderr, "inobt level 1, maxrec = %d, minrec = %d\n",
keep_fsinos(mp);
/* allocate per ag counters */
- sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
+ sb_icount_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
if (sb_icount_ag == NULL)
do_error(_("cannot alloc sb_icount_ag buffers\n"));
- sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
+ sb_ifree_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
if (sb_ifree_ag == NULL)
do_error(_("cannot alloc sb_ifree_ag buffers\n"));
- sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(__uint64_t));
+ sb_fdblocks_ag = calloc(mp->m_sb.sb_agcount, sizeof(uint64_t));
if (sb_fdblocks_ag == NULL)
do_error(_("cannot alloc sb_fdblocks_ag buffers\n"));
struct dir_hash_ent *nextbyhash; /* next in name bucket */
struct dir_hash_ent *nextbyorder; /* next in order added */
xfs_dahash_t hashval; /* hash value of name */
- __uint32_t address; /* offset of data entry */
+ uint32_t address; /* offset of data entry */
xfs_ino_t inum; /* inode num of entry */
short junkit; /* name starts with / */
short seen; /* have seen leaf entry */
dir_hash_add(
xfs_mount_t *mp,
dir_hash_tab_t *hashtab,
- __uint32_t addr,
+ uint32_t addr,
xfs_ino_t inum,
int namelen,
unsigned char *name,
- __uint8_t ftype)
+ uint8_t ftype)
{
xfs_dahash_t hash = 0;
int byaddr;
dir_hash_update_ftype(
dir_hash_tab_t *hashtab,
xfs_dir2_dataptr_t addr,
- __uint8_t ftype)
+ uint8_t ftype)
{
int i;
dir_hash_ent_t *p;
/* validate ftype field if supported */
if (xfs_sb_version_hasftype(&mp->m_sb)) {
- __uint8_t dir_ftype;
- __uint8_t ino_ftype;
+ uint8_t dir_ftype;
+ uint8_t ino_ftype;
dir_ftype = M_DIROPS(mp)->data_get_ftype(dep);
ino_ftype = get_inode_ftype(irec, ino_offset);
/* validate ftype field if supported */
if (xfs_sb_version_hasftype(&mp->m_sb)) {
- __uint8_t dir_ftype;
- __uint8_t ino_ftype;
+ uint8_t dir_ftype;
+ uint8_t ino_ftype;
dir_ftype = M_DIROPS(mp)->sf_get_ftype(sfep);
ino_ftype = get_inode_ftype(irec, ino_offset);
update_inode_nlinks(
xfs_mount_t *mp,
xfs_ino_t ino,
- __uint32_t nlinks)
+ uint32_t nlinks)
{
xfs_trans_t *tp;
xfs_inode_t *ip;
{
ino_tree_node_t *irec;
int j;
- __uint32_t nrefs;
+ uint32_t nrefs;
for (irec = findfirst_inode_rec(agno); irec;
irec = next_ino_rec(irec)) {
else
do_log(_("Phase 7 - verify link counts...\n"));
- set_progress_msg(PROGRESS_FMT_CORR_LINK, (__uint64_t) glob_agcount);
+ set_progress_msg(PROGRESS_FMT_CORR_LINK, (uint64_t) glob_agcount);
create_work_queue(&wq, mp, scan_threads);
typedef struct msg_block_s {
pthread_mutex_t mutex;
progress_rpt_t *format;
- __uint64_t *done;
- __uint64_t *total;
+ uint64_t *done;
+ uint64_t *total;
int count;
int interval;
} msg_block_t;
time_t start;
time_t end;
time_t duration;
- __uint64_t item_counts[4];
+ uint64_t item_counts[4];
} phase_times_t;
static phase_times_t phase_times[8];
static void *progress_rpt_thread(void *);
static int current_phase;
static int running;
-static __uint64_t prog_rpt_total;
+static uint64_t prog_rpt_total;
void
init_progress_rpt (void)
* allocate the done vector
*/
- if ((prog_rpt_done = (__uint64_t *)
- malloc(sizeof(__uint64_t)*glob_agcount)) == NULL ) {
+ if ((prog_rpt_done = (uint64_t *)
+ malloc(sizeof(uint64_t)*glob_agcount)) == NULL) {
do_error(_("cannot malloc pointer to done vector\n"));
}
- bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
+ bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
/*
* Setup comm block, start the thread
timer_t timerid;
struct itimerspec timespec;
char *msgbuf;
- __uint64_t *donep;
- __uint64_t sum;
+ uint64_t *donep;
+ uint64_t sum;
msg_block_t *msgp = (msg_block_t *)p;
- __uint64_t percent;
+ uint64_t percent;
/* It's possible to get here very early w/ no progress msg set */
if (!msgp->format)
}
int
-set_progress_msg (int report, __uint64_t total)
+set_progress_msg(int report, uint64_t total)
{
if (!ag_stride)
/* reset all the accumulative totals */
if (prog_rpt_done)
- bzero(prog_rpt_done, sizeof(__uint64_t)*glob_agcount);
+ bzero(prog_rpt_done, sizeof(uint64_t)*glob_agcount);
if (pthread_mutex_unlock(&global_msgs.mutex))
do_error(_("set_progress_msg: cannot unlock progress mutex\n"));
return (0);
}
-__uint64_t
+uint64_t
print_final_rpt(void)
{
int i;
struct tm *tmp;
time_t now;
- __uint64_t *donep;
- __uint64_t sum;
+ uint64_t *donep;
+ uint64_t sum;
msg_block_t *msgp = &global_msgs;
char msgbuf[DURATION_BUF_SIZE];
extern void init_progress_rpt(void);
extern void stop_progress_rpt(void);
extern void summary_report(void);
-extern int set_progress_msg(int report, __uint64_t total);
-extern __uint64_t print_final_rpt(void);
+extern int set_progress_msg(int report, uint64_t total);
+extern uint64_t print_final_rpt(void);
extern char *timestamp(int end, int phase, char *buf);
extern char *duration(int val, char *buf);
extern int do_parallel;
static int
find_first_zero_bit(
- __uint64_t mask)
+ uint64_t mask)
{
int n;
int b = 0;
static int
popcnt(
- __uint64_t mask)
+ uint64_t mask)
{
int n;
int b = 0;
* Compare the key fields of two rmap records -- positive if key1 > key2,
* negative if key1 < key2, and zero if equal.
*/
-__int64_t
+int64_t
rmap_diffkeys(
struct xfs_rmap_irec *kp1,
struct xfs_rmap_irec *kp2)
{
__u64 oa;
__u64 ob;
- __int64_t d;
+ int64_t d;
struct xfs_rmap_irec tmp;
tmp = *kp1;
tmp.rm_flags &= ~XFS_RMAP_REC_FLAGS;
ob = libxfs_rmap_irec_offset_pack(&tmp);
- d = (__int64_t)kp1->rm_startblock - kp2->rm_startblock;
+ d = (int64_t)kp1->rm_startblock - kp2->rm_startblock;
if (d)
return d;
{
struct ino_tree_node *irec;
int bit;
- __uint64_t was;
- __uint64_t is;
- __uint64_t diff;
- __uint64_t mask;
+ uint64_t was;
+ uint64_t is;
+ uint64_t diff;
+ uint64_t mask;
int error = 0;
xfs_agino_t agino;
extern void rmap_avoid_check(void);
extern int rmaps_verify_btree(struct xfs_mount *, xfs_agnumber_t);
-extern __int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
+extern int64_t rmap_diffkeys(struct xfs_rmap_irec *kp1,
struct xfs_rmap_irec *kp2);
extern void rmap_high_key_from_rec(struct xfs_rmap_irec *rec,
struct xfs_rmap_irec *key);
xfs_ino_t uquotino;
xfs_ino_t gquotino;
xfs_ino_t pquotino;
- __uint16_t versionnum;
+ uint16_t versionnum;
rootino = dest->sb_rootino;
rbmino = dest->sb_rbmino;
static int
__find_secondary_sb(
xfs_sb_t *rsb,
- __uint64_t start,
- __uint64_t skip)
+ uint64_t start,
+ uint64_t skip)
{
xfs_off_t off;
xfs_sb_t *sb;
static int
guess_default_geometry(
- __uint64_t *agsize,
- __uint64_t *agcount,
+ uint64_t *agsize,
+ uint64_t *agcount,
libxfs_init_t *x)
{
struct fs_topology ft;
int blocklog;
- __uint64_t dblocks;
+ uint64_t dblocks;
int multidisk;
memset(&ft, 0, sizeof(ft));
find_secondary_sb(xfs_sb_t *rsb)
{
int retval = 0;
- __uint64_t agcount;
- __uint64_t agsize;
- __uint64_t skip;
+ uint64_t agcount;
+ uint64_t agsize;
+ uint64_t skip;
int blocklog;
/*
do_warn(_("\nattempting to find secondary superblock...\n"));
if (verify_sb_blocksize(rsb) == 0) {
- skip = (__uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
+ skip = (uint64_t)rsb->sb_agblocks * rsb->sb_blocksize;
if (skip >= XFS_AG_MIN_BYTES && skip <= XFS_AG_MAX_BYTES)
retval = __find_secondary_sb(rsb, skip, skip);
}
int
verify_sb(char *sb_buf, xfs_sb_t *sb, int is_primary_sb)
{
- __uint32_t bsize;
+ uint32_t bsize;
int i;
int ret;
sb->sb_dblocks < XFS_MIN_DBLOCKS(sb))
return(XR_BAD_FS_SIZE_DATA);
- if (sb->sb_agblklog != (__uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
+ if (sb->sb_agblklog != (uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
return(XR_BAD_FS_SIZE_DATA);
if (sb->sb_inodesize < XFS_DINODE_MIN_SIZE ||
xfs_agnumber_t agno;
xfs_extlen_t agffreeblks;
xfs_extlen_t agflongest;
- __uint64_t agfbtreeblks;
- __uint32_t agicount;
- __uint32_t agifreecount;
- __uint64_t fdblocks;
- __uint64_t usedblocks;
- __uint64_t ifreecount;
- __uint32_t fibtfreecount;
+ uint64_t agfbtreeblks;
+ uint32_t agicount;
+ uint32_t agifreecount;
+ uint64_t fdblocks;
+ uint64_t usedblocks;
+ uint64_t ifreecount;
+ uint32_t fibtfreecount;
};
void
xfs_agnumber_t agno,
int suspect,
int isroot,
- __uint32_t magic,
+ uint32_t magic,
void *priv),
int isroot,
- __uint32_t magic,
+ uint32_t magic,
void *priv,
const struct xfs_buf_ops *ops)
{
xfs_fsblock_t bno,
xfs_ino_t ino,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
blkmap_t **blkmapp,
bmap_cursor_t *bm_cursor,
int isroot,
int check_dups,
int *dirty,
- __uint64_t magic),
+ uint64_t magic),
int type,
int whichfork,
xfs_ino_t ino,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
blkmap_t **blkmapp,
bmap_cursor_t *bm_cursor,
int isroot,
int check_dups,
- __uint64_t magic,
+ uint64_t magic,
const struct xfs_buf_ops *ops)
{
xfs_buf_t *bp;
xfs_fsblock_t bno,
xfs_ino_t ino,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
blkmap_t **blkmapp,
bmap_cursor_t *bm_cursor,
int isroot,
int check_dups,
int *dirty,
- __uint64_t magic)
+ uint64_t magic)
{
int i;
int err;
xfs_agnumber_t agno,
int suspect,
int isroot,
- __uint32_t magic,
+ uint32_t magic,
void *priv)
{
struct aghdr_cnts *agcnts = priv;
xfs_agnumber_t agno,
int suspect,
int isroot,
- __uint32_t magic,
+ uint32_t magic,
void *priv)
{
const char *name = "rmap";
xfs_agnumber_t agno,
int suspect,
int isroot,
- __uint32_t magic,
+ uint32_t magic,
void *priv)
{
const char *name = "refcount";
xfs_agnumber_t agno,
int suspect,
int isroot,
- __uint32_t magic,
+ uint32_t magic,
void *priv)
{
struct aghdr_cnts *agcnts = priv;
struct aghdr_cnts *agcnts)
{
xfs_agblock_t bno;
- __uint32_t magic;
+ uint32_t magic;
bno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]);
if (bno != 0 && verify_agbno(mp, agno, bno)) {
{
xfs_agblock_t bno;
int i;
- __uint32_t magic;
+ uint32_t magic;
bno = be32_to_cpu(agi->agi_root);
if (bno != 0 && verify_agbno(mp, agno, bno)) {
int scan_threads)
{
struct aghdr_cnts *agcnts;
- __uint64_t fdblocks = 0;
- __uint64_t icount = 0;
- __uint64_t ifreecount = 0;
- __uint64_t usedblocks = 0;
+ uint64_t fdblocks = 0;
+ uint64_t icount = 0;
+ uint64_t ifreecount = 0;
+ uint64_t usedblocks = 0;
xfs_agnumber_t i;
work_queue_t wq;
xfs_fsblock_t bno,
xfs_ino_t ino,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
struct blkmap **blkmapp,
bmap_cursor_t *bm_cursor,
int isroot,
int check_dups,
int *dirty,
- __uint64_t magic),
+ uint64_t magic),
int type,
int whichfork,
xfs_ino_t ino,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
struct blkmap **blkmapp,
bmap_cursor_t *bm_cursor,
int isroot,
int check_dups,
- __uint64_t magic,
+ uint64_t magic,
const struct xfs_buf_ops *ops);
int scan_bmapbt(
xfs_fsblock_t bno,
xfs_ino_t ino,
xfs_rfsblock_t *tot,
- __uint64_t *nex,
+ uint64_t *nex,
struct blkmap **blkmapp,
bmap_cursor_t *bm_cursor,
int isroot,
int check_dups,
int *dirty,
- __uint64_t magic);
+ uint64_t magic);
void
scan_ags(