Fix sbin/ build with a 64-bit ino_t.
Original code by: Gleb Kurtsou
This commit is contained in:
parent
623d7cb663
commit
e25a029eb2
@ -197,8 +197,8 @@ mapfiles(ino_t maxino, long *tapesize)
|
|||||||
(mode & IFMT) == 0)
|
(mode & IFMT) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (ino >= maxino) {
|
if (ino >= maxino) {
|
||||||
msg("Skipping inode %d >= maxino %d\n",
|
msg("Skipping inode %ju >= maxino %ju\n",
|
||||||
ino, maxino);
|
(uintmax_t)ino, (uintmax_t)maxino);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -400,15 +400,16 @@ searchdir(
|
|||||||
for (loc = 0; loc < size; ) {
|
for (loc = 0; loc < size; ) {
|
||||||
dp = (struct direct *)(dblk + loc);
|
dp = (struct direct *)(dblk + loc);
|
||||||
if (dp->d_reclen == 0) {
|
if (dp->d_reclen == 0) {
|
||||||
msg("corrupted directory, inumber %d\n", ino);
|
msg("corrupted directory, inumber %ju\n",
|
||||||
|
(uintmax_t)ino);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
loc += dp->d_reclen;
|
loc += dp->d_reclen;
|
||||||
if (dp->d_ino == 0)
|
if (dp->d_ino == 0)
|
||||||
continue;
|
continue;
|
||||||
if (dp->d_ino >= maxino) {
|
if (dp->d_ino >= maxino) {
|
||||||
msg("corrupted directory entry, d_ino %d >= %d\n",
|
msg("corrupted directory entry, d_ino %ju >= %ju\n",
|
||||||
dp->d_ino, maxino);
|
(uintmax_t)dp->d_ino, (uintmax_t)maxino);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (dp->d_name[0] == '.') {
|
if (dp->d_name[0] == '.') {
|
||||||
|
@ -1945,7 +1945,7 @@ ino_unlinked(void)
|
|||||||
if (DIP(ip, di_nlink) == 0) {
|
if (DIP(ip, di_nlink) == 0) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("Freeing unlinked ino %ju mode %o\n",
|
printf("Freeing unlinked ino %ju mode %o\n",
|
||||||
ino, mode);
|
(uintmax_t)ino, mode);
|
||||||
ino_reclaim(ip, ino, mode);
|
ino_reclaim(ip, ino, mode);
|
||||||
} else if (debug)
|
} else if (debug)
|
||||||
printf("Skipping ino %ju mode %o with link %d\n",
|
printf("Skipping ino %ju mode %o with link %d\n",
|
||||||
|
@ -39,6 +39,7 @@ static const char rcsid[] =
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <histedit.h>
|
#include <histedit.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <timeconv.h>
|
#include <timeconv.h>
|
||||||
@ -211,7 +212,8 @@ char *
|
|||||||
prompt(EditLine *el)
|
prompt(EditLine *el)
|
||||||
{
|
{
|
||||||
static char pstring[64];
|
static char pstring[64];
|
||||||
snprintf(pstring, sizeof(pstring), "fsdb (inum: %d)> ", curinum);
|
snprintf(pstring, sizeof(pstring), "fsdb (inum: %ju)> ",
|
||||||
|
(uintmax_t)curinum);
|
||||||
return pstring;
|
return pstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +300,8 @@ ino_t curinum, ocurrent;
|
|||||||
|
|
||||||
#define GETINUM(ac,inum) inum = strtoul(argv[ac], &cp, 0); \
|
#define GETINUM(ac,inum) inum = strtoul(argv[ac], &cp, 0); \
|
||||||
if (inum < ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \
|
if (inum < ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \
|
||||||
printf("inode %d out of range; range is [%d,%d]\n", \
|
printf("inode %ju out of range; range is [%ju,%ju]\n", \
|
||||||
inum, ROOTINO, maxino); \
|
(uintmax_t)inum, (uintmax_t)ROOTINO, (uintmax_t)maxino); \
|
||||||
return 1; \
|
return 1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +366,8 @@ CMDFUNCSTART(uplink)
|
|||||||
if (!checkactive())
|
if (!checkactive())
|
||||||
return 1;
|
return 1;
|
||||||
DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) + 1);
|
DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) + 1);
|
||||||
printf("inode %d link count now %d\n", curinum, DIP(curinode, di_nlink));
|
printf("inode %ju link count now %d\n",
|
||||||
|
(uintmax_t)curinum, DIP(curinode, di_nlink));
|
||||||
inodirty();
|
inodirty();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -374,7 +377,8 @@ CMDFUNCSTART(downlink)
|
|||||||
if (!checkactive())
|
if (!checkactive())
|
||||||
return 1;
|
return 1;
|
||||||
DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) - 1);
|
DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) - 1);
|
||||||
printf("inode %d link count now %d\n", curinum, DIP(curinode, di_nlink));
|
printf("inode %ju link count now %d\n",
|
||||||
|
(uintmax_t)curinum, DIP(curinode, di_nlink));
|
||||||
inodirty();
|
inodirty();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -493,11 +497,11 @@ CMDFUNCSTART(findblk)
|
|||||||
if (is_ufs2 ?
|
if (is_ufs2 ?
|
||||||
compare_blk64(wantedblk64, ino_to_fsba(&sblock, inum)) :
|
compare_blk64(wantedblk64, ino_to_fsba(&sblock, inum)) :
|
||||||
compare_blk32(wantedblk32, ino_to_fsba(&sblock, inum))) {
|
compare_blk32(wantedblk32, ino_to_fsba(&sblock, inum))) {
|
||||||
printf("block %llu: inode block (%d-%d)\n",
|
printf("block %llu: inode block (%ju-%ju)\n",
|
||||||
(unsigned long long)fsbtodb(&sblock,
|
(unsigned long long)fsbtodb(&sblock,
|
||||||
ino_to_fsba(&sblock, inum)),
|
ino_to_fsba(&sblock, inum)),
|
||||||
(inum / INOPB(&sblock)) * INOPB(&sblock),
|
(uintmax_t)(inum / INOPB(&sblock)) * INOPB(&sblock),
|
||||||
(inum / INOPB(&sblock) + 1) * INOPB(&sblock));
|
(uintmax_t)(inum / INOPB(&sblock) + 1) * INOPB(&sblock));
|
||||||
findblk_numtofind--;
|
findblk_numtofind--;
|
||||||
if (findblk_numtofind == 0)
|
if (findblk_numtofind == 0)
|
||||||
goto end;
|
goto end;
|
||||||
@ -593,8 +597,8 @@ static int
|
|||||||
founddatablk(uint64_t blk)
|
founddatablk(uint64_t blk)
|
||||||
{
|
{
|
||||||
|
|
||||||
printf("%llu: data block of inode %d\n",
|
printf("%llu: data block of inode %ju\n",
|
||||||
(unsigned long long)fsbtodb(&sblock, blk), curinum);
|
(unsigned long long)fsbtodb(&sblock, blk), (uintmax_t)curinum);
|
||||||
findblk_numtofind--;
|
findblk_numtofind--;
|
||||||
if (findblk_numtofind == 0)
|
if (findblk_numtofind == 0)
|
||||||
return 1;
|
return 1;
|
||||||
@ -753,7 +757,7 @@ CMDFUNCSTART(ln)
|
|||||||
return 1;
|
return 1;
|
||||||
rval = makeentry(curinum, inum, argv[2]);
|
rval = makeentry(curinum, inum, argv[2]);
|
||||||
if (rval)
|
if (rval)
|
||||||
printf("Ino %d entered as `%s'\n", inum, argv[2]);
|
printf("Ino %ju entered as `%s'\n", (uintmax_t)inum, argv[2]);
|
||||||
else
|
else
|
||||||
printf("could not enter name? weird.\n");
|
printf("could not enter name? weird.\n");
|
||||||
curinode = ginode(curinum);
|
curinode = ginode(curinum);
|
||||||
|
@ -152,7 +152,7 @@ printstat(const char *cp, ino_t inum, union dinode *dp)
|
|||||||
puts("fifo");
|
puts("fifo");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf("I=%lu MODE=%o SIZE=%ju", (u_long)inum, DIP(dp, di_mode),
|
printf("I=%ju MODE=%o SIZE=%ju", (uintmax_t)inum, DIP(dp, di_mode),
|
||||||
(uintmax_t)DIP(dp, di_size));
|
(uintmax_t)DIP(dp, di_size));
|
||||||
if (sblock.fs_magic != FS_UFS1_MAGIC) {
|
if (sblock.fs_magic != FS_UFS1_MAGIC) {
|
||||||
t = _time64_to_time(dp->dp2.di_birthtime);
|
t = _time64_to_time(dp->dp2.di_birthtime);
|
||||||
@ -290,7 +290,7 @@ printblocks(ino_t inum, union dinode *dp)
|
|||||||
long ndb, offset;
|
long ndb, offset;
|
||||||
ufs2_daddr_t blkno;
|
ufs2_daddr_t blkno;
|
||||||
|
|
||||||
printf("Blocks for inode %d:\n", inum);
|
printf("Blocks for inode %ju:\n", (uintmax_t)inum);
|
||||||
printf("Direct blocks:\n");
|
printf("Direct blocks:\n");
|
||||||
ndb = howmany(DIP(dp, di_size), sblock.fs_bsize);
|
ndb = howmany(DIP(dp, di_size), sblock.fs_bsize);
|
||||||
for (i = 0; i < NDADDR && i < ndb; i++) {
|
for (i = 0; i < NDADDR && i < ndb; i++) {
|
||||||
@ -338,7 +338,7 @@ checkactivedir(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((DIP(curinode, di_mode) & IFMT) != IFDIR) {
|
if ((DIP(curinode, di_mode) & IFMT) != IFDIR) {
|
||||||
warnx("inode %d not a directory", curinum);
|
warnx("inode %ju not a directory", (uintmax_t)curinum);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@ -363,11 +363,12 @@ printactive(int doblocks)
|
|||||||
printstat("current inode", curinum, curinode);
|
printstat("current inode", curinum, curinode);
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
printf("current inode %d: unallocated inode\n", curinum);
|
printf("current inode %ju: unallocated inode\n", (uintmax_t)curinum);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("current inode %d: screwy itype 0%o (mode 0%o)?\n",
|
printf("current inode %ju: screwy itype 0%o (mode 0%o)?\n",
|
||||||
curinum, DIP(curinode, di_mode) & IFMT, DIP(curinode, di_mode));
|
(uintmax_t)curinum, DIP(curinode, di_mode) & IFMT,
|
||||||
|
DIP(curinode, di_mode));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -274,8 +274,8 @@ fsirand(char *device)
|
|||||||
dp2 = &((struct ufs2_dinode *)inodebuf)[n];
|
dp2 = &((struct ufs2_dinode *)inodebuf)[n];
|
||||||
if (inumber >= ROOTINO) {
|
if (inumber >= ROOTINO) {
|
||||||
if (printonly)
|
if (printonly)
|
||||||
(void)printf("ino %d gen %08x\n",
|
(void)printf("ino %ju gen %08x\n",
|
||||||
inumber,
|
(uintmax_t)inumber,
|
||||||
sblock->fs_magic == FS_UFS1_MAGIC ?
|
sblock->fs_magic == FS_UFS1_MAGIC ?
|
||||||
dp1->di_gen : dp2->di_gen);
|
dp1->di_gen : dp2->di_gen);
|
||||||
else if (sblock->fs_magic == FS_UFS1_MAGIC)
|
else if (sblock->fs_magic == FS_UFS1_MAGIC)
|
||||||
|
@ -324,6 +324,7 @@ initcg(int cylno, time_t modtime, int fso, unsigned int Nflag)
|
|||||||
DBG_FUNC("initcg")
|
DBG_FUNC("initcg")
|
||||||
static caddr_t iobuf;
|
static caddr_t iobuf;
|
||||||
long blkno, start;
|
long blkno, start;
|
||||||
|
ino_t ino;
|
||||||
ufs2_daddr_t i, cbase, dmax;
|
ufs2_daddr_t i, cbase, dmax;
|
||||||
struct ufs1_dinode *dp1;
|
struct ufs1_dinode *dp1;
|
||||||
struct csum *cs;
|
struct csum *cs;
|
||||||
@ -392,8 +393,8 @@ initcg(int cylno, time_t modtime, int fso, unsigned int Nflag)
|
|||||||
}
|
}
|
||||||
acg.cg_cs.cs_nifree += sblock.fs_ipg;
|
acg.cg_cs.cs_nifree += sblock.fs_ipg;
|
||||||
if (cylno == 0)
|
if (cylno == 0)
|
||||||
for (i = 0; i < ROOTINO; i++) {
|
for (ino = 0; ino < ROOTINO; ino++) {
|
||||||
setbit(cg_inosused(&acg), i);
|
setbit(cg_inosused(&acg), ino);
|
||||||
acg.cg_cs.cs_nifree--;
|
acg.cg_cs.cs_nifree--;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -1003,7 +1003,8 @@ iput(union dinode *ip, ino_t ino)
|
|||||||
sblock.fs_cstotal.cs_nifree--;
|
sblock.fs_cstotal.cs_nifree--;
|
||||||
fscs[0].cs_nifree--;
|
fscs[0].cs_nifree--;
|
||||||
if (ino >= (unsigned long)sblock.fs_ipg * sblock.fs_ncg) {
|
if (ino >= (unsigned long)sblock.fs_ipg * sblock.fs_ncg) {
|
||||||
printf("fsinit: inode value out of range (%d).\n", ino);
|
printf("fsinit: inode value out of range (%ju).\n",
|
||||||
|
(uintmax_t)ino);
|
||||||
exit(32);
|
exit(32);
|
||||||
}
|
}
|
||||||
d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino));
|
d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino));
|
||||||
|
@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <libutil.h>
|
#include <libutil.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -383,9 +384,9 @@ chkquota(char *specname, struct quotafile *qfu, struct quotafile *qfg)
|
|||||||
if (vflag) {
|
if (vflag) {
|
||||||
if (aflag)
|
if (aflag)
|
||||||
(void)printf("%s: ", mntpt);
|
(void)printf("%s: ", mntpt);
|
||||||
(void)printf("out of range UID/GID (%u/%u) ino=%u\n",
|
(void)printf("out of range UID/GID (%u/%u) ino=%ju\n",
|
||||||
DIP(dp, di_uid), DIP(dp,di_gid),
|
DIP(dp, di_uid), DIP(dp,di_gid),
|
||||||
ino);
|
(uintmax_t)ino);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -601,7 +602,8 @@ getnextinode(ino_t inumber)
|
|||||||
static caddr_t nextinop;
|
static caddr_t nextinop;
|
||||||
|
|
||||||
if (inumber != nextino++ || inumber > lastvalidinum)
|
if (inumber != nextino++ || inumber > lastvalidinum)
|
||||||
errx(1, "bad inode number %d to nextinode", inumber);
|
errx(1, "bad inode number %ju to nextinode",
|
||||||
|
(uintmax_t)inumber);
|
||||||
if (inumber >= lastinum) {
|
if (inumber >= lastinum) {
|
||||||
readcnt++;
|
readcnt++;
|
||||||
dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum));
|
dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum));
|
||||||
@ -635,7 +637,7 @@ setinodebuf(ino_t inum)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (inum % sblock.fs_ipg != 0)
|
if (inum % sblock.fs_ipg != 0)
|
||||||
errx(1, "bad inode number %d to setinodebuf", inum);
|
errx(1, "bad inode number %ju to setinodebuf", (uintmax_t)inum);
|
||||||
lastvalidinum = inum + sblock.fs_ipg - 1;
|
lastvalidinum = inum + sblock.fs_ipg - 1;
|
||||||
nextino = inum;
|
nextino = inum;
|
||||||
lastinum = inum;
|
lastinum = inum;
|
||||||
|
@ -637,7 +637,8 @@ setdirmodes(int flags)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ep == NULL) {
|
if (ep == NULL) {
|
||||||
panic("cannot find directory inode %d\n", node.ino);
|
panic("cannot find directory inode %ju\n",
|
||||||
|
(uintmax_t)node.ino);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cp = myname(ep);
|
cp = myname(ep);
|
||||||
@ -678,7 +679,8 @@ genliteraldir(char *name, ino_t ino)
|
|||||||
|
|
||||||
itp = inotablookup(ino);
|
itp = inotablookup(ino);
|
||||||
if (itp == NULL)
|
if (itp == NULL)
|
||||||
panic("Cannot find directory inode %d named %s\n", ino, name);
|
panic("Cannot find directory inode %ju named %s\n",
|
||||||
|
(uintmax_t)ino, name);
|
||||||
if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
|
if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
|
||||||
fprintf(stderr, "%s: ", name);
|
fprintf(stderr, "%s: ", name);
|
||||||
(void) fflush(stderr);
|
(void) fflush(stderr);
|
||||||
@ -691,15 +693,15 @@ genliteraldir(char *name, ino_t ino)
|
|||||||
size = i < BUFSIZ ? i : BUFSIZ;
|
size = i < BUFSIZ ? i : BUFSIZ;
|
||||||
if (read(dp, buf, (int) size) == -1) {
|
if (read(dp, buf, (int) size) == -1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"write error extracting inode %d, name %s\n",
|
"write error extracting inode %ju, name %s\n",
|
||||||
curfile.ino, curfile.name);
|
(uintmax_t)curfile.ino, curfile.name);
|
||||||
fprintf(stderr, "read: %s\n", strerror(errno));
|
fprintf(stderr, "read: %s\n", strerror(errno));
|
||||||
done(1);
|
done(1);
|
||||||
}
|
}
|
||||||
if (!Nflag && write(ofile, buf, (int) size) == -1) {
|
if (!Nflag && write(ofile, buf, (int) size) == -1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"write error extracting inode %d, name %s\n",
|
"write error extracting inode %ju, name %s\n",
|
||||||
curfile.ino, curfile.name);
|
(uintmax_t)curfile.ino, curfile.name);
|
||||||
fprintf(stderr, "write: %s\n", strerror(errno));
|
fprintf(stderr, "write: %s\n", strerror(errno));
|
||||||
done(1);
|
done(1);
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -675,7 +676,8 @@ formatf(struct afile *list, int nentry)
|
|||||||
for (j = 0; j < columns; j++) {
|
for (j = 0; j < columns; j++) {
|
||||||
fp = &list[j * lines + i];
|
fp = &list[j * lines + i];
|
||||||
if (vflag) {
|
if (vflag) {
|
||||||
fprintf(stderr, "%*d ", precision, fp->fnum);
|
fprintf(stderr, "%*ju ",
|
||||||
|
precision, (uintmax_t)fp->fnum);
|
||||||
fp->len += precision + 1;
|
fp->len += precision + 1;
|
||||||
}
|
}
|
||||||
if (haveprefix) {
|
if (haveprefix) {
|
||||||
|
@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -61,7 +62,7 @@ listfile(char *name, ino_t ino, int type)
|
|||||||
if (TSTINO(ino, dumpmap) == 0)
|
if (TSTINO(ino, dumpmap) == 0)
|
||||||
return (descend);
|
return (descend);
|
||||||
vprintf(stdout, "%s", type == LEAF ? "leaf" : "dir ");
|
vprintf(stdout, "%s", type == LEAF ? "leaf" : "dir ");
|
||||||
fprintf(stdout, "%10d\t%s\n", ino, name);
|
fprintf(stdout, "%10ju\t%s\n", (uintmax_t)ino, name);
|
||||||
return (descend);
|
return (descend);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ addfile(char *name, ino_t ino, int type)
|
|||||||
if (ino == WINO && command == 'i' && !vflag)
|
if (ino == WINO && command == 'i' && !vflag)
|
||||||
return (descend);
|
return (descend);
|
||||||
if (!mflag) {
|
if (!mflag) {
|
||||||
(void) sprintf(buf, "./%u", ino);
|
(void) sprintf(buf, "./%ju", (uintmax_t)ino);
|
||||||
name = buf;
|
name = buf;
|
||||||
if (type == NODE) {
|
if (type == NODE) {
|
||||||
(void) genliteraldir(name, ino);
|
(void) genliteraldir(name, ino);
|
||||||
@ -457,8 +458,8 @@ nodeupdates(char *name, ino_t ino, int type)
|
|||||||
* next incremental tape.
|
* next incremental tape.
|
||||||
*/
|
*/
|
||||||
case 0:
|
case 0:
|
||||||
fprintf(stderr, "%s: (inode %d) not found on tape\n",
|
fprintf(stderr, "%s: (inode %ju) not found on tape\n",
|
||||||
name, ino);
|
name, (uintmax_t)ino);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -612,7 +613,7 @@ createleaves(char *symtabfile)
|
|||||||
while (first < curfile.ino) {
|
while (first < curfile.ino) {
|
||||||
ep = lookupino(first);
|
ep = lookupino(first);
|
||||||
if (ep == NULL)
|
if (ep == NULL)
|
||||||
panic("%d: bad first\n", first);
|
panic("%ju: bad first\n", (uintmax_t)first);
|
||||||
fprintf(stderr, "%s: not found on tape\n", myname(ep));
|
fprintf(stderr, "%s: not found on tape\n", myname(ep));
|
||||||
ep->e_flags &= ~(NEW|EXTRACT);
|
ep->e_flags &= ~(NEW|EXTRACT);
|
||||||
first = lowerbnd(first);
|
first = lowerbnd(first);
|
||||||
@ -625,8 +626,8 @@ createleaves(char *symtabfile)
|
|||||||
* on the next incremental tape.
|
* on the next incremental tape.
|
||||||
*/
|
*/
|
||||||
if (first != curfile.ino) {
|
if (first != curfile.ino) {
|
||||||
fprintf(stderr, "expected next file %d, got %d\n",
|
fprintf(stderr, "expected next file %ju, got %ju\n",
|
||||||
first, curfile.ino);
|
(uintmax_t)first, (uintmax_t)curfile.ino);
|
||||||
skipfile();
|
skipfile();
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
@ -852,7 +853,7 @@ verifyfile(char *name, ino_t ino, int type)
|
|||||||
if (np == ep)
|
if (np == ep)
|
||||||
break;
|
break;
|
||||||
if (np == NULL)
|
if (np == NULL)
|
||||||
panic("missing inumber %d\n", ino);
|
panic("missing inumber %ju\n", (uintmax_t)ino);
|
||||||
if (ep->e_type == LEAF && type != LEAF)
|
if (ep->e_type == LEAF && type != LEAF)
|
||||||
badentry(ep, "type should be LEAF");
|
badentry(ep, "type should be LEAF");
|
||||||
return (descend);
|
return (descend);
|
||||||
|
@ -52,6 +52,7 @@ static const char rcsid[] =
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -100,7 +101,7 @@ addino(ino_t inum, struct entry *np)
|
|||||||
struct entry **epp;
|
struct entry **epp;
|
||||||
|
|
||||||
if (inum < WINO || inum >= maxino)
|
if (inum < WINO || inum >= maxino)
|
||||||
panic("addino: out of range %d\n", inum);
|
panic("addino: out of range %ju\n", (uintmax_t)inum);
|
||||||
epp = &entry[inum % entrytblsize];
|
epp = &entry[inum % entrytblsize];
|
||||||
np->e_ino = inum;
|
np->e_ino = inum;
|
||||||
np->e_next = *epp;
|
np->e_next = *epp;
|
||||||
@ -121,7 +122,7 @@ deleteino(ino_t inum)
|
|||||||
struct entry **prev;
|
struct entry **prev;
|
||||||
|
|
||||||
if (inum < WINO || inum >= maxino)
|
if (inum < WINO || inum >= maxino)
|
||||||
panic("deleteino: out of range %d\n", inum);
|
panic("deleteino: out of range %ju\n", (uintmax_t)inum);
|
||||||
prev = &entry[inum % entrytblsize];
|
prev = &entry[inum % entrytblsize];
|
||||||
for (next = *prev; next != NULL; next = next->e_next) {
|
for (next = *prev; next != NULL; next = next->e_next) {
|
||||||
if (next->e_ino == inum) {
|
if (next->e_ino == inum) {
|
||||||
@ -131,7 +132,7 @@ deleteino(ino_t inum)
|
|||||||
}
|
}
|
||||||
prev = &next->e_next;
|
prev = &next->e_next;
|
||||||
}
|
}
|
||||||
panic("deleteino: %d not found\n", inum);
|
panic("deleteino: %ju not found\n", (uintmax_t)inum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -274,7 +274,7 @@ setup(void)
|
|||||||
done(1);
|
done(1);
|
||||||
}
|
}
|
||||||
maxino = (spcl.c_count * TP_BSIZE * NBBY) + 1;
|
maxino = (spcl.c_count * TP_BSIZE * NBBY) + 1;
|
||||||
dprintf(stdout, "maxino = %d\n", maxino);
|
dprintf(stdout, "maxino = %ju\n", (uintmax_t)maxino);
|
||||||
map = calloc((unsigned)1, (unsigned)howmany(maxino, NBBY));
|
map = calloc((unsigned)1, (unsigned)howmany(maxino, NBBY));
|
||||||
if (map == NULL)
|
if (map == NULL)
|
||||||
panic("no memory for active inode map\n");
|
panic("no memory for active inode map\n");
|
||||||
@ -1050,8 +1050,9 @@ setupextattr(int extsize)
|
|||||||
}
|
}
|
||||||
extbufsize = 0;
|
extbufsize = 0;
|
||||||
extbuf = NULL;
|
extbuf = NULL;
|
||||||
fprintf(stderr, "Cannot extract %d bytes %s for inode %d, name %s\n",
|
fprintf(stderr, "Cannot extract %d bytes %s for inode %ju, name %s\n",
|
||||||
extsize, "of extended attributes", curfile.ino, curfile.name);
|
extsize, "of extended attributes", (uintmax_t)curfile.ino,
|
||||||
|
curfile.name);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1079,8 +1080,8 @@ xtrfile(char *buf, long size)
|
|||||||
return;
|
return;
|
||||||
if (write(ofile, buf, (int) size) == -1) {
|
if (write(ofile, buf, (int) size) == -1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"write error extracting inode %d, name %s\nwrite: %s\n",
|
"write error extracting inode %ju, name %s\nwrite: %s\n",
|
||||||
curfile.ino, curfile.name, strerror(errno));
|
(uintmax_t)curfile.ino, curfile.name, strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1094,8 +1095,8 @@ xtrskip(char *buf, long size)
|
|||||||
|
|
||||||
if (lseek(ofile, size, SEEK_CUR) == -1) {
|
if (lseek(ofile, size, SEEK_CUR) == -1) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"seek error extracting inode %d, name %s\nlseek: %s\n",
|
"seek error extracting inode %ju, name %s\nlseek: %s\n",
|
||||||
curfile.ino, curfile.name, strerror(errno));
|
(uintmax_t)curfile.ino, curfile.name, strerror(errno));
|
||||||
done(1);
|
done(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1243,8 +1244,8 @@ readtape(char *buf)
|
|||||||
fprintf(stderr, "restoring %s\n", curfile.name);
|
fprintf(stderr, "restoring %s\n", curfile.name);
|
||||||
break;
|
break;
|
||||||
case SKIP:
|
case SKIP:
|
||||||
fprintf(stderr, "skipping over inode %d\n",
|
fprintf(stderr, "skipping over inode %ju\n",
|
||||||
curfile.ino);
|
(uintmax_t)curfile.ino);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!yflag && !reply("continue"))
|
if (!yflag && !reply("continue"))
|
||||||
@ -1477,10 +1478,11 @@ accthdr(struct s_spcl *header)
|
|||||||
fprintf(stderr, "Used inodes map header");
|
fprintf(stderr, "Used inodes map header");
|
||||||
break;
|
break;
|
||||||
case TS_INODE:
|
case TS_INODE:
|
||||||
fprintf(stderr, "File header, ino %d", previno);
|
fprintf(stderr, "File header, ino %ju", (uintmax_t)previno);
|
||||||
break;
|
break;
|
||||||
case TS_ADDR:
|
case TS_ADDR:
|
||||||
fprintf(stderr, "File continuation header, ino %d", previno);
|
fprintf(stderr, "File continuation header, ino %ju",
|
||||||
|
(uintmax_t)previno);
|
||||||
break;
|
break;
|
||||||
case TS_END:
|
case TS_END:
|
||||||
fprintf(stderr, "End of tape header");
|
fprintf(stderr, "End of tape header");
|
||||||
@ -1631,8 +1633,8 @@ checksum(int *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i != CHECKSUM) {
|
if (i != CHECKSUM) {
|
||||||
fprintf(stderr, "Checksum error %o, inode %d file %s\n", i,
|
fprintf(stderr, "Checksum error %o, inode %ju file %s\n", i,
|
||||||
curfile.ino, curfile.name);
|
(uintmax_t)curfile.ino, curfile.name);
|
||||||
return(FAIL);
|
return(FAIL);
|
||||||
}
|
}
|
||||||
return(GOOD);
|
return(GOOD);
|
||||||
|
@ -894,7 +894,7 @@ journal_clear(void)
|
|||||||
warnx("Journal file does not exist");
|
warnx("Journal file does not exist");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("Clearing journal flags from inode %d\n", ino);
|
printf("Clearing journal flags from inode %ju\n", (uintmax_t)ino);
|
||||||
if (getino(&disk, &ip, ino, &mode) != 0) {
|
if (getino(&disk, &ip, ino, &mode) != 0) {
|
||||||
warn("Failed to get journal inode");
|
warn("Failed to get journal inode");
|
||||||
return;
|
return;
|
||||||
@ -970,8 +970,8 @@ journal_alloc(int64_t size)
|
|||||||
ino = cgialloc(&disk);
|
ino = cgialloc(&disk);
|
||||||
if (ino <= 0)
|
if (ino <= 0)
|
||||||
break;
|
break;
|
||||||
printf("Using inode %d in cg %d for %jd byte journal\n",
|
printf("Using inode %ju in cg %d for %jd byte journal\n",
|
||||||
ino, cgp->cg_cgx, size);
|
(uintmax_t)ino, cgp->cg_cgx, size);
|
||||||
if (getino(&disk, &ip, ino, &mode) != 0) {
|
if (getino(&disk, &ip, ino, &mode) != 0) {
|
||||||
warn("Failed to get allocated inode");
|
warn("Failed to get allocated inode");
|
||||||
sbdirty();
|
sbdirty();
|
||||||
|
Loading…
Reference in New Issue
Block a user