From owner-svn-src-projects@FreeBSD.ORG Thu Sep 1 16:43:23 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA9611065674; Thu, 1 Sep 2011 16:43:23 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6EC28FC1C; Thu, 1 Sep 2011 16:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p81GhNtY059331; Thu, 1 Sep 2011 16:43:23 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p81GhNgC059308; Thu, 1 Sep 2011 16:43:23 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201109011643.p81GhNgC059308@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 1 Sep 2011 16:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225314 - in projects/ino64: 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/lpr/lpr u... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 16:43:24 -0000 Author: mdf Date: Thu Sep 1 16:43:23 2011 New Revision: 225314 URL: http://svn.freebsd.org/changeset/base/225314 Log: usr: Change ino_t printf format flag to %ju. usr.sbin/quot: Change inode type to uintmax_t to keep scanf() happy. GSoC r222841, r223085. Code by: Gleb Kurtsou. Modified: projects/ino64/bin/ls/ls.c projects/ino64/bin/ls/print.c projects/ino64/bin/rm/rm.c projects/ino64/sbin/dump/traverse.c projects/ino64/sbin/fsck_ffs/fsutil.c projects/ino64/sbin/fsck_ffs/gjournal.c projects/ino64/sbin/fsck_ffs/inode.c projects/ino64/sbin/fsck_ffs/main.c projects/ino64/sbin/fsck_ffs/pass1.c projects/ino64/sbin/fsck_ffs/pass2.c projects/ino64/sbin/fsck_ffs/pass4.c projects/ino64/sbin/fsck_ffs/suj.c projects/ino64/sbin/fsdb/fsdb.c projects/ino64/sbin/fsdb/fsdbutil.c projects/ino64/sbin/fsirand/fsirand.c projects/ino64/sbin/growfs/growfs.c projects/ino64/sbin/newfs/mkfs.c projects/ino64/sbin/quotacheck/quotacheck.c projects/ino64/sbin/restore/dirs.c projects/ino64/sbin/restore/interactive.c projects/ino64/sbin/restore/restore.c projects/ino64/sbin/restore/symtab.c projects/ino64/sbin/restore/tape.c projects/ino64/sbin/tunefs/tunefs.c projects/ino64/usr.bin/find/ls.c projects/ino64/usr.sbin/lpr/lpr/lpr.c projects/ino64/usr.sbin/makefs/ffs/ffs_alloc.c projects/ino64/usr.sbin/quot/quot.c projects/ino64/usr.sbin/snapinfo/snapinfo.c Modified: projects/ino64/bin/ls/ls.c ============================================================================== --- projects/ino64/bin/ls/ls.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/bin/ls/ls.c Thu Sep 1 16:43:23 2011 (r225314) @@ -559,9 +559,10 @@ display(const FTSENT *p, FTSENT *list, i DISPLAY d; FTSENT *cur; NAMES *np; + uintmax_t maxinode; off_t maxsize; long maxblock; - u_long btotal, labelstrlen, maxinode, maxlen, maxnlink; + u_long btotal, labelstrlen, maxlen, maxnlink; u_long maxlabelstr; u_int devstrlen; int maxflags; @@ -581,8 +582,9 @@ display(const FTSENT *p, FTSENT *list, i btotal = 0; initmax = getenv("LS_COLWIDTHS"); /* Fields match -lios order. New ones should be added at the end. */ - maxlabelstr = maxblock = maxinode = maxlen = maxnlink = + maxlabelstr = maxblock = maxlen = maxnlink = maxuser = maxgroup = maxflags = maxsize = 0; + maxinode = 0; if (initmax != NULL && *initmax != '\0') { char *initmax2, *jinitmax; int ninitmax; @@ -610,7 +612,7 @@ display(const FTSENT *p, FTSENT *list, i 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 @@ label_out: 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: projects/ino64/bin/ls/print.c ============================================================================== --- projects/ino64/bin/ls/print.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/bin/ls/print.c Thu Sep 1 16:43:23 2011 (r225314) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,7 +152,8 @@ printlong(const DISPLAY *dp) 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 @@ printaname(const FTSENT *p, u_long inode 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: projects/ino64/bin/rm/rm.c ============================================================================== --- projects/ino64/bin/rm/rm.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/bin/rm/rm.c Thu Sep 1 16:43:23 2011 (r225314) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -423,8 +424,8 @@ rm_overwrite(char *file, struct stat *sb 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: projects/ino64/sbin/dump/traverse.c ============================================================================== --- projects/ino64/sbin/dump/traverse.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/dump/traverse.c Thu Sep 1 16:43:23 2011 (r225314) @@ -197,8 +197,8 @@ mapfiles(ino_t maxino, long *tapesize) (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 @@ searchdir( 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: projects/ino64/sbin/fsck_ffs/fsutil.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/fsutil.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/fsutil.c Thu Sep 1 16:43:23 2011 (r225314) @@ -137,7 +137,8 @@ inoinfo(ino_t inum) 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: projects/ino64/sbin/fsck_ffs/gjournal.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/gjournal.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/gjournal.c Thu Sep 1 16:43:23 2011 (r225314) @@ -449,7 +449,8 @@ gjournal_check(const char *filesys) 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 @@ gjournal_check(const char *filesys) *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: projects/ino64/sbin/fsck_ffs/inode.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/inode.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/inode.c Thu Sep 1 16:43:23 2011 (r225314) @@ -285,7 +285,8 @@ ginode(ino_t inumber) 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 @@ getnextinode(ino_t inumber, int rebuildc 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 @@ setinodebuf(ino_t inum) { 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 @@ getinoinfo(ino_t inumber) continue; return (inp); } - errx(EEXIT, "cannot find inode %d", inumber); + errx(EEXIT, "cannot find inode %ju", (uintmax_t)inumber); return ((struct inoinfo *)0); } Modified: projects/ino64/sbin/fsck_ffs/main.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/main.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/main.c Thu Sep 1 16:43:23 2011 (r225314) @@ -493,7 +493,7 @@ checkfilesys(char *filesys) 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: projects/ino64/sbin/fsck_ffs/pass1.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/pass1.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/pass1.c Thu Sep 1 16:43:23 2011 (r225314) @@ -99,8 +99,9 @@ pass1(void) 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: projects/ino64/sbin/fsck_ffs/pass2.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/pass2.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/pass2.c Thu Sep 1 16:43:23 2011 (r225314) @@ -223,13 +223,14 @@ pass2(void) * 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 @@ again: } 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 @@ again: 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: projects/ino64/sbin/fsck_ffs/pass4.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/pass4.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/pass4.c Thu Sep 1 16:43:23 2011 (r225314) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "fsck.h" @@ -114,8 +115,9 @@ pass4(void) 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: projects/ino64/sbin/fsck_ffs/suj.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/suj.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/suj.c Thu Sep 1 16:43:23 2011 (r225314) @@ -831,8 +831,8 @@ ino_clrat(ino_t parent, off_t diroff, in 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 @@ ino_clrat(ino_t parent, off_t diroff, in 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 @@ ino_isat(ino_t parent, off_t diroff, ino * 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 @@ ino_isat(ino_t parent, off_t diroff, ino 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 @@ ino_isat(ino_t parent, off_t diroff, ino 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 @@ ino_isat(ino_t parent, off_t diroff, ino 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 @@ indir_visit(ino_t ino, ufs_lbn_t lbn, uf 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 @@ ino_adjblks(struct suj_ino *sino) 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 @@ ino_free_children(ino_t ino, ufs_lbn_t l 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 @@ ino_reclaim(union dinode *ip, ino_t ino, 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) @@ -1318,9 +1321,11 @@ ino_decr(ino_t ino) nlink = DIP(ip, di_nlink); mode = DIP(ip, di_mode); if (nlink < 1) - err_suj("Inode %d link count %d invalid\n", ino, nlink); + err_suj("Inode %ju link count %d invalid\n", (uintmax_t)ino, + nlink); if (mode == 0) - err_suj("Inode %d has a link of %d with 0 mode\n", ino, nlink); + err_suj("Inode %ju has a link of %d with 0 mode\n", + (uintmax_t)ino, nlink); nlink--; if ((mode & IFMT) == IFDIR) reqlink = 2; @@ -1328,8 +1333,8 @@ ino_decr(ino_t ino) 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 +1379,7 @@ ino_adjust(struct suj_ino *sino) 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 @@ -1399,20 +1404,22 @@ ino_adjust(struct suj_ino *sino) mode = DIP(ip, di_mode) & IFMT; if (nlink > LINK_MAX) err_suj( - "ino %d nlink manipulation error, new link %d, old link %d\n", - ino, nlink, DIP(ip, di_nlink)); + "ino %ju nlink manipulation error, new link %d, old link %d\n", + (uintmax_t)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 +1427,16 @@ ino_adjust(struct suj_ino *sino) /* 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 +1535,8 @@ ino_trunc(ino_t ino, off_t size) 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 || @@ -1586,7 +1594,8 @@ ino_trunc(ino_t ino, off_t size) bn = DIP(ip, di_db[visitlbn]); if (bn == 0) - err_suj("Bad blk at ino %d lbn %jd\n", ino, visitlbn); + err_suj("Bad blk at ino %ju lbn %jd\n", + (uintmax_t)ino, visitlbn); oldspace = sblksize(fs, cursize, visitlbn); newspace = sblksize(fs, size, visitlbn); if (oldspace != newspace) { @@ -1610,8 +1619,8 @@ ino_trunc(ino_t ino, off_t size) bn = ino_blkatoff(ip, ino, visitlbn, &frags); if (bn == 0) - err_suj("Block missing from ino %d at lbn %jd\n", - ino, visitlbn); + err_suj("Block missing from ino %ju at lbn %jd\n", + (uintmax_t)ino, visitlbn); clrsize = frags * fs->fs_fsize; buf = dblk_read(bn, clrsize); clrsize -= off; @@ -1676,8 +1685,8 @@ ino_check(struct suj_ino *sino) * 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; @@ -1923,12 +1932,12 @@ ino_unlinked(void) */ 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; } } @@ -2351,27 +2360,27 @@ suj_verifyino(union dinode *ip) { 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); } @@ -2699,12 +2708,12 @@ suj_check(const char *filesys) * 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: projects/ino64/sbin/fsdb/fsdb.c ============================================================================== --- projects/ino64/sbin/fsdb/fsdb.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsdb/fsdb.c Thu Sep 1 16:43:23 2011 (r225314) @@ -39,6 +39,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -211,7 +212,8 @@ char * 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 @@ ino_t curinum, ocurrent; #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 @@ CMDFUNCSTART(uplink) 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 @@ CMDFUNCSTART(downlink) 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 @@ CMDFUNCSTART(findblk) 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 @@ static int 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 @@ CMDFUNCSTART(ln) 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: projects/ino64/sbin/fsdb/fsdbutil.c ============================================================================== --- projects/ino64/sbin/fsdb/fsdbutil.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsdb/fsdbutil.c Thu Sep 1 16:43:23 2011 (r225314) @@ -154,7 +154,7 @@ printstat(const char *cp, ino_t inum, un 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 @@ printblocks(ino_t inum, union dinode *dp 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 @@ checkactivedir(void) 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 @@ printactive(int doblocks) 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: projects/ino64/sbin/fsirand/fsirand.c ============================================================================== --- projects/ino64/sbin/fsirand/fsirand.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsirand/fsirand.c Thu Sep 1 16:43:23 2011 (r225314) @@ -275,8 +275,8 @@ fsirand(char *device) 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: projects/ino64/sbin/growfs/growfs.c ============================================================================== --- projects/ino64/sbin/growfs/growfs.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/growfs/growfs.c Thu Sep 1 16:43:23 2011 (r225314) @@ -372,6 +372,7 @@ initcg(int cylno, time_t modtime, int fs { DBG_FUNC("initcg") static caddr_t iobuf; + ino_t ino; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; @@ -441,8 +442,8 @@ initcg(int cylno, time_t modtime, int fs } acg.cg_cs.cs_nifree += sblock.fs_ipg; if (cylno == 0) - for (i = 0; i < ROOTINO; i++) { - setbit(cg_inosused(&acg), i); + for (ino = 0; ino < ROOTINO; ino++) { + setbit(cg_inosused(&acg), ino); acg.cg_cs.cs_nifree--; } /* @@ -1847,6 +1848,7 @@ ginode(ino_t inumber, int fsi, int cg) { DBG_FUNC("ginode") static ino_t startinum = 0; /* first inode in cached block */ + uintptr_t ioff; DBG_ENTER; @@ -1868,19 +1870,20 @@ ginode(ino_t inumber, int fsi, int cg) 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)); rdfs(inoblk, (size_t)sblock.fs_bsize, inobuf, fsi); startinum = (inumber / INOPB(&sblock)) * INOPB(&sblock); } + ioff = inumber % INOPB(&sblock); DBG_LEAVE; if (sblock.fs_magic == FS_UFS1_MAGIC) return (union dinode *)((uintptr_t)inobuf + - (inumber % INOPB(&sblock)) * sizeof(struct ufs1_dinode)); + ioff * sizeof(struct ufs1_dinode)); return (union dinode *)((uintptr_t)inobuf + - (inumber % INOPB(&sblock)) * sizeof(struct ufs2_dinode)); + ioff * sizeof(struct ufs2_dinode)); } /* ****************************************************** charsperline ***** */ Modified: projects/ino64/sbin/newfs/mkfs.c ============================================================================== --- projects/ino64/sbin/newfs/mkfs.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/newfs/mkfs.c Thu Sep 1 16:43:23 2011 (r225314) @@ -1005,7 +1005,8 @@ iput(union dinode *ip, ino_t ino) 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: projects/ino64/sbin/quotacheck/quotacheck.c ============================================================================== --- projects/ino64/sbin/quotacheck/quotacheck.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/quotacheck/quotacheck.c Thu Sep 1 16:43:23 2011 (r225314) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -383,9 +384,9 @@ chkquota(char *specname, struct quotafil 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 @@ getnextinode(ino_t inumber) 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 @@ setinodebuf(ino_t inum) { 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: projects/ino64/sbin/restore/dirs.c ============================================================================== --- projects/ino64/sbin/restore/dirs.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/restore/dirs.c Thu Sep 1 16:43:23 2011 (r225314) @@ -637,7 +637,8 @@ setdirmodes(int flags) 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 @@ genliteraldir(char *name, ino_t ino) 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 @@ genliteraldir(char *name, ino_t ino) 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: projects/ino64/sbin/restore/interactive.c ============================================================================== --- projects/ino64/sbin/restore/interactive.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/restore/interactive.c Thu Sep 1 16:43:23 2011 (r225314) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -675,7 +676,8 @@ formatf(struct afile *list, int nentry) for (j = 0; j < columns; j++) { fp = &list[j * lines + i]; if (vflag) { - fprintf(stderr, "%*d ", precision, fp->fnum); + fprintf(stderr, "%*ju ", + precision, (uintmax_t)fp->fnum); fp->len += precision + 1; } if (haveprefix) { Modified: projects/ino64/sbin/restore/restore.c ============================================================================== --- projects/ino64/sbin/restore/restore.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/restore/restore.c Thu Sep 1 16:43:23 2011 (r225314) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -61,7 +62,7 @@ listfile(char *name, ino_t ino, int type 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 @@ addfile(char *name, ino_t ino, int type) 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 @@ nodeupdates(char *name, ino_t ino, int t * 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 @@ createleaves(char *symtabfile) 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 @@ createleaves(char *symtabfile) * 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 @@ verifyfile(char *name, ino_t ino, int ty 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); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***