>Number:         174028
>Category:       bin
>Synopsis:       [patch][mthca] Fix some warnings with fsck_ffs(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 01 06:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Cooper
>Release:        9.1-STABLE
>Organization:
EMC Isilon
>Environment:
FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240836M: Sat 
Sep 22 12:30:11 PDT 2012     
[email protected]:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA  amd64
>Description:
I was doing a rescue(8) compile before in the past and ignorantly enabled 
WARNS=6 on the build and ran into a slew of warnings-related build errors with 
fsck_ffs.

The attached patch fixes some (but not all) of the warnings. In particular 
there are a large chunk of signage warnings that need to be fixed (along with 
some always true/false code due to the fact that some of the values being 
compared are unsigned), and an issue with pointer arithmetic.

The remaining warnings as errors follow...

cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/dir.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/dir.c: In function 'dircheck':
/usr/src/sbin/fsck_ffs/dir.c:227: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/dir.c: In function 'expanddir':
/usr/src/sbin/fsck_ffs/dir.c:569: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/dir.c:569: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/dir.c:571: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/dir.c:571: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/dir.c:585: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/dir.c:585: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/dir.c:601: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/dir.c:601: warning: signed and unsigned type in 
conditional expression
*** [dir.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/fsutil.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/fsutil.c: In function 'check_cgmagic':
/usr/src/sbin/fsck_ffs/fsutil.c:452: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/fsutil.c:453: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/fsutil.c:457: warning: comparison between signed and 
unsigned
*** [fsutil.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/inode.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/inode.c: In function 'getnextinode':
/usr/src/sbin/fsck_ffs/inode.c:368: warning: comparison between signed and 
unsigned
*** [inode.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/main.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/main.c: In function 'checkfilesys':
/usr/src/sbin/fsck_ffs/main.c:354: warning: passing argument 4 of 'build_iovec' 
discards qualifiers from pointer target type
/usr/src/sbin/fsck_ffs/main.c:495: warning: comparison of unsigned expression < 
0 is always false
/usr/src/sbin/fsck_ffs/main.c:517: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/main.c:532: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/main.c: In function 'chkdoreload':
/usr/src/sbin/fsck_ffs/main.c:571: warning: passing argument 4 of 'build_iovec' 
discards qualifiers from pointer target type
*** [main.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/pass1.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/pass1.c: In function 'pass1':
/usr/src/sbin/fsck_ffs/pass1.c:72: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass1.c:92: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass1.c:141: warning: comparison of unsigned expression 
< 0 is always false
/usr/src/sbin/fsck_ffs/pass1.c: In function 'checkinode':
/usr/src/sbin/fsck_ffs/pass1.c:275: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass1.c:315: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass1.c:392: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/pass1.c:392: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass1.c:394: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/pass1.c:406: warning: signed and unsigned type in 
conditional expression
*** [pass1.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/pass1b.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/pass1b.c: In function 'pass1b':
/usr/src/sbin/fsck_ffs/pass1b.c:63: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass1b.c:75: warning: comparison between signed and 
unsigned
*** [pass1b.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/pass2.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/pass2.c: In function 'pass2':
/usr/src/sbin/fsck_ffs/pass2.c:186: warning: comparison between signed and 
unsigned
*** [pass2.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/pass4.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/pass4.c: In function 'pass4':
/usr/src/sbin/fsck_ffs/pass4.c:59: warning: comparison between signed and 
unsigned
*** [pass4.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/pass5.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/pass5.c: In function 'pass5':
/usr/src/sbin/fsck_ffs/pass5.c:153: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass5.c:178: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/pass5.c:285: warning: comparison between signed and 
unsigned
*** [pass5.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/setup.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/setup.c: In function 'readsb':
/usr/src/sbin/fsck_ffs/setup.c:352: warning: comparison between signed and 
unsigned
*** [setup.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/suj.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/suj.c: In function 'closedisk':
/usr/src/sbin/fsck_ffs/suj.c:225: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c: In function 'cg_lookup':
/usr/src/sbin/fsck_ffs/suj.c:256: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c: In function 'ino_blkatoff':
/usr/src/sbin/fsck_ffs/suj.c:771: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c:774: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c:774: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/suj.c: In function 'ino_clrat':
/usr/src/sbin/fsck_ffs/suj.c:841: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c:841: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/suj.c: In function 'ino_isat':
/usr/src/sbin/fsck_ffs/suj.c:891: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c:891: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/suj.c: In function 'ino_visit':
/usr/src/sbin/fsck_ffs/suj.c:1047: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c:1052: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c:1052: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/suj.c: In function 'ino_adjblks':
/usr/src/sbin/fsck_ffs/suj.c:1132: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/suj.c:1136: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/suj.c: In function 'ino_remref':
/store/freebsd/stable/9/sbin/fsck_ffs/suj.c:1228: warning: comparison between 
signed and unsigned
/usr/src/sbin/fsck_ffs/suj.c: In function 'suj_verifyino':
/usr/src/sbin/fsck_ffs/suj.c:2393: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/suj.c: In function 'suj_read':
/usr/src/sbin/fsck_ffs/suj.c:2607: warning: pointer of type 'void *' used in 
arithmetic
*** [suj.o] Error code 1 (continuing)
cc -O2 -pipe -fno-strict-aliasing -O2 -march=core2 -I/usr/src/sbin/fsck_ffs 
-I/usr/src/sbin/fsck_ffs/../mount -std=gnu99 -fstack-protector -Wsystem-headers 
-Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings 
-Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline 
-Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c 
/usr/src/sbin/fsck_ffs/gjournal.c
cc1: warnings being treated as errors
/usr/src/sbin/fsck_ffs/gjournal.c: In function 'getcg':
/usr/src/sbin/fsck_ffs/gjournal.c:109: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/gjournal.c: In function 'clear_inode':
/usr/src/sbin/fsck_ffs/gjournal.c:389: warning: comparison between signed and 
unsigned
/usr/src/sbin/fsck_ffs/gjournal.c:389: warning: signed and unsigned type in 
conditional expression
/usr/src/sbin/fsck_ffs/gjournal.c: In function 'gjournal_check':
/usr/src/sbin/fsck_ffs/gjournal.c:414: warning: comparison between signed and 
unsigned
1 error
*** [gjournal.o] Error code 1 (continuing)
`all' not remade because of errors.
>How-To-Repeat:
cd sbin/fsck_ffs; make obj depend all -k WARNS=6
>Fix:


Patch attached with submission follows:

Index: sbin/fsck_ffs/ea.c
===================================================================
--- sbin/fsck_ffs/ea.c  (revision 243557)
+++ sbin/fsck_ffs/ea.c  (working copy)
@@ -53,7 +53,11 @@
  * Scan each entry in an ea block.
  */
 int
+#if 1
+eascan(struct inodesc *idesc __unused, struct ufs2_dinode *dp __unused)
+#else
 eascan(struct inodesc *idesc, struct ufs2_dinode *dp)
+#endif
 {
 #if 1
        return (0);
Index: sbin/fsck_ffs/fsutil.c
===================================================================
--- sbin/fsck_ffs/fsutil.c      (revision 243557)
+++ sbin/fsck_ffs/fsutil.c      (working copy)
@@ -564,7 +564,7 @@
 
 /* Slow down IO so as to leave some disk bandwidth for other processes */
 void
-slowio_start()
+slowio_start(void)
 {
 
        /* Delay one in every 8 operations */
@@ -575,7 +575,7 @@
 }
 
 void
-slowio_end()
+slowio_end(void)
 {
        struct timeval tv;
        int delay_usec;
Index: sbin/fsck_ffs/gjournal.c
===================================================================
--- sbin/fsck_ffs/gjournal.c    (revision 243557)
+++ sbin/fsck_ffs/gjournal.c    (working copy)
@@ -91,7 +91,6 @@
 static const char *devnam;
 static struct uufsd *disk = NULL;
 static struct fs *fs = NULL;
-struct ufs2_dinode ufs2_zino;
 
 static void putcgs(void);
 
Index: sbin/fsck_ffs/pass5.c
===================================================================
--- sbin/fsck_ffs/pass5.c       (revision 243557)
+++ sbin/fsck_ffs/pass5.c       (working copy)
@@ -189,15 +189,15 @@
                newcg->cg_cs.cs_nffree = 0;
                newcg->cg_cs.cs_nbfree = 0;
                newcg->cg_cs.cs_nifree = fs->fs_ipg;
-               if (cg->cg_rotor >= 0 && cg->cg_rotor < newcg->cg_ndblk)
+               if (cg->cg_rotor < newcg->cg_ndblk)
                        newcg->cg_rotor = cg->cg_rotor;
                else
                        newcg->cg_rotor = 0;
-               if (cg->cg_frotor >= 0 && cg->cg_frotor < newcg->cg_ndblk)
+               if (cg->cg_frotor < newcg->cg_ndblk)
                        newcg->cg_frotor = cg->cg_frotor;
                else
                        newcg->cg_frotor = 0;
-               if (cg->cg_irotor >= 0 && cg->cg_irotor < fs->fs_ipg)
+               if (cg->cg_irotor < fs->fs_ipg)
                        newcg->cg_irotor = cg->cg_irotor;
                else
                        newcg->cg_irotor = 0;
Index: sbin/fsck_ffs/suj.c
===================================================================
--- sbin/fsck_ffs/suj.c (revision 243557)
+++ sbin/fsck_ffs/suj.c (working copy)
@@ -314,7 +314,7 @@
 static struct suj_blk *
 blk_lookup(ufs2_daddr_t blk, int creat)
 {
-       struct suj_blk *sblk;
+       struct suj_blk *sjblk;
        struct suj_cg *sc;
        struct blkhd *hd;
 
@@ -322,18 +322,18 @@
        if (sc->sc_lastblk && sc->sc_lastblk->sb_blk == blk)
                return (sc->sc_lastblk);
        hd = &sc->sc_blkhash[SUJ_HASH(fragstoblks(fs, blk))];
-       LIST_FOREACH(sblk, hd, sb_next)
-               if (sblk->sb_blk == blk)
-                       return (sblk);
+       LIST_FOREACH(sjblk, hd, sb_next)
+               if (sjblk->sb_blk == blk)
+                       return (sjblk);
        if (creat == 0)
                return (NULL);
-       sblk = errmalloc(sizeof(*sblk));
-       bzero(sblk, sizeof(*sblk));
-       sblk->sb_blk = blk;
-       TAILQ_INIT(&sblk->sb_recs);
-       LIST_INSERT_HEAD(hd, sblk, sb_next);
+       sjblk = errmalloc(sizeof(*sjblk));
+       bzero(sjblk, sizeof(*sjblk));
+       sjblk->sb_blk = blk;
+       TAILQ_INIT(&sjblk->sb_recs);
+       LIST_INSERT_HEAD(hd, sjblk, sb_next);
 
-       return (sblk);
+       return (sjblk);
 }
 
 static struct data_blk *
@@ -529,7 +529,7 @@
 static int
 blk_freemask(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t lbn, int frags)
 {
-       struct suj_blk *sblk;
+       struct suj_blk *sjblk;
        struct suj_rec *srec;
        struct jblkrec *brec;
        int mask;
@@ -543,11 +543,11 @@
         * the block has already been freed and re-used for another purpose.
         */
        mask = 0;
-       sblk = blk_lookup(blknum(fs, blk), 0);
-       if (sblk == NULL)
+       sjblk = blk_lookup(blknum(fs, blk), 0);
+       if (sjblk == NULL)
                return (0);
-       off = blk - sblk->sb_blk;
-       TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) {
+       off = blk - sjblk->sb_blk;
+       TAILQ_FOREACH(srec, &sjblk->sb_recs, sr_next) {
                brec = (struct jblkrec *)srec->sr_rec;
                /*
                 * If the block overlaps but does not match
@@ -563,8 +563,8 @@
                        blk_setmask(brec, &mask);
        }
        if (debug)
-               printf("blk_freemask: blk %jd sblk %jd off %d mask 0x%X\n",
-                   blk, sblk->sb_blk, off, mask);
+               printf("blk_freemask: blk %jd sjblk %jd off %d mask 0x%X\n",
+                   blk, sjblk->sb_blk, off, mask);
        return (mask >> off);
 }
 
@@ -582,15 +582,15 @@
 static int
 blk_isindir(ufs2_daddr_t blk, ino_t ino, ufs_lbn_t lbn)
 {
-       struct suj_blk *sblk;
+       struct suj_blk *sjblk;
        struct jblkrec *brec;
 
-       sblk = blk_lookup(blk, 0);
-       if (sblk == NULL)
+       sjblk = blk_lookup(blk, 0);
+       if (sjblk == NULL)
                return (1);
-       if (TAILQ_EMPTY(&sblk->sb_recs))
+       if (TAILQ_EMPTY(&sjblk->sb_recs))
                return (1);
-       brec = (struct jblkrec *)TAILQ_LAST(&sblk->sb_recs, srechd)->sr_rec;
+       brec = (struct jblkrec *)TAILQ_LAST(&sjblk->sb_recs, srechd)->sr_rec;
        if (blk_equals(brec, ino, lbn, blk, fs->fs_frag))
                if (brec->jb_op == JOP_FREEBLK)
                        return (!blk_isfree(blk));
@@ -1077,7 +1077,8 @@
  */
 ufs_lbn_t visitlbn;
 static void
-null_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
+null_visit(ino_t ino __unused, ufs_lbn_t lbn, ufs2_daddr_t blk __unused,
+    int frags __unused)
 {
        if (lbn > 0)
                visitlbn = lbn;
@@ -1693,7 +1694,7 @@
  * a free completed.
  */
 static void
-blk_check(struct suj_blk *sblk)
+blk_check(struct suj_blk *sjblk)
 {
        struct suj_rec *srec;
        struct jblkrec *brec;
@@ -1708,7 +1709,7 @@
         * block.  As a result we must evaluate each record individually.
         */
        sino = NULL;
-       TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) {
+       TAILQ_FOREACH(srec, &sjblk->sb_recs, sr_next) {
                brec = (struct jblkrec *)srec->sr_rec;
                frags = brec->jb_frags;
                blk = brec->jb_blkno + brec->jb_oldfrags;
@@ -1810,13 +1811,13 @@
 static void
 cg_check_blk(struct suj_cg *sc)
 {
-       struct suj_blk *sblk;
+       struct suj_blk *sjblk;
        int i;
 
 
        for (i = 0; i < SUJ_HASHSIZE; i++)
-               LIST_FOREACH(sblk, &sc->sc_blkhash[i], sb_next)
-                       blk_check(sblk);
+               LIST_FOREACH(sjblk, &sc->sc_blkhash[i], sb_next)
+                       blk_check(sjblk);
 }
 
 /*
@@ -2174,7 +2175,7 @@
 blk_build(struct jblkrec *blkrec)
 {
        struct suj_rec *srec;
-       struct suj_blk *sblk;
+       struct suj_blk *sjblk;
        struct jblkrec *blkrn;
        ufs2_daddr_t blk;
        int frag;
@@ -2187,7 +2188,7 @@
 
        blk = blknum(fs, blkrec->jb_blkno);
        frag = fragnum(fs, blkrec->jb_blkno);
-       sblk = blk_lookup(blk, 1);
+       sjblk = blk_lookup(blk, 1);
        /*
         * Rewrite the record using oldfrags to indicate the offset into
         * the block.  Leave jb_frags as the actual allocated count.
@@ -2203,7 +2204,7 @@
         * later stages but also eliminates free records which are used
         * to indicate that the contents of indirects can be trusted.
         */
-       TAILQ_FOREACH(srec, &sblk->sb_recs, sr_next) {
+       TAILQ_FOREACH(srec, &sjblk->sb_recs, sr_next) {
                blkrn = (struct jblkrec *)srec->sr_rec;
                if (blkrn->jb_ino != blkrec->jb_ino ||
                    blkrn->jb_lbn != blkrec->jb_lbn ||
@@ -2216,13 +2217,13 @@
                /* Discard the free which is a dup with an alloc. */
                if (blkrec->jb_op == JOP_FREEBLK)
                        return;
-               TAILQ_REMOVE(&sblk->sb_recs, srec, sr_next);
+               TAILQ_REMOVE(&sjblk->sb_recs, srec, sr_next);
                free(srec);
                break;
        }
        srec = errmalloc(sizeof(*srec));
        srec->sr_rec = (union jrec *)blkrec;
-       TAILQ_INSERT_TAIL(&sblk->sb_recs, srec, sr_next);
+       TAILQ_INSERT_TAIL(&sjblk->sb_recs, srec, sr_next);
 }
 
 static void
@@ -2520,7 +2521,8 @@
  * buffer and segments may span mutliple contiguous blocks.
  */
 static void
-suj_add_block(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
+suj_add_block(ino_t ino __unused, ufs_lbn_t lbn __unused, ufs2_daddr_t blk 
__unused,
+    int frags)
 {
 
        jblocks_add(suj_jblocks, fsbtodb(fs, blk), fsbtodb(fs, frags));
@@ -2629,7 +2631,8 @@
  * Search a directory block for the SUJ_FILE.
  */
 static void
-suj_find(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
+suj_find(ino_t ino __unused, ufs_lbn_t lbn __unused, ufs2_daddr_t blk,
+    int frags)
 {
        char block[MAXBSIZE];
        struct direct *dp;


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to