static void addr_help(void);
static const cmdinfo_t addr_cmd =
- { "addr", "a", addr_f, 0, 1, 1, "[field-expression]",
- "set current address", addr_help };
+ { "addr", "a", addr_f, 0, 1, 1, N_("[field-expression]"),
+ N_("set current address"), addr_help };
static void
addr_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" 'addr' uses the given field to set the filesystem address and type\n"
"\n"
" a rootino - set the type to inode and set position to the root inode\n"
" a u.bmx[0].startblock (for inode with blockmap)\n"
"\n"
-);
+));
}
return 0;
}
if (cur_typ == NULL) {
- dbprintf("no current type\n");
+ dbprintf(_("no current type\n"));
return 0;
}
fld = cur_typ->fields;
fld = fa->subfld;
}
if (fld == NULL) {
- dbprintf("no fields for type %s\n", cur_typ->name);
+ dbprintf(_("no fields for type %s\n"), cur_typ->name);
return 0;
}
fl = flist_scan(argv[1]);
flist_print(fl);
for (tfl = fl; tfl->child != NULL; tfl = tfl->child) {
if ((tfl->flags & FL_OKLOW) && tfl->low < tfl->high) {
- dbprintf("array not allowed for addr command\n");
+ dbprintf(_("array not allowed for addr command\n"));
flist_free(fl);
return 0;
}
if (next == TYP_INODATA)
next = inode_next_type();
if (next == TYP_NONE) {
- dbprintf("no next type for field %s\n", fld->name);
+ dbprintf(_("no next type for field %s\n"), fld->name);
return 0;
}
fa = &ftattrtab[fld->ftyp];
ASSERT(fa->ftyp == fld->ftyp);
adf = fa->adfunc;
if (adf == NULL) {
- dbprintf("no addr function for field %s (type %s)\n",
+ dbprintf(_("no addr function for field %s (type %s)\n"),
fld->name, fa->name);
return 0;
}
static void agf_help(void);
static const cmdinfo_t agf_cmd =
- { "agf", NULL, agf_f, 0, 1, 1, "[agno]",
- "set address to agf header", agf_help };
+ { "agf", NULL, agf_f, 0, 1, 1, N_("[agno]"),
+ N_("set address to agf header"), agf_help };
const field_t agf_hfld[] = {
{ "", FLDT_AGF, OI(0), C1, 0, TYP_NONE },
static void
agf_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" set allocation group free block list\n"
"\n"
" contains the root of two different freespace btrees:\n"
" The 'cnt' btree keeps track freespace indexed on section size.\n"
" The 'bno' btree tracks sections of freespace indexed on block number.\n"
-);
+));
}
static int
if (argc > 1) {
agno = (xfs_agnumber_t)strtoul(argv[1], &p, 0);
if (*p != '\0' || agno >= mp->m_sb.sb_agcount) {
- dbprintf("bad allocation group number %s\n", argv[1]);
+ dbprintf(_("bad allocation group number %s\n"), argv[1]);
return 0;
}
cur_agno = agno;
static void agfl_help(void);
static const cmdinfo_t agfl_cmd =
- { "agfl", NULL, agfl_f, 0, 1, 1, "[agno]",
- "set address to agfl block", agfl_help };
+ { "agfl", NULL, agfl_f, 0, 1, 1, N_("[agno]"),
+ N_("set address to agfl block"), agfl_help };
const field_t agfl_hfld[] = { {
"", FLDT_AGFL, OI(0), C1, 0, TYP_NONE, },
static void
agfl_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" set allocation group freelist\n"
"\n"
" for each allocation group. This acts as a reserved pool of space\n"
" separate from the general filesystem freespace (not used for user data).\n"
"\n"
-);
+));
}
if (argc > 1) {
agno = (xfs_agnumber_t)strtoul(argv[1], &p, 0);
if (*p != '\0' || agno >= mp->m_sb.sb_agcount) {
- dbprintf("bad allocation group number %s\n", argv[1]);
+ dbprintf(_("bad allocation group number %s\n"), argv[1]);
return 0;
}
cur_agno = agno;
static void agi_help(void);
static const cmdinfo_t agi_cmd =
- { "agi", NULL, agi_f, 0, 1, 1, "[agno]",
- "set address to agi header", agi_help };
+ { "agi", NULL, agi_f, 0, 1, 1, N_("[agno]"),
+ N_("set address to agi header"), agi_help };
const field_t agi_hfld[] = {
{ "", FLDT_AGI, OI(0), C1, 0, TYP_NONE },
static void
agi_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" set allocation group inode btree\n"
"\n"
" the agi inode btree tracks all used/free inodes in the allocation group.\n"
" Inodes are allocated in 16k 'chunks', each btree entry tracks a 'chunk'.\n"
"\n"
-);
+));
}
static int
if (argc > 1) {
agno = (xfs_agnumber_t)strtoul(argv[1], &p, 0);
if (*p != '\0' || agno >= mp->m_sb.sb_agcount) {
- dbprintf("bad allocation group number %s\n", argv[1]);
+ dbprintf(_("bad allocation group number %s\n"), argv[1]);
return 0;
}
cur_agno = agno;
static const cmdinfo_t attr_set_cmd =
{ "attr_set", "aset", attr_set_f, 1, -1, 0,
- "[-r|-s|-p|-u] [-n] [-R|-C] [-v n] name",
- "set the named attribute on the current inode", attrset_help };
+ N_("[-r|-s|-p|-u] [-n] [-R|-C] [-v n] name"),
+ N_("set the named attribute on the current inode"), attrset_help };
static const cmdinfo_t attr_remove_cmd =
{ "attr_remove", "aremove", attr_remove_f, 1, -1, 0,
- "[-r|-s|-p|-u] [-n] name",
- "remove the named attribute from the current inode", attrset_help };
+ N_("[-r|-s|-p|-u] [-n] name"),
+ N_("remove the named attribute from the current inode"), attrset_help };
static void
attrset_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" The 'attr_set' and 'attr_remove' commands provide interfaces for debugging\n"
" the extended attribute allocation and removal code.\n"
" -C -- 'create' - create attribute, fail if it already exists\n"
" -R -- 'replace' - replace attribute, fail if it does not exist\n"
" The backward compatibility mode 'noattr2' can be emulated (-n) also.\n"
-"\n");
+"\n"));
}
void
int c, namelen, valuelen = 0, flags = 0;
if (cur_typ == NULL) {
- dbprintf("no current type\n");
+ dbprintf(_("no current type\n"));
return 0;
}
if (cur_typ->typnm != TYP_INODE) {
- dbprintf("current type is not inode\n");
+ dbprintf(_("current type is not inode\n"));
return 0;
}
case 'v':
valuelen = (int)strtol(optarg, &sp, 0);
if (*sp != '\0' || valuelen < 0 || valuelen > 64*1024) {
- dbprintf("bad attr_set valuelen %s\n", optarg);
+ dbprintf(_("bad attr_set valuelen %s\n"), optarg);
return 0;
}
break;
default:
- dbprintf("bad option for attr_set command\n");
+ dbprintf(_("bad option for attr_set command\n"));
return 0;
}
}
if (optind != argc - 1) {
- dbprintf("too few options for attr_set (no name given)\n");
+ dbprintf(_("too few options for attr_set (no name given)\n"));
return 0;
}
if (valuelen) {
value = (char *)memalign(getpagesize(), valuelen);
if (!value) {
- dbprintf("cannot allocate buffer (%d)\n", valuelen);
+ dbprintf(_("cannot allocate buffer (%d)\n"), valuelen);
goto out;
}
memset(value, 0xfeedface, valuelen);
int c, namelen, flags = 0;
if (cur_typ == NULL) {
- dbprintf("no current type\n");
+ dbprintf(_("no current type\n"));
return 0;
}
if (cur_typ->typnm != TYP_INODE) {
- dbprintf("current type is not inode\n");
+ dbprintf(_("current type is not inode\n"));
return 0;
}
break;
default:
- dbprintf("bad option for attr_remove command\n");
+ dbprintf(_("bad option for attr_remove command\n"));
return 0;
}
}
if (optind != argc - 1) {
- dbprintf("too few options for attr_remove (no name given)\n");
+ dbprintf(_("too few options for attr_remove (no name given)\n"));
return 0;
}
static void print_rawdata(void *data, int len);
static const cmdinfo_t ablock_cmd =
- { "ablock", NULL, ablock_f, 1, 1, 1, "filoff",
- "set address to file offset (attr fork)", ablock_help };
+ { "ablock", NULL, ablock_f, 1, 1, 1, N_("filoff"),
+ N_("set address to file offset (attr fork)"), ablock_help };
static const cmdinfo_t daddr_cmd =
- { "daddr", NULL, daddr_f, 0, 1, 1, "[d]",
- "set address to daddr value", daddr_help };
+ { "daddr", NULL, daddr_f, 0, 1, 1, N_("[d]"),
+ N_("set address to daddr value"), daddr_help };
static const cmdinfo_t dblock_cmd =
- { "dblock", NULL, dblock_f, 1, 1, 1, "filoff",
- "set address to file offset (data fork)", dblock_help };
+ { "dblock", NULL, dblock_f, 1, 1, 1, N_("filoff"),
+ N_("set address to file offset (data fork)"), dblock_help };
static const cmdinfo_t fsblock_cmd =
- { "fsblock", "fsb", fsblock_f, 0, 1, 1, "[fsb]",
- "set address to fsblock value", fsblock_help };
+ { "fsblock", "fsb", fsblock_f, 0, 1, 1, N_("[fsb]"),
+ N_("set address to fsblock value"), fsblock_help };
static void
ablock_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n Example:\n"
"\n"
" 'ablock 23' - sets the file position to the 23rd filesystem block in\n"
" the inode's attribute fork. The filesystem block size is specified in\n"
" the superblock.\n\n"
-);
+));
}
/*ARGSUSED*/
bno = (xfs_dfiloff_t)strtoull(argv[1], &p, 0);
if (*p != '\0') {
- dbprintf("bad block number %s\n", argv[1]);
+ dbprintf(_("bad block number %s\n"), argv[1]);
return 0;
}
push_cur();
haveattr = XFS_DFORK_Q((xfs_dinode_t *)iocur_top->data);
pop_cur();
if (!haveattr) {
- dbprintf("no attribute data for file\n");
+ dbprintf(_("no attribute data for file\n"));
return 0;
}
nex = 1;
bmap(bno, 1, XFS_ATTR_FORK, &nex, &bm);
if (nex == 0) {
- dbprintf("file attr block is unmapped\n");
+ dbprintf(_("file attr block is unmapped\n"));
return 0;
}
dfsbno = bm.startblock + (bno - bm.startoff);
static void
daddr_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n Example:\n"
"\n"
" 'daddr 102' - sets position to the 102nd absolute disk block\n"
" (512 byte block).\n"
-);
+));
}
static int
char *p;
if (argc == 1) {
- dbprintf("current daddr is %lld\n", iocur_top->off >> BBSHIFT);
+ dbprintf(_("current daddr is %lld\n"), iocur_top->off >> BBSHIFT);
return 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]);
+ dbprintf(_("bad daddr %s\n"), argv[1]);
return 0;
}
ASSERT(typtab[TYP_DATA].typnm == TYP_DATA);
static void
dblock_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n Example:\n"
"\n"
" 'dblock 23' - sets the file position to the 23rd filesystem block in\n"
" the inode's data fork. The filesystem block size is specified in the\n"
" superblock.\n\n"
-);
+));
}
static int
bno = (xfs_dfiloff_t)strtoull(argv[1], &p, 0);
if (*p != '\0') {
- dbprintf("bad block number %s\n", argv[1]);
+ dbprintf(_("bad block number %s\n"), argv[1]);
return 0;
}
push_cur();
type = inode_next_type();
pop_cur();
if (type == TYP_NONE) {
- dbprintf("no type for file data\n");
+ dbprintf(_("no type for file data\n"));
return 0;
}
nex = nb = type == TYP_DIR2 ? mp->m_dirblkfsbs : 1;
bmp = malloc(nb * sizeof(*bmp));
bmap(bno, nb, XFS_DATA_FORK, &nex, bmp);
if (nex == 0) {
- dbprintf("file data block is unmapped\n");
+ dbprintf(_("file data block is unmapped\n"));
free(bmp);
return 0;
}
static void
fsblock_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n Example:\n"
"\n"
" 'fsblock 1023' - sets the file position to the 1023rd filesystem block.\n"
" The filesystem block size is specified in the superblock and set during\n"
" mkfs time. Offset is absolute (not AG relative).\n\n"
-);
+));
}
static int
char *p;
if (argc == 1) {
- dbprintf("current fsblock is %lld\n",
+ dbprintf(_("current fsblock is %lld\n"),
XFS_DADDR_TO_FSB(mp, iocur_top->off >> BBSHIFT));
return 0;
}
d = strtoull(argv[1], &p, 0);
if (*p != '\0') {
- dbprintf("bad fsblock %s\n", argv[1]);
+ dbprintf(_("bad fsblock %s\n"), argv[1]);
return 0;
}
agno = XFS_FSB_TO_AGNO(mp, d);
agbno = XFS_FSB_TO_AGBNO(mp, d);
if (agno >= mp->m_sb.sb_agcount || agbno >= mp->m_sb.sb_agblocks) {
- dbprintf("bad fsblock %s\n", argv[1]);
+ dbprintf(_("bad fsblock %s\n"), argv[1]);
return 0;
}
ASSERT(typtab[TYP_DATA].typnm == TYP_DATA);
xfs_bmbt_ptr_t *pp, int nrecs);
static const cmdinfo_t bmap_cmd =
- { "bmap", NULL, bmap_f, 0, 3, 0, "[-ad] [block [len]]",
- "show block map for current file", NULL };
+ { "bmap", NULL, bmap_f, 0, 3, 0, N_("[-ad] [block [len]]"),
+ N_("show block map for current file"), NULL };
void
bmap(
int whichfork;
if (iocur_top->ino == NULLFSINO) {
- dbprintf("no current inode\n");
+ dbprintf(_("no current inode\n"));
return 0;
}
optind = 0;
dfork = 1;
break;
default:
- dbprintf("bad option for bmap command\n");
+ dbprintf(_("bad option for bmap command\n"));
return 0;
}
}
if (optind < argc) {
co = (xfs_dfiloff_t)strtoull(argv[optind], &p, 0);
if (*p != '\0') {
- dbprintf("bad block number for bmap %s\n",
+ dbprintf(_("bad block number for bmap %s\n"),
argv[optind]);
return 0;
}
if (optind < argc) {
len = (xfs_dfilblks_t)strtoull(argv[optind], &p, 0);
if (*p != '\0') {
- dbprintf("bad len for bmap %s\n", argv[optind]);
+ dbprintf(_("bad len for bmap %s\n"), argv[optind]);
return 0;
}
eo = co + len - 1;
bmap(co, eo - co + 1, whichfork, &nex, &be);
if (nex == 0)
break;
- dbprintf("%s offset %lld startblock %llu (%u/%u) count "
- "%llu flag %u\n",
- whichfork == XFS_DATA_FORK ? "data" : "attr",
+ dbprintf(_("%s offset %lld startblock %llu (%u/%u) count "
+ "%llu flag %u\n"),
+ whichfork == XFS_DATA_FORK ? _("data") : _("attr"),
be.startoff, be.startblock,
XFS_FSB_TO_AGNO(mp, be.startblock),
XFS_FSB_TO_AGBNO(mp, be.startblock),
static const cmdinfo_t blockfree_cmd =
{ "blockfree", NULL, blockfree_f, 0, 0, 0,
- NULL, "free block usage information", NULL };
+ NULL, N_("free block usage information"), NULL };
static const cmdinfo_t blockget_cmd =
{ "blockget", "check", blockget_f, 0, -1, 0,
- "[-s|-v] [-n] [-t] [-b bno]... [-i ino] ...",
- "get block usage and check consistency", NULL };
+ N_("[-s|-v] [-n] [-t] [-b bno]... [-i ino] ..."),
+ N_("get block usage and check consistency"), NULL };
static const cmdinfo_t blocktrash_cmd =
{ "blocktrash", NULL, blocktrash_f, 0, -1, 0,
- "[-n count] [-x minlen] [-y maxlen] [-s seed] [-0123] [-t type] ...",
- "trash randomly selected block(s)", NULL };
+ N_("[-n count] [-x minlen] [-y maxlen] [-s seed] [-0123] [-t type] ..."),
+ N_("trash randomly selected block(s)"), NULL };
static const cmdinfo_t blockuse_cmd =
{ "blockuse", NULL, blockuse_f, 0, 3, 0,
- "[-n] [-c blockcount]",
- "print usage for current block(s)", NULL };
+ N_("[-n] [-c blockcount]"),
+ N_("print usage for current block(s)"), NULL };
static const cmdinfo_t ncheck_cmd =
{ "ncheck", NULL, ncheck_f, 0, -1, 0,
- "[-s] [-i ino] ...",
- "print inode-name pairs", NULL };
+ N_("[-s] [-i ino] ..."),
+ N_("print inode-name pairs"), NULL };
static void
id = find_inode(ino, 1);
if (id == NULL) {
- dbprintf("-i %lld bad inode number\n", ino);
+ dbprintf(_("-i %lld bad inode number\n"), ino);
return;
}
id->ilist = 1;
{
id->link_add++;
if (verbose || id->ilist)
- dbprintf("inode %lld add link, now %u\n", id->ino,
+ dbprintf(_("inode %lld add link, now %u\n"), id->ino,
id->link_add);
}
pid = find_inode(parent, 1);
id->parent = pid;
if (verbose || id->ilist || (pid && pid->ilist))
- dbprintf("inode %lld parent %lld\n", id->ino, parent);
+ dbprintf(_("inode %lld parent %lld\n"), id->ino, parent);
}
static void
int rt;
if (!dbmap) {
- dbprintf("block usage information not allocated\n");
+ dbprintf(_("block usage information not allocated\n"));
return 0;
}
rt = mp->m_sb.sb_rextents != 0;
int sbyell;
if (dbmap) {
- dbprintf("already have block usage information\n");
+ dbprintf(_("already have block usage information\n"));
return 0;
}
if (!init(argc, argv)) {
scan_ag(agno);
if (sbver_err > 4 && !sbyell && sbver_err >= agno) {
sbyell = 1;
- dbprintf("WARNING: this may be a newer XFS "
- "filesystem.\n");
+ dbprintf(_("WARNING: this may be a newer XFS "
+ "filesystem.\n"));
}
}
if (blist_size) {
}
if (mp->m_sb.sb_icount != icount) {
if (!sflag)
- dbprintf("sb_icount %lld, counted %lld\n",
+ dbprintf(_("sb_icount %lld, counted %lld\n"),
mp->m_sb.sb_icount, icount);
error++;
}
if (mp->m_sb.sb_ifree != ifree) {
if (!sflag)
- dbprintf("sb_ifree %lld, counted %lld\n",
+ dbprintf(_("sb_ifree %lld, counted %lld\n"),
mp->m_sb.sb_ifree, ifree);
error++;
}
if (mp->m_sb.sb_fdblocks != fdblocks) {
if (!sflag)
- dbprintf("sb_fdblocks %lld, counted %lld\n",
+ dbprintf(_("sb_fdblocks %lld, counted %lld\n"),
mp->m_sb.sb_fdblocks, fdblocks);
error++;
}
if (lazycount && mp->m_sb.sb_fdblocks != agf_aggr_freeblks) {
if (!sflag)
- dbprintf("sb_fdblocks %lld, aggregate AGF count %lld\n",
+ dbprintf(_("sb_fdblocks %lld, aggregate AGF count %lld\n"),
mp->m_sb.sb_fdblocks, agf_aggr_freeblks);
error++;
}
if (mp->m_sb.sb_frextents != frextents) {
if (!sflag)
- dbprintf("sb_frextents %lld, counted %lld\n",
+ dbprintf(_("sb_frextents %lld, counted %lld\n"),
mp->m_sb.sb_frextents, frextents);
error++;
}
if (mp->m_sb.sb_bad_features2 != 0 &&
mp->m_sb.sb_bad_features2 != mp->m_sb.sb_features2) {
if (!sflag)
- dbprintf("sb_features2 (0x%x) not same as "
- "sb_bad_features2 (0x%x)\n",
+ dbprintf(_("sb_features2 (0x%x) not same as "
+ "sb_bad_features2 (0x%x)\n"),
mp->m_sb.sb_features2,
mp->m_sb.sb_bad_features2);
error++;
if ((sbversion & XFS_SB_VERSION_ATTRBIT) &&
!xfs_sb_version_hasattr(&mp->m_sb)) {
if (!sflag)
- dbprintf("sb versionnum missing attr bit %x\n",
+ dbprintf(_("sb versionnum missing attr bit %x\n"),
XFS_SB_VERSION_ATTRBIT);
error++;
}
if ((sbversion & XFS_SB_VERSION_NLINKBIT) &&
!xfs_sb_version_hasnlink(&mp->m_sb)) {
if (!sflag)
- dbprintf("sb versionnum missing nlink bit %x\n",
+ dbprintf(_("sb versionnum missing nlink bit %x\n"),
XFS_SB_VERSION_NLINKBIT);
error++;
}
if ((sbversion & XFS_SB_VERSION_QUOTABIT) &&
!xfs_sb_version_hasquota(&mp->m_sb)) {
if (!sflag)
- dbprintf("sb versionnum missing quota bit %x\n",
+ dbprintf(_("sb versionnum missing quota bit %x\n"),
XFS_SB_VERSION_QUOTABIT);
error++;
}
if (!(sbversion & XFS_SB_VERSION_ALIGNBIT) &&
xfs_sb_version_hasalign(&mp->m_sb)) {
if (!sflag)
- dbprintf("sb versionnum extra align bit %x\n",
+ dbprintf(_("sb versionnum extra align bit %x\n"),
XFS_SB_VERSION_ALIGNBIT);
error++;
}
if (qgdo)
quota_check("group", qgdata);
if (sbver_err > mp->m_sb.sb_agcount / 2)
- dbprintf("WARNING: this may be a newer XFS filesystem.\n");
+ dbprintf(_("WARNING: this may be a newer XFS filesystem.\n"));
if (error)
exitcode = 3;
dbprefix = oldprefix;
int newbit;
int offset;
static char *modestr[] = {
- "zeroed", "set", "flipped", "randomized"
+ N_("zeroed"), N_("set"), N_("flipped"), N_("randomized")
};
len = (int)((random() % (ltabp->max - ltabp->min + 1)) + ltabp->min);
set_cur(&typtab[DBM_UNKNOWN],
XFS_AGB_TO_DADDR(mp, agno, agbno), blkbb, DB_RING_IGN, NULL);
if ((buf = iocur_top->data) == NULL) {
- dbprintf("can't read block %u/%u for trashing\n", agno, agbno);
+ dbprintf(_("can't read block %u/%u for trashing\n"), agno, agbno);
pop_cur();
return;
}
}
write_cur();
pop_cur();
- printf("blocktrash: %u/%u %s block %d bit%s starting %d:%d %s\n",
+ printf(_("blocktrash: %u/%u %s block %d bit%s starting %d:%d %s\n"),
agno, agbno, typename[type], len, len == 1 ? "" : "s",
offset / NBBY, offset % NBBY, modestr[mode]);
}
int tmask;
if (!dbmap) {
- dbprintf("must run blockget first\n");
+ dbprintf(_("must run blockget first\n"));
return 0;
}
optind = 0;
case 'n':
count = (int)strtol(optarg, &p, 0);
if (*p != '\0' || count <= 0) {
- dbprintf("bad blocktrash count %s\n", optarg);
+ dbprintf(_("bad blocktrash count %s\n"), optarg);
return 0;
}
break;
break;
}
if (!typename[i] || (((1 << i) & goodmask) == 0)) {
- dbprintf("bad blocktrash type %s\n", optarg);
+ dbprintf(_("bad blocktrash type %s\n"), optarg);
return 0;
}
tmask |= 1 << i;
min = (int)strtol(optarg, &p, 0);
if (*p != '\0' || min <= 0 ||
min > mp->m_sb.sb_blocksize * NBBY) {
- dbprintf("bad blocktrash min %s\n", optarg);
+ dbprintf(_("bad blocktrash min %s\n"), optarg);
return 0;
}
break;
max = (int)strtol(optarg, &p, 0);
if (*p != '\0' || max <= 0 ||
max > mp->m_sb.sb_blocksize * NBBY) {
- dbprintf("bad blocktrash max %s\n", optarg);
+ dbprintf(_("bad blocktrash max %s\n"), optarg);
return 0;
}
break;
default:
- dbprintf("bad option for blocktrash command\n");
+ dbprintf(_("bad option for blocktrash command\n"));
return 0;
}
}
if (min > max) {
- dbprintf("bad min/max for blocktrash command\n");
+ dbprintf(_("bad min/max for blocktrash command\n"));
return 0;
}
if (tmask == 0)
}
}
if (blocks == 0) {
- dbprintf("blocktrash: no matching blocks\n");
+ dbprintf(_("blocktrash: no matching blocks\n"));
return 0;
}
if (!sopt)
- dbprintf("blocktrash: seed %u\n", seed);
+ dbprintf(_("blocktrash: seed %u\n"), seed);
srandom(seed);
for (i = 0; i < count; i++) {
randb = (xfs_drfsbno_t)((((__int64_t)random() << 32) |
int shownames;
if (!dbmap) {
- dbprintf("must run blockget first\n");
+ dbprintf(_("must run blockget first\n"));
return 0;
}
optind = 0;
end = agbno + count - 1;
if (*p != '\0' || count <= 0 ||
end >= mp->m_sb.sb_agblocks) {
- dbprintf("bad blockuse count %s\n", optarg);
+ dbprintf(_("bad blockuse count %s\n"), optarg);
return 0;
}
break;
case 'n':
if (!nflag) {
- dbprintf("must run blockget -n first\n");
+ dbprintf(_("must run blockget -n first\n"));
return 0;
}
shownames = 1;
break;
default:
- dbprintf("bad option for blockuse command\n");
+ dbprintf(_("bad option for blockuse command\n"));
return 0;
}
}
while (agbno <= end) {
p = &dbmap[agno][agbno];
i = inomap[agno][agbno];
- dbprintf("block %llu (%u/%u) type %s",
+ dbprintf(_("block %llu (%u/%u) type %s"),
(xfs_dfsbno_t)XFS_AGB_TO_FSB(mp, agno, agbno),
agno, agbno, typename[(dbm_t)*p]);
if (i) {
- dbprintf(" inode %lld", i->ino);
+ dbprintf(_(" inode %lld"), i->ino);
if (shownames && (p = inode_name(i->ino, NULL))) {
dbprintf(" %s", p);
xfree(p);
for (i = 0, p = &dbmap[agno][agbno]; i < len; i++, p++) {
if ((dbm_t)*p != type) {
if (!sflag || CHECK_BLISTA(agno, agbno + i))
- dbprintf("block %u/%u expected type %s got "
- "%s\n",
+ dbprintf(_("block %u/%u expected type %s got "
+ "%s\n"),
agno, agbno + i, typename[type],
typename[(dbm_t)*p]);
error++;
int rval;
if (!check_range(agno, agbno, len)) {
- dbprintf("blocks %u/%u..%u claimed by inode %lld\n",
+ dbprintf(_("blocks %u/%u..%u claimed by inode %lld\n"),
agno, agbno, agbno + len - 1, c_ino);
return 0;
}
if (*idp) {
if (!sflag || (*idp)->ilist ||
CHECK_BLISTA(agno, agbno + i))
- dbprintf("block %u/%u claimed by inode %lld, "
- "previous inum %lld\n",
+ dbprintf(_("block %u/%u claimed by inode %lld, "
+ "previous inum %lld\n"),
agno, agbno + i, c_ino, (*idp)->ino);
error++;
rval = 0;
path = xstrdup("?");
if (!sflag || ep->ilist) {
if (ep->link_add)
- dbprintf("link count mismatch "
+ dbprintf(_("link count mismatch "
"for inode %lld (name "
"%s), nlink %d, "
- "counted %d\n",
+ "counted %d\n"),
ep->ino, path,
ep->link_set,
ep->link_add);
else if (ep->link_set)
- dbprintf("disconnected inode "
- "%lld, nlink %d\n",
+ dbprintf(_("disconnected inode "
+ "%lld, nlink %d\n"),
ep->ino, ep->link_set);
else
- dbprintf("allocated inode %lld "
- "has 0 link count\n",
+ dbprintf(_("allocated inode %lld "
+ "has 0 link count\n"),
ep->ino);
}
if (path)
} else if (verbose || ep->ilist) {
path = inode_name(ep->ino, NULL);
if (path) {
- dbprintf("inode %lld name %s\n",
+ dbprintf(_("inode %lld name %s\n"),
ep->ino, path);
xfree(path);
}
/* Do nothing */
} else if (cur == 0 && prev == 1) {
if (low == high) {
- dbprintf("block %u/%u out of range\n",
+ dbprintf(_("block %u/%u out of range\n"),
agno, low);
} else {
- dbprintf("blocks %u/%u..%u "
- "out of range\n",
+ dbprintf(_("blocks %u/%u..%u "
+ "out of range\n"),
agno, low, high);
}
valid_range = 0;
}
if (valid_range) {
if (low == high) {
- dbprintf("block %u/%u out of range\n",
+ dbprintf(_("block %u/%u out of range\n"),
agno, low);
} else {
- dbprintf("blocks %u/%u..%u "
- "out of range\n",
+ dbprintf(_("blocks %u/%u..%u "
+ "out of range\n"),
agno, low, high);
}
}
for (i = 0, p = &dbmap[mp->m_sb.sb_agcount][bno]; i < len; i++, p++) {
if ((dbm_t)*p != type) {
if (!sflag || CHECK_BLIST(bno + i))
- dbprintf("rtblock %llu expected type %s got "
- "%s\n",
+ dbprintf(_("rtblock %llu expected type %s got "
+ "%s\n"),
bno + i, typename[type],
typename[(dbm_t)*p]);
error++;
int rval;
if (!check_rrange(bno, len)) {
- dbprintf("rtblocks %llu..%llu claimed by inode %lld\n",
+ dbprintf(_("rtblocks %llu..%llu claimed by inode %lld\n"),
bno, bno + len - 1, c_ino);
return 0;
}
i++, idp++) {
if (*idp) {
if (!sflag || (*idp)->ilist || CHECK_BLIST(bno + i))
- dbprintf("rtblock %llu claimed by inode %lld, "
- "previous inum %lld\n",
+ dbprintf(_("rtblock %llu claimed by inode %lld, "
+ "previous inum %lld\n"),
bno + i, c_ino, (*idp)->ino);
error++;
rval = 0;
id = find_inode(mp->m_sb.sb_rootino, 0);
if (id == NULL) {
if (!sflag)
- dbprintf("root inode %lld is missing\n",
+ dbprintf(_("root inode %lld is missing\n"),
mp->m_sb.sb_rootino);
error++;
} else if (!id->isdir) {
if (!sflag || id->ilist)
- dbprintf("root inode %lld is not a directory\n",
+ dbprintf(_("root inode %lld is not a directory\n"),
mp->m_sb.sb_rootino);
error++;
}
if (bno + len - 1 >= mp->m_sb.sb_rblocks) {
for (i = 0; i < len; i++) {
if (!sflag || CHECK_BLIST(bno + i))
- dbprintf("rtblock %llu out of range\n",
+ dbprintf(_("rtblock %llu out of range\n"),
bno + i);
}
error++;
char *p;
if (!check_range(agno, agbno, len)) {
- dbprintf("blocks %u/%u..%u claimed by block %u/%u\n", agno,
+ dbprintf(_("blocks %u/%u..%u claimed by block %u/%u\n"), agno,
agbno, agbno + len - 1, c_agno, c_agbno);
return;
}
for (i = 0, p = &dbmap[agno][agbno]; i < len; i++, p++) {
*p = (char)type2;
if (mayprint && (verbose || CHECK_BLISTA(agno, agbno + i)))
- dbprintf("setting block %u/%u to %s\n", agno, agbno + i,
+ dbprintf(_("setting block %u/%u to %s\n"), agno, agbno + i,
typename[type2]);
}
}
for (i = 0, p = &dbmap[mp->m_sb.sb_agcount][bno]; i < len; i++, p++) {
*p = (char)type2;
if (mayprint && (verbose || CHECK_BLIST(bno + i)))
- dbprintf("setting rtblock %llu to %s\n",
+ dbprintf(_("setting rtblock %llu to %s\n"),
bno + i, typename[type2]);
}
}
bno++, csp++, fsp++) {
if (*csp != *fsp) {
if (!sflag)
- dbprintf("rt summary mismatch, size %d "
+ dbprintf(_("rt summary mismatch, size %d "
"block %llu, file: %d, "
- "computed: %d\n",
+ "computed: %d\n"),
log, bno, *fsp, *csp);
error++;
}
for (i = 0, p = &dbmap[agno][agbno]; i < len; i++, p++) {
if ((1 << *p) & typemask) {
if (!sflag || CHECK_BLISTA(agno, agbno + i))
- dbprintf("block %u/%u type %s not expected\n",
+ dbprintf(_("block %u/%u type %s not expected\n"),
agno, agbno + i, typename[(dbm_t)*p]);
error++;
}
for (i = 0, p = &dbmap[mp->m_sb.sb_agcount][bno]; i < len; i++, p++) {
if ((1 << *p) & typemask) {
if (!sflag || CHECK_BLIST(bno + i))
- dbprintf("rtblock %llu type %s not expected\n",
+ dbprintf(_("rtblock %llu type %s not expected\n"),
bno + i, typename[(dbm_t)*p]);
error++;
}
if (p->seen)
continue;
if (!sflag || id->ilist || v)
- dbprintf("dir ino %lld missing leaf entry for "
- "%x/%x\n",
+ dbprintf(_("dir ino %lld missing leaf entry for "
+ "%x/%x\n"),
id->ino, p->hashval, p->address);
error++;
}
serious_error = 0;
if (mp->m_sb.sb_magicnum != XFS_SB_MAGIC) {
- dbprintf("bad superblock magic number %x, giving up\n",
+ dbprintf(_("bad superblock magic number %x, giving up\n"),
mp->m_sb.sb_magicnum);
serious_error = 1;
return 0;
verbose = 1;
break;
default:
- dbprintf("bad option for blockget command\n");
+ dbprintf(_("bad option for blockget command\n"));
return 0;
}
}
int security;
if (!inodata || !nflag) {
- dbprintf("must run blockget -n first\n");
+ dbprintf(_("must run blockget -n first\n"));
return 0;
}
security = optind = ilist_size = 0;
security = 1;
break;
default:
- dbprintf("bad option -%c for ncheck command\n", c);
+ dbprintf(_("bad option -%c for ncheck command\n"), c);
return 0;
}
}
v = id->ilist || verbose;
if (nex == 0) {
if (!sflag || v)
- dbprintf("block 0 for directory inode %lld is "
- "missing\n",
+ dbprintf(_("block 0 for directory inode %lld is "
+ "missing\n"),
id->ino);
error++;
return 0;
free(bmp);
if (iocur_top->data == NULL) {
if (!sflag || id->ilist || v)
- dbprintf("can't read block 0 for directory inode "
- "%lld\n",
+ dbprintf(_("can't read block 0 for directory inode "
+ "%lld\n"),
id->ino);
error++;
pop_cur();
for (i = 0; i < numrecs; i++, rp++) {
convert_extent((xfs_bmbt_rec_64_t *)rp, &o, &s, &c, &f);
if (v)
- dbprintf("inode %lld extent [%lld,%lld,%lld,%d]\n",
+ dbprintf(_("inode %lld extent [%lld,%lld,%lld,%d]\n"),
id->ino, o, s, c, f);
if (!sflag && i > 0 && op + cp > o)
- dbprintf("bmap rec out of order, inode %lld entry %d\n",
+ dbprintf(_("bmap rec out of order, inode %lld entry %d\n"),
id->ino, i);
op = o;
cp = c;
if (type == DBM_RTDATA) {
if (!sflag && s >= mp->m_sb.sb_rblocks) {
- dbprintf("inode %lld bad rt block number %lld, "
- "offset %lld\n",
+ dbprintf(_("inode %lld bad rt block number %lld, "
+ "offset %lld\n"),
id->ino, s, o);
continue;
}
agbno = XFS_FSB_TO_AGBNO(mp, s);
if (agno >= mp->m_sb.sb_agcount ||
agbno >= mp->m_sb.sb_agblocks) {
- dbprintf("inode %lld bad block number %lld "
- "[%d,%d], offset %lld\n",
+ dbprintf(_("inode %lld bad block number %lld "
+ "[%d,%d], offset %lld\n"),
id->ino, s, agno, agbno, o);
continue;
}
if (agbno + c - 1 >= mp->m_sb.sb_agblocks) {
- dbprintf("inode %lld bad block number %lld "
- "[%d,%d], offset %lld\n",
+ dbprintf(_("inode %lld bad block number %lld "
+ "[%d,%d], offset %lld\n"),
id->ino, s + c - 1, agno,
agbno + (xfs_agblock_t)c - 1, o);
continue;
blist_size && b < s + c;
b++, o++) {
if (CHECK_BLIST(b))
- dbprintf("inode %lld block %lld at "
- "offset %lld\n",
+ dbprintf(_("inode %lld block %lld at "
+ "offset %lld\n"),
id->ino, (xfs_dfsbno_t)b, o);
}
} else {
blist_size && b < s + c;
b++, o++, agbno++) {
if (CHECK_BLIST(b))
- dbprintf("inode %lld block %lld at "
- "offset %lld\n",
+ dbprintf(_("inode %lld block %lld at "
+ "offset %lld\n"),
id->ino, (xfs_dfsbno_t)b, o);
}
}
dib = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
if (be16_to_cpu(dib->bb_level) >= XFS_BM_MAXLEVELS(mp, whichfork)) {
if (!sflag || id->ilist)
- dbprintf("level for ino %lld %s fork bmap root too "
- "large (%u)\n",
+ dbprintf(_("level for ino %lld %s fork bmap root too "
+ "large (%u)\n"),
id->ino,
- whichfork == XFS_DATA_FORK ? "data" : "attr",
+ whichfork == XFS_DATA_FORK ? _("data") : _("attr"),
be16_to_cpu(dib->bb_level));
error++;
return;
xfs_bmdr_maxrecs(mp, XFS_DFORK_SIZE(dip, mp, whichfork),
be16_to_cpu(dib->bb_level) == 0)) {
if (!sflag || id->ilist)
- dbprintf("numrecs for ino %lld %s fork bmap root too "
- "large (%u)\n",
+ dbprintf(_("numrecs for ino %lld %s fork bmap root too "
+ "large (%u)\n"),
id->ino,
- whichfork == XFS_DATA_FORK ? "data" : "attr",
+ whichfork == XFS_DATA_FORK ? _("data") : _("attr"),
be16_to_cpu(dib->bb_numrecs));
error++;
return;
}
if (*nex <= XFS_DFORK_SIZE(dip, mp, whichfork) / sizeof(xfs_bmbt_rec_t)) {
if (!sflag || id->ilist)
- dbprintf("extent count for ino %lld %s fork too low "
- "(%d) for file format\n",
+ dbprintf(_("extent count for ino %lld %s fork too low "
+ "(%d) for file format\n"),
id->ino,
- whichfork == XFS_DATA_FORK ? "data" : "attr",
+ whichfork == XFS_DATA_FORK ? _("data") : _("attr"),
*nex);
error++;
}
if (be32_to_cpu(block->hdr.magic) != XFS_DIR2_BLOCK_MAGIC &&
be32_to_cpu(data->hdr.magic) != XFS_DIR2_DATA_MAGIC) {
if (!sflag || v)
- dbprintf("bad directory data magic # %#x for dir ino "
- "%lld block %d\n",
+ dbprintf(_("bad directory data magic # %#x for dir ino "
+ "%lld block %d\n"),
be32_to_cpu(data->hdr.magic), id->ino, dabno);
error++;
return NULLFSINO;
endptr = (char *)data + mp->m_dirblksize;
lep = NULL;
if (!sflag || v)
- dbprintf("bad block directory tail for dir ino "
- "%lld\n",
+ dbprintf(_("bad block directory tail for dir ino "
+ "%lld\n"),
id->ino);
error++;
}
be16_to_cpu(dup->length) == 0 ||
(char *)tagp >= endptr) {
if (!sflag || v)
- dbprintf("dir %lld block %d bad free "
- "entry at %d\n",
+ dbprintf(_("dir %lld block %d bad free "
+ "entry at %d\n"),
id->ino, dabno,
(int)((char *)dup -
(char *)data));
dep = (xfs_dir2_data_entry_t *)dup;
if (dep->namelen == 0) {
if (!sflag || v)
- dbprintf("dir %lld block %d zero length entry "
- "at %d\n",
+ dbprintf(_("dir %lld block %d zero length entry "
+ "at %d\n"),
id->ino, dabno,
(int)((char *)dep - (char *)data));
error++;
tagp = xfs_dir2_data_entry_tag_p(dep);
if ((char *)tagp >= endptr) {
if (!sflag || v)
- dbprintf("dir %lld block %d bad entry at %d\n",
+ dbprintf(_("dir %lld block %d bad entry at %d\n"),
id->ino, dabno,
(int)((char *)dep - (char *)data));
error++;
lino = be64_to_cpu(dep->inumber);
cid = find_inode(lino, 1);
if (v)
- dbprintf("dir %lld block %d entry %*.*s %lld\n",
+ dbprintf(_("dir %lld block %d entry %*.*s %lld\n"),
id->ino, dabno, dep->namelen, dep->namelen,
dep->name, lino);
if (cid)
addlink_inode(cid);
else {
if (!sflag || v)
- dbprintf("dir %lld block %d entry %*.*s bad "
- "inode number %lld\n",
+ dbprintf(_("dir %lld block %d entry %*.*s bad "
+ "inode number %lld\n"),
id->ino, dabno, dep->namelen,
dep->namelen, dep->name, lino);
error++;
dep->name[1] == '.') {
if (parent) {
if (!sflag || v)
- dbprintf("multiple .. entries in dir "
- "%lld (%lld, %lld)\n",
+ dbprintf(_("multiple .. entries in dir "
+ "%lld (%lld, %lld)\n"),
id->ino, parent, lino);
error++;
} else
} else {
if (lino != id->ino) {
if (!sflag || v)
- dbprintf("dir %lld entry . inode "
- "number mismatch (%lld)\n",
+ dbprintf(_("dir %lld entry . inode "
+ "number mismatch (%lld)\n"),
id->ino, lino);
error++;
}
for (i = stale = 0; lep && i < be32_to_cpu(btp->count); i++) {
if ((char *)&lep[i] >= endptr) {
if (!sflag || v)
- dbprintf("dir %lld block %d bad count "
- "%u\n", id->ino, dabno,
+ dbprintf(_("dir %lld block %d bad count "
+ "%u\n"), id->ino, dabno,
be32_to_cpu(btp->count));
error++;
break;
else if (dir_hash_see(be32_to_cpu(lep[i].hashval),
be32_to_cpu(lep[i].address))) {
if (!sflag || v)
- dbprintf("dir %lld block %d extra leaf "
- "entry %x %x\n",
+ dbprintf(_("dir %lld block %d extra leaf "
+ "entry %x %x\n"),
id->ino, dabno,
be32_to_cpu(lep[i].hashval),
be32_to_cpu(lep[i].address));
bf_err += freeseen != 7;
if (bf_err) {
if (!sflag || v)
- dbprintf("dir %lld block %d bad bestfree data\n",
+ dbprintf(_("dir %lld block %d bad bestfree data\n"),
id->ino, dabno);
error++;
}
count != be32_to_cpu(btp->count) -
be32_to_cpu(btp->stale)) {
if (!sflag || v)
- dbprintf("dir %lld block %d bad block tail count %d "
- "(stale %d)\n",
+ dbprintf(_("dir %lld block %d bad block tail count %d "
+ "(stale %d)\n"),
id->ino, dabno, be32_to_cpu(btp->count),
be32_to_cpu(btp->stale));
error++;
if (be32_to_cpu(data->hdr.magic) == XFS_DIR2_BLOCK_MAGIC &&
stale != be32_to_cpu(btp->stale)) {
if (!sflag || v)
- dbprintf("dir %lld block %d bad stale tail count %d\n",
+ dbprintf(_("dir %lld block %d bad stale tail count %d\n"),
id->ino, dabno, be32_to_cpu(btp->stale));
error++;
}
if (lastfree_err) {
if (!sflag || v)
- dbprintf("dir %lld block %d consecutive free entries\n",
+ dbprintf(_("dir %lld block %d consecutive free entries\n"),
id->ino, dabno);
error++;
}
if (tag_err) {
if (!sflag || v)
- dbprintf("dir %lld block %d entry/unused tag "
- "mismatch\n",
+ dbprintf(_("dir %lld block %d entry/unused tag "
+ "mismatch\n"),
id->ino, dabno);
error++;
}
bno = XFS_INO_TO_FSB(mp, id->ino);
if (dot == 0) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("no . entry for directory %lld\n", id->ino);
+ dbprintf(_("no . entry for directory %lld\n"), id->ino);
error++;
}
if (dotdot == 0) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("no .. entry for directory %lld\n", id->ino);
+ dbprintf(_("no .. entry for directory %lld\n"), id->ino);
error++;
} else if (parent == id->ino && id->ino != mp->m_sb.sb_rootino) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf(". and .. same for non-root directory %lld\n",
+ dbprintf(_(". and .. same for non-root directory %lld\n"),
id->ino);
error++;
} else if (id->ino == mp->m_sb.sb_rootino && id->ino != parent) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("root directory %lld has .. %lld\n", id->ino,
+ dbprintf(_("root directory %lld has .. %lld\n"), id->ino,
parent);
error++;
} else if (parent != NULLFSINO && id->ino != parent)
dip->di_core.di_format == XFS_DINODE_FMT_BTREE))
*parent = process_node_dir_v1(blkmap, dot, dotdot, id);
else {
- dbprintf("bad size (%lld) or format (%d) for directory inode "
- "%lld\n",
+ dbprintf(_("bad size (%lld) or format (%d) for directory inode "
+ "%lld\n"),
size, dip->di_core.di_format, id->ino);
error++;
return 1;
dip->di_core.di_format == XFS_DINODE_FMT_BTREE))
*parent = process_leaf_node_dir_v2(blkmap, dot, dotdot, id, size);
else {
- dbprintf("bad size (%lld) or format (%d) for directory inode "
- "%lld\n",
+ dbprintf(_("bad size (%lld) or format (%d) for directory inode "
+ "%lld\n"),
size, dip->di_core.di_format, id->ino);
error++;
return 1;
if (*nex < 0 || *nex > XFS_DFORK_SIZE(dip, mp, whichfork) /
sizeof(xfs_bmbt_rec_32_t)) {
if (!sflag || id->ilist)
- dbprintf("bad number of extents %d for inode %lld\n",
+ dbprintf(_("bad number of extents %d for inode %lld\n"),
*nex, id->ino);
error++;
return;
}
if (idic.di_magic != XFS_DINODE_MAGIC) {
if (!sflag || isfree || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad magic number %#x for inode %lld\n",
+ dbprintf(_("bad magic number %#x for inode %lld\n"),
idic.di_magic, ino);
error++;
return;
}
if (!XFS_DINODE_GOOD_VERSION(idic.di_version)) {
if (!sflag || isfree || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad version number %#x for inode %lld\n",
+ dbprintf(_("bad version number %#x for inode %lld\n"),
idic.di_version, ino);
error++;
return;
if (isfree) {
if (idic.di_nblocks != 0) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad nblocks %lld for free inode "
- "%lld\n",
+ dbprintf(_("bad nblocks %lld for free inode "
+ "%lld\n"),
idic.di_nblocks, ino);
error++;
}
nlink = idic.di_nlink;
if (nlink != 0) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad nlink %d for free inode %lld\n",
+ dbprintf(_("bad nlink %d for free inode %lld\n"),
nlink, ino);
error++;
}
if (idic.di_mode != 0) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad mode %#o for free inode %lld\n",
+ dbprintf(_("bad mode %#o for free inode %lld\n"),
idic.di_mode, ino);
error++;
}
}
if (be32_to_cpu(dip->di_next_unlinked) != NULLAGINO) {
if (!sflag || isfree || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad next unlinked %#x for inode %lld\n",
+ dbprintf(_("bad next unlinked %#x for inode %lld\n"),
be32_to_cpu(dip->di_next_unlinked), ino);
error++;
}
if ((((idic.di_mode & S_IFMT) >> 12) > 15) ||
(!(okfmts[(idic.di_mode & S_IFMT) >> 12] & (1 << idic.di_format)))) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad format %d for inode %lld type %#o\n",
+ dbprintf(_("bad format %d for inode %lld type %#o\n"),
idic.di_format, id->ino, idic.di_mode & S_IFMT);
error++;
return;
}
if ((unsigned int)XFS_DFORK_ASIZE(dip, mp) >= XFS_LITINO(mp)) {
if (!sflag || id->ilist)
- dbprintf("bad fork offset %d for inode %lld\n",
+ dbprintf(_("bad fork offset %d for inode %lld\n"),
idic.di_forkoff, id->ino);
error++;
return;
}
if ((unsigned int)idic.di_aformat > XFS_DINODE_FMT_BTREE) {
if (!sflag || id->ilist)
- dbprintf("bad attribute format %d for inode %lld\n",
+ dbprintf(_("bad attribute format %d for inode %lld\n"),
idic.di_aformat, id->ino);
error++;
return;
}
if (verbose || id->ilist || CHECK_BLIST(bno))
- dbprintf("inode %lld mode %#o fmt %s "
+ dbprintf(_("inode %lld mode %#o fmt %s "
"afmt %s "
- "nex %d anex %d nblk %lld sz %lld%s%s%s%s%s%s%s\n",
+ "nex %d anex %d nblk %lld sz %lld%s%s%s%s%s%s%s\n"),
id->ino, idic.di_mode, fmtnames[(int)idic.di_format],
fmtnames[(int)idic.di_aformat],
idic.di_nextents,
totblocks = totdblocks + totiblocks + atotdblocks + atotiblocks;
if (totblocks != idic.di_nblocks) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad nblocks %lld for inode %lld, counted "
- "%lld\n",
+ dbprintf(_("bad nblocks %lld for inode %lld, counted "
+ "%lld\n"),
idic.di_nblocks, id->ino, totblocks);
error++;
}
if (nextents != idic.di_nextents) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad nextents %d for inode %lld, counted %d\n",
+ dbprintf(_("bad nextents %d for inode %lld, counted %d\n"),
idic.di_nextents, id->ino, nextents);
error++;
}
if (anextents != idic.di_anextents) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad anextents %d for inode %lld, counted "
- "%d\n",
+ dbprintf(_("bad anextents %d for inode %lld, counted "
+ "%d\n"),
idic.di_anextents, id->ino, anextents);
error++;
}
if (whichfork == XFS_DATA_FORK && be64_to_cpu(dip->di_core.di_size) >
XFS_DFORK_DSIZE(dip, mp)) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("local inode %lld data is too large (size "
- "%lld)\n",
+ dbprintf(_("local inode %lld data is too large (size "
+ "%lld)\n"),
id->ino, be64_to_cpu(dip->di_core.di_size));
error++;
}
asf = (xfs_attr_shortform_t *)XFS_DFORK_APTR(dip);
if (be16_to_cpu(asf->hdr.totsize) > XFS_DFORK_ASIZE(dip, mp)) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("local inode %lld attr is too large "
- "(size %d)\n",
+ dbprintf(_("local inode %lld attr is too large "
+ "(size %d)\n"),
id->ino, be16_to_cpu(asf->hdr.totsize));
error++;
}
bno = blkmap_get(blkmap, 0);
if (bno == NULLFSBLOCK) {
if (!sflag || id->ilist)
- dbprintf("block 0 for directory inode %lld is "
- "missing\n",
+ dbprintf(_("block 0 for directory inode %lld is "
+ "missing\n"),
id->ino);
error++;
return 0;
NULL);
if (iocur_top->data == NULL) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("can't read block 0 for directory inode "
- "%lld\n",
+ dbprintf(_("can't read block 0 for directory inode "
+ "%lld\n"),
id->ino);
error++;
pop_cur();
leaf = iocur_top->data;
if (be16_to_cpu(leaf->hdr.info.magic) != XFS_DIR_LEAF_MAGIC) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad directory leaf magic # %#x for dir ino "
- "%lld\n",
+ dbprintf(_("bad directory leaf magic # %#x for dir ino "
+ "%lld\n"),
be16_to_cpu(leaf->hdr.info.magic), id->ino);
error++;
return NULLFSINO;
lino = XFS_GET_DIR_INO8(namest->inumber);
cid = find_inode(lino, 1);
if (v)
- dbprintf("dir %lld entry %*.*s %lld\n", id->ino,
+ dbprintf(_("dir %lld entry %*.*s %lld\n"), id->ino,
entry->namelen, entry->namelen, namest->name,
lino);
if (cid)
addlink_inode(cid);
else {
if (!sflag)
- dbprintf("dir %lld entry %*.*s bad inode "
- "number %lld\n",
+ dbprintf(_("dir %lld entry %*.*s bad inode "
+ "number %lld\n"),
id->ino, entry->namelen, entry->namelen,
namest->name, lino);
error++;
namest->name[1] == '.') {
if (parent) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("multiple .. entries in dir "
- "%lld (%lld, %lld)\n",
+ dbprintf(_("multiple .. entries in dir "
+ "%lld (%lld, %lld)\n"),
id->ino, parent, lino);
error++;
} else
} else {
if (lino != id->ino) {
if (!sflag)
- dbprintf("dir %lld entry . inode "
- "number mismatch (%lld)\n",
+ dbprintf(_("dir %lld entry . inode "
+ "number mismatch (%lld)\n"),
id->ino, lino);
error++;
}
v = CHECK_BLIST(b);
}
if (v)
- dbprintf("dir inode %lld block %u=%llu\n", id->ino,
+ dbprintf(_("dir inode %lld block %u=%llu\n"), id->ino,
(__uint32_t)dbno,
(xfs_dfsbno_t)bmp->startblock);
push_cur();
free(bmp);
if (iocur_top->data == NULL) {
if (!sflag || v)
- dbprintf("can't read block %u for directory "
- "inode %lld\n",
+ dbprintf(_("can't read block %u for directory "
+ "inode %lld\n"),
(__uint32_t)dbno, id->ino);
error++;
pop_cur();
if (lino) {
if (parent) {
if (!sflag || v)
- dbprintf("multiple .. entries "
- "in dir %lld\n",
+ dbprintf(_("multiple .. entries "
+ "in dir %lld\n"),
id->ino);
error++;
} else
for (i = 0; i < freetab->nents; i++) {
if (freetab->ents[i] != NULLDATAOFF) {
if (!sflag || v)
- dbprintf("missing free index for data block %d "
- "in dir ino %lld\n",
+ dbprintf(_("missing free index for data block %d "
+ "in dir ino %lld\n"),
xfs_dir2_db_to_da(mp, i), id->ino);
error++;
}
free = iocur_top->data;
if (be32_to_cpu(free->hdr.magic) != XFS_DIR2_FREE_MAGIC) {
if (!sflag || v)
- dbprintf("bad free block magic # %#x for dir ino %lld "
- "block %d\n",
+ dbprintf(_("bad free block magic # %#x for dir ino %lld "
+ "block %d\n"),
be32_to_cpu(free->hdr.magic), id->ino, dabno);
error++;
return;
if (be32_to_cpu(free->hdr.firstdb) != xfs_dir2_da_to_db(mp,
dabno - mp->m_dirfreeblk) * maxent) {
if (!sflag || v)
- dbprintf("bad free block firstdb %d for dir ino %lld "
- "block %d\n",
+ dbprintf(_("bad free block firstdb %d for dir ino %lld "
+ "block %d\n"),
be32_to_cpu(free->hdr.firstdb), id->ino, dabno);
error++;
return;
be32_to_cpu(free->hdr.nused) >
be32_to_cpu(free->hdr.nvalid)) {
if (!sflag || v)
- dbprintf("bad free block nvalid/nused %d/%d for dir "
- "ino %lld block %d\n",
+ dbprintf(_("bad free block nvalid/nused %d/%d for dir "
+ "ino %lld block %d\n"),
be32_to_cpu(free->hdr.nvalid),
be32_to_cpu(free->hdr.nused), id->ino, dabno);
error++;
ent = freetab->ents[be32_to_cpu(free->hdr.firstdb) + i];
if (ent != be16_to_cpu(free->bests[i])) {
if (!sflag || v)
- dbprintf("bad free block ent %d is %d should "
- "be %d for dir ino %lld block %d\n",
+ dbprintf(_("bad free block ent %d is %d should "
+ "be %d for dir ino %lld block %d\n"),
i, be16_to_cpu(free->bests[i]), ent,
id->ino, dabno);
error++;
}
if (used != be32_to_cpu(free->hdr.nused)) {
if (!sflag || v)
- dbprintf("bad free block nused %d should be %d for dir "
- "ino %lld block %d\n",
+ dbprintf(_("bad free block nused %d should be %d for dir "
+ "ino %lld block %d\n"),
be32_to_cpu(free->hdr.nused), used, id->ino,
dabno);
error++;
if (be32_to_cpu(leaf->hdr.info.forw) ||
be32_to_cpu(leaf->hdr.info.back)) {
if (!sflag || v)
- dbprintf("bad leaf block forw/back pointers "
- "%d/%d for dir ino %lld block %d\n",
+ dbprintf(_("bad leaf block forw/back pointers "
+ "%d/%d for dir ino %lld block %d\n"),
be32_to_cpu(leaf->hdr.info.forw),
be32_to_cpu(leaf->hdr.info.back),
id->ino, dabno);
}
if (dabno != mp->m_dirleafblk) {
if (!sflag || v)
- dbprintf("single leaf block for dir ino %lld "
- "block %d should be at block %d\n",
+ dbprintf(_("single leaf block for dir ino %lld "
+ "block %d should be at block %d\n"),
id->ino, dabno,
(xfs_dablk_t)mp->m_dirleafblk);
error++;
if (freetab->nents <= i || freetab->ents[i] !=
be16_to_cpu(lbp[i])) {
if (!sflag || v)
- dbprintf("bestfree %d for dir ino %lld "
+ dbprintf(_("bestfree %d for dir ino %lld "
"block %d doesn't match table "
- "value %d\n",
+ "value %d\n"),
freetab->nents <= i ?
NULLDATAOFF :
freetab->ents[i],
be16_to_cpu(node->hdr.level) >
XFS_DA_NODE_MAXDEPTH) {
if (!sflag || v)
- dbprintf("bad node block level %d for dir ino "
- "%lld block %d\n",
+ dbprintf(_("bad node block level %d for dir ino "
+ "%lld block %d\n"),
be16_to_cpu(node->hdr.level), id->ino,
dabno);
error++;
return;
default:
if (!sflag || v)
- dbprintf("bad directory data magic # %#x for dir ino "
- "%lld block %d\n",
+ dbprintf(_("bad directory data magic # %#x for dir ino "
+ "%lld block %d\n"),
be16_to_cpu(leaf->hdr.info.magic), id->ino,
dabno);
error++;
else if (dir_hash_see(be32_to_cpu(lep[i].hashval),
be32_to_cpu(lep[i].address))) {
if (!sflag || v)
- dbprintf("dir %lld block %d extra leaf entry "
- "%x %x\n", id->ino, dabno,
+ dbprintf(_("dir %lld block %d extra leaf entry "
+ "%x %x\n"), id->ino, dabno,
be32_to_cpu(lep[i].hashval),
be32_to_cpu(lep[i].address));
error++;
}
if (stale != be16_to_cpu(leaf->hdr.stale)) {
if (!sflag || v)
- dbprintf("dir %lld block %d stale mismatch "
- "%d/%d\n",
+ dbprintf(_("dir %lld block %d stale mismatch "
+ "%d/%d\n"),
id->ino, dabno, stale,
be16_to_cpu(leaf->hdr.stale));
error++;
v2 = bno != NULLFSBLOCK && CHECK_BLIST(bno);
if (bno == NULLFSBLOCK && dbno == 0) {
if (!sflag || v)
- dbprintf("can't read root block for directory "
- "inode %lld\n",
+ dbprintf(_("can't read root block for directory "
+ "inode %lld\n"),
id->ino);
error++;
}
if (v || v2)
- dbprintf("dir inode %lld block %u=%llu\n", id->ino,
+ dbprintf(_("dir inode %lld block %u=%llu\n"), id->ino,
(__uint32_t)dbno, (xfs_dfsbno_t)bno);
if (bno == NULLFSBLOCK)
continue;
DB_RING_IGN, NULL);
if (iocur_top->data == NULL) {
if (!sflag || v || v2)
- dbprintf("can't read block %u for directory "
- "inode %lld\n",
+ dbprintf(_("can't read block %u for directory "
+ "inode %lld\n"),
(__uint32_t)dbno, id->ino);
error++;
continue;
if (lino) {
if (parent) {
if (!sflag || v || v2)
- dbprintf("multiple .. entries in dir "
- "%lld\n",
+ dbprintf(_("multiple .. entries in dir "
+ "%lld\n"),
id->ino);
error++;
} else
DB_RING_IGN, NULL);
if ((dqb = iocur_top->data) == NULL) {
if (scicb)
- dbprintf("can't read block %lld for %s quota "
- "inode (fsblock %lld)\n",
+ dbprintf(_("can't read block %lld for %s quota "
+ "inode (fsblock %lld)\n"),
(xfs_dfiloff_t)qbno, s,
(xfs_dfsbno_t)bno);
error++;
}
for (i = 0; i < perblock; i++, dqid++, dqb++) {
if (verbose || id->ilist || cb)
- dbprintf("%s dqblk %lld entry %d id %u bc "
- "%lld ic %lld rc %lld\n",
+ dbprintf(_("%s dqblk %lld entry %d id %u bc "
+ "%lld ic %lld rc %lld\n"),
s, (xfs_dfiloff_t)qbno, i, dqid,
be64_to_cpu(dqb->dd_diskdq.d_bcount),
be64_to_cpu(dqb->dd_diskdq.d_icount),
be64_to_cpu(dqb->dd_diskdq.d_rtbcount));
if (be16_to_cpu(dqb->dd_diskdq.d_magic) != XFS_DQUOT_MAGIC) {
if (scicb)
- dbprintf("bad magic number %#x for %s "
- "dqblk %lld entry %d id %u\n",
+ dbprintf(_("bad magic number %#x for %s "
+ "dqblk %lld entry %d id %u\n"),
be16_to_cpu(dqb->dd_diskdq.d_magic), s,
(xfs_dfiloff_t)qbno, i, dqid);
error++;
}
if (dqb->dd_diskdq.d_version != XFS_DQUOT_VERSION) {
if (scicb)
- dbprintf("bad version number %#x for "
+ dbprintf(_("bad version number %#x for "
"%s dqblk %lld entry %d id "
- "%u\n",
+ "%u\n"),
dqb->dd_diskdq.d_version, s,
(xfs_dfiloff_t)qbno, i, dqid);
error++;
}
if (dqb->dd_diskdq.d_flags != exp_flags) {
if (scicb)
- dbprintf("bad flags %#x for %s dqblk "
- "%lld entry %d id %u\n",
+ dbprintf(_("bad flags %#x for %s dqblk "
+ "%lld entry %d id %u\n"),
dqb->dd_diskdq.d_flags, s,
(xfs_dfiloff_t)qbno, i, dqid);
error++;
}
if (be32_to_cpu(dqb->dd_diskdq.d_id) != dqid) {
if (scicb)
- dbprintf("bad id %u for %s dqblk %lld "
- "entry %d id %u\n",
+ dbprintf(_("bad id %u for %s dqblk %lld "
+ "entry %d id %u\n"),
be32_to_cpu(dqb->dd_diskdq.d_id), s,
(xfs_dfiloff_t)qbno, i, dqid);
error++;
bno = blkmap_get(blkmap, bmbno);
if (bno == NULLFSBLOCK) {
if (!sflag)
- dbprintf("block %lld for rtbitmap inode is "
- "missing\n",
+ dbprintf(_("block %lld for rtbitmap inode is "
+ "missing\n"),
(xfs_dfiloff_t)bmbno);
error++;
continue;
DB_RING_IGN, NULL);
if ((words = iocur_top->data) == NULL) {
if (!sflag)
- dbprintf("can't read block %lld for rtbitmap "
- "inode\n",
+ dbprintf(_("can't read block %lld for rtbitmap "
+ "inode\n"),
(xfs_dfiloff_t)bmbno);
error++;
pop_cur();
bno = blkmap_get(blkmap, sumbno);
if (bno == NULLFSBLOCK) {
if (!sflag)
- dbprintf("block %lld for rtsummary inode is "
- "missing\n",
+ dbprintf(_("block %lld for rtsummary inode is "
+ "missing\n"),
(xfs_dfiloff_t)sumbno);
error++;
continue;
blkbb, DB_RING_IGN, NULL);
if ((bytes = iocur_top->data) == NULL) {
if (!sflag)
- dbprintf("can't read block %lld for rtsummary "
- "inode\n",
+ dbprintf(_("can't read block %lld for rtsummary "
+ "inode\n"),
(xfs_dfiloff_t)sumbno);
error++;
pop_cur();
addlink_inode(id);
v = verbose || id->ilist;
if (v)
- dbprintf("dir %lld entry . %lld\n", id->ino, id->ino);
+ dbprintf(_("dir %lld entry . %lld\n"), id->ino, id->ino);
(*dot)++;
sfe = xfs_dir2_sf_firstentry(sf);
offset = XFS_DIR2_DATA_FIRST_OFFSET;
if ((__psint_t)sfe + xfs_dir2_sf_entsize_byentry(sf, sfe) -
(__psint_t)sf > be64_to_cpu(dip->di_core.di_size)) {
if (!sflag)
- dbprintf("dir %llu bad size in entry at %d\n",
+ dbprintf(_("dir %llu bad size in entry at %d\n"),
id->ino,
(int)((char *)sfe - (char *)sf));
error++;
cid = find_inode(lino, 1);
if (cid == NULL) {
if (!sflag)
- dbprintf("dir %lld entry %*.*s bad inode "
- "number %lld\n",
+ dbprintf(_("dir %lld entry %*.*s bad inode "
+ "number %lld\n"),
id->ino, sfe->namelen, sfe->namelen,
sfe->name, lino);
error++;
addname_inode(cid, (char *)sfe->name, sfe->namelen);
}
if (v)
- dbprintf("dir %lld entry %*.*s offset %d %lld\n",
+ dbprintf(_("dir %lld entry %*.*s offset %d %lld\n"),
id->ino, sfe->namelen, sfe->namelen, sfe->name,
xfs_dir2_sf_get_offset(sfe), lino);
if (xfs_dir2_sf_get_offset(sfe) < offset) {
if (!sflag)
- dbprintf("dir %lld entry %*.*s bad offset %d\n",
+ dbprintf(_("dir %lld entry %*.*s bad offset %d\n"),
id->ino, sfe->namelen, sfe->namelen,
sfe->name, xfs_dir2_sf_get_offset(sfe));
error++;
if (i < 0 && (__psint_t)sfe - (__psint_t)sf !=
be64_to_cpu(dip->di_core.di_size)) {
if (!sflag)
- dbprintf("dir %llu size is %lld, should be %u\n",
+ dbprintf(_("dir %llu size is %lld, should be %u\n"),
id->ino, be64_to_cpu(dip->di_core.di_size),
(uint)((char *)sfe - (char *)sf));
error++;
if (offset + (sf->hdr.count + 2) * sizeof(xfs_dir2_leaf_entry_t) +
sizeof(xfs_dir2_block_tail_t) > mp->m_dirblksize) {
if (!sflag)
- dbprintf("dir %llu offsets too high\n", id->ino);
+ dbprintf(_("dir %llu offsets too high\n"), id->ino);
error++;
}
lino = xfs_dir2_sf_get_inumber(sf, &sf->hdr.parent);
addlink_inode(cid);
else {
if (!sflag)
- dbprintf("dir %lld entry .. bad inode number %lld\n",
+ dbprintf(_("dir %lld entry .. bad inode number %lld\n"),
id->ino, lino);
error++;
}
if (v)
- dbprintf("dir %lld entry .. %lld\n", id->ino, lino);
+ dbprintf(_("dir %lld entry .. %lld\n"), id->ino, lino);
if (i8 != sf->hdr.i8count) {
if (!sflag)
- dbprintf("dir %lld i8count mismatch is %d should be "
- "%d\n",
+ dbprintf(_("dir %lld i8count mismatch is %d should be "
+ "%d\n"),
id->ino, sf->hdr.i8count, i8);
error++;
}
addlink_inode(id);
v = verbose || id->ilist;
if (v)
- dbprintf("dir %lld entry . %lld\n", id->ino, id->ino);
+ dbprintf(_("dir %lld entry . %lld\n"), id->ino, id->ino);
(*dot)++;
sfe = &sf->list[0];
for (i = sf->hdr.count - 1; i >= 0; i--) {
cid = find_inode(lino, 1);
if (cid == NULL) {
if (!sflag)
- dbprintf("dir %lld entry %*.*s bad inode "
- "number %lld\n",
+ dbprintf(_("dir %lld entry %*.*s bad inode "
+ "number %lld\n"),
id->ino, sfe->namelen, sfe->namelen,
sfe->name, lino);
error++;
addname_inode(cid, (char *)sfe->name, sfe->namelen);
}
if (v)
- dbprintf("dir %lld entry %*.*s %lld\n", id->ino,
+ dbprintf(_("dir %lld entry %*.*s %lld\n"), id->ino,
sfe->namelen, sfe->namelen, sfe->name, lino);
sfe = xfs_dir_sf_nextentry(sfe);
}
if ((__psint_t)sfe - (__psint_t)sf != be64_to_cpu(dip->di_core.di_size))
- dbprintf("dir %llu size is %lld, should be %d\n",
+ dbprintf(_("dir %llu size is %lld, should be %d\n"),
id->ino, be64_to_cpu(dip->di_core.di_size),
(int)((char *)sfe - (char *)sf));
lino = XFS_GET_DIR_INO8(sf->hdr.parent);
addlink_inode(cid);
else {
if (!sflag)
- dbprintf("dir %lld entry .. bad inode number %lld\n",
+ dbprintf(_("dir %lld entry .. bad inode number %lld\n"),
id->ino, lino);
error++;
}
if (v)
- dbprintf("dir %lld entry .. %lld\n", id->ino, lino);
+ dbprintf(_("dir %lld entry .. %lld\n"), id->ino, lino);
(*dotdot)++;
return cid ? lino : NULLFSINO;
}
qp->count.ic != qp->dq.ic ||
qp->count.rc != qp->dq.rc) {
if (!sflag) {
- dbprintf("%s quota id %u, have/exp",
+ dbprintf(_("%s quota id %u, have/exp"),
s, qp->id);
if (qp->count.bc != qp->dq.bc)
- dbprintf(" bc %lld/%lld",
+ dbprintf(_(" bc %lld/%lld"),
qp->dq.bc,
qp->count.bc);
if (qp->count.ic != qp->dq.ic)
- dbprintf(" ic %lld/%lld",
+ dbprintf(_(" ic %lld/%lld"),
qp->dq.ic,
qp->count.ic);
if (qp->count.rc != qp->dq.rc)
- dbprintf(" rc %lld/%lld",
+ dbprintf(_(" rc %lld/%lld"),
qp->dq.rc,
qp->count.rc);
dbprintf("\n");
XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
if (!iocur_top->data) {
- dbprintf("can't read superblock for ag %u\n", agno);
+ dbprintf(_("can't read superblock for ag %u\n"), agno);
serious_error++;
goto pop1_out;
}
if (sb->sb_magicnum != XFS_SB_MAGIC) {
if (!sflag)
- dbprintf("bad sb magic # %#x in ag %u\n",
+ dbprintf(_("bad sb magic # %#x in ag %u\n"),
sb->sb_magicnum, agno);
error++;
}
if (!xfs_sb_good_version(sb)) {
if (!sflag)
- dbprintf("bad sb version # %#x in ag %u\n",
+ dbprintf(_("bad sb version # %#x in ag %u\n"),
sb->sb_versionnum, agno);
error++;
sbver_err++;
}
if (agno == 0 && sb->sb_inprogress != 0) {
if (!sflag)
- dbprintf("mkfs not completed successfully\n");
+ dbprintf(_("mkfs not completed successfully\n"));
error++;
}
set_dbmap(agno, XFS_SB_BLOCK(mp), 1, DBM_SB, agno, XFS_SB_BLOCK(mp));
XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
if ((agf = iocur_top->data) == NULL) {
- dbprintf("can't read agf block for ag %u\n", agno);
+ dbprintf(_("can't read agf block for ag %u\n"), agno);
serious_error++;
goto pop2_out;
}
if (be32_to_cpu(agf->agf_magicnum) != XFS_AGF_MAGIC) {
if (!sflag)
- dbprintf("bad agf magic # %#x in ag %u\n",
+ dbprintf(_("bad agf magic # %#x in ag %u\n"),
be32_to_cpu(agf->agf_magicnum), agno);
error++;
}
if (!XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum))) {
if (!sflag)
- dbprintf("bad agf version # %#x in ag %u\n",
+ dbprintf(_("bad agf version # %#x in ag %u\n"),
be32_to_cpu(agf->agf_versionnum), agno);
error++;
}
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
if ((agi = iocur_top->data) == NULL) {
- dbprintf("can't read agi block for ag %u\n", agno);
+ dbprintf(_("can't read agi block for ag %u\n"), agno);
serious_error++;
goto pop3_out;
}
if (be32_to_cpu(agi->agi_magicnum) != XFS_AGI_MAGIC) {
if (!sflag)
- dbprintf("bad agi magic # %#x in ag %u\n",
+ dbprintf(_("bad agi magic # %#x in ag %u\n"),
be32_to_cpu(agi->agi_magicnum), agno);
error++;
}
if (!XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum))) {
if (!sflag)
- dbprintf("bad agi version # %#x in ag %u\n",
+ dbprintf(_("bad agi version # %#x in ag %u\n"),
be32_to_cpu(agi->agi_versionnum), agno);
error++;
}
1, scanfunc_ino, TYP_INOBT);
if (be32_to_cpu(agf->agf_freeblks) != agffreeblks) {
if (!sflag)
- dbprintf("agf_freeblks %u, counted %u in ag %u\n",
+ dbprintf(_("agf_freeblks %u, counted %u in ag %u\n"),
be32_to_cpu(agf->agf_freeblks),
agffreeblks, agno);
error++;
}
if (be32_to_cpu(agf->agf_longest) != agflongest) {
if (!sflag)
- dbprintf("agf_longest %u, counted %u in ag %u\n",
+ dbprintf(_("agf_longest %u, counted %u in ag %u\n"),
be32_to_cpu(agf->agf_longest),
agflongest, agno);
error++;
if (lazycount &&
be32_to_cpu(agf->agf_btreeblks) != agfbtreeblks) {
if (!sflag)
- dbprintf("agf_btreeblks %u, counted %u in ag %u\n",
+ dbprintf(_("agf_btreeblks %u, counted %u in ag %u\n"),
be32_to_cpu(agf->agf_btreeblks),
agfbtreeblks, agno);
error++;
agf_aggr_freeblks += agffreeblks + agfbtreeblks;
if (be32_to_cpu(agi->agi_count) != agicount) {
if (!sflag)
- dbprintf("agi_count %u, counted %u in ag %u\n",
+ dbprintf(_("agi_count %u, counted %u in ag %u\n"),
be32_to_cpu(agi->agi_count),
agicount, agno);
error++;
}
if (be32_to_cpu(agi->agi_freecount) != agifreecount) {
if (!sflag)
- dbprintf("agi_freecount %u, counted %u in ag %u\n",
+ dbprintf(_("agi_freecount %u, counted %u in ag %u\n"),
be32_to_cpu(agi->agi_freecount),
agifreecount, agno);
error++;
if (be32_to_cpu(agi->agi_unlinked[i]) != NULLAGINO) {
if (!sflag) {
xfs_agino_t agino=be32_to_cpu(agi->agi_unlinked[i]);
- dbprintf("agi unlinked bucket %d is %u in ag "
- "%u (inode=%lld)\n", i, agino, agno,
+ dbprintf(_("agi unlinked bucket %d is %u in ag "
+ "%u (inode=%lld)\n"), i, agino, agno,
XFS_AGINO_TO_INO(mp, agno, agino));
}
error++;
XFS_AG_DADDR(mp, seqno, XFS_AGFL_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
if ((agfl = iocur_top->data) == NULL) {
- dbprintf("can't read agfl block for ag %u\n", seqno);
+ dbprintf(_("can't read agfl block for ag %u\n"), seqno);
serious_error++;
pop_cur();
return;
}
if (count != be32_to_cpu(agf->agf_flcount)) {
if (!sflag)
- dbprintf("freeblk count %u != flcount %u in ag %u\n",
+ dbprintf(_("freeblk count %u != flcount %u in ag %u\n"),
count, be32_to_cpu(agf->agf_flcount),
seqno);
error++;
NULL);
if (iocur_top->data == NULL) {
if (!sflag)
- dbprintf("can't read btree block %u/%u\n",
+ dbprintf(_("can't read btree block %u/%u\n"),
XFS_FSB_TO_AGNO(mp, root),
XFS_FSB_TO_AGBNO(mp, root));
error++;
XFS_AGB_TO_DADDR(mp, seqno, root), blkbb, DB_RING_IGN, NULL);
if (iocur_top->data == NULL) {
if (!sflag)
- dbprintf("can't read btree block %u/%u\n", seqno, root);
+ dbprintf(_("can't read btree block %u/%u\n"), seqno, root);
error++;
pop_cur();
return;
agbno = XFS_FSB_TO_AGBNO(mp, bno);
if (be32_to_cpu(block->bb_magic) != XFS_BMAP_MAGIC) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad magic # %#x in inode %lld bmbt block "
- "%u/%u\n",
+ dbprintf(_("bad magic # %#x in inode %lld bmbt block "
+ "%u/%u\n"),
be32_to_cpu(block->bb_magic), id->ino, agno, agbno);
error++;
}
if (be16_to_cpu(block->bb_level) != level) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("expected level %d got %d in inode %lld bmbt "
- "block %u/%u\n",
+ dbprintf(_("expected level %d got %d in inode %lld bmbt "
+ "block %u/%u\n"),
level, be16_to_cpu(block->bb_level), id->ino, agno, agbno);
error++;
}
if (be16_to_cpu(block->bb_numrecs) > mp->m_bmap_dmxr[0] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_bmap_dmnr[0])) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) "
- "in inode %lld bmap block %lld\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) "
+ "in inode %lld bmap block %lld\n"),
be16_to_cpu(block->bb_numrecs), mp->m_bmap_dmnr[0],
mp->m_bmap_dmxr[0], id->ino,
(xfs_dfsbno_t)bno);
if (be16_to_cpu(block->bb_numrecs) > mp->m_bmap_dmxr[1] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_bmap_dmnr[1])) {
if (!sflag || id->ilist || CHECK_BLIST(bno))
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) in "
- "inode %lld bmap block %lld\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) in "
+ "inode %lld bmap block %lld\n"),
be16_to_cpu(block->bb_numrecs), mp->m_bmap_dmnr[1],
mp->m_bmap_dmxr[1], id->ino, (xfs_dfsbno_t)bno);
error++;
xfs_agblock_t lastblock;
if (be32_to_cpu(block->bb_magic) != XFS_ABTB_MAGIC) {
- dbprintf("bad magic # %#x in btbno block %u/%u\n",
+ dbprintf(_("bad magic # %#x in btbno block %u/%u\n"),
be32_to_cpu(block->bb_magic), seqno, bno);
serious_error++;
return;
agfbtreeblks++;
if (be16_to_cpu(block->bb_level) != level) {
if (!sflag)
- dbprintf("expected level %d got %d in btbno block "
- "%u/%u\n",
+ dbprintf(_("expected level %d got %d in btbno block "
+ "%u/%u\n"),
level, be16_to_cpu(block->bb_level), seqno, bno);
error++;
}
if (level == 0) {
if (be16_to_cpu(block->bb_numrecs) > mp->m_alloc_mxr[0] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_alloc_mnr[0])) {
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) in "
- "btbno block %u/%u\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) in "
+ "btbno block %u/%u\n"),
be16_to_cpu(block->bb_numrecs), mp->m_alloc_mnr[0],
mp->m_alloc_mxr[0], seqno, bno);
serious_error++;
be32_to_cpu(rp[i].ar_blockcount), DBM_FREE1,
seqno, bno);
if (be32_to_cpu(rp[i].ar_startblock) <= lastblock) {
- dbprintf(
- "out-of-order bno btree record %d (%u %u) block %u/%u\n",
+ dbprintf(_(
+ "out-of-order bno btree record %d (%u %u) block %u/%u\n"),
i, be32_to_cpu(rp[i].ar_startblock),
be32_to_cpu(rp[i].ar_blockcount),
be32_to_cpu(agf->agf_seqno), bno);
}
if (be16_to_cpu(block->bb_numrecs) > mp->m_alloc_mxr[1] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_alloc_mnr[1])) {
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) in btbno block "
- "%u/%u\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) in btbno block "
+ "%u/%u\n"),
be16_to_cpu(block->bb_numrecs), mp->m_alloc_mnr[1],
mp->m_alloc_mxr[1], seqno, bno);
serious_error++;
xfs_extlen_t lastcount;
if (be32_to_cpu(block->bb_magic) != XFS_ABTC_MAGIC) {
- dbprintf("bad magic # %#x in btcnt block %u/%u\n",
+ dbprintf(_("bad magic # %#x in btcnt block %u/%u\n"),
be32_to_cpu(block->bb_magic), seqno, bno);
serious_error++;
return;
agfbtreeblks++;
if (be16_to_cpu(block->bb_level) != level) {
if (!sflag)
- dbprintf("expected level %d got %d in btcnt block "
- "%u/%u\n",
+ dbprintf(_("expected level %d got %d in btcnt block "
+ "%u/%u\n"),
level, be16_to_cpu(block->bb_level), seqno, bno);
error++;
}
if (level == 0) {
if (be16_to_cpu(block->bb_numrecs) > mp->m_alloc_mxr[0] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_alloc_mnr[0])) {
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) in "
- "btbno block %u/%u\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) in "
+ "btbno block %u/%u\n"),
be16_to_cpu(block->bb_numrecs), mp->m_alloc_mnr[0],
mp->m_alloc_mxr[0], seqno, bno);
serious_error++;
if (be32_to_cpu(rp[i].ar_blockcount) > agflongest)
agflongest = be32_to_cpu(rp[i].ar_blockcount);
if (be32_to_cpu(rp[i].ar_blockcount) < lastcount) {
- dbprintf(
- "out-of-order cnt btree record %d (%u %u) block %u/%u\n",
+ dbprintf(_(
+ "out-of-order cnt btree record %d (%u %u) block %u/%u\n"),
i, be32_to_cpu(rp[i].ar_startblock),
be32_to_cpu(rp[i].ar_blockcount),
be32_to_cpu(agf->agf_seqno), bno);
}
if (be16_to_cpu(block->bb_numrecs) > mp->m_alloc_mxr[1] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_alloc_mnr[1])) {
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) in btbno block "
- "%u/%u\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) in btbno block "
+ "%u/%u\n"),
be16_to_cpu(block->bb_numrecs), mp->m_alloc_mnr[1],
mp->m_alloc_mxr[1], seqno, bno);
serious_error++;
xfs_inobt_rec_t *rp;
if (be32_to_cpu(block->bb_magic) != XFS_IBT_MAGIC) {
- dbprintf("bad magic # %#x in inobt block %u/%u\n",
+ dbprintf(_("bad magic # %#x in inobt block %u/%u\n"),
be32_to_cpu(block->bb_magic), seqno, bno);
serious_error++;
return;
}
if (be16_to_cpu(block->bb_level) != level) {
if (!sflag)
- dbprintf("expected level %d got %d in inobt block "
- "%u/%u\n",
+ dbprintf(_("expected level %d got %d in inobt block "
+ "%u/%u\n"),
level, be16_to_cpu(block->bb_level), seqno, bno);
error++;
}
if (level == 0) {
if (be16_to_cpu(block->bb_numrecs) > mp->m_inobt_mxr[0] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_inobt_mnr[0])) {
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) in "
- "inobt block %u/%u\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) in "
+ "inobt block %u/%u\n"),
be16_to_cpu(block->bb_numrecs), mp->m_inobt_mnr[0],
mp->m_inobt_mxr[0], seqno, bno);
serious_error++;
DB_RING_IGN, NULL);
if (iocur_top->data == NULL) {
if (!sflag)
- dbprintf("can't read inode block "
- "%u/%u\n",
+ dbprintf(_("can't read inode block "
+ "%u/%u\n"),
seqno,
XFS_AGINO_TO_AGBNO(mp, agino));
error++;
}
if (nfree != be32_to_cpu(rp[i].ir_freecount)) {
if (!sflag)
- dbprintf("ir_freecount/free mismatch, "
+ dbprintf(_("ir_freecount/free mismatch, "
"inode chunk %u/%u, freecount "
- "%d nfree %d\n",
+ "%d nfree %d\n"),
seqno, agino,
be32_to_cpu(rp[i].ir_freecount), nfree);
error++;
}
if (be16_to_cpu(block->bb_numrecs) > mp->m_inobt_mxr[1] ||
(isroot == 0 && be16_to_cpu(block->bb_numrecs) < mp->m_inobt_mnr[1])) {
- dbprintf("bad btree nrecs (%u, min=%u, max=%u) in inobt block "
- "%u/%u\n",
+ dbprintf(_("bad btree nrecs (%u, min=%u, max=%u) in inobt block "
+ "%u/%u\n"),
be16_to_cpu(block->bb_numrecs), mp->m_inobt_mnr[1],
mp->m_inobt_mxr[1], seqno, bno);
serious_error++;
*idp = id;
if (mayprint &&
(verbose || id->ilist || CHECK_BLISTA(agno, agbno + i)))
- dbprintf("setting inode to %lld for block %u/%u\n",
+ dbprintf(_("setting inode to %lld for block %u/%u\n"),
id->ino, agno, agbno + i);
}
}
i++, idp++) {
*idp = id;
if (mayprint && (verbose || id->ilist || CHECK_BLIST(bno + i)))
- dbprintf("setting inode to %lld for rtblock %llu\n",
+ dbprintf(_("setting inode to %lld for rtblock %llu\n"),
id->ino, bno + i);
}
}
id->isdir = isdir;
id->security = security;
if (verbose || id->ilist)
- dbprintf("inode %lld nlink %u %s dir\n", id->ino, nlink,
+ dbprintf(_("inode %lld nlink %u %s dir\n"), id->ino, nlink,
isdir ? "is" : "not");
}
cmd = argv[0];
ct = find_command(cmd);
if (ct == NULL) {
- dbprintf("command %s not found\n", cmd);
+ dbprintf(_("command %s not found\n"), cmd);
return 0;
}
if (argc-1 < ct->argmin || (ct->argmax != -1 && argc-1 > ct->argmax)) {
- dbprintf("bad argument count %d to %s, expected ", argc-1, cmd);
+ dbprintf(_("bad argument count %d to %s, expected "), argc-1, cmd);
if (ct->argmax == -1)
- dbprintf("at least %d", ct->argmin);
+ dbprintf(_("at least %d"), ct->argmin);
else if (ct->argmin == ct->argmax)
dbprintf("%d", ct->argmin);
else
- dbprintf("between %d and %d", ct->argmin, ct->argmax);
- dbprintf(" arguments\n");
+ dbprintf(_("between %d and %d"), ct->argmin, ct->argmax);
+ dbprintf(_(" arguments\n"));
return 0;
}
platform_getoptreset();
argv++;
if ((argc % 2) != 1) {
- dbprintf("bad argument count %d to convert, expected 3,5,7,9 "
- "arguments\n", argc);
+ dbprintf(_("bad argument count %d to convert, expected 3,5,7,9 "
+ "arguments\n"), argc);
return 0;
}
if ((wtype = lookupcty(argv[argc - 1])) == CT_NONE) {
- dbprintf("unknown conversion type %s\n", argv[argc - 1]);
+ dbprintf(_("unknown conversion type %s\n"), argv[argc - 1]);
return 0;
}
for (i = mask = conmask = 0; i < (argc - 1) / 2; i++) {
c = lookupcty(argv[i * 2]);
if (c == CT_NONE) {
- dbprintf("unknown conversion type %s\n", argv[i * 2]);
+ dbprintf(_("unknown conversion type %s\n"), argv[i * 2]);
return 0;
}
if (c == wtype) {
- dbprintf("result type same as argument\n");
+ dbprintf(_("result type same as argument\n"));
return 0;
}
if (conmask & (1 << c)) {
- dbprintf("conflicting conversion type %s\n",
+ dbprintf(_("conflicting conversion type %s\n"),
argv[i * 2]);
return 0;
}
v = strtoull(s, &p, 0);
if (*p != '\0') {
- dbprintf("%s is not a number\n", s);
+ dbprintf(_("%s is not a number\n"), s);
return 0;
}
switch (ctype) {
static int debug_f(int argc, char **argv);
static const cmdinfo_t debug_cmd =
- { "debug", NULL, debug_f, 0, 1, 0, "[flagbits]",
- "set debug option bits", NULL };
+ { "debug", NULL, debug_f, 0, 1, 0, N_("[flagbits]"),
+ N_("set debug option bits"), NULL };
long debug_state;
if (argc > 1) {
debug_state = strtol(argv[1], &p, 0);
if (*p != '\0') {
- dbprintf("bad value for debug %s\n", argv[1]);
+ dbprintf(_("bad value for debug %s\n"), argv[1]);
return 0;
}
}
static void dquot_help(void);
static const cmdinfo_t dquot_cmd =
- { "dquot", NULL, dquot_f, 1, 2, 1, "[projid|gid|uid]",
- "set current address to project, group or user quota block", dquot_help };
+ { "dquot", NULL, dquot_f, 1, 2, 1, N_("[projid|gid|uid]"),
+ N_("set current address to project, group or user quota block"), dquot_help };
const field_t dqblk_hfld[] = {
{ "", FLDT_DQBLK, OI(0), C1, 0, TYP_NONE },
dogrp = doprj = 0;
break;
default:
- dbprintf("bad option for dquot command\n");
+ dbprintf(_("bad option for dquot command\n"));
return 0;
}
}
- s = doprj ? "project" : dogrp ? "group" : "user";
+ s = doprj ? _("project") : dogrp ? _("group") : _("user");
if (optind != argc - 1) {
- dbprintf("dquot command requires one %s id argument\n", s);
+ dbprintf(_("dquot command requires one %s id argument\n"), s);
return 0;
}
ino = (dogrp || doprj) ? mp->m_sb.sb_gquotino : mp->m_sb.sb_uquotino;
if (ino == 0 || ino == NULLFSINO ||
(dogrp && (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT)) ||
(doprj && (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT))) {
- dbprintf("no %s quota inode present\n", s);
+ dbprintf(_("no %s quota inode present\n"), s);
return 0;
}
id = (xfs_dqid_t)strtol(argv[optind], &p, 0);
if (*p != '\0') {
- dbprintf("bad %s id for dquot %s\n", s, argv[optind]);
+ dbprintf(_("bad %s id for dquot %s\n"), s, argv[optind]);
return 0;
}
perblock = (int)(mp->m_sb.sb_blocksize / sizeof(xfs_dqblk_t));
bmap(qbno, 1, XFS_DATA_FORK, &nex, &bm);
pop_cur();
if (nex == 0) {
- dbprintf("no %s quota data for id %d\n", s, id);
+ dbprintf(_("no %s quota data for id %d\n"), s, id);
return 0;
}
set_cur(&typtab[TYP_DQBLK], XFS_FSB_TO_DADDR(mp, bm.startblock), blkbb,
static int echo_f(int argc, char **argv);
static const cmdinfo_t echo_cmd =
- { "echo", NULL, echo_f, 0, -1, 0, "[args]...",
- "echo arguments", NULL };
+ { "echo", NULL, echo_f, 0, -1, 0, N_("[args]..."),
+ N_("echo arguments"), NULL };
/*ARGSUSED*/
static int
xfs_agblock_t bno;
if (cur_agno == NULLAGNUMBER) {
- dbprintf("no current allocation group, cannot set new addr\n");
+ dbprintf(_("no current allocation group, cannot set new addr\n"));
return;
}
bno = (xfs_agblock_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == NULLAGBLOCK) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
ASSERT(typtab[next].typnm == next);
xfs_agino_t agino;
if (cur_agno == NULLAGNUMBER) {
- dbprintf("no current allocation group, cannot set new addr\n");
+ dbprintf(_("no current allocation group, cannot set new addr\n"));
return;
}
agino = (xfs_agino_t)getbitval(obj, bit, bitsz(agino), BVUNSIGNED);
if (agino == NULLAGINO) {
- dbprintf("null inode number, cannot set new addr\n");
+ dbprintf(_("null inode number, cannot set new addr\n"));
return;
}
set_cur_inode(XFS_AGINO_TO_INO(mp, cur_agno, agino));
bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == 0) {
- dbprintf("null attribute block number, cannot set new addr\n");
+ dbprintf(_("null attribute block number, cannot set new addr\n"));
return;
}
nex = 1;
bmap(bno, 1, XFS_ATTR_FORK, &nex, &bm);
if (nex == 0) {
- dbprintf("attribute block is unmapped\n");
+ dbprintf(_("attribute block is unmapped\n"));
return;
}
dfsbno = bm.startblock + (bno - bm.startoff);
bno = (xfs_dfiloff_t)getbitval(obj, bit, BMBT_STARTOFF_BITLEN,
BVUNSIGNED);
if (bno == NULLDFILOFF) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
nex = 1;
bmap(bno, 1, XFS_ATTR_FORK, &nex, &bm);
if (nex == 0) {
- dbprintf("file block is unmapped\n");
+ dbprintf(_("file block is unmapped\n"));
return;
}
dfsbno = bm.startblock + (bno - bm.startoff);
bno = (xfs_dfiloff_t)getbitval(obj, bit, BMBT_STARTOFF_BITLEN,
BVUNSIGNED);
if (bno == NULLDFILOFF) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
nex = nb = next == TYP_DIR2 ? mp->m_dirblkfsbs : 1;
bmp = malloc(nb * sizeof(*bmp));
bmap(bno, nb, XFS_DATA_FORK, &nex, bmp);
if (nex == 0) {
- dbprintf("file block is unmapped\n");
+ dbprintf(_("file block is unmapped\n"));
free(bmp);
return;
}
bno = (xfs_dfsbno_t)getbitval(obj, bit, BMBT_STARTBLOCK_BITLEN,
BVUNSIGNED);
if (bno == NULLDFSBNO) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
nb = next == TYP_DIR2 ? mp->m_dirblkfsbs : 1;
bno = (xfs_dfiloff_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == NULLDFILOFF) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
nex = 1;
bmap(bno, 1, XFS_ATTR_FORK, &nex, &bm);
if (nex == 0) {
- dbprintf("file block is unmapped\n");
+ dbprintf(_("file block is unmapped\n"));
return;
}
dfsbno = bm.startblock + (bno - bm.startoff);
bno = (xfs_dfiloff_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == NULLDFILOFF) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
nex = nb = next == TYP_DIR2 ? mp->m_dirblkfsbs : 1;
bmp = malloc(nb * sizeof(*bmp));
bmap(bno, nb, XFS_DATA_FORK, &nex, bmp);
if (nex == 0) {
- dbprintf("file block is unmapped\n");
+ dbprintf(_("file block is unmapped\n"));
free(bmp);
return;
}
bno = (xfs_dfsbno_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == NULLDFSBNO) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
ASSERT(typtab[next].typnm == next);
bno = (__uint32_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == 0) {
- dbprintf("null directory block number, cannot set new addr\n");
+ dbprintf(_("null directory block number, cannot set new addr\n"));
return;
}
nex = mp->m_dirblkfsbs;
bmp = malloc(nex * sizeof(*bmp));
bmap(bno, mp->m_dirblkfsbs, XFS_DATA_FORK, &nex, bmp);
if (nex == 0) {
- dbprintf("directory block is unmapped\n");
+ dbprintf(_("directory block is unmapped\n"));
free(bmp);
return;
}
bno = (xfs_drfsbno_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == NULLDRFSBNO) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
ASSERT(typtab[next].typnm == next);
bno = (xfs_drtbno_t)getbitval(obj, bit, bitsz(bno), BVUNSIGNED);
if (bno == NULLDRTBNO) {
- dbprintf("null block number, cannot set new addr\n");
+ dbprintf(_("null block number, cannot set new addr\n"));
return;
}
/* need set_cur to understand rt subvolume */
ASSERT(next == TYP_INODE);
ino = (xfs_ino_t)getbitval(obj, bit, bitsz(ino), BVUNSIGNED);
if (ino == NULLFSINO) {
- dbprintf("null inode number, cannot set new addr\n");
+ dbprintf(_("null inode number, cannot set new addr\n"));
return;
}
set_cur_inode(ino);
ASSERT(next == TYP_INODE);
ino = (xfs_ino_t)getbitval(obj, bit, bitsz(ino4), BVUNSIGNED);
if (ino == NULLFSINO) {
- dbprintf("null inode number, cannot set new addr\n");
+ dbprintf(_("null inode number, cannot set new addr\n"));
return;
}
set_cur_inode(ino);
ASSERT(next == TYP_INODE);
ino = (xfs_ino_t)getbitval(obj, bit, bitsz(ino8), BVUNSIGNED);
if (ino == NULLFSINO) {
- dbprintf("null inode number, cannot set new addr\n");
+ dbprintf(_("null inode number, cannot set new addr\n"));
return;
}
set_cur_inode(ino);
while (fl) {
f = findfield(fl->name, fields, obj, startoff);
if (f == NULL) {
- dbprintf("field %s not found\n", fl->name);
+ dbprintf(_("field %s not found\n"), fl->name);
return 0;
}
fl->fld = f;
low = (f->flags & FLD_ABASE1) != 0;
high = fcount(f, obj, startoff) + low - 1;
if (low > high) {
- dbprintf("no elements in %s\n", fl->name);
+ dbprintf(_("no elements in %s\n"), fl->name);
return 0;
}
if (fl->flags & FL_OKHIGH) {
if (fl->low < low || fl->low > high ||
fl->high < low || fl->high > high) {
- dbprintf("indices %d-%d for field %s "
- "out of range %d-%d\n",
+ dbprintf(_("indices %d-%d for field %s "
+ "out of range %d-%d\n"),
fl->low, fl->high, fl->name,
low, high);
return 0;
}
} else if (fl->flags & FL_OKLOW) {
if (fl->low < low || fl->low > high) {
- dbprintf("index %d for field %s out of "
- "range %d-%d\n",
+ dbprintf(_("index %d for field %s out of "
+ "range %d-%d\n"),
fl->low, fl->name, low, high);
return 0;
}
}
} else {
if (fl->flags & FL_OKLOW) {
- dbprintf("field %s is not an array\n",
+ dbprintf(_("field %s is not an array\n"),
fl->name);
return 0;
}
flist_expand_structs(fl, obj);
if (fl->child) {
if (fa->subfld == NULL) {
- dbprintf("field %s has no subfields\n",
+ dbprintf(_("field %s has no subfields\n"),
fl->name);
return 0;
}
if (!(debug_state & DEBUG_FLIST))
return;
while (fl) {
- dbprintf("fl@%p:\n", fl);
- dbprintf("\tname=%s, fld=%p, child=%p, sibling=%p\n",
+ dbprintf(_("fl@%p:\n"), fl);
+ dbprintf(_("\tname=%s, fld=%p, child=%p, sibling=%p\n"),
fl->name, fl->fld, fl->child, fl->sibling);
- dbprintf("\tlow=%d, high=%d, flags=%d (%s%s), offset=%d\n",
+ dbprintf(_("\tlow=%d, high=%d, flags=%d (%s%s), offset=%d\n"),
fl->low, fl->high, fl->flags,
- fl->flags & FL_OKLOW ? "oklow " : "",
- fl->flags & FL_OKHIGH ? "okhigh" : "", fl->offset);
- dbprintf("\tfld->name=%s, fld->ftyp=%d (%s)\n",
+ fl->flags & FL_OKLOW ? _("oklow ") : "",
+ fl->flags & FL_OKHIGH ? _("okhigh") : "", fl->offset);
+ dbprintf(_("\tfld->name=%s, fld->ftyp=%d (%s)\n"),
fl->fld->name, fl->fld->ftyp,
ftattrtab[fl->fld->ftyp].name);
- dbprintf("\tfld->flags=%d (%s%s%s%s%s)\n", fl->fld->flags,
+ dbprintf(_("\tfld->flags=%d (%s%s%s%s%s)\n"), fl->fld->flags,
fl->fld->flags & FLD_ABASE1 ? "abase1 " : "",
fl->fld->flags & FLD_SKIPALL ? "skipall " : "",
fl->fld->flags & FLD_ARRAY ? "array " : "",
ftok_free(v);
return fl;
bad:
- dbprintf("bad syntax in field name %s\n", name);
+ dbprintf(_("bad syntax in field name %s\n"), name);
ftok_free(v);
if (fl)
flist_free(fl);
if (*s == '\"') {
s++; /* skip first quote */
if ((a = strrchr(s, '\"')) == NULL) {
- dbprintf("missing closing quote %s\n", s);
+ dbprintf(_("missing closing quote %s\n"), s);
ftok_free(v);
return NULL;
}
l = 1;
t = puncttypes[a - punctchars];
} else {
- dbprintf("bad character in field %s\n", s);
+ dbprintf(_("bad character in field %s\n"), s);
ftok_free(v);
return NULL;
}
if (array)
dbprintf("%d:", i + base);
if ((arg & FTARG_DONULL) && isnull)
- dbprintf("null");
+ dbprintf(_("null"));
else if (size > 32)
dbprintf(fmtstr, val);
else
(double)extcount_actual;
else
answer = 0.0;
- dbprintf("actual %llu, ideal %llu, fragmentation factor %.2f%%\n",
+ dbprintf(_("actual %llu, ideal %llu, fragmentation factor %.2f%%\n"),
extcount_actual, extcount_ideal, answer);
return 0;
}
vflag = 1;
break;
default:
- dbprintf("bad option for frag command\n");
+ dbprintf(_("bad option for frag command\n"));
return 0;
}
}
if (!skipa)
process_fork(dip, XFS_ATTR_FORK);
if (vflag && (!skipd || !skipa))
- dbprintf("inode %lld actual %lld ideal %lld\n",
+ dbprintf(_("inode %lld actual %lld ideal %lld\n"),
ino, extcount_actual - actual, extcount_ideal - ideal);
}
XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
if ((agf = iocur_top->data) == NULL) {
- dbprintf("can't read agf block for ag %u\n", agno);
+ dbprintf(_("can't read agf block for ag %u\n"), agno);
pop_cur();
return;
}
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)),
XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
if ((agi = iocur_top->data) == NULL) {
- dbprintf("can't read agi block for ag %u\n", agno);
+ dbprintf(_("can't read agi block for ag %u\n"), agno);
pop_cur();
pop_cur();
return;
set_cur(&typtab[btype], XFS_FSB_TO_DADDR(mp, root), blkbb, DB_RING_IGN,
NULL);
if (iocur_top->data == NULL) {
- dbprintf("can't read btree block %u/%u\n",
+ dbprintf(_("can't read btree block %u/%u\n"),
XFS_FSB_TO_AGNO(mp, root),
XFS_FSB_TO_AGBNO(mp, root));
return;
set_cur(&typtab[btype], XFS_AGB_TO_DADDR(mp, seqno, root),
blkbb, DB_RING_IGN, NULL);
if (iocur_top->data == NULL) {
- dbprintf("can't read btree block %u/%u\n", seqno, root);
+ dbprintf(_("can't read btree block %u/%u\n"), seqno, root);
return;
}
(*func)(iocur_top->data, nlevels - 1, agf);
XFS_FSB_TO_BB(mp, XFS_IALLOC_BLOCKS(mp)),
DB_RING_IGN, NULL);
if (iocur_top->data == NULL) {
- dbprintf("can't read inode block %u/%u\n",
+ dbprintf(_("can't read inode block %u/%u\n"),
seqno, XFS_AGINO_TO_AGBNO(mp, agino));
continue;
}
if (histcount)
printhist();
if (summaryflag) {
- dbprintf("total free extents %lld\n", totexts);
- dbprintf("total free blocks %lld\n", totblocks);
- dbprintf("average free extent size %g\n",
+ dbprintf(_("total free extents %lld\n"), totexts);
+ dbprintf(_("total free blocks %lld\n"), totblocks);
+ dbprintf(_("average free extent size %g\n"),
(double)totblocks / (double)totexts);
}
if (aglist)
static int
usage(void)
{
- dbprintf("freesp arguments: [-bcdfs] [-a agno] [-e binsize] [-h h1]... "
- "[-m binmult]\n");
+ dbprintf(_("freesp arguments: [-bcdfs] [-a agno] [-e binsize] [-h h1]... "
+ "[-m binmult]\n"));
return 0;
}
set_cur(&typtab[typ], XFS_AGB_TO_DADDR(mp, seqno, root),
blkbb, DB_RING_IGN, NULL);
if (iocur_top->data == NULL) {
- dbprintf("can't read btree block %u/%u\n", seqno, root);
+ dbprintf(_("can't read btree block %u/%u\n"), seqno, root);
return;
}
(*func)(iocur_top->data, typ, nlevels - 1, agf);
int i;
dbprintf("%7s %7s %7s %7s %6s\n",
- "from", "to", "extents", "blocks", "pct");
+ _("from"), _("to"), _("extents"), _("blocks"), _("pct"));
for (i = 0; i < histcount; i++) {
if (hist[i].count)
dbprintf("%7d %7d %7lld %7lld %6.2f\n", hist[i].low,
static void hash_help(void);
static const cmdinfo_t hash_cmd =
- { "hash", NULL, hash_f, 1, 1, 0, "string",
- "calculate hash value", hash_help };
+ { "hash", NULL, hash_f, 1, 1, 0, N_("string"),
+ N_("calculate hash value"), hash_help };
static void
hash_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" 'hash' prints out the calculated hash value for a string using the\n"
"directory/attribute code hash function.\n"
"\n"
" Usage: \"hash <string>\"\n"
"\n"
-);
+));
}
static void help_oneline(const char *cmd, const cmdinfo_t *ct);
static const cmdinfo_t help_cmd =
- { "help", "?", help_f, 0, 1, 0, "[command]",
- "help for one or all commands", NULL };
+ { "help", "?", help_f, 0, 1, 0, N_("[command]"),
+ N_("help for one or all commands"), NULL };
static void
help_all(void)
for (ct = cmdtab; ct < &cmdtab[ncmds]; ct++)
help_oneline(ct->name, ct);
- dbprintf("\nUse 'help commandname' for extended help.\n");
+ dbprintf(_("\nUse 'help commandname' for extended help.\n"));
}
static int
}
ct = find_command(argv[1]);
if (ct == NULL) {
- dbprintf("command %s not found\n", argv[1]);
+ dbprintf(_("command %s not found\n"), argv[1]);
return 0;
}
help_onecmd(argv[1], ct);
else {
dbprintf("%s ", ct->name);
if (ct->altname)
- dbprintf("(or %s) ", ct->altname);
+ dbprintf(_("(or %s) "), ct->altname);
}
if (ct->args)
dbprintf("%s ", ct->args);
void *bufp = NULL;
int c;
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
progname = basename(argv[0]);
while ((c = getopt(argc, argv, "c:fFip:rxVl:")) != EOF) {
switch (c) {
expert_mode = 1;
break;
case 'V':
- printf("%s version %s\n", progname, VERSION);
+ printf(_("%s version %s\n"), progname, VERSION);
exit(0);
case '?':
usage();
if (argc > 1) {
ino = strtoull(argv[1], &p, 0);
if (*p != '\0') {
- dbprintf("bad value for inode number %s\n", argv[1]);
+ dbprintf(_("bad value for inode number %s\n"), argv[1]);
return 0;
}
set_cur_inode(ino);
} else if (iocur_top->ino == NULLFSINO)
- dbprintf("no current inode\n");
+ dbprintf(_("no current inode\n"));
else
- dbprintf("current inode number is %lld\n", iocur_top->ino);
+ dbprintf(_("current inode number is %lld\n"), iocur_top->ino);
return 0;
}
if (agno >= mp->m_sb.sb_agcount || agbno >= mp->m_sb.sb_agblocks ||
offset >= mp->m_sb.sb_inopblock ||
XFS_AGINO_TO_INO(mp, agno, agino) != ino) {
- dbprintf("bad inode number %lld\n", ino);
+ dbprintf(_("bad inode number %lld\n"), ino);
return;
}
cur_agno = agno;
static int source_f(int argc, char **argv);
static const cmdinfo_t source_cmd =
- { "source", NULL, source_f, 1, 1, 0, "source-file",
- "get commands from source-file", NULL };
+ { "source", NULL, source_f, 1, 1, 0, N_("source-file"),
+ N_("get commands from source-file"), NULL };
/* our homegrown strtok that understands strings */
f = fopen(argv[1], "r");
if (f == NULL)
- dbprintf("can't open %s\n", argv[0]);
+ dbprintf(_("can't open %s\n"), argv[0]);
else
pushfile(f);
return 0;
static const cmdinfo_t pop_cmd =
{ "pop", NULL, pop_f, 0, 0, 0, NULL,
- "pop location from the stack", pop_help };
+ N_("pop location from the stack"), pop_help };
static const cmdinfo_t push_cmd =
- { "push", NULL, push_f, 0, 2, 0, "[command]",
- "push location to the stack", push_help };
+ { "push", NULL, push_f, 0, 2, 0, N_("[command]"),
+ N_("push location to the stack"), push_help };
static const cmdinfo_t stack_cmd =
{ "stack", NULL, stack_f, 0, 0, 0, NULL,
- "view the location stack", stack_help };
+ N_("view the location stack"), stack_help };
static const cmdinfo_t forward_cmd =
{ "forward", "f", forward_f, 0, 0, 0, NULL,
- "move forward to next entry in the position ring", forward_help };
+ N_("move forward to next entry in the position ring"), forward_help };
static const cmdinfo_t back_cmd =
{ "back", "b", back_f, 0, 0, 0, NULL,
- "move to the previous location in the position ring", back_help };
+ N_("move to the previous location in the position ring"), back_help };
static const cmdinfo_t ring_cmd =
{ "ring", NULL, ring_f, 0, 1, 0, NULL,
- "show position ring or move to a specific entry", ring_help };
+ N_("show position ring or move to a specific entry"), ring_help };
iocur_t *iocur_base;
iocur_t *iocur_top;
int len)
{
if (iocur_top == NULL || off + len > BBTOB(iocur_top->blen))
- dbprintf("can't set block offset to %d\n", off);
+ dbprintf(_("can't set block offset to %d\n"), off);
else {
iocur_top->boff = off;
iocur_top->off = ((xfs_off_t)iocur_top->bb << BBSHIFT) + off;
pop_cur(void)
{
if (iocur_sp < 0) {
- dbprintf("can't pop anything from I/O stack\n");
+ dbprintf(_("can't pop anything from I/O stack\n"));
return;
}
if (iocur_top->buf)
static void
pop_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" Changes the address and data type to the first entry on the stack.\n"
"\n"
- );
+ ));
}
void
int i;
dbprintf("%s\n", tag);
- dbprintf("\tbyte offset %lld, length %d\n", ioc->off, ioc->len);
- dbprintf("\tbuffer block %lld (fsbno %lld), %d bb%s\n", ioc->bb,
+ dbprintf(_("\tbyte offset %lld, length %d\n"), ioc->off, ioc->len);
+ dbprintf(_("\tbuffer block %lld (fsbno %lld), %d bb%s\n"), ioc->bb,
(xfs_dfsbno_t)XFS_DADDR_TO_FSB(mp, ioc->bb), ioc->blen,
ioc->blen == 1 ? "" : "s");
if (ioc->use_bbmap) {
- dbprintf("\tblock map");
+ dbprintf(_("\tblock map"));
for (i = 0; i < ioc->blen; i++)
dbprintf(" %d:%lld", i, ioc->bbmap.b[i]);
dbprintf("\n");
}
- dbprintf("\tinode %lld, dir inode %lld, type %s\n", ioc->ino,
- ioc->dirino, ioc->typ == NULL ? "none" : ioc->typ->name);
+ dbprintf(_("\tinode %lld, dir inode %lld, type %s\n"), ioc->ino,
+ ioc->dirino, ioc->typ == NULL ? _("none") : ioc->typ->name);
}
void
iocur_t *ioc;
if (ring_current == -1) {
- dbprintf("no entries in location ring.\n");
+ dbprintf(_("no entries in location ring.\n"));
return;
}
- dbprintf(" type bblock bblen fsbno inode\n");
+ dbprintf(_(" type bblock bblen fsbno inode\n"));
i = ring_head;
for (;;) {
/* check we can execute command */
ct = find_command(argv[1]);
if (ct == NULL) {
- dbprintf("no such command %s\n", argv[1]);
+ dbprintf(_("no such command %s\n"), argv[1]);
return 0;
}
if (!ct->canpush) {
- dbprintf("no push form allowed for %s\n", argv[1]);
+ dbprintf(_("no push form allowed for %s\n"), argv[1]);
return 0;
}
}
static void
push_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" Allows you to push the current address and data type on the stack for\n"
" later return. 'push' also accepts an additional command to execute after\n"
" storing the current address (ex: 'push a rootino' from the superblock).\n"
"\n"
- );
+ ));
}
/* move forward through the ring */
char **argv)
{
if (ring_current == -1) {
- dbprintf("ring is empty\n");
+ dbprintf(_("ring is empty\n"));
return 0;
}
if (ring_current == ring_head) {
- dbprintf("no further entries\n");
+ dbprintf(_("no further entries\n"));
return 0;
}
static void
forward_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" The 'forward' ('f') command moves to the next location in the position\n"
" ring, updating the current position and data type. If the current location\n"
" is the top entry in the ring, then the 'forward' command will have\n"
" no effect.\n"
"\n"
- );
+ ));
}
/* move backwards through the ring */
char **argv)
{
if (ring_current == -1) {
- dbprintf("ring is empty\n");
+ dbprintf(_("ring is empty\n"));
return 0;
}
if (ring_current == ring_tail) {
- dbprintf("no previous entries\n");
+ dbprintf(_("no previous entries\n"));
return 0;
}
static void
back_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" The 'back' ('b') command moves to the previous location in the position\n"
" ring, updating the current position and data type. If the current location\n"
" is the last entry in the ring, then the 'back' command will have no effect.\n"
"\n"
- );
+ ));
}
/* show or go to specific point in ring */
index = (int)strtoul(argv[1], NULL, 0);
if (index < 0 || index >= RING_ENTRIES)
- dbprintf("invalid entry: %d\n", index);
+ dbprintf(_("invalid entry: %d\n"), index);
ring_current = index;
static void
ring_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" The position ring automatically keeps track of each disk location and\n"
" structure type for each change of position you make during your xfs_db\n"
" Note: Unlike the 'stack', 'push' and 'pop' commands, the ring tracks your\n"
" location implicitly. Use the 'push' and 'pop' commands if you wish to\n"
" store a specific location explicitly for later return.\n"
-"\n",
+"\n"),
RING_ENTRIES);
}
bbno = bbmap->b[j];
if (lseek64(x.dfd, bbno << BBSHIFT, SEEK_SET) < 0) {
rval = errno;
- dbprintf("can't seek in filesystem at bb %lld\n", bbno);
+ dbprintf(_("can't seek in filesystem at bb %lld\n"), bbno);
return rval;
}
c = BBTOB(bbmap ? 1 : count);
bbno = bbmap->b[j];
if (lseek64(x.dfd, bbno << BBSHIFT, SEEK_SET) < 0) {
rval = errno;
- dbprintf("can't seek in filesystem at bb %lld\n", bbno);
+ dbprintf(_("can't seek in filesystem at bb %lld\n"), bbno);
if (*bufp == NULL)
xfree(buf);
buf = NULL;
int ret;
if (iocur_sp < 0) {
- dbprintf("nothing to write\n");
+ dbprintf(_("nothing to write\n"));
return;
}
ret = write_bbs(iocur_top->bb, iocur_top->blen, iocur_top->buf,
iocur_top->use_bbmap ? &iocur_top->bbmap : NULL);
if (ret == -1)
- dbprintf("incomplete write, block: %lld\n",
+ dbprintf(_("incomplete write, block: %lld\n"),
(iocur_base + iocur_sp)->bb);
else if (ret != 0)
- dbprintf("write error: %s\n", strerror(ret));
+ dbprintf(_("write error: %s\n"), strerror(ret));
/* re-read buffer from disk */
ret = read_bbs(iocur_top->bb, iocur_top->blen, &iocur_top->buf,
iocur_top->use_bbmap ? &iocur_top->bbmap : NULL);
if (ret == -1)
- dbprintf("incomplete read, block: %lld\n",
+ dbprintf(_("incomplete read, block: %lld\n"),
(iocur_base + iocur_sp)->bb);
else if (ret != 0)
- dbprintf("read error: %s\n", strerror(ret));
+ dbprintf(_("read error: %s\n"), strerror(ret));
}
void
__uint16_t mode;
if (iocur_sp < 0) {
- dbprintf("set_cur no stack element to set\n");
+ dbprintf(_("set_cur no stack element to set\n"));
return;
}
#ifdef DEBUG
if (bbmap)
- printf("xfs_db got a bbmap for %lld\n", (long long)d);
+ printf(_("xfs_db got a bbmap for %lld\n"), (long long)d);
#endif
ino = iocur_top->ino;
dirino = iocur_top->dirino;
static void
stack_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" The stack is used to explicitly store your location and data type\n"
" for later return. The 'push' operation stores the current address\n"
" The 'stack' allows explicit location saves, see 'ring' for implicit\n"
" position tracking.\n"
"\n"
- );
+ ));
}
/*ARGSUSED*/
static void
badmalloc(void)
{
- dbprintf("%s: out of memory\n", progname);
+ dbprintf(_("%s: out of memory\n"), progname);
exit(4);
}
static const cmdinfo_t metadump_cmd =
{ "metadump", NULL, metadump_f, 0, -1, 0,
- "[-e] [-g] [-m max_extent] [-w] [-o] filename",
- "dump metadata to a file", metadump_help };
+ N_("[-e] [-g] [-m max_extent] [-w] [-o] filename"),
+ N_("dump metadata to a file"), metadump_help };
static FILE *outf; /* metadump file */
static void
metadump_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" The 'metadump' command dumps the known metadata to a compact file suitable\n"
" for compressing and sending to an XFS maintainer for corruption analysis \n"
" -m -- Specify max extent size in blocks to copy (default = %d blocks)\n"
" -o -- Don't obfuscate names and extended attributes\n"
" -w -- Show warnings of bad metadata information\n"
-"\n", DEFAULT_MAX_EXT_SIZE);
+"\n"), DEFAULT_MAX_EXT_SIZE);
}
static void
static int log_f(int argc, char **argv);
static const cmdinfo_t log_cmd =
- { "log", NULL, log_f, 0, 2, 0, "[stop|start <filename>]",
- "start or stop logging to a file", NULL };
+ { "log", NULL, log_f, 0, 2, 0, N_("[stop|start <filename>]"),
+ N_("start or stop logging to a file"), NULL };
int dbprefix;
static FILE *log_file;
{
if (argc == 1) {
if (log_file)
- dbprintf("logging to %s\n", log_file_name);
+ dbprintf(_("logging to %s\n"), log_file_name);
else
- dbprintf("no log file\n");
+ dbprintf(_("no log file\n"));
} else if (argc == 2 && strcmp(argv[1], "stop") == 0) {
if (log_file) {
xfree(log_file_name);
fclose(log_file);
log_file = NULL;
} else
- dbprintf("no log file\n");
+ dbprintf(_("no log file\n"));
} else if (argc == 3 && strcmp(argv[1], "start") == 0) {
if (log_file)
- dbprintf("already logging to %s\n", log_file_name);
+ dbprintf(_("already logging to %s\n"), log_file_name);
else {
log_file = fopen(argv[2], "a");
if (log_file == NULL)
- dbprintf("can't open %s for writing\n",
+ dbprintf(_("can't open %s for writing\n"),
argv[2]);
else
log_file_name = xstrdup(argv[1]);
}
} else
- dbprintf("bad log command, ignored\n");
+ dbprintf(_("bad log command, ignored\n"));
return 0;
}
char **argv);
static const cmdinfo_t print_cmd =
- { "print", "p", print_f, 0, -1, 0, "[value]...",
- "print field values", NULL };
+ { "print", "p", print_f, 0, -1, 0, N_("[value]..."),
+ N_("print field values"), NULL };
static void
print_allfields(
pfunc_t pf;
if (cur_typ == NULL) {
- dbprintf("no current type\n");
+ dbprintf(_("no current type\n"));
return 0;
}
pf = cur_typ->pfunc;
if (pf == NULL) {
- dbprintf("no print function for type %s\n", cur_typ->name);
+ dbprintf(_("no print function for type %s\n"), cur_typ->name);
return 0;
}
argc--;
dbprintf("\n");
} else {
ASSERT(fa->arg & FTARG_OKEMPTY);
- dbprintf("(empty)\n");
+ dbprintf(_("(empty)\n"));
}
}
free_strvec(pfx);
f->flags & FLD_ARRAY);
else {
ASSERT(fa->arg & FTARG_OKEMPTY);
- dbprintf("(empty)");
+ dbprintf(_("(empty)"));
}
}
dbprintf("]");
char *cp;
if (argc != 0)
- dbprintf("no arguments allowed\n");
+ dbprintf(_("no arguments allowed\n"));
dbprintf("\"");
for (cp = iocur_top->data;
cp < (char *)iocur_top->data + iocur_top->len && *cp &&
static const cmdinfo_t quit_cmd =
{ "quit", "q", quit_f, 0, 0, 0, NULL,
- "exit xfs_db", NULL };
+ N_("exit xfs_db"), NULL };
static int
quit_f(
static void version_help(void);
static const cmdinfo_t sb_cmd =
- { "sb", NULL, sb_f, 0, 1, 1, "[agno]",
- "set current address to sb header", sb_help };
+ { "sb", NULL, sb_f, 0, 1, 1, N_("[agno]"),
+ N_("set current address to sb header"), sb_help };
static const cmdinfo_t uuid_cmd =
- { "uuid", NULL, uuid_f, 0, 1, 1, "[uuid]",
- "write/print FS uuid", uuid_help };
+ { "uuid", NULL, uuid_f, 0, 1, 1, N_("[uuid]"),
+ N_("write/print FS uuid"), uuid_help };
static const cmdinfo_t label_cmd =
- { "label", NULL, label_f, 0, 1, 1, "[label]",
- "write/print FS label", label_help };
+ { "label", NULL, label_f, 0, 1, 1, N_("[label]"),
+ N_("write/print FS label"), label_help };
static const cmdinfo_t version_cmd =
- { "version", NULL, version_f, 0, -1, 1, "[feature | [vnum fnum]]",
- "set feature bit(s) in the sb version field", version_help };
+ { "version", NULL, version_f, 0, -1, 1, N_("[feature | [vnum fnum]]"),
+ N_("set feature bit(s) in the sb version field"), version_help };
void
sb_init(void)
static void
sb_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" set allocation group superblock\n"
"\n"
" remaining allocation groups only serve as backup for filesystem recovery.\n"
" The icount/ifree/fdblocks/frextents are only updated in superblock 0.\n"
"\n"
-);
+));
}
static int
if (argc > 1) {
agno = (xfs_agnumber_t)strtoul(argv[1], &p, 0);
if (*p != '\0' || agno >= mp->m_sb.sb_agcount) {
- dbprintf("bad allocation group number %s\n", argv[1]);
+ dbprintf(_("bad allocation group number %s\n"), argv[1]);
return 0;
}
cur_agno = agno;
XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
if (!iocur_top->data) {
- dbprintf("can't read superblock for AG %u\n", agno);
+ dbprintf(_("can't read superblock for AG %u\n"), agno);
pop_cur();
return 0;
}
libxfs_sb_from_disk(sb, iocur_top->data);
if (sb->sb_magicnum != XFS_SB_MAGIC) {
- dbprintf("bad sb magic # %#x in AG %u\n",
+ dbprintf(_("bad sb magic # %#x in AG %u\n"),
sb->sb_magicnum, agno);
return 0;
}
if (!xfs_sb_good_version(sb)) {
- dbprintf("bad sb version # %#x in AG %u\n",
+ dbprintf(_("bad sb version # %#x in AG %u\n"),
sb->sb_versionnum, agno);
return 0;
}
if (agno == 0 && sb->sb_inprogress != 0) {
- dbprintf("mkfs not completed successfully\n");
+ dbprintf(_("mkfs not completed successfully\n"));
return 0;
}
return 1;
if (mp->m_sb.sb_logstart) {
if (x.logdev && x.logdev != x.ddev) {
- dbprintf("aborting - external log specified for FS "
- "with an internal log\n");
+ dbprintf(_("aborting - external log specified for FS "
+ "with an internal log\n"));
return 0;
}
} else {
if (!x.logdev || (x.logdev == x.ddev)) {
- dbprintf("aborting - no external log specified for FS "
- "with an external log\n");
+ dbprintf(_("aborting - no external log specified for FS "
+ "with an external log\n"));
return 0;
}
}
log.l_mp = mp;
if (xlog_find_tail(&log, &head_blk, &tail_blk)) {
- dbprintf("ERROR: cannot find log head/tail, run xfs_repair\n");
+ dbprintf(_("ERROR: cannot find log head/tail, run xfs_repair\n"));
return 0;
}
if (head_blk != tail_blk) {
- dbprintf(
+ dbprintf(_(
"ERROR: The filesystem has valuable metadata changes in a log which needs to\n"
"be replayed. Mount the filesystem to replay the log, and unmount it before\n"
"re-running %s. If you are unable to mount the filesystem, then use\n"
"the xfs_repair -L option to destroy the log and attempt a repair.\n"
"Note that destroying the log may cause corruption -- please attempt a mount\n"
-"of the filesystem before doing this.\n", progname);
+"of the filesystem before doing this.\n"), progname);
return 0;
}
return 1;
if (!sb_logcheck())
return 0;
- dbprintf("Clearing log and setting UUID\n");
+ dbprintf(_("Clearing log and setting UUID\n"));
if (libxfs_log_clear(
(mp->m_sb.sb_logstart == 0) ? x.logdev : x.ddev,
uuidp,
xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1,
mp->m_sb.sb_logsunit, XLOG_FMT)) {
- dbprintf("ERROR: cannot clear the log\n");
+ dbprintf(_("ERROR: cannot clear the log\n"));
return 0;
}
return 1;
static void
uuid_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" write/print FS uuid\n"
"\n"
"As a side effect of writing the UUID, the log is cleared (which is fine\n"
"on a CLEANLY unmounted FS).\n"
"\n"
-);
+));
}
static uuid_t *
uuid_t *uup = NULL;
if (argc != 1 && argc != 2) {
- dbprintf("invalid parameters\n");
+ dbprintf(_("invalid parameters\n"));
return 0;
}
if (argc == 2) { /* WRITE UUID */
if ((x.isreadonly & LIBXFS_ISREADONLY) || !expert_mode) {
- dbprintf("%s: not in expert mode, writing disabled\n",
+ dbprintf(_("%s: not in expert mode, writing disabled\n"),
progname);
return 0;
}
} else if (!strcasecmp(argv[1], "rewrite")) {
uup = do_uuid(0, NULL);
if (!uup) {
- dbprintf("failed to read UUID from AG 0\n");
+ dbprintf(_("failed to read UUID from AG 0\n"));
return 0;
}
memcpy(&uu, uup, sizeof(uuid_t));
platform_uuid_unparse(&uu, bp);
- dbprintf("old UUID = %s\n", bp);
+ dbprintf(_("old UUID = %s\n"), bp);
} else {
if (platform_uuid_parse(argv[1], &uu)) {
- dbprintf("invalid UUID\n");
+ dbprintf(_("invalid UUID\n"));
return 0;
}
}
if (!sb_logzero(&uu))
return 0;
- dbprintf("writing all SBs\n");
+ dbprintf(_("writing all SBs\n"));
for (agno = 0; agno < mp->m_sb.sb_agcount; agno++)
if (!do_uuid(agno, &uu)) {
- dbprintf("failed to set UUID in AG %d\n", agno);
+ dbprintf(_("failed to set UUID in AG %d\n"), agno);
break;
}
platform_uuid_unparse(&uu, bp);
- dbprintf("new UUID = %s\n", bp);
+ dbprintf(_("new UUID = %s\n"), bp);
return 0;
} else { /* READ+CHECK UUID */
for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) {
uup = do_uuid(agno, NULL);
if (!uup) {
- dbprintf("failed to read UUID from AG %d\n",
+ dbprintf(_("failed to read UUID from AG %d\n"),
agno);
return 0;
}
if (agno) {
if (memcmp(&uu, uup, sizeof(uuid_t))) {
- dbprintf("warning: UUID in AG %d "
- "differs to the primary SB\n",
+ dbprintf(_("warning: UUID in AG %d "
+ "differs to the primary SB\n"),
agno);
break;
}
}
if (mp->m_sb.sb_logstart) {
if (x.logdev && x.logdev != x.ddev)
- dbprintf("warning - external log specified "
- "for FS with an internal log\n");
+ dbprintf(_("warning - external log specified "
+ "for FS with an internal log\n"));
} else if (!x.logdev || (x.logdev == x.ddev)) {
- dbprintf("warning - no external log specified "
- "for FS with an external log\n");
+ dbprintf(_("warning - no external log specified "
+ "for FS with an external log\n"));
}
platform_uuid_unparse(&uu, bp);
- dbprintf("UUID = %s\n", bp);
+ dbprintf(_("UUID = %s\n"), bp);
}
return 0;
static void
label_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" write/print FS label\n"
"\n"
"specified value. The maximum length of a label is 12 characters - use of a\n"
"longer label will result in truncation and a warning will be issued.\n"
"\n"
-);
+));
}
static char *
/* set label */
if ((len = strlen(label)) > sizeof(tsb.sb_fname)) {
if (agno == 0)
- dbprintf("%s: truncating label length from %d to %d\n",
+ dbprintf(_("%s: truncating label length from %d to %d\n"),
progname, (int)len, (int)sizeof(tsb.sb_fname));
len = sizeof(tsb.sb_fname);
}
xfs_agnumber_t ag;
if (argc != 1 && argc != 2) {
- dbprintf("invalid parameters\n");
+ dbprintf(_("invalid parameters\n"));
return 0;
}
if (argc == 2) { /* WRITE LABEL */
if ((x.isreadonly & LIBXFS_ISREADONLY) || !expert_mode) {
- dbprintf("%s: not in expert mode, writing disabled\n",
+ dbprintf(_("%s: not in expert mode, writing disabled\n"),
progname);
return 0;
}
- dbprintf("writing all SBs\n");
+ dbprintf(_("writing all SBs\n"));
for (ag = 0; ag < mp->m_sb.sb_agcount; ag++)
if ((p = do_label(ag, argv[1])) == NULL) {
- dbprintf("failed to set label in AG %d\n", ag);
+ dbprintf(_("failed to set label in AG %d\n"), ag);
break;
}
- dbprintf("new label = \"%s\"\n", p);
+ dbprintf(_("new label = \"%s\"\n"), p);
} else { /* READ LABEL */
for (ag = 0; ag < mp->m_sb.sb_agcount; ag++) {
p = do_label(ag, NULL);
if (!p) {
- dbprintf("failed to read label in AG %d\n", ag);
+ dbprintf(_("failed to read label in AG %d\n"), ag);
return 0;
}
if (!ag)
memcpy(&sb.sb_fname, p, sizeof(sb.sb_fname));
else if (memcmp(&sb.sb_fname, p, sizeof(sb.sb_fname)))
- dbprintf("warning: AG %d label differs\n", ag);
+ dbprintf(_("warning: AG %d label differs\n"), ag);
}
- dbprintf("label = \"%s\"\n", p);
+ dbprintf(_("label = \"%s\"\n"), p);
}
return 0;
}
static void
version_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" set/print feature bits in sb version\n"
"\n"
"It can also be used to enable selected features, such as support for\n"
"unwritten extents. The upated version is written into all AGs.\n"
"\n"
-);
+));
}
static int
if (argc == 2) { /* WRITE VERSION */
if ((x.isreadonly & LIBXFS_ISREADONLY) || !expert_mode) {
- dbprintf("%s: not in expert mode, writing disabled\n",
+ dbprintf(_("%s: not in expert mode, writing disabled\n"),
progname);
return 0;
}
break;
case XFS_SB_VERSION_4:
if (xfs_sb_version_hasextflgbit(&mp->m_sb))
- dbprintf("unwritten extents flag"
- " is already enabled\n");
+ dbprintf(_("unwritten extents flag"
+ " is already enabled\n"));
else
version = mp->m_sb.sb_versionnum |
XFS_SB_VERSION_EXTFLGBIT;
break;
case XFS_SB_VERSION_4:
if (xfs_sb_version_haslogv2(&mp->m_sb))
- dbprintf("version 2 log format"
- " is already in use\n");
+ dbprintf(_("version 2 log format"
+ " is already in use\n"));
else
version = mp->m_sb.sb_versionnum |
XFS_SB_VERSION_LOGV2BIT;
version = mp->m_sb.sb_versionnum;
features = mp->m_sb.sb_features2;
} else {
- dbprintf("%s: invalid version change command \"%s\"\n",
+ dbprintf(_("%s: invalid version change command \"%s\"\n"),
progname, argv[1]);
return 0;
}
if (version) {
- dbprintf("writing all SBs\n");
+ dbprintf(_("writing all SBs\n"));
for (ag = 0; ag < mp->m_sb.sb_agcount; ag++)
if (!do_version(ag, version, features)) {
- dbprintf("failed to set versionnum "
- "in AG %d\n", ag);
+ dbprintf(_("failed to set versionnum "
+ "in AG %d\n"), ag);
break;
}
mp->m_sb.sb_versionnum = version;
mp->m_sb.sb_features2 = strtoul(argv[2], &sp, 0);
}
- dbprintf("versionnum [0x%x+0x%x] = %s\n", mp->m_sb.sb_versionnum,
+ dbprintf(_("versionnum [0x%x+0x%x] = %s\n"), mp->m_sb.sb_versionnum,
mp->m_sb.sb_features2, version_string(&mp->m_sb));
if (argc == 3) { /* now reset... */
const typ_t *cur_typ;
static const cmdinfo_t type_cmd =
- { "type", NULL, type_f, 0, 1, 1, "[newtype]",
- "set/show current data type", NULL };
+ { "type", NULL, type_f, 0, 1, 1, N_("[newtype]"),
+ N_("set/show current data type"), NULL };
const typ_t typtab[] = {
{ TYP_AGF, "agf", handle_struct, agf_hfld },
if (argc == 1) {
if (cur_typ == NULL)
- dbprintf("no current type\n");
+ dbprintf(_("no current type\n"));
else
- dbprintf("current type is \"%s\"\n", cur_typ->name);
+ dbprintf(_("current type is \"%s\"\n"), cur_typ->name);
- dbprintf("\n supported types are:\n ");
+ dbprintf(_("\n supported types are:\n "));
for (tt = typtab, count = 0; tt->name != NULL; tt++) {
if ((tt+1)->name != NULL) {
dbprintf("%s, ", tt->name);
} else {
tt = findtyp(argv[1]);
if (tt == NULL) {
- dbprintf("no such type %s\n", argv[1]);
+ dbprintf(_("no such type %s\n"), argv[1]);
} else {
if (iocur_top->typ == NULL) {
- dbprintf("no current object\n");
+ dbprintf(_("no current object\n"));
} else {
iocur_top->typ = cur_typ = tt;
}
static void write_help(void);
static const cmdinfo_t write_cmd =
- { "write", NULL, write_f, 0, -1, 0, "[field or value]...",
- "write value to disk", write_help };
+ { "write", NULL, write_f, 0, -1, 0, N_("[field or value]..."),
+ N_("write value to disk"), write_help };
void
write_init(void)
static void
write_help(void)
{
- dbprintf(
+ dbprintf(_(
"\n"
" The 'write' command takes on different personalities depending on the\n"
" type of object being worked with.\n\n"
" String mode: 'write \"This_is_a_filename\" - write null terminated string.\n"
"\n"
" In data mode type 'write' by itself for a list of specific commands.\n\n"
-);
+));
}
extern char *progname;
if (x.isreadonly & LIBXFS_ISREADONLY) {
- dbprintf("%s started in read only mode, writing disabled\n",
+ dbprintf(_("%s started in read only mode, writing disabled\n"),
progname);
return 0;
}
if (cur_typ == NULL) {
- dbprintf("no current type\n");
+ dbprintf(_("no current type\n"));
return 0;
}
pf = cur_typ->pfunc;
if (pf == NULL) {
- dbprintf("no handler function for type %s, write unsupported.\n",
+ dbprintf(_("no handler function for type %s, write unsupported.\n"),
cur_typ->name);
return 0;
}
len = iocur_top->len - start;
if (len+start > iocur_top->len) {
- dbprintf("length (%d) too large for data block size (%d)",
+ dbprintf(_("length (%d) too large for data block size (%d)"),
len, iocur_top->len);
}
len = iocur_top->len - start;
if (len+start > iocur_top->len) {
- dbprintf("length (%d) too large for data block size (%d)",
+ dbprintf(_("length (%d) too large for data block size (%d)"),
len, iocur_top->len);
}
len = iocur_top->len - start;
if (len+start > iocur_top->len) {
- dbprintf("length (%d) too large for data block size (%d)",
+ dbprintf(_("length (%d) too large for data block size (%d)"),
len, iocur_top->len);
}
len = iocur_top->len - start;
if (len+start > iocur_top->len) {
- dbprintf("length (%d) too large for data block size (%d)",
+ dbprintf(_("length (%d) too large for data block size (%d)"),
len, iocur_top->len);
}
len = iocur_top->len - start;
if (len+start > iocur_top->len) {
- dbprintf("length (%d) too large for data block size (%d)",
+ dbprintf(_("length (%d) too large for data block size (%d)"),
len, iocur_top->len);
}
len = iocur_top->len - start;
if (len+start > iocur_top->len) {
- dbprintf("length (%d) too large for data block size (%d)",
+ dbprintf(_("length (%d) too large for data block size (%d)"),
len, iocur_top->len);
}
len = iocur_top->len - start;
if (len+start > iocur_top->len) {
- dbprintf("length (%d) too large for data block size (%d)",
+ dbprintf(_("length (%d) too large for data block size (%d)"),
len, iocur_top->len);
}
int parentoffset;
if (argc != 2) {
- dbprintf("usage: write fieldname value\n");
+ dbprintf(_("usage: write fieldname value\n"));
return;
}
fl = flist_scan(argv[0]);
if (!fl) {
- dbprintf("unable to parse '%s'.\n", argv[0]);
+ dbprintf(_("unable to parse '%s'.\n"), argv[0]);
return;
}
/* run down the field list and set offsets into the data */
if (!flist_parse(fields, fl, iocur_top->data, 0)) {
flist_free(fl);
- dbprintf("parsing error\n");
+ dbprintf(_("parsing error\n"));
return;
}
buf = convert_arg(argv[1], bit_length);
if (!buf) {
- dbprintf("unable to convert value '%s'.\n", argv[1]);
+ dbprintf(_("unable to convert value '%s'.\n"), argv[1]);
return;
}
int i;
if (argc != 1) {
- dbprintf("usage (in string mode): write \"string...\"\n");
+ dbprintf(_("usage (in string mode): write \"string...\"\n"));
return;
}
}
if (!cmd) {
- dbprintf("write: invalid subcommand\n");
+ dbprintf(_("write: invalid subcommand\n"));
goto block_usage;
}
if ((argc < cmd->argmin + 1) || (argc > cmd->argmax + 1)) {
- dbprintf("write %s: invalid number of arguments\n",
+ dbprintf(_("write %s: invalid number of arguments\n"),
cmd->cmdstr);
goto block_usage;
}
block_usage:
- dbprintf("usage: write (in data mode)\n");
+ dbprintf(_("usage: write (in data mode)\n"));
for (i = 0; i < BWRITE_CMD_MAX; i++) {
dbprintf(" %-9.9s %s\n",
bw_cmdtab[i].cmdstr, bw_cmdtab[i].usage);
for (blkno = 0; blkno < log->l_logBBsize; blkno++) {
r = read(fd, buf, sizeof(buf));
if (r < 0) {
- fprintf(stderr, "%s: read error (%lld): %s\n",
+ fprintf(stderr, _("%s: read error (%lld): %s\n"),
__FUNCTION__, (long long)blkno,
strerror(errno));
continue;
} else if (r == 0) {
- printf("%s: physical end of log at %lld\n",
+ printf(_("%s: physical end of log at %lld\n"),
__FUNCTION__, (long long)blkno);
break;
} else if (r != sizeof(buf)) {
- fprintf(stderr, "%s: short read? (%lld)\n",
+ fprintf(stderr, _("%s: short read? (%lld)\n"),
__FUNCTION__, (long long)blkno);
continue;
}
r = write(ofd, buf, sizeof(buf));
if (r < 0) {
- fprintf(stderr, "%s: write error (%lld): %s\n",
+ fprintf(stderr, _("%s: write error (%lld): %s\n"),
__FUNCTION__, (long long)blkno,
strerror(errno));
break;
} else if (r != sizeof(buf)) {
- fprintf(stderr, "%s: short write? (%lld)\n",
+ fprintf(stderr, _("%s: short write? (%lld)\n"),
__FUNCTION__, (long long)blkno);
continue;
}
for (blkno = 0; blkno < log->l_logBBsize; blkno++) {
r = read(fd, buf, sizeof(buf));
if (r < 0) {
- fprintf(stderr, "%s: read error (%lld): %s\n",
+ fprintf(stderr, _("%s: read error (%lld): %s\n"),
__FUNCTION__, (long long)blkno,
strerror(errno));
continue;
} else if (r == 0) {
- printf("%s: physical end of log at %lld\n",
+ printf(_("%s: physical end of log at %lld\n"),
__FUNCTION__, (long long)blkno);
break;
}
if (CYCLE_LSN(be64_to_cpu(*(__be64 *)buf)) ==
XLOG_HEADER_MAGIC_NUM && !print_no_data) {
- printf(
- "%6lld HEADER Cycle %d tail %d:%06d len %6d ops %d\n",
+ printf(_(
+ "%6lld HEADER Cycle %d tail %d:%06d len %6d ops %d\n"),
(long long)blkno,
be32_to_cpu(hdr->h_cycle),
CYCLE_LSN(be64_to_cpu(hdr->h_tail_lsn)),
}
if (xlog_get_cycle(buf) != last_cycle) {
- printf(
- "[%05lld - %05lld] Cycle 0x%08x New Cycle 0x%08x\n",
+ printf(_(
+ "[%05lld - %05lld] Cycle 0x%08x New Cycle 0x%08x\n"),
(long long)dupblkno, (long long)blkno,
last_cycle, xlog_get_cycle(buf));
last_cycle = xlog_get_cycle(buf);
memmove(&hbuf, op_head, sizeof(xlog_op_header_t));
op_head = &hbuf;
*ptr += sizeof(xlog_op_header_t);
- printf("Oper (%d): tid: %x len: %d clientid: %s ", i,
+ printf(_("Oper (%d): tid: %x len: %d clientid: %s "), i,
be32_to_cpu(op_head->oh_tid),
be32_to_cpu(op_head->oh_len),
(op_head->oh_clientid == XFS_TRANSACTION ? "TRANS" :
(op_head->oh_clientid == XFS_LOG ? "LOG" : "ERROR")));
- printf("flags: ");
+ printf(_("flags: "));
if (op_head->oh_flags) {
if (op_head->oh_flags & XLOG_START_TRANS)
printf("START ");
if (op_head->oh_flags & XLOG_END_TRANS)
printf("END ");
} else {
- printf("none");
+ printf(_("none"));
}
printf("\n");
} /* xlog_print_op_header */
#endif
}
if (len != sizeof(xfs_trans_header_t)) {
- printf(" Not enough data to decode further\n");
+ printf(_(" Not enough data to decode further\n"));
return 1;
}
h = (xfs_trans_header_t *)cptr;
- printf(" type: %s tid: %x num_items: %d\n",
+ printf(_(" type: %s tid: %x num_items: %d\n"),
trans_type[h->th_type], h->th_tid, h->th_num_items);
return 0;
} /* xlog_print_trans_header */
if (len >= struct_size) {
ASSERT((len - sizeof(struct_size)) % sizeof(int) == 0);
- printf("#regs: %d start blkno: %lld (0x%llx) len: %d bmap size: %d flags: 0x%x\n",
+ printf(_("#regs: %d start blkno: %lld (0x%llx) len: %d bmap size: %d flags: 0x%x\n"),
size, (long long)blkno, (unsigned long long)blkno, blen, map_size, flags);
if (blkno == 0)
super_block = 1;
} else {
ASSERT(len >= 4); /* must have at least 4 bytes if != 0 */
- printf("#regs: %d Not printing rest of data\n", f->blf_size);
+ printf(_("#regs: %d Not printing rest of data\n"), f->blf_size);
return size;
}
num = size-1;
head = (xlog_op_header_t *)*ptr;
xlog_print_op_header(head, *i, ptr);
if (super_block) {
- printf("SUPER BLOCK Buffer: ");
+ printf(_("SUPER BLOCK Buffer: "));
if (be32_to_cpu(head->oh_len) < 4*8) {
- printf("Out of space\n");
+ printf(_("Out of space\n"));
} else {
printf("\n");
/*
*/
memmove(&x, *ptr, sizeof(__be64));
memmove(&y, *ptr+8, sizeof(__be64));
- printf("icount: %lld ifree: %lld ",
+ printf(_("icount: %lld ifree: %lld "),
be64_to_cpu(x), be64_to_cpu(y));
memmove(&x, *ptr+16, sizeof(__be64));
memmove(&y, *ptr+24, sizeof(__be64));
- printf("fdblks: %lld frext: %lld\n",
+ printf(_("fdblks: %lld frext: %lld\n"),
be64_to_cpu(x), be64_to_cpu(y));
}
super_block = 0;
} else if (be32_to_cpu(*(__be32 *)(*ptr)) == XFS_AGI_MAGIC) {
agi = (xfs_agi_t *)(*ptr);
- printf("AGI Buffer: XAGI ");
+ printf(_("AGI Buffer: XAGI "));
if (be32_to_cpu(head->oh_len) < sizeof(xfs_agi_t) -
XFS_AGI_UNLINKED_BUCKETS*sizeof(xfs_agino_t)) {
- printf("out of space\n");
+ printf(_("out of space\n"));
} else {
printf("\n");
- printf("ver: %d ",
+ printf(_("ver: %d "),
be32_to_cpu(agi->agi_versionnum));
- printf("seq#: %d len: %d cnt: %d root: %d\n",
+ printf(_("seq#: %d len: %d cnt: %d root: %d\n"),
be32_to_cpu(agi->agi_seqno),
be32_to_cpu(agi->agi_length),
be32_to_cpu(agi->agi_count),
be32_to_cpu(agi->agi_root));
- printf("level: %d free#: 0x%x newino: 0x%x\n",
+ printf(_("level: %d free#: 0x%x newino: 0x%x\n"),
be32_to_cpu(agi->agi_level),
be32_to_cpu(agi->agi_freecount),
be32_to_cpu(agi->agi_newino));
buckets = 32 + 17;
} else {
if (head->oh_flags & XLOG_CONTINUE_TRANS) {
- printf("AGI unlinked data skipped ");
- printf("(CONTINUE set, no space)\n");
+ printf(_("AGI unlinked data skipped "));
+ printf(_("(CONTINUE set, no space)\n"));
continue;
}
buckets = XFS_AGI_UNLINKED_BUCKETS;
}
for (bucket = 0; bucket < buckets;) {
- printf("bucket[%d - %d]: ", bucket, bucket+3);
+ printf(_("bucket[%d - %d]: "), bucket, bucket+3);
for (col = 0; col < 4; col++, bucket++) {
if (bucket < buckets) {
printf("0x%x ",
}
} else if (be32_to_cpu(*(__be32 *)(*ptr)) == XFS_AGF_MAGIC) {
agf = (xfs_agf_t *)(*ptr);
- printf("AGF Buffer: XAGF ");
+ printf(_("AGF Buffer: XAGF "));
if (be32_to_cpu(head->oh_len) < sizeof(xfs_agf_t)) {
- printf("Out of space\n");
+ printf(_("Out of space\n"));
} else {
printf("\n");
- printf("ver: %d seq#: %d len: %d \n",
+ printf(_("ver: %d seq#: %d len: %d \n"),
be32_to_cpu(agf->agf_versionnum),
be32_to_cpu(agf->agf_seqno),
be32_to_cpu(agf->agf_length));
- printf("root BNO: %d CNT: %d\n",
+ printf(_("root BNO: %d CNT: %d\n"),
be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNOi]),
be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNTi]));
- printf("level BNO: %d CNT: %d\n",
+ printf(_("level BNO: %d CNT: %d\n"),
be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]),
be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]));
- printf("1st: %d last: %d cnt: %d "
- "freeblks: %d longest: %d\n",
+ printf(_("1st: %d last: %d cnt: %d "
+ "freeblks: %d longest: %d\n"),
be32_to_cpu(agf->agf_flfirst),
be32_to_cpu(agf->agf_fllast),
be32_to_cpu(agf->agf_flcount),
}
} else if (be32_to_cpu(*(__be32 *)(*ptr)) == XFS_DQUOT_MAGIC) {
dq = (xfs_disk_dquot_t *)(*ptr);
- printf("DQUOT Buffer: DQ ");
+ printf(_("DQUOT Buffer: DQ "));
if (be32_to_cpu(head->oh_len) <
sizeof(xfs_disk_dquot_t)) {
- printf("Out of space\n");
+ printf(_("Out of space\n"));
}
else {
printf("\n");
- printf("ver: %d flags: 0x%x id: %d \n",
+ printf(_("ver: %d flags: 0x%x id: %d \n"),
dq->d_version, dq->d_flags,
be32_to_cpu(dq->d_id));
- printf("blk limits hard: %llu soft: %llu\n",
+ printf(_("blk limits hard: %llu soft: %llu\n"),
be64_to_cpu(dq->d_blk_hardlimit),
be64_to_cpu(dq->d_blk_softlimit));
- printf("blk count: %llu warns: %d timer: %d\n",
+ printf(_("blk count: %llu warns: %d timer: %d\n"),
be64_to_cpu(dq->d_bcount),
be16_to_cpu(dq->d_bwarns),
be32_to_cpu(dq->d_btimer));
- printf("ino limits hard: %llu soft: %llu\n",
+ printf(_("ino limits hard: %llu soft: %llu\n"),
be64_to_cpu(dq->d_ino_hardlimit),
be64_to_cpu(dq->d_ino_softlimit));
- printf("ino count: %llu warns: %d timer: %d\n",
+ printf(_("ino count: %llu warns: %d timer: %d\n"),
be64_to_cpu(dq->d_icount),
be16_to_cpu(dq->d_iwarns),
be32_to_cpu(dq->d_itimer));
}
} else {
- printf("BUF DATA\n");
+ printf(_("BUF DATA\n"));
if (print_data) {
uint *dp = (uint *)*ptr;
int nums = be32_to_cpu(head->oh_len) >> 2;
f = &lbuf;
*ptr += len;
if (len >= core_size) {
- printf("EFD: #regs: %d num_extents: %d id: 0x%llx\n",
+ printf(_("EFD: #regs: %d num_extents: %d id: 0x%llx\n"),
f->efd_size, f->efd_nextents, (unsigned long long)f->efd_efi_id);
/* don't print extents as they are not used */
return 0;
} else {
- printf("EFD: Not enough data to decode further\n");
+ printf(_("EFD: Not enough data to decode further\n"));
return 1;
}
} /* xlog_print_trans_efd */
* xfs_efi_log_format_t structure
*/
if ((src_f = (xfs_efi_log_format_t *)malloc(src_len)) == NULL) {
- fprintf(stderr, "%s: xlog_print_trans_efi: malloc failed\n", progname);
+ fprintf(stderr, _("%s: xlog_print_trans_efi: malloc failed\n"), progname);
exit(1);
}
memmove((char*)src_f, *ptr, src_len);
/* convert to native format */
dst_len = sizeof(xfs_efi_log_format_t) + (src_f->efi_nextents - 1) * sizeof(xfs_extent_t);
if ((f = (xfs_efi_log_format_t *)malloc(dst_len)) == NULL) {
- fprintf(stderr, "%s: xlog_print_trans_efi: malloc failed\n", progname);
+ fprintf(stderr, _("%s: xlog_print_trans_efi: malloc failed\n"), progname);
exit(1);
}
if (xfs_efi_copy_format((char*)src_f, src_len, f)) {
goto error;
}
- printf("EFI: #regs: %d num_extents: %d id: 0x%llx\n",
+ printf(_("EFI: #regs: %d num_extents: %d id: 0x%llx\n"),
f->efi_size, f->efi_nextents, (unsigned long long)f->efi_id);
ex = f->efi_extents;
for (i=0; i < f->efi_nextents; i++) {
f = &lbuf;
*ptr += len;
if (len >= sizeof(xfs_qoff_logformat_t)) {
- printf("QOFF: #regs: %d flags: 0x%x\n", f->qf_size, f->qf_flags);
+ printf(_("QOFF: #regs: %d flags: 0x%x\n"), f->qf_size, f->qf_flags);
return 0;
} else {
- printf("QOFF: Not enough data to decode further\n");
+ printf(_("QOFF: Not enough data to decode further\n"));
return 1;
}
} /* xlog_print_trans_qoff */
void
xlog_print_trans_inode_core(xfs_icdinode_t *ip)
{
- printf("INODE CORE\n");
- printf("magic 0x%hx mode 0%ho version %d format %d\n",
+ printf(_("INODE CORE\n"));
+ printf(_("magic 0x%hx mode 0%ho version %d format %d\n"),
ip->di_magic, ip->di_mode, (int)ip->di_version,
(int)ip->di_format);
- printf("nlink %hd uid %d gid %d\n",
+ printf(_("nlink %hd uid %d gid %d\n"),
ip->di_nlink, ip->di_uid, ip->di_gid);
- printf("atime 0x%x mtime 0x%x ctime 0x%x\n",
+ printf(_("atime 0x%x mtime 0x%x ctime 0x%x\n"),
ip->di_atime.t_sec, ip->di_mtime.t_sec, ip->di_ctime.t_sec);
- printf("size 0x%llx nblocks 0x%llx extsize 0x%x nextents 0x%x\n",
+ printf(_("size 0x%llx nblocks 0x%llx extsize 0x%x nextents 0x%x\n"),
(unsigned long long)ip->di_size, (unsigned long long)ip->di_nblocks,
ip->di_extsize, ip->di_nextents);
- printf("naextents 0x%x forkoff %d dmevmask 0x%x dmstate 0x%hx\n",
+ printf(_("naextents 0x%x forkoff %d dmevmask 0x%x dmstate 0x%hx\n"),
ip->di_anextents, (int)ip->di_forkoff, ip->di_dmevmask,
ip->di_dmstate);
- printf("flags 0x%x gen 0x%x\n",
+ printf(_("flags 0x%x gen 0x%x\n"),
ip->di_flags, ip->di_gen);
}
/* XXX need to determine whether this is v1 or v2, then
print appropriate structure */
- printf("SHORTFORM DIRECTORY size %d\n",
+ printf(_("SHORTFORM DIRECTORY size %d\n"),
size);
/* bail out for now */
return;
- printf("SHORTFORM DIRECTORY size %d count %d\n",
+ printf(_("SHORTFORM DIRECTORY size %d count %d\n"),
size, sfp->hdr.count);
memmove(&ino, &(sfp->hdr.parent), sizeof(ino));
- printf(".. ino 0x%llx\n", be64_to_cpu(*(__be64 *)&ino));
+ printf(_(".. ino 0x%llx\n"), be64_to_cpu(*(__be64 *)&ino));
count = (uint)(sfp->hdr.count);
sfep = &(sfp->list[0]);
memmove(&ino, &(sfep->inumber), sizeof(ino));
memmove(namebuf, (sfep->name), sfep->namelen);
namebuf[sfep->namelen] = '\0';
- printf("%s ino 0x%llx namelen %d\n",
+ printf(_("%s ino 0x%llx namelen %d\n"),
namebuf, (unsigned long long)ino, sfep->namelen);
sfep = xfs_dir_sf_nextentry(sfep);
}
if (len == sizeof(xfs_inode_log_format_32_t) ||
len == sizeof(xfs_inode_log_format_64_t)) {
f = xfs_inode_item_format_convert((char*)&src_lbuf, len, &dst_lbuf);
- printf("INODE: ");
- printf("#regs: %d ino: 0x%llx flags: 0x%x dsize: %d\n",
+ printf(_("INODE: "));
+ printf(_("#regs: %d ino: 0x%llx flags: 0x%x dsize: %d\n"),
f->ilf_size, (unsigned long long)f->ilf_ino,
f->ilf_fields, f->ilf_dsize);
- printf(" blkno: %lld len: %d boff: %d\n",
+ printf(_(" blkno: %lld len: %d boff: %d\n"),
(long long)f->ilf_blkno, f->ilf_len, f->ilf_boffset);
} else {
ASSERT(len >= 4); /* must have at least 4 bytes if != 0 */
f = (xfs_inode_log_format_t *)&src_lbuf;
- printf("INODE: #regs: %d Not printing rest of data\n",
+ printf(_("INODE: #regs: %d Not printing rest of data\n"),
f->ilf_size);
return f->ilf_size;
}
ASSERT(f->ilf_size == 3);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
- printf("EXTENTS inode data\n");
+ printf(_("EXTENTS inode data\n"));
*ptr += be32_to_cpu(op_head->oh_len);
if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS)) {
return 1;
ASSERT(f->ilf_size == 3);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
- printf("BTREE inode data\n");
+ printf(_("BTREE inode data\n"));
*ptr += be32_to_cpu(op_head->oh_len);
if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS)) {
return 1;
ASSERT(f->ilf_size == 3);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
- printf("LOCAL inode data\n");
+ printf(_("LOCAL inode data\n"));
if (mode == S_IFDIR) {
xlog_print_dir_sf((xfs_dir_shortform_t*)*ptr, size);
}
ASSERT(f->ilf_size == 3);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
- printf("EXTENTS inode attr\n");
+ printf(_("EXTENTS inode attr\n"));
*ptr += be32_to_cpu(op_head->oh_len);
if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS)) {
return 1;
ASSERT(f->ilf_size == 3);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
- printf("BTREE inode attr\n");
+ printf(_("BTREE inode attr\n"));
*ptr += be32_to_cpu(op_head->oh_len);
if (XLOG_SET(op_head->oh_flags, XLOG_CONTINUE_TRANS)) {
return 1;
ASSERT(f->ilf_size == 3);
(*i)++;
xlog_print_op_header(op_head, *i, ptr);
- printf("LOCAL inode attr\n");
+ printf(_("LOCAL inode attr\n"));
if (mode == S_IFDIR) {
xlog_print_dir_sf((xfs_dir_shortform_t*)*ptr, size);
}
}
case XFS_ILOG_DEV: {
ASSERT(f->ilf_size == 2);
- printf("DEV inode: no extra region\n");
+ printf(_("DEV inode: no extra region\n"));
break;
}
case XFS_ILOG_UUID: {
ASSERT(f->ilf_size == 2);
- printf("UUID inode: no extra region\n");
+ printf(_("UUID inode: no extra region\n"));
break;
}
case 0: {
break;
}
default: {
- xlog_panic("xlog_print_trans_inode: illegal inode type");
+ xlog_panic(_("xlog_print_trans_inode: illegal inode type"));
}
}
return 0;
*ptr += len;
if (len == sizeof(xfs_dq_logformat_t)) {
- printf("#regs: %d id: 0x%x", f->qlf_size, f->qlf_id);
- printf(" blkno: %lld len: %d boff: %d\n",
+ printf(_("#regs: %d id: 0x%x"), f->qlf_size, f->qlf_id);
+ printf(_(" blkno: %lld len: %d boff: %d\n"),
(long long)f->qlf_blkno, f->qlf_len, f->qlf_boffset);
} else {
ASSERT(len >= 4); /* must have at least 4 bytes if != 0 */
- printf("DQUOT: #regs: %d Not printing rest of data\n",
+ printf(_("DQUOT: #regs: %d Not printing rest of data\n"),
f->qlf_size);
return f->qlf_size;
}
xlog_print_op_header(head, *i, ptr);
ASSERT(be32_to_cpu(head->oh_len) == sizeof(xfs_disk_dquot_t));
memmove(&ddq, *ptr, sizeof(xfs_disk_dquot_t));
- printf("DQUOT: magic 0x%hx flags 0%ho\n",
+ printf(_("DQUOT: magic 0x%hx flags 0%ho\n"),
be16_to_cpu(ddq.d_magic), ddq.d_flags);
*ptr += be32_to_cpu(head->oh_len);
}
else
offset = BBTOOFF64(blkno);
if (lseek64(fd, offset, whence) < 0) {
- fprintf(stderr, "%s: lseek64 to %lld failed: %s\n",
+ fprintf(stderr, _("%s: lseek64 to %lld failed: %s\n"),
progname, (long long)offset, strerror(errno));
exit(1);
}
/* read_type => don't malloc() new buffer, use old one */
if (*read_type == FULL_READ) {
if ((ptr = buf = (xfs_caddr_t)malloc(read_len)) == NULL) {
- fprintf(stderr, "%s: xlog_print_record: malloc failed\n", progname);
+ fprintf(stderr, _("%s: xlog_print_record: malloc failed\n"), progname);
exit(1);
}
} else {
ptr = *partial_buf;
}
if ((ret = (int) read(fd, buf, read_len)) == -1) {
- fprintf(stderr, "%s: xlog_print_record: read error\n", progname);
+ fprintf(stderr, _("%s: xlog_print_record: read error\n"), progname);
exit(1);
}
/* Did we overflow the end? */
}
if (xlog_print_find_tid(be32_to_cpu(op_head->oh_tid),
op_head->oh_flags & XLOG_WAS_CONT_TRANS)) {
- printf("Left over region from split log item\n");
+ printf(_("Left over region from split log item\n"));
ptr += be32_to_cpu(op_head->oh_len);
continue;
}
break;
}
case XLOG_UNMOUNT_TYPE: {
- printf("Unmount filesystem\n");
+ printf(_("Unmount filesystem\n"));
skip = 0;
break;
}
default: {
- fprintf(stderr, "%s: unknown log operation type (%x)\n",
+ fprintf(stderr, _("%s: unknown log operation type (%x)\n"),
progname, *(unsigned short *)ptr);
if (print_exit) {
free(buf);
return ZEROED_LOG;
if (be32_to_cpu(head->h_magicno) != XLOG_HEADER_MAGIC_NUM) {
- printf("Header 0x%x wanted 0x%x\n",
+ printf(_("Header 0x%x wanted 0x%x\n"),
be32_to_cpu(head->h_magicno),
XLOG_HEADER_MAGIC_NUM);
return BAD_HEADER;
datalen=be32_to_cpu(head->h_len);
bbs=BTOBB(datalen);
- printf("cycle: %d version: %d ",
+ printf(_("cycle: %d version: %d "),
be32_to_cpu(head->h_cycle),
be32_to_cpu(head->h_version));
print_lsn(" lsn", &head->h_lsn);
print_lsn(" tail_lsn", &head->h_tail_lsn);
printf("\n");
- printf("length of Log Record: %d prev offset: %d num ops: %d\n",
+ printf(_("length of Log Record: %d prev offset: %d num ops: %d\n"),
datalen,
be32_to_cpu(head->h_prev_block),
be32_to_cpu(head->h_num_logops));
if (print_overwrite) {
- printf("cycle num overwrites: ");
+ printf(_("cycle num overwrites: "));
for (i=0; i< MIN(bbs, XLOG_HEADER_CYCLE_SIZE / BBSIZE); i++)
printf("%d - 0x%x ",
i,
}
platform_uuid_unparse(&head->h_fs_uuid, uub);
- printf("uuid: %s format: ", uub);
+ printf(_("uuid: %s format: "), uub);
switch (be32_to_cpu(head->h_fmt)) {
case XLOG_FMT_UNKNOWN:
- printf("unknown\n");
+ printf(_("unknown\n"));
break;
case XLOG_FMT_LINUX_LE:
- printf("little endian linux\n");
+ printf(_("little endian linux\n"));
break;
case XLOG_FMT_LINUX_BE:
- printf("big endian linux\n");
+ printf(_("big endian linux\n"));
break;
case XLOG_FMT_IRIX_BE:
- printf("big endian irix\n");
+ printf(_("big endian irix\n"));
break;
default:
printf("? (%d)\n", be32_to_cpu(head->h_fmt));
break;
}
- printf("h_size: %d\n", be32_to_cpu(head->h_size));
+ printf(_("h_size: %d\n"), be32_to_cpu(head->h_size));
*len = be32_to_cpu(head->h_len);
return(be32_to_cpu(head->h_num_logops));
int i;
print_xlog_xhdr_line();
- printf("extended-header: cycle: %d\n", be32_to_cpu(head->xh_cycle));
+ printf(_("extended-header: cycle: %d\n"), be32_to_cpu(head->xh_cycle));
if (print_overwrite) {
- printf("cycle num overwrites: ");
+ printf(_("cycle num overwrites: "));
for (i = 0; i < coverage; i++)
printf("%d - 0x%x ",
i,
print_xlog_bad_zeroed(xfs_daddr_t blkno)
{
print_stars();
- printf("* ERROR: found data after zeroed blocks block=%-21lld *\n",
+ printf(_("* ERROR: found data after zeroed blocks block=%-21lld *\n"),
(long long)blkno);
print_stars();
if (print_exit)
print_xlog_bad_header(xfs_daddr_t blkno, xfs_caddr_t buf)
{
print_stars();
- printf("* ERROR: header cycle=%-11d block=%-21lld *\n",
+ printf(_("* ERROR: header cycle=%-11d block=%-21lld *\n"),
xlog_get_cycle(buf), (long long)blkno);
print_stars();
if (print_exit)
print_xlog_bad_data(xfs_daddr_t blkno)
{
print_stars();
- printf("* ERROR: data block=%-21lld *\n",
+ printf(_("* ERROR: data block=%-21lld *\n"),
(long long)blkno);
print_stars();
if (print_exit)
print_xlog_bad_reqd_hdrs(xfs_daddr_t blkno, int num_reqd, int num_hdrs)
{
print_stars();
- printf("* ERROR: for header block=%lld\n"
+ printf(_("* ERROR: for header block=%lld\n"
"* not enough hdrs for data length, "
- "required num = %d, hdr num = %d\n",
+ "required num = %d, hdr num = %d\n"),
(long long)blkno, num_reqd, num_hdrs);
print_stars();
if (print_exit)
- xlog_exit("Not enough headers for data length.");
+ xlog_exit(_("Not enough headers for data length."));
} /* print_xlog_bad_reqd_hdrs */
static void
*ret_xhdrs = (xlog_rec_ext_header_t *)realloc(*ret_xhdrs, len);
if (*ret_xhdrs == NULL) {
- fprintf(stderr, "%s: xlog_print: malloc failed for ext hdrs\n", progname);
+ fprintf(stderr, _("%s: xlog_print: malloc failed for ext hdrs\n"), progname);
exit(1);
}
}
for (i = 1, x = *ret_xhdrs; i < num_hdrs; i++, (*blkno)++, x++) {
/* read one extra header blk */
if (read(fd, xhbuf, 512) == 0) {
- printf("%s: physical end of log\n", progname);
+ printf(_("%s: physical end of log\n"), progname);
print_xlog_record_line();
/* reached the end so return 1 */
return 1;
}
if (print_only_data) {
- printf("BLKNO: %lld\n", (long long)*blkno);
+ printf(_("BLKNO: %lld\n"), (long long)*blkno);
xlog_recover_print_data(xhbuf, 512);
}
else {
* we still end at the end of the logical log.
*/
if ((error = xlog_print_find_oldest(log, &block_end))) {
- fprintf(stderr, "%s: problem finding oldest LR\n", progname);
+ fprintf(stderr, _("%s: problem finding oldest LR\n"), progname);
return;
}
if (print_block_start == -1)
for (;;) {
if (read(fd, hbuf, 512) == 0) {
- printf("%s: physical end of log\n", progname);
+ printf(_("%s: physical end of log\n"), progname);
print_xlog_record_line();
break;
}
if (print_only_data) {
- printf("BLKNO: %lld\n", (long long)blkno);
+ printf(_("BLKNO: %lld\n"), (long long)blkno);
xlog_recover_print_data(hbuf, 512);
blkno++;
goto loop;
blkno++;
if (zeroed && num_ops != ZEROED_LOG) {
- printf("%s: after %d zeroed blocks\n", progname, zeroed);
+ printf(_("%s: after %d zeroed blocks\n"), progname, zeroed);
/* once we find zeroed blocks - that's all we expect */
print_xlog_bad_zeroed(blkno-1);
/* reset count since we're assuming previous zeroed blocks
}
case PARTIAL_READ: {
print_xlog_record_line();
- printf("%s: physical end of log\n", progname);
+ printf(_("%s: physical end of log\n"), progname);
print_xlog_record_line();
blkno = 0;
xlog_print_lseek(log, fd, 0, SEEK_SET);
goto end;
goto partial_log_read;
}
- default: xlog_panic("illegal value");
+ default: xlog_panic(_("illegal value"));
}
print_xlog_record_line();
loop:
if (blkno >= logBBsize) {
if (cleared) {
- printf("%s: skipped %d cleared blocks in range: %lld - %lld\n",
+ printf(_("%s: skipped %d cleared blocks in range: %lld - %lld\n"),
progname, cleared,
(long long)(cleared_blkno),
(long long)(cleared + cleared_blkno - 1));
if (cleared == logBBsize)
- printf("%s: totally cleared log\n", progname);
+ printf(_("%s: totally cleared log\n"), progname);
cleared=0;
}
if (zeroed) {
- printf("%s: skipped %d zeroed blocks in range: %lld - %lld\n",
+ printf(_("%s: skipped %d zeroed blocks in range: %lld - %lld\n"),
progname, zeroed,
(long long)(zeroed_blkno),
(long long)(zeroed + zeroed_blkno - 1));
if (zeroed == logBBsize)
- printf("%s: totally zeroed log\n", progname);
+ printf(_("%s: totally zeroed log\n"), progname);
zeroed=0;
}
- printf("%s: physical end of log\n", progname);
+ printf(_("%s: physical end of log\n"), progname);
print_xlog_record_line();
break;
}
xlog_print_lseek(log, fd, 0, SEEK_SET);
for (;;) {
if (read(fd, hbuf, 512) == 0) {
- xlog_panic("xlog_find_head: bad read");
+ xlog_panic(_("xlog_find_head: bad read"));
}
if (print_only_data) {
- printf("BLKNO: %lld\n", (long long)blkno);
+ printf(_("BLKNO: %lld\n"), (long long)blkno);
xlog_recover_print_data(hbuf, 512);
blkno++;
goto loop2;
}
end:
- printf("%s: logical end of log\n", progname);
+ printf(_("%s: logical end of log\n"), progname);
print_xlog_record_line();
}
}
return 0;
}
- fprintf(stderr, "%s: bad size of efi format: %u; expected %u or %u; nextents = %u\n",
+ fprintf(stderr, _("%s: bad size of efi format: %u; expected %u or %u; nextents = %u\n"),
progname, len, len32, len64, nextents);
return 1;
}
len = item->ri_buf[0].i_len;
printf(" ");
ASSERT(f->blf_type == XFS_LI_BUF);
- printf("BUF: #regs:%d start blkno:0x%llx len:%d bmap size:%d flags:0x%x\n",
+ printf(_("BUF: #regs:%d start blkno:0x%llx len:%d bmap size:%d flags:0x%x\n"),
f->blf_size, (long long)f->blf_blkno, f->blf_len, f->blf_map_size, f->blf_flags);
blkno = (xfs_daddr_t)f->blf_blkno;
num = f->blf_size-1;
len = item->ri_buf[i].i_len;
i++;
if (blkno == 0) { /* super block */
- printf(" SUPER Block Buffer:\n");
+ printf(_(" SUPER Block Buffer:\n"));
if (!print_buffer)
continue;
- printf(" icount:%Ld ifree:%Ld ",
+ printf(_(" icount:%Ld ifree:%Ld "),
be64_to_cpu(*(__be64 *)(p)),
be64_to_cpu(*(__be64 *)(p+8)));
- printf("fdblks:%Ld frext:%Ld\n",
+ printf(_("fdblks:%Ld frext:%Ld\n"),
be64_to_cpu(*(__be64 *)(p+16)),
be64_to_cpu(*(__be64 *)(p+24)));
- printf(" sunit:%u swidth:%u\n",
+ printf(_(" sunit:%u swidth:%u\n"),
be32_to_cpu(*(__be32 *)(p+56)),
be32_to_cpu(*(__be32 *)(p+60)));
} else if (be32_to_cpu(*(__be32 *)p) == XFS_AGI_MAGIC) {
agi = (xfs_agi_t *)p;
- printf(" AGI Buffer: (XAGI)\n");
+ printf(_(" AGI Buffer: (XAGI)\n"));
if (!print_buffer)
continue;
- printf(" ver:%d ",
+ printf(_(" ver:%d "),
be32_to_cpu(agi->agi_versionnum));
- printf("seq#:%d len:%d cnt:%d root:%d\n",
+ printf(_("seq#:%d len:%d cnt:%d root:%d\n"),
be32_to_cpu(agi->agi_seqno),
be32_to_cpu(agi->agi_length),
be32_to_cpu(agi->agi_count),
be32_to_cpu(agi->agi_root));
- printf(" level:%d free#:0x%x newino:0x%x\n",
+ printf(_(" level:%d free#:0x%x newino:0x%x\n"),
be32_to_cpu(agi->agi_level),
be32_to_cpu(agi->agi_freecount),
be32_to_cpu(agi->agi_newino));
} else if (be32_to_cpu(*(__be32 *)p) == XFS_AGF_MAGIC) {
agf = (xfs_agf_t *)p;
- printf(" AGF Buffer: (XAGF)\n");
+ printf(_(" AGF Buffer: (XAGF)\n"));
if (!print_buffer)
continue;
- printf(" ver:%d seq#:%d len:%d \n",
+ printf(_(" ver:%d seq#:%d len:%d \n"),
be32_to_cpu(agf->agf_versionnum),
be32_to_cpu(agf->agf_seqno),
be32_to_cpu(agf->agf_length));
- printf(" root BNO:%d CNT:%d\n",
+ printf(_(" root BNO:%d CNT:%d\n"),
be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNOi]),
be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNTi]));
- printf(" level BNO:%d CNT:%d\n",
+ printf(_(" level BNO:%d CNT:%d\n"),
be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNOi]),
be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi]));
- printf(" 1st:%d last:%d cnt:%d "
- "freeblks:%d longest:%d\n",
+ printf(_(" 1st:%d last:%d cnt:%d "
+ "freeblks:%d longest:%d\n"),
be32_to_cpu(agf->agf_flfirst),
be32_to_cpu(agf->agf_fllast),
be32_to_cpu(agf->agf_flcount),
be32_to_cpu(agf->agf_longest));
} else if (*(uint *)p == XFS_DQUOT_MAGIC) {
ddq = (xfs_disk_dquot_t *)p;
- printf(" DQUOT Buffer:\n");
+ printf(_(" DQUOT Buffer:\n"));
if (!print_buffer)
continue;
- printf(" UIDs 0x%lx-0x%lx\n",
+ printf(_(" UIDs 0x%lx-0x%lx\n"),
(unsigned long)be32_to_cpu(ddq->d_id),
(unsigned long)be32_to_cpu(ddq->d_id) +
(BBTOB(f->blf_len) / sizeof(xfs_dqblk_t)) - 1);
} else {
- printf(" BUF DATA\n");
+ printf(_(" BUF DATA\n"));
if (!print_buffer) continue;
xlog_recover_print_data(p, len);
}
strcat(str, "GROUP QUOTA");
if (qoff_f->qf_flags & XFS_PQUOTA_ACCT)
strcat(str, "PROJECT QUOTA");
- printf("\tQUOTAOFF: #regs:%d type:%s\n",
+ printf(_("\tQUOTAOFF: #regs:%d type:%s\n"),
qoff_f->qf_size, str);
}
ASSERT(f);
ASSERT(f->qlf_len == 1);
d = (xfs_disk_dquot_t *)item->ri_buf[1].i_addr;
- printf("\tDQUOT: #regs:%d blkno:%lld boffset:%u id: %d\n",
+ printf(_("\tDQUOT: #regs:%d blkno:%lld boffset:%u id: %d\n"),
f->qlf_size, (long long)f->qlf_blkno, f->qlf_boffset, f->qlf_id);
if (!print_quota)
return;
- printf("\t\tmagic 0x%x\tversion 0x%x\tID 0x%x (%d)\t\n",
+ printf(_("\t\tmagic 0x%x\tversion 0x%x\tID 0x%x (%d)\t\n"),
be16_to_cpu(d->d_magic),
d->d_version,
be32_to_cpu(d->d_id),
be32_to_cpu(d->d_id));
- printf("\t\tblk_hard 0x%x\tblk_soft 0x%x\tino_hard 0x%x"
- "\tino_soft 0x%x\n",
+ printf(_("\t\tblk_hard 0x%x\tblk_soft 0x%x\tino_hard 0x%x"
+ "\tino_soft 0x%x\n"),
(int)be64_to_cpu(d->d_blk_hardlimit),
(int)be64_to_cpu(d->d_blk_softlimit),
(int)be64_to_cpu(d->d_ino_hardlimit),
(int)be64_to_cpu(d->d_ino_softlimit));
- printf("\t\tbcount 0x%x (%d) icount 0x%x (%d)\n",
+ printf(_("\t\tbcount 0x%x (%d) icount 0x%x (%d)\n"),
(int)be64_to_cpu(d->d_bcount),
(int)be64_to_cpu(d->d_bcount),
(int)be64_to_cpu(d->d_icount),
(int)be64_to_cpu(d->d_icount));
- printf("\t\tbtimer 0x%x itimer 0x%x \n",
+ printf(_("\t\tbtimer 0x%x itimer 0x%x \n"),
(int)be32_to_cpu(d->d_btimer),
(int)be32_to_cpu(d->d_itimer));
}
xlog_recover_print_inode_core(
xfs_icdinode_t *di)
{
- printf(" CORE inode:\n");
+ printf(_(" CORE inode:\n"));
if (!print_inode)
return;
- printf(" magic:%c%c mode:0x%x ver:%d format:%d "
- "onlink:%d\n",
+ printf(_(" magic:%c%c mode:0x%x ver:%d format:%d "
+ "onlink:%d\n"),
(di->di_magic>>8) & 0xff, di->di_magic & 0xff,
di->di_mode, di->di_version, di->di_format, di->di_onlink);
- printf(" uid:%d gid:%d nlink:%d projid:%d\n",
+ printf(_(" uid:%d gid:%d nlink:%d projid:%d\n"),
di->di_uid, di->di_gid, di->di_nlink, (uint)di->di_projid);
- printf(" atime:%d mtime:%d ctime:%d\n",
+ printf(_(" atime:%d mtime:%d ctime:%d\n"),
di->di_atime.t_sec, di->di_mtime.t_sec, di->di_ctime.t_sec);
- printf(" flushiter:%d\n", di->di_flushiter);
- printf(" size:0x%llx nblks:0x%llx exsize:%d "
- "nextents:%d anextents:%d\n", (unsigned long long)
+ printf(_(" flushiter:%d\n"), di->di_flushiter);
+ printf(_(" size:0x%llx nblks:0x%llx exsize:%d "
+ "nextents:%d anextents:%d\n"), (unsigned long long)
di->di_size, (unsigned long long)di->di_nblocks,
di->di_extsize, di->di_nextents, (int)di->di_anextents);
- printf(" forkoff:%d dmevmask:0x%x dmstate:%d flags:0x%x "
- "gen:%d\n",
+ printf(_(" forkoff:%d dmevmask:0x%x dmstate:%d flags:0x%x "
+ "gen:%d\n"),
(int)di->di_forkoff, di->di_dmevmask, (int)di->di_dmstate,
(int)di->di_flags, di->di_gen);
}
item->ri_buf[0].i_len == sizeof(xfs_inode_log_format_64_t));
f = xfs_inode_item_format_convert(item->ri_buf[0].i_addr, item->ri_buf[0].i_len, &f_buf);
- printf(" INODE: #regs:%d ino:0x%llx flags:0x%x dsize:%d\n",
+ printf(_(" INODE: #regs:%d ino:0x%llx flags:0x%x dsize:%d\n"),
f->ilf_size, (unsigned long long)f->ilf_ino, f->ilf_fields,
f->ilf_dsize);
switch (f->ilf_fields & (XFS_ILOG_DFORK|XFS_ILOG_DEV|XFS_ILOG_UUID)) {
case XFS_ILOG_DEXT:
ASSERT(f->ilf_size == 3 + hasattr);
- printf(" DATA FORK EXTENTS inode data:\n");
+ printf(_(" DATA FORK EXTENTS inode data:\n"));
if (print_inode && print_data)
xlog_recover_print_data(item->ri_buf[2].i_addr,
item->ri_buf[2].i_len);
break;
case XFS_ILOG_DBROOT:
ASSERT(f->ilf_size == 3 + hasattr);
- printf(" DATA FORK BTREE inode data:\n");
+ printf(_(" DATA FORK BTREE inode data:\n"));
if (print_inode && print_data)
xlog_recover_print_data(item->ri_buf[2].i_addr,
item->ri_buf[2].i_len);
break;
case XFS_ILOG_DDATA:
ASSERT(f->ilf_size == 3 + hasattr);
- printf(" DATA FORK LOCAL inode data:\n");
+ printf(_(" DATA FORK LOCAL inode data:\n"));
if (print_inode && print_data)
xlog_recover_print_data(item->ri_buf[2].i_addr,
item->ri_buf[2].i_len);
break;
case XFS_ILOG_DEV:
ASSERT(f->ilf_size == 2 + hasattr);
- printf(" DEV inode: no extra region\n");
+ printf(_(" DEV inode: no extra region\n"));
break;
case XFS_ILOG_UUID:
ASSERT(f->ilf_size == 2 + hasattr);
- printf(" UUID inode: no extra region\n");
+ printf(_(" UUID inode: no extra region\n"));
break;
case 0:
switch (f->ilf_fields & XFS_ILOG_AFORK) {
case XFS_ILOG_AEXT:
ASSERT(f->ilf_size == 3 + hasdata);
- printf(" ATTR FORK EXTENTS inode data:\n");
+ printf(_(" ATTR FORK EXTENTS inode data:\n"));
if (print_inode && print_data)
xlog_recover_print_data(
item->ri_buf[attr_index].i_addr,
break;
case XFS_ILOG_ABROOT:
ASSERT(f->ilf_size == 3 + hasdata);
- printf(" ATTR FORK BTREE inode data:\n");
+ printf(_(" ATTR FORK BTREE inode data:\n"));
if (print_inode && print_data)
xlog_recover_print_data(
item->ri_buf[attr_index].i_addr,
break;
case XFS_ILOG_ADATA:
ASSERT(f->ilf_size == 3 + hasdata);
- printf(" ATTR FORK LOCAL inode data:\n");
+ printf(_(" ATTR FORK LOCAL inode data:\n"));
if (print_inode && print_data)
xlog_recover_print_data(
item->ri_buf[attr_index].i_addr,
* Each element is of size xfs_extent_32_t or xfs_extent_64_t.
* However, the extents are never used and won't be printed.
*/
- printf(" EFD: #regs: %d num_extents: %d id: 0x%llx\n",
+ printf(_(" EFD: #regs: %d num_extents: %d id: 0x%llx\n"),
f->efd_size, f->efd_nextents, (unsigned long long)f->efd_efi_id);
}
*/
dst_len = sizeof(xfs_efi_log_format_t) + (src_f->efi_nextents - 1) * sizeof(xfs_extent_t);
if ((f = (xfs_efi_log_format_t *)malloc(dst_len)) == NULL) {
- fprintf(stderr, "%s: xlog_recover_print_efi: malloc failed\n", progname);
+ fprintf(stderr, _("%s: xlog_recover_print_efi: malloc failed\n"), progname);
exit(1);
}
if (xfs_efi_copy_format((char*)src_f, src_len, f)) {
return;
}
- printf(" EFI: #regs:%d num_extents:%d id:0x%llx\n",
+ printf(_(" EFI: #regs:%d num_extents:%d id:0x%llx\n"),
f->efi_size, f->efi_nextents, (unsigned long long)f->efi_id);
ex = f->efi_extents;
printf(" ");
xlog_recover_print_quotaoff(item);
break;
default:
- printf("xlog_recover_print_logitem: illegal type\n");
+ printf(_("xlog_recover_print_logitem: illegal type\n"));
break;
}
}
printf("QOFF");
break;
default:
- cmn_err(CE_PANIC, "%s: illegal type", __FUNCTION__);
+ cmn_err(CE_PANIC, _("%s: illegal type"), __FUNCTION__);
break;
}
/* type isn't filled in yet
- printf("ITEM: type: %d cnt: %d total: %d ",
+ printf(_("ITEM: type: %d cnt: %d total: %d "),
item->ri_type, item->ri_cnt, item->ri_total);
*/
- printf(": cnt:%d total:%d ", item->ri_cnt, item->ri_total);
+ printf(_(": cnt:%d total:%d "), item->ri_cnt, item->ri_total);
for (i=0; i<item->ri_cnt; i++) {
- printf("a:0x%lx len:%d ",
+ printf(_("a:0x%lx len:%d "),
(long)item->ri_buf[i].i_addr, item->ri_buf[i].i_len);
}
printf("\n");
xlog_recover_print_trans_head(
xlog_recover_t *tr)
{
- printf("TRANS: tid:0x%x type:%s #items:%d trans:0x%x q:0x%lx\n",
+ printf(_("TRANS: tid:0x%x type:%s #items:%d trans:0x%x q:0x%lx\n"),
tr->r_log_tid, trans_type[tr->r_theader.th_type],
tr->r_theader.th_num_items,
tr->r_theader.th_tid, (long)tr->r_itemq);
error = xlog_find_tail(log, &head_blk, &tail_blk);
if (error) {
- fprintf(stderr, "%s: failed to find head and tail, error: %d\n",
+ fprintf(stderr, _("%s: failed to find head and tail, error: %d\n"),
progname, error);
exit(1);
}
- printf(" log tail: %lld head: %lld state: %s\n",
+ printf(_(" log tail: %lld head: %lld state: %s\n"),
(long long)tail_blk,
(long long)head_blk,
(tail_blk == head_blk)?"<CLEAN>":"<DIRTY>");
if (print_block_start != -1) {
- printf(" override tail: %d\n", print_block_start);
+ printf(_(" override tail: %d\n"), print_block_start);
tail_blk = print_block_start;
}
printf("\n");
if (head_blk == tail_blk)
return;
if ((error = xlog_do_recovery_pass(log, head_blk, tail_blk, XLOG_RECOVER_PASS1))) {
- fprintf(stderr, "%s: failed in xfs_do_recovery_pass, error: %d\n",
+ fprintf(stderr, _("%s: failed in xfs_do_recovery_pass, error: %d\n"),
progname, error);
exit(1);
}
void
usage(void)
{
- fprintf(stderr, "Usage: %s [options...] <device>\n\n\
+ fprintf(stderr, _("Usage: %s [options...] <device>\n\n\
Options:\n\
-c try to continue if error found in log\n\
-C <filename> copy the log from the filesystem to filename\n\
-i in transactional view, extract inode info\n\
-q in transactional view, extract quota info\n\
-D print only data; no decoding\n\
- -V print version information\n",
+ -V print version information\n"),
progname);
exit(1);
}
* log. Otherwise we end up seeking forever. -- mkp
*/
if ((fd = open(x.dname, O_RDONLY)) == -1) {
- fprintf(stderr, " Can't open device %s: %s\n",
+ fprintf(stderr, _(" Can't open device %s: %s\n"),
x.dname, strerror(errno));
exit(1);
}
lseek64(fd, 0, SEEK_SET);
if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
- fprintf(stderr, " read of XFS superblock failed\n");
+ fprintf(stderr, _(" read of XFS superblock failed\n"));
exit(1);
}
close (fd);
x.logBBsize = XFS_FSB_TO_BB(mp, sb->sb_logblocks);
x.logBBstart = XFS_FSB_TO_DADDR(mp, sb->sb_logstart);
if (!x.logname && sb->sb_logstart == 0) {
- fprintf(stderr, " external log device not specified\n\n");
+ fprintf(stderr, _(" external log device not specified\n\n"));
usage();
/*NOTREACHED*/
}
if (x.logname && *x.logname) { /* External log */
if ((fd = open(x.logname, O_RDONLY)) == -1) {
- fprintf(stderr, "Can't open file %s: %s\n",
+ fprintf(stderr, _("Can't open file %s: %s\n"),
x.logname, strerror(errno));
exit(1);
}
xlog_t log = {0};
xfs_mount_t mount;
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
progname = basename(argv[0]);
while ((c = getopt(argc, argv, "bC:cdefl:iqnors:tDVv")) != EOF) {
switch (c) {
print_overwrite++;
break;
case 'V':
- printf("%s version %s\n", progname, VERSION);
+ printf(_("%s version %s\n"), progname, VERSION);
exit(0);
case '?':
usage();
usage();
x.isreadonly = LIBXFS_ISINACTIVE;
- printf("xfs_logprint:\n");
+ printf(_("xfs_logprint:\n"));
if (!libxfs_init(&x))
exit(1);
logfd = (x.logfd < 0) ? x.dfd : x.logfd;
- printf(" data device: 0x%llx\n", (unsigned long long)x.ddev);
+ printf(_(" data device: 0x%llx\n"), (unsigned long long)x.ddev);
if (x.logname) {
- printf(" log file: \"%s\" ", x.logname);
+ printf(_(" log file: \"%s\" "), x.logname);
} else {
- printf(" log device: 0x%llx ", (unsigned long long)x.logdev);
+ printf(_(" log device: 0x%llx "), (unsigned long long)x.logdev);
}
- printf("daddr: %lld length: %lld\n\n",
+ printf(_("daddr: %lld length: %lld\n\n"),
(long long)x.logBBstart, (long long)x.logBBsize);
ASSERT(x.logBBsize <= INT_MAX);
printf("\n");
while (1) {
- printf("Command [fpdir] : ");
+ printf(_("Command [fpdir] : "));
fgets(linebuf, 256, stdin);
if (feof(stdin)) break;
cmd[0] = NULL;
switch (cmd[0]) {
case 'd':
case 'f':
- printf("end of range ? ");
+ printf(_("end of range ? "));
fgets(linebuf, 256, stdin);
j = atoi(linebuf);
if (cmd[0] == 'd')
avl_delete(&tree, np);
} else
- printf("Cannot find %d\n", i);
+ printf(_("Cannot find %d\n"), i);
break;
case 'p':
avl_print(&tree, tree.avl_root, 0);
np = alloc_avlnode();
ASSERT(np);
np->avl_start = i;
- printf("size of range ? ");
+ printf(_("size of range ? "));
fgets(linebuf, 256, stdin);
j = atoi(linebuf);
avlnode_t *b, *e, *t;
int checklen;
- printf("End of range ? ");
+ printf(_("End of range ? "));
fgets(linebuf, 256, stdin);
j = atoi(linebuf);
- printf("checklen 0/1 ? ");
+ printf(_("checklen 0/1 ? "));
fgets(linebuf, 256, stdin);
checklen = atoi(linebuf);
b = avl_findanyrange(&tree, i, j, checklen);
if (b) {
- printf("Found something\n");
+ printf(_("Found something\n"));
t = b;
while (t) {
if (t != b &&
printf("\n");
while (1) {
- printf("Command [fpdir] : ");
+ printf(_("Command [fpdir] : "));
fgets(linebuf, 256, stdin);
if (feof(stdin)) break;
cmd[0] = NULL;
switch (cmd[0]) {
case 'd':
case 'f':
- printf("end of range ? ");
+ printf(_("end of range ? "));
fgets(linebuf, 256, stdin);
j = atoi(linebuf);
if (cmd[0] == 'd')
avl64_delete(&tree, np);
} else
- printf("Cannot find %d\n", i);
+ printf(_("Cannot find %d\n"), i);
break;
case 'p':
avl64_print(&tree, tree.avl_root, 0);
np = alloc_avlnode();
ASSERT(np);
np->avl_start = i;
- printf("size of range ? ");
+ printf(_("size of range ? "));
fgets(linebuf, 256, stdin);
j = atoi(linebuf);
avl64node_t *b, *e, *t;
int checklen;
- printf("End of range ? ");
+ printf(_("End of range ? "));
fgets(linebuf, 256, stdin);
j = atoi(linebuf);
- printf("checklen 0/1 ? ");
+ printf(_("checklen 0/1 ? "));
fgets(linebuf, 256, stdin);
checklen = atoi(linebuf);
b = avl64_findanyrange(&tree, i, j, checklen);
if (b) {
- printf("Found something\n");
+ printf(_("Found something\n"));
t = b;
while (t) {
if (t != b &&
const int uncertain = 0;
#ifdef XR_INODE_TRACE
- fprintf(stderr, "processing inode %d/%d\n", agno, ino);
+ fprintf(stderr, _("processing inode %d/%d\n"), agno, ino);
#endif
return process_dinode_int(mp, dino, agno, ino, was_free, dirty, used,
verify_mode, uncertain, ino_discovery,
/* Increase limits */
if (getrlimit(RLIMIT_FSIZE, &rl) == -1) {
perror("getrlimit");
- fprintf(stderr, "getrlimit(RLIMIT_FSIZE) failed!\n");
+ fprintf(stderr, _("getrlimit(RLIMIT_FSIZE) failed!\n"));
exit(1);
}
if (rl.rlim_cur != RLIM_INFINITY) {
if (setrlimit(RLIMIT_FSIZE, &rl) == -1) {
perror("setrlimit");
fprintf(stderr,
- "setrlimit failed - current: %lld, max: %lld\n",
+ _("setrlimit failed - current: %lld, max: %lld\n"),
(unsigned long long)rl.rlim_cur,
(unsigned long long)rl.rlim_max);
exit(1);