socsvn commit: r222841 - in soc2011/gk/ino64-head: bin/ls bin/rm
sbin/dump sbin/fsck_ffs sbin/fsdb sbin/fsirand sbin/growfs
sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs
usr.bin/find usr.sbin...
gk at FreeBSD.org
gk at FreeBSD.org
Sun Jun 5 16:21:18 UTC 2011
Author: gk
Date: Sun Jun 5 16:21:16 2011
New Revision: 222841
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=222841
Log:
usr: Change ino_t printf format flag to %ju
Modified:
soc2011/gk/ino64-head/bin/ls/ls.c
soc2011/gk/ino64-head/bin/ls/print.c
soc2011/gk/ino64-head/bin/rm/rm.c
soc2011/gk/ino64-head/sbin/dump/traverse.c
soc2011/gk/ino64-head/sbin/fsck_ffs/fsutil.c
soc2011/gk/ino64-head/sbin/fsck_ffs/gjournal.c
soc2011/gk/ino64-head/sbin/fsck_ffs/inode.c
soc2011/gk/ino64-head/sbin/fsck_ffs/main.c
soc2011/gk/ino64-head/sbin/fsck_ffs/pass1.c
soc2011/gk/ino64-head/sbin/fsck_ffs/pass2.c
soc2011/gk/ino64-head/sbin/fsck_ffs/pass4.c
soc2011/gk/ino64-head/sbin/fsck_ffs/suj.c
soc2011/gk/ino64-head/sbin/fsdb/fsdb.c
soc2011/gk/ino64-head/sbin/fsdb/fsdbutil.c
soc2011/gk/ino64-head/sbin/fsirand/fsirand.c
soc2011/gk/ino64-head/sbin/growfs/growfs.c
soc2011/gk/ino64-head/sbin/newfs/mkfs.c
soc2011/gk/ino64-head/sbin/quotacheck/quotacheck.c
soc2011/gk/ino64-head/sbin/restore/dirs.c
soc2011/gk/ino64-head/sbin/restore/interactive.c
soc2011/gk/ino64-head/sbin/restore/restore.c
soc2011/gk/ino64-head/sbin/restore/symtab.c
soc2011/gk/ino64-head/sbin/restore/tape.c
soc2011/gk/ino64-head/sbin/tunefs/tunefs.c
soc2011/gk/ino64-head/usr.bin/find/ls.c
soc2011/gk/ino64-head/usr.sbin/lpr/lpr/lpr.c
soc2011/gk/ino64-head/usr.sbin/makefs/ffs/ffs_alloc.c
soc2011/gk/ino64-head/usr.sbin/quot/quot.c
soc2011/gk/ino64-head/usr.sbin/snapinfo/snapinfo.c
Modified: soc2011/gk/ino64-head/bin/ls/ls.c
==============================================================================
--- soc2011/gk/ino64-head/bin/ls/ls.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/bin/ls/ls.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -561,7 +561,8 @@
NAMES *np;
off_t maxsize;
long maxblock;
- u_long btotal, labelstrlen, maxinode, maxlen, maxnlink;
+ uintmax_t maxinode;
+ u_long btotal, labelstrlen, maxlen, maxnlink;
u_long maxlabelstr;
u_int devstrlen;
int maxflags;
@@ -581,8 +582,9 @@
btotal = 0;
initmax = getenv("LS_COLWIDTHS");
/* Fields match -lios order. New ones should be added at the end. */
- maxlabelstr = maxblock = maxinode = maxlen = maxnlink =
- maxuser = maxgroup = maxflags = maxsize = 0;
+ maxlabelstr = maxblock = maxlen = maxnlink = 0;
+ maxuser = maxgroup = maxflags = maxsize = 0;
+ maxinode = 0;
if (initmax != NULL && *initmax != '\0') {
char *initmax2, *jinitmax;
int ninitmax;
@@ -610,7 +612,7 @@
strcpy(initmax2, "0");
ninitmax = sscanf(jinitmax,
- " %lu : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ",
+ " %ju : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ",
&maxinode, &maxblock, &maxnlink, &maxuser,
&maxgroup, &maxflags, &maxsize, &maxlen, &maxlabelstr);
f_notabs = 1;
@@ -842,7 +844,7 @@
d.s_flags = maxflags;
d.s_label = maxlabelstr;
d.s_group = maxgroup;
- (void)snprintf(buf, sizeof(buf), "%lu", maxinode);
+ (void)snprintf(buf, sizeof(buf), "%ju", maxinode);
d.s_inode = strlen(buf);
(void)snprintf(buf, sizeof(buf), "%lu", maxnlink);
d.s_nlink = strlen(buf);
Modified: soc2011/gk/ino64-head/bin/ls/print.c
==============================================================================
--- soc2011/gk/ino64-head/bin/ls/print.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/bin/ls/print.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -40,6 +40,7 @@
#include <sys/param.h>
#include <sys/stat.h>
+#include <sys/stdint.h>
#include <sys/acl.h>
#include <err.h>
@@ -151,7 +152,8 @@
continue;
sp = p->fts_statp;
if (f_inode)
- (void)printf("%*lu ", dp->s_inode, (u_long)sp->st_ino);
+ (void)printf("%*ju ",
+ dp->s_inode, (uintmax_t)sp->st_ino);
if (f_size)
(void)printf("%*jd ",
dp->s_block, howmany(sp->st_blocks, blocksize));
@@ -327,7 +329,8 @@
sp = p->fts_statp;
chcnt = 0;
if (f_inode)
- chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino);
+ chcnt += printf("%*ju ",
+ (int)inodefield, (uintmax_t)sp->st_ino);
if (f_size)
chcnt += printf("%*jd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
Modified: soc2011/gk/ino64-head/bin/rm/rm.c
==============================================================================
--- soc2011/gk/ino64-head/bin/rm/rm.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/bin/rm/rm.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -42,6 +42,7 @@
__FBSDID("$FreeBSD$");
#include <sys/stat.h>
+#include <sys/stdint.h>
#include <sys/param.h>
#include <sys/mount.h>
@@ -423,8 +424,8 @@
if (!S_ISREG(sbp->st_mode))
return (1);
if (sbp->st_nlink > 1 && !fflag) {
- warnx("%s (inode %u): not overwritten due to multiple links",
- file, sbp->st_ino);
+ warnx("%s (inode %ju): not overwritten due to multiple links",
+ file, (uintmax_t)sbp->st_ino);
return (0);
}
if ((fd = open(file, O_WRONLY, 0)) == -1)
Modified: soc2011/gk/ino64-head/sbin/dump/traverse.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/dump/traverse.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/dump/traverse.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -197,8 +197,8 @@
(mode & IFMT) == 0)
continue;
if (ino >= maxino) {
- msg("Skipping inode %d >= maxino %d\n",
- ino, maxino);
+ msg("Skipping inode %ju >= maxino %ju\n",
+ (uintmax_t)ino, (uintmax_t)maxino);
continue;
}
/*
@@ -400,15 +400,16 @@
for (loc = 0; loc < size; ) {
dp = (struct direct *)(dblk + loc);
if (dp->d_reclen == 0) {
- msg("corrupted directory, inumber %d\n", ino);
+ msg("corrupted directory, inumber %ju\n",
+ (uintmax_t)ino);
break;
}
loc += dp->d_reclen;
if (dp->d_ino == 0)
continue;
if (dp->d_ino >= maxino) {
- msg("corrupted directory entry, d_ino %d >= %d\n",
- dp->d_ino, maxino);
+ msg("corrupted directory entry, d_ino %ju >= %ju\n",
+ (uintmax_t)dp->d_ino, (uintmax_t)maxino);
break;
}
if (dp->d_name[0] == '.') {
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/fsutil.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/fsutil.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/fsutil.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -137,7 +137,8 @@
int iloff;
if (inum > maxino)
- errx(EEXIT, "inoinfo: inumber %d out of range", inum);
+ errx(EEXIT, "inoinfo: inumber %ju out of range",
+ (uintmax_t)inum);
ilp = &inostathead[inum / sblock.fs_ipg];
iloff = inum % sblock.fs_ipg;
if (iloff >= ilp->il_numalloced)
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/gjournal.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/gjournal.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/gjournal.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -449,7 +449,8 @@
if (isclr(inosused, cino))
continue;
if (getino(disk, &p, ino, &mode) == -1)
- err(1, "getino(cg=%d ino=%d)", cg, ino);
+ err(1, "getino(cg=%d ino=%ju)",
+ cg, (uintmax_t)ino);
dino = p;
/* Not a regular file nor directory? Skip it. */
if (!S_ISREG(dino->di_mode) && !S_ISDIR(dino->di_mode))
@@ -481,7 +482,8 @@
*dino = ufs2_zino;
/* Write the inode back. */
if (putino(disk) == -1)
- err(1, "putino(cg=%d ino=%d)", cg, ino);
+ err(1, "putino(cg=%d ino=%ju)",
+ cg, (uintmax_t)ino);
if (cgp->cg_unrefs == 0) {
//printf("No more unreferenced inodes in cg=%d.\n", cg);
break;
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/inode.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/inode.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/inode.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -285,7 +285,8 @@
ufs2_daddr_t iblk;
if (inumber < ROOTINO || inumber > maxino)
- errx(EEXIT, "bad inode number %d to ginode", inumber);
+ errx(EEXIT, "bad inode number %ju to ginode",
+ (uintmax_t)inumber);
if (startinum == 0 ||
inumber < startinum || inumber >= startinum + INOPB(&sblock)) {
iblk = ino_to_fsba(&sblock, inumber);
@@ -319,7 +320,8 @@
static caddr_t nextinop;
if (inumber != nextino++ || inumber > lastvalidinum)
- errx(EEXIT, "bad inode number %d to nextinode", inumber);
+ errx(EEXIT, "bad inode number %ju to nextinode",
+ (uintmax_t)inumber);
if (inumber >= lastinum) {
readcnt++;
dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum));
@@ -398,7 +400,8 @@
{
if (inum % sblock.fs_ipg != 0)
- errx(EEXIT, "bad inode number %d to setinodebuf", inum);
+ errx(EEXIT, "bad inode number %ju to setinodebuf",
+ (uintmax_t)inum);
lastvalidinum = inum + sblock.fs_ipg - 1;
startinum = 0;
nextino = inum;
@@ -489,7 +492,7 @@
continue;
return (inp);
}
- errx(EEXIT, "cannot find inode %d", inumber);
+ errx(EEXIT, "cannot find inode %ju", (uintmax_t)inumber);
return ((struct inoinfo *)0);
}
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/main.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/main.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/main.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -493,7 +493,7 @@
n_ffree * 100.0 / sblock.fs_dsize);
if (debug) {
if (files < 0)
- printf("%d inodes missing\n", -files);
+ printf("%jd inodes missing\n", (intmax_t)-files);
if (blks < 0)
printf("%lld blocks missing\n", -(long long)blks);
if (duplist != NULL) {
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/pass1.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/pass1.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/pass1.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -99,8 +99,9 @@
if (!rebuildcg && sblock.fs_magic == FS_UFS2_MAGIC) {
inosused = cgrp.cg_initediblk;
if (inosused > sblock.fs_ipg) {
- pfatal("%s (%d > %d) %s %d\nReset to %d\n",
- "Too many initialized inodes", inosused,
+ pfatal("%s (%ju > %d) %s %d\nReset to %d\n",
+ "Too many initialized inodes",
+ (uintmax_t)inosused,
sblock.fs_ipg, "in cylinder group", c,
sblock.fs_ipg);
inosused = sblock.fs_ipg;
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/pass2.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/pass2.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/pass2.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -223,13 +223,14 @@
* inp->i_parent is directory to which ".." should point.
*/
getpathname(pathbuf, inp->i_parent, inp->i_number);
- printf("BAD INODE NUMBER FOR '..' in DIR I=%d (%s)\n",
- inp->i_number, pathbuf);
+ printf("BAD INODE NUMBER FOR '..' in DIR I=%ju (%s)\n",
+ (uintmax_t)inp->i_number, pathbuf);
getpathname(pathbuf, inp->i_dotdot, inp->i_dotdot);
- printf("CURRENTLY POINTS TO I=%d (%s), ", inp->i_dotdot,
- pathbuf);
+ printf("CURRENTLY POINTS TO I=%ju (%s), ",
+ (uintmax_t)inp->i_dotdot, pathbuf);
getpathname(pathbuf, inp->i_parent, inp->i_parent);
- printf("SHOULD POINT TO I=%d (%s)", inp->i_parent, pathbuf);
+ printf("SHOULD POINT TO I=%ju (%s)",
+ (uintmax_t)inp->i_parent, pathbuf);
if (cursnapshot != 0) {
/*
* We need to:
@@ -443,8 +444,8 @@
} else {
getpathname(dirname, idesc->id_number,
dirp->d_ino);
- pwarn("ZERO LENGTH DIRECTORY %s I=%d",
- dirname, dirp->d_ino);
+ pwarn("ZERO LENGTH DIRECTORY %s I=%ju",
+ dirname, (uintmax_t)dirp->d_ino);
/*
* We need to:
* setcwd(idesc->id_parent);
@@ -507,8 +508,9 @@
break;
default:
- errx(EEXIT, "BAD STATE %d FOR INODE I=%d",
- inoinfo(dirp->d_ino)->ino_state, dirp->d_ino);
+ errx(EEXIT, "BAD STATE %d FOR INODE I=%ju",
+ inoinfo(dirp->d_ino)->ino_state,
+ (uintmax_t)dirp->d_ino);
}
}
if (n == 0)
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/pass4.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/pass4.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/pass4.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -36,6 +36,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/stdint.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
@@ -114,8 +115,9 @@
break;
default:
- errx(EEXIT, "BAD STATE %d FOR INODE I=%d",
- inoinfo(inumber)->ino_state, inumber);
+ errx(EEXIT, "BAD STATE %d FOR INODE I=%ju",
+ inoinfo(inumber)->ino_state,
+ (uintmax_t)inumber);
}
}
}
Modified: soc2011/gk/ino64-head/sbin/fsck_ffs/suj.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsck_ffs/suj.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsck_ffs/suj.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -831,8 +831,8 @@
int doff;
if (debug)
- printf("Clearing inode %d from parent %d at offset %jd\n",
- child, parent, diroff);
+ printf("Clearing inode %ju from parent %ju at offset %jd\n",
+ (uintmax_t)child, (uintmax_t)parent, diroff);
lbn = lblkno(fs, diroff);
doff = blkoff(fs, diroff);
@@ -842,8 +842,8 @@
block = dblk_read(blk, blksize);
dp = (struct direct *)&block[doff];
if (dp->d_ino != child)
- errx(1, "Inode %d does not exist in %d at %jd",
- child, parent, diroff);
+ errx(1, "Inode %ju does not exist in %ju at %jd",
+ (uintmax_t)child, (uintmax_t)parent, diroff);
dp->d_ino = 0;
dblk_dirty(blk);
/*
@@ -879,10 +879,11 @@
* was reallocated.
*/
if (*mode != 0)
- printf("Directory %d has bad mode %o\n",
- parent, *mode);
+ printf("Directory %ju has bad mode %o\n",
+ (uintmax_t)parent, *mode);
else
- printf("Directory %d zero inode\n", parent);
+ printf("Directory %ju zero inode\n",
+ (uintmax_t)parent);
}
return (0);
}
@@ -891,15 +892,16 @@
blksize = sblksize(fs, DIP(dip, di_size), lbn);
if (diroff + DIRECTSIZ(1) > DIP(dip, di_size) || doff >= blksize) {
if (debug)
- printf("ino %d absent from %d due to offset %jd"
+ printf("ino %ju absent from %ju due to offset %jd"
" exceeding size %jd\n",
- child, parent, diroff, DIP(dip, di_size));
+ (uintmax_t)child, (uintmax_t)parent, diroff,
+ DIP(dip, di_size));
return (0);
}
blk = ino_blkatoff(dip, parent, lbn, &frags);
if (blk <= 0) {
if (debug)
- printf("Sparse directory %d", parent);
+ printf("Sparse directory %ju", (uintmax_t)parent);
return (0);
}
block = dblk_read(blk, blksize);
@@ -918,12 +920,13 @@
dpoff += dp->d_reclen;
} while (dpoff <= doff);
if (dpoff > fs->fs_bsize)
- err_suj("Corrupt directory block in dir ino %d\n", parent);
+ err_suj("Corrupt directory block in dir ino %ju\n",
+ (uintmax_t)parent);
/* Not found. */
if (dpoff != doff) {
if (debug)
- printf("ino %d not found in %d, lbn %jd, dpoff %d\n",
- child, parent, lbn, dpoff);
+ printf("ino %ju not found in %ju, lbn %jd, dpoff %d\n",
+ (uintmax_t)child, (uintmax_t)parent, lbn, dpoff);
return (0);
}
/*
@@ -940,8 +943,8 @@
return (1);
}
if (debug)
- printf("ino %d doesn't match dirent ino %d in parent %d\n",
- child, dp->d_ino, parent);
+ printf("ino %ju doesn't match dirent ino %ju in parent %ju\n",
+ (uintmax_t)child, (uintmax_t)dp->d_ino, (uintmax_t)parent);
return (0);
}
@@ -977,8 +980,8 @@
err_suj("Invalid level for lbn %jd\n", lbn);
if ((flags & VISIT_ROOT) == 0 && blk_isindir(blk, ino, lbn) == 0) {
if (debug)
- printf("blk %jd ino %d lbn %jd(%d) is not indir.\n",
- blk, ino, lbn, level);
+ printf("blk %jd ino %ju lbn %jd(%d) is not indir.\n",
+ blk, (uintmax_t)ino, lbn, level);
goto out;
}
lbnadd = 1;
@@ -1131,8 +1134,8 @@
if (blocks == DIP(ip, di_blocks))
return;
if (debug)
- printf("ino %d adjusting block count from %jd to %jd\n",
- ino, DIP(ip, di_blocks), blocks);
+ printf("ino %ju adjusting block count from %jd to %jd\n",
+ (uintmax_t)ino, DIP(ip, di_blocks), blocks);
DIP_SET(ip, di_blocks, blocks);
ino_dirty(ino);
}
@@ -1264,8 +1267,8 @@
if (isdotdot && skipparent == 1)
continue;
if (debug)
- printf("Directory %d removing ino %d name %s\n",
- ino, dp->d_ino, dp->d_name);
+ printf("Directory %ju removing ino %ju name %s\n",
+ (uintmax_t)ino, (uintmax_t)dp->d_ino, dp->d_name);
diroff = lblktosize(fs, lbn) + dpoff;
ino_remref(ino, dp->d_ino, diroff, isdotdot);
}
@@ -1283,8 +1286,8 @@
if (ino == ROOTINO)
err_suj("Attempting to free ROOTINO\n");
if (debug)
- printf("Truncating and freeing ino %d, nlink %d, mode %o\n",
- ino, DIP(ip, di_nlink), DIP(ip, di_mode));
+ printf("Truncating and freeing ino %ju, nlink %d, mode %o\n",
+ (uintmax_t)ino, DIP(ip, di_nlink), DIP(ip, di_mode));
/* We are freeing an inode or directory. */
if ((DIP(ip, di_mode) & IFMT) == IFDIR)
@@ -1328,8 +1331,8 @@
reqlink = 1;
if (nlink < reqlink) {
if (debug)
- printf("ino %d not enough links to live %d < %d\n",
- ino, nlink, reqlink);
+ printf("ino %ju not enough links to live %d < %d\n",
+ (uintmax_t)ino, nlink, reqlink);
ino_reclaim(ip, ino, mode);
return;
}
@@ -1374,7 +1377,7 @@
break;
}
if (srec == NULL)
- errx(1, "Directory %d name not found", ino);
+ errx(1, "Directory %ju name not found", (uintmax_t)ino);
}
/*
* If it's a directory with no real names pointing to it go ahead
@@ -1402,17 +1405,19 @@
"ino %d nlink manipulation error, new link %d, old link %d\n",
ino, nlink, DIP(ip, di_nlink));
if (debug)
- printf("Adjusting ino %d, nlink %d, old link %d lastmode %o\n",
- ino, nlink, DIP(ip, di_nlink), sino->si_mode);
+ printf("Adjusting ino %ju, nlink %d, old link %d lastmode %o\n",
+ (uintmax_t)ino, nlink, DIP(ip, di_nlink), sino->si_mode);
if (mode == 0) {
if (debug)
- printf("ino %d, zero inode freeing bitmap\n", ino);
+ printf("ino %ju, zero inode freeing bitmap\n",
+ (uintmax_t)ino);
ino_free(ino, sino->si_mode);
return;
}
/* XXX Should be an assert? */
if (mode != sino->si_mode && debug)
- printf("ino %d, mode %o != %o\n", ino, mode, sino->si_mode);
+ printf("ino %ju, mode %o != %o\n",
+ (uintmax_t)ino, mode, sino->si_mode);
if ((mode & IFMT) == IFDIR)
reqlink = 2;
else
@@ -1420,15 +1425,16 @@
/* If the inode doesn't have enough links to live, free it. */
if (nlink < reqlink) {
if (debug)
- printf("ino %d not enough links to live %d < %d\n",
- ino, nlink, reqlink);
+ printf("ino %ju not enough links to live %d < %d\n",
+ (uintmax_t)ino, nlink, reqlink);
ino_reclaim(ip, ino, mode);
return;
}
/* If required write the updated link count. */
if (DIP(ip, di_nlink) == nlink) {
if (debug)
- printf("ino %d, link matches, skipping.\n", ino);
+ printf("ino %ju, link matches, skipping.\n",
+ (uintmax_t)ino);
return;
}
DIP_SET(ip, di_nlink, nlink);
@@ -1527,8 +1533,8 @@
mode = DIP(ip, di_mode) & IFMT;
cursize = DIP(ip, di_size);
if (debug)
- printf("Truncating ino %d, mode %o to size %jd from size %jd\n",
- ino, mode, size, cursize);
+ printf("Truncating ino %ju, mode %o to size %jd from size %jd\n",
+ (uintmax_t)ino, mode, size, cursize);
/* Skip datablocks for short links and devices. */
if (mode == 0 || mode == IFBLK || mode == IFCHR ||
@@ -1676,8 +1682,8 @@
* by one.
*/
if (debug)
- printf("ino %d nlink %d newlinks %d removes %d dotlinks %d\n",
- ino, nlink, newlinks, removes, dotlinks);
+ printf("ino %ju nlink %d newlinks %d removes %d dotlinks %d\n",
+ (uintmax_t)ino, nlink, newlinks, removes, dotlinks);
nlink += newlinks;
nlink -= removes;
sino->si_linkadj = 1;
@@ -1928,12 +1934,12 @@
*/
if (DIP(ip, di_nlink) == 0) {
if (debug)
- printf("Freeing unlinked ino %d mode %o\n",
- ino, mode);
+ printf("Freeing unlinked ino %ju mode %o\n",
+ (uintmax_t)ino, mode);
ino_reclaim(ip, ino, mode);
} else if (debug)
- printf("Skipping ino %d mode %o with link %d\n",
- ino, mode, DIP(ip, di_nlink));
+ printf("Skipping ino %ju mode %o with link %d\n",
+ (uintmax_t)ino, mode, DIP(ip, di_nlink));
ino = inon;
}
}
@@ -2370,27 +2376,27 @@
{
if (DIP(ip, di_nlink) != 1) {
- printf("Invalid link count %d for journal inode %d\n",
- DIP(ip, di_nlink), sujino);
+ printf("Invalid link count %d for journal inode %ju\n",
+ DIP(ip, di_nlink), (uintmax_t)sujino);
return (-1);
}
if ((DIP(ip, di_flags) & (SF_IMMUTABLE | SF_NOUNLINK)) !=
(SF_IMMUTABLE | SF_NOUNLINK)) {
- printf("Invalid flags 0x%X for journal inode %d\n",
- DIP(ip, di_flags), sujino);
+ printf("Invalid flags 0x%X for journal inode %ju\n",
+ DIP(ip, di_flags), (uintmax_t)sujino);
return (-1);
}
if (DIP(ip, di_mode) != (IFREG | IREAD)) {
- printf("Invalid mode %o for journal inode %d\n",
- DIP(ip, di_mode), sujino);
+ printf("Invalid mode %o for journal inode %ju\n",
+ DIP(ip, di_mode), (uintmax_t)sujino);
return (-1);
}
if (DIP(ip, di_size) < SUJ_MIN || DIP(ip, di_size) > SUJ_MAX) {
- printf("Invalid size %jd for journal inode %d\n",
- DIP(ip, di_size), sujino);
+ printf("Invalid size %jd for journal inode %ju\n",
+ DIP(ip, di_size), (uintmax_t)sujino);
return (-1);
}
@@ -2718,12 +2724,12 @@
* Build a list of journal blocks in jblocks before parsing the
* available journal blocks in with suj_read().
*/
- printf("** Reading %jd byte journal from inode %d.\n",
- DIP(jip, di_size), sujino);
+ printf("** Reading %jd byte journal from inode %ju.\n",
+ DIP(jip, di_size), (uintmax_t)sujino);
suj_jblocks = jblocks_create();
blocks = ino_visit(jip, sujino, suj_add_block, 0);
if (blocks != numfrags(fs, DIP(jip, di_size))) {
- printf("Sparse journal inode %d.\n", sujino);
+ printf("Sparse journal inode %ju.\n", (uintmax_t)sujino);
return (-1);
}
suj_read();
Modified: soc2011/gk/ino64-head/sbin/fsdb/fsdb.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsdb/fsdb.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsdb/fsdb.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -34,6 +34,7 @@
#endif /* not lint */
#include <sys/param.h>
+#include <sys/stdint.h>
#include <ctype.h>
#include <err.h>
#include <grp.h>
@@ -211,7 +212,8 @@
prompt(EditLine *el)
{
static char pstring[64];
- snprintf(pstring, sizeof(pstring), "fsdb (inum: %d)> ", curinum);
+ snprintf(pstring, sizeof(pstring), "fsdb (inum: %ju)> ",
+ (uintmax_t)curinum);
return pstring;
}
@@ -298,8 +300,8 @@
#define GETINUM(ac,inum) inum = strtoul(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", \
- inum, ROOTINO, maxino); \
+ printf("inode %ju out of range; range is [%ju,%ju]\n", \
+ (uintmax_t)inum, (uintmax_t)ROOTINO, (uintmax_t)maxino); \
return 1; \
}
@@ -364,7 +366,8 @@
if (!checkactive())
return 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();
return 0;
}
@@ -374,7 +377,8 @@
if (!checkactive())
return 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();
return 0;
}
@@ -493,11 +497,11 @@
if (is_ufs2 ?
compare_blk64(wantedblk64, 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,
ino_to_fsba(&sblock, inum)),
- (inum / INOPB(&sblock)) * INOPB(&sblock),
- (inum / INOPB(&sblock) + 1) * INOPB(&sblock));
+ (uintmax_t)(inum / INOPB(&sblock)) * INOPB(&sblock),
+ (uintmax_t)(inum / INOPB(&sblock) + 1) * INOPB(&sblock));
findblk_numtofind--;
if (findblk_numtofind == 0)
goto end;
@@ -593,8 +597,8 @@
founddatablk(uint64_t blk)
{
- printf("%llu: data block of inode %d\n",
- (unsigned long long)fsbtodb(&sblock, blk), curinum);
+ printf("%llu: data block of inode %ju\n",
+ (unsigned long long)fsbtodb(&sblock, blk), (uintmax_t)curinum);
findblk_numtofind--;
if (findblk_numtofind == 0)
return 1;
@@ -753,7 +757,7 @@
return 1;
rval = makeentry(curinum, inum, argv[2]);
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
printf("could not enter name? weird.\n");
curinode = ginode(curinum);
Modified: soc2011/gk/ino64-head/sbin/fsdb/fsdbutil.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsdb/fsdbutil.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsdb/fsdbutil.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -154,7 +154,7 @@
puts("fifo");
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));
if (sblock.fs_magic != FS_UFS1_MAGIC) {
t = _time64_to_time(dp->dp2.di_birthtime);
@@ -292,7 +292,7 @@
long ndb, offset;
ufs2_daddr_t blkno;
- printf("Blocks for inode %d:\n", inum);
+ printf("Blocks for inode %ju:\n", (uintmax_t)inum);
printf("Direct blocks:\n");
ndb = howmany(DIP(dp, di_size), sblock.fs_bsize);
for (i = 0; i < NDADDR; i++) {
@@ -341,7 +341,7 @@
return 0;
}
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 1;
@@ -366,11 +366,12 @@
printstat("current inode", curinum, curinode);
break;
case 0:
- printf("current inode %d: unallocated inode\n", curinum);
+ printf("current inode %ju: unallocated inode\n", (uintmax_t)curinum);
break;
default:
- printf("current inode %d: screwy itype 0%o (mode 0%o)?\n",
- curinum, DIP(curinode, di_mode) & IFMT, DIP(curinode, di_mode));
+ printf("current inode %ju: screwy itype 0%o (mode 0%o)?\n",
+ (uintmax_t)curinum, DIP(curinode, di_mode) & IFMT,
+ DIP(curinode, di_mode));
break;
}
return 0;
Modified: soc2011/gk/ino64-head/sbin/fsirand/fsirand.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/fsirand/fsirand.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/fsirand/fsirand.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -275,8 +275,8 @@
dp2 = &((struct ufs2_dinode *)inodebuf)[n];
if (inumber >= ROOTINO) {
if (printonly)
- (void)printf("ino %d gen %08x\n",
- inumber,
+ (void)printf("ino %ju gen %08x\n",
+ (uintmax_t)inumber,
sblock->fs_magic == FS_UFS1_MAGIC ?
dp1->di_gen : dp2->di_gen);
else if (sblock->fs_magic == FS_UFS1_MAGIC)
Modified: soc2011/gk/ino64-head/sbin/growfs/growfs.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/growfs/growfs.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/growfs/growfs.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -441,7 +441,7 @@
}
acg.cg_cs.cs_nifree += sblock.fs_ipg;
if (cylno == 0)
- for (i = 0; i < ROOTINO; i++) {
+ for (i = 0; i < (ufs2_daddr_t)ROOTINO; i++) {
setbit(cg_inosused(&acg), i);
acg.cg_cs.cs_nifree--;
}
@@ -1868,7 +1868,7 @@
return NULL;
}
if (inumber > maxino)
- errx(8, "bad inode number %d to ginode", inumber);
+ errx(8, "bad inode number %ju to ginode", (uintmax_t)inumber);
if (startinum == 0 ||
inumber < startinum || inumber >= startinum + INOPB(&sblock)) {
inoblk = fsbtodb(&sblock, ino_to_fsba(&sblock, inumber));
Modified: soc2011/gk/ino64-head/sbin/newfs/mkfs.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/newfs/mkfs.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/newfs/mkfs.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -1005,7 +1005,8 @@
sblock.fs_cstotal.cs_nifree--;
fscs[0].cs_nifree--;
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);
}
d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino));
Modified: soc2011/gk/ino64-head/sbin/quotacheck/quotacheck.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/quotacheck/quotacheck.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/quotacheck/quotacheck.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -51,6 +51,7 @@
#include <sys/disklabel.h>
#include <sys/mount.h>
#include <sys/stat.h>
+#include <sys/stdint.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/quota.h>
@@ -383,9 +384,9 @@
if (vflag) {
if (aflag)
(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),
- ino);
+ (uintmax_t)ino);
}
continue;
}
@@ -601,7 +602,8 @@
static caddr_t nextinop;
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) {
readcnt++;
dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum));
@@ -635,7 +637,7 @@
{
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;
nextino = inum;
lastinum = inum;
Modified: soc2011/gk/ino64-head/sbin/restore/dirs.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/restore/dirs.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/restore/dirs.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -637,7 +637,8 @@
continue;
}
if (ep == NULL) {
- panic("cannot find directory inode %d\n", node.ino);
+ panic("cannot find directory inode %ju\n",
+ (uintmax_t)node.ino);
continue;
}
cp = myname(ep);
@@ -678,7 +679,8 @@
itp = inotablookup(ino);
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) {
fprintf(stderr, "%s: ", name);
(void) fflush(stderr);
@@ -691,15 +693,15 @@
size = i < BUFSIZ ? i : BUFSIZ;
if (read(dp, buf, (int) size) == -1) {
fprintf(stderr,
- "write error extracting inode %d, name %s\n",
- curfile.ino, curfile.name);
+ "write error extracting inode %ju, name %s\n",
+ (uintmax_t)curfile.ino, curfile.name);
fprintf(stderr, "read: %s\n", strerror(errno));
done(1);
}
if (!Nflag && write(ofile, buf, (int) size) == -1) {
fprintf(stderr,
- "write error extracting inode %d, name %s\n",
- curfile.ino, curfile.name);
+ "write error extracting inode %ju, name %s\n",
+ (uintmax_t)curfile.ino, curfile.name);
fprintf(stderr, "write: %s\n", strerror(errno));
done(1);
}
Modified: soc2011/gk/ino64-head/sbin/restore/interactive.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/restore/interactive.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/restore/interactive.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -38,6 +38,7 @@
#include <sys/param.h>
#include <sys/stat.h>
+#include <sys/stdint.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
@@ -675,7 +676,8 @@
for (j = 0; j < columns; j++) {
fp = &list[j * lines + i];
if (vflag) {
- fprintf(stderr, "%*d ", precision, fp->fnum);
+ fprintf(stderr, "%*jd ",
+ precision, (uintmax_t)fp->fnum);
fp->len += precision + 1;
}
if (haveprefix) {
Modified: soc2011/gk/ino64-head/sbin/restore/restore.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/restore/restore.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/restore/restore.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -37,6 +37,7 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
+#include <sys/stdint.h>
#include <limits.h>
#include <stdio.h>
@@ -61,7 +62,7 @@
if (TSTINO(ino, dumpmap) == 0)
return (descend);
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);
}
@@ -83,7 +84,7 @@
if (ino == WINO && command == 'i' && !vflag)
return (descend);
if (!mflag) {
- (void) sprintf(buf, "./%u", ino);
+ (void) sprintf(buf, "./%ju", (uintmax_t)ino);
name = buf;
if (type == NODE) {
(void) genliteraldir(name, ino);
@@ -457,8 +458,8 @@
* next incremental tape.
*/
case 0:
- fprintf(stderr, "%s: (inode %d) not found on tape\n",
- name, ino);
+ fprintf(stderr, "%s: (inode %ju) not found on tape\n",
+ name, (uintmax_t)ino);
break;
/*
@@ -612,7 +613,7 @@
while (first < curfile.ino) {
ep = lookupino(first);
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));
ep->e_flags &= ~(NEW|EXTRACT);
first = lowerbnd(first);
@@ -625,8 +626,8 @@
* on the next incremental tape.
*/
if (first != curfile.ino) {
- fprintf(stderr, "expected next file %d, got %d\n",
- first, curfile.ino);
+ fprintf(stderr, "expected next file %ju, got %ju\n",
+ (uintmax_t)first, (uintmax_t)curfile.ino);
skipfile();
goto next;
}
@@ -852,7 +853,7 @@
if (np == ep)
break;
if (np == NULL)
- panic("missing inumber %d\n", ino);
+ panic("missing inumber %ju\n", (uintmax_t)ino);
if (ep->e_type == LEAF && type != LEAF)
badentry(ep, "type should be LEAF");
return (descend);
Modified: soc2011/gk/ino64-head/sbin/restore/symtab.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/restore/symtab.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/restore/symtab.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -46,6 +46,7 @@
#include <sys/param.h>
#include <sys/stat.h>
+#include <sys/stdint.h>
#include <ufs/ufs/dinode.h>
@@ -100,7 +101,7 @@
struct entry **epp;
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];
np->e_ino = inum;
np->e_next = *epp;
@@ -121,7 +122,7 @@
struct entry **prev;
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];
for (next = *prev; next != NULL; next = next->e_next) {
if (next->e_ino == inum) {
@@ -131,7 +132,7 @@
}
prev = &next->e_next;
}
- panic("deleteino: %d not found\n", inum);
+ panic("deleteino: %ju not found\n", (uintmax_t)inum);
}
/*
Modified: soc2011/gk/ino64-head/sbin/restore/tape.c
==============================================================================
--- soc2011/gk/ino64-head/sbin/restore/tape.c Sun Jun 5 16:20:38 2011 (r222840)
+++ soc2011/gk/ino64-head/sbin/restore/tape.c Sun Jun 5 16:21:16 2011 (r222841)
@@ -274,7 +274,7 @@
done(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));
if (map == NULL)
panic("no memory for active inode map\n");
@@ -1050,8 +1050,9 @@
}
extbufsize = 0;
extbuf = NULL;
- fprintf(stderr, "Cannot extract %d bytes %s for inode %d, name %s\n",
- extsize, "of extended attributes", curfile.ino, curfile.name);
+ fprintf(stderr, "Cannot extract %d bytes %s for inode %ju, name %s\n",
+ extsize, "of extended attributes", (uintmax_t)curfile.ino,
+ curfile.name);
return (NULL);
}
@@ -1079,8 +1080,8 @@
return;
if (write(ofile, buf, (int) size) == -1) {
fprintf(stderr,
- "write error extracting inode %d, name %s\nwrite: %s\n",
- curfile.ino, curfile.name, strerror(errno));
+ "write error extracting inode %ju, name %s\nwrite: %s\n",
+ (uintmax_t)curfile.ino, curfile.name, strerror(errno));
}
}
@@ -1094,8 +1095,8 @@
if (lseek(ofile, size, SEEK_CUR) == -1) {
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-soc-all
mailing list