Kill __P(), ANSIfy and WARNS=2

This commit is contained in:
xtraeme 2005-01-19 17:33:58 +00:00
parent 442b6cb908
commit 52781d1897
13 changed files with 184 additions and 302 deletions

View File

@ -1,8 +1,9 @@
# $NetBSD: Makefile,v 1.26 2005/01/13 19:56:02 christos Exp $
# $NetBSD: Makefile,v 1.27 2005/01/19 17:33:58 xtraeme Exp $
# @(#)Makefile 8.2 (Berkeley) 4/27/95
.include <bsd.own.mk>
WARNS= 2
PROG= fsck_ffs
MAN= fsck_ffs.8
SRCS= dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \

View File

@ -1,4 +1,4 @@
/* $NetBSD: dir.c,v 1.41 2004/10/08 17:29:29 dbj Exp $ */
/* $NetBSD: dir.c,v 1.42 2005/01/19 17:33:58 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)dir.c 8.8 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: dir.c,v 1.41 2004/10/08 17:29:29 dbj Exp $");
__RCSID("$NetBSD: dir.c,v 1.42 2005/01/19 17:33:58 xtraeme Exp $");
#endif
#endif /* not lint */
@ -67,22 +67,21 @@ struct odirtemplate odirhead = {
0, DIRBLKSIZ - 12, 2, ".."
};
static int chgino __P((struct inodesc *));
static int dircheck __P((struct inodesc *, struct direct *));
static int expanddir __P((union dinode *, char *));
static void freedir __P((ino_t, ino_t));
static struct direct *fsck_readdir __P((struct inodesc *));
static struct bufarea *getdirblk __P((daddr_t, long));
static int lftempname __P((char *, ino_t));
static int mkentry __P((struct inodesc *));
void reparent __P((ino_t, ino_t));
static int chgino (struct inodesc *);
static int dircheck (struct inodesc *, struct direct *);
static int expanddir (union dinode *, char *);
static void freedir (ino_t, ino_t);
static struct direct *fsck_readdir (struct inodesc *);
static struct bufarea *getdirblk (daddr_t, long);
static int lftempname (char *, ino_t);
static int mkentry (struct inodesc *);
void reparent (ino_t, ino_t);
/*
* Propagate connected state through the tree.
*/
void
propagate(inumber)
ino_t inumber;
propagate(ino_t inumber)
{
struct inoinfo *inp;
@ -116,8 +115,7 @@ propagate(inumber)
}
void
reparent(inumber, parent)
ino_t inumber, parent;
reparent(ino_t inumber, ino_t parent)
{
struct inoinfo *inp, *pinp;
@ -133,8 +131,7 @@ reparent(inumber, parent)
* Scan each entry in a directory block.
*/
int
dirscan(idesc)
struct inodesc *idesc;
dirscan(struct inodesc *idesc)
{
struct direct *dp;
struct bufarea *bp;
@ -230,8 +227,7 @@ dirscan(idesc)
* get next entry in a directory.
*/
static struct direct *
fsck_readdir(idesc)
struct inodesc *idesc;
fsck_readdir(struct inodesc *idesc)
{
struct direct *dp, *ndp;
struct bufarea *bp;
@ -296,9 +292,7 @@ dpok:
* This is a superset of the checks made in the kernel.
*/
static int
dircheck(idesc, dp)
struct inodesc *idesc;
struct direct *dp;
dircheck(struct inodesc *idesc, struct direct *dp)
{
int size;
char *cp;
@ -339,18 +333,14 @@ dircheck(idesc, dp)
}
void
direrror(ino, errmesg)
ino_t ino;
char *errmesg;
direrror(ino_t ino, char *errmesg)
{
fileerror(ino, ino, errmesg);
}
void
fileerror(cwd, ino, errmesg)
ino_t cwd, ino;
char *errmesg;
fileerror(ino_t cwd, ino_t ino, char *errmesg)
{
union dinode *dp;
char pathbuf[MAXPATHLEN + 1];
@ -375,9 +365,7 @@ fileerror(cwd, ino, errmesg)
}
void
adjust(idesc, lcnt)
struct inodesc *idesc;
short lcnt;
adjust(struct inodesc *idesc, int lcnt)
{
union dinode *dp;
int16_t nlink;
@ -438,8 +426,7 @@ adjust(idesc, lcnt)
}
static int
mkentry(idesc)
struct inodesc *idesc;
mkentry(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
struct direct newent;
@ -486,8 +473,7 @@ mkentry(idesc)
}
static int
chgino(idesc)
struct inodesc *idesc;
chgino(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@ -502,10 +488,7 @@ chgino(idesc)
}
int
linkup(orphan, parentdir, name)
ino_t orphan;
ino_t parentdir;
char *name;
linkup(ino_t orphan, ino_t parentdir, char *name)
{
union dinode *dp;
int lostdir;
@ -632,10 +615,7 @@ linkup(orphan, parentdir, name)
* fix an entry in a directory.
*/
int
changeino(dir, name, newnum)
ino_t dir;
char *name;
ino_t newnum;
changeino(ino_t dir, char *name, ino_t newnum)
{
struct inodesc idesc;
@ -653,9 +633,7 @@ changeino(dir, name, newnum)
* make an entry in a directory
*/
int
makeentry(parent, ino, name)
ino_t parent, ino;
char *name;
makeentry(ino_t parent, ino_t ino, char *name)
{
union dinode *dp;
struct inodesc idesc;
@ -690,9 +668,7 @@ makeentry(parent, ino, name)
* Attempt to expand the size of a directory
*/
static int
expanddir(dp, name)
union dinode *dp;
char *name;
expanddir(union dinode *dp, char *name)
{
daddr_t lastbn, newblk, dirblk;
struct bufarea *bp;
@ -780,9 +756,7 @@ bad:
* allocate a new directory
*/
ino_t
allocdir(parent, request, mode)
ino_t parent, request;
int mode;
allocdir(ino_t parent, ino_t request, int mode)
{
ino_t ino;
char *cp;
@ -853,8 +827,7 @@ allocdir(parent, request, mode)
* free a directory inode
*/
static void
freedir(ino, parent)
ino_t ino, parent;
freedir(ino_t ino, ino_t parent)
{
union dinode *dp;
@ -870,9 +843,7 @@ freedir(ino, parent)
* generate a temporary name for the lost+found directory.
*/
static int
lftempname(bufp, ino)
char *bufp;
ino_t ino;
lftempname(char *bufp, ino_t ino)
{
ino_t in;
char *cp;
@ -897,9 +868,7 @@ lftempname(bufp, ino)
* Insure that it is held until another is requested.
*/
static struct bufarea *
getdirblk(blkno, size)
daddr_t blkno;
long size;
getdirblk(daddr_t blkno, long size)
{
if (pdirbp != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.19 2004/01/09 19:12:31 dbj Exp $ */
/* $NetBSD: extern.h,v 1.20 2005/01/19 17:33:58 xtraeme Exp $ */
/*
* Copyright (c) 1994 James A. Jegers
@ -24,65 +24,65 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void adjust __P((struct inodesc *, int));
daddr_t allocblk __P((long));
ino_t allocdir __P((ino_t, ino_t, int));
ino_t allocino __P((ino_t request, int type));
void blkerror __P((ino_t, char *, daddr_t));
int bread __P((int, char *, daddr_t, long));
void bufinit __P((void));
void bwrite __P((int, char *, daddr_t, long));
void cacheino __P((union dinode *, ino_t));
void catch __P((int));
void catchquit __P((int));
int changeino __P((ino_t, char *, ino_t));
int chkrange __P((daddr_t, int));
void ckfini __P((void));
int ckinode __P((union dinode *, struct inodesc *));
int clearentry __P((struct inodesc *));
void clri __P((struct inodesc *, char *, int));
int cmpsblks __P((const struct fs *, struct fs *));
int cmpsblks42 __P((const struct fs *, struct fs *));
int cmpsblks44 __P((const struct fs *, struct fs *));
union dinode * getnextinode __P((ino_t));
void direrror __P((ino_t, char *));
int dirscan __P((struct inodesc *));
int dofix __P((struct inodesc *, char *));
void fileerror __P((ino_t, ino_t, char *));
int findino __P((struct inodesc *));
int findname __P((struct inodesc *));
void flush __P((int, struct bufarea *));
void freeblk __P((daddr_t, long));
void freeino __P((ino_t));
void freeinodebuf __P((void));
int ftypeok __P((union dinode *));
void getblk __P((struct bufarea *, daddr_t, long));
struct bufarea *getdatablk __P((daddr_t, long));
struct inoinfo *getinoinfo __P((ino_t));
union dinode *ginode __P((ino_t));
void getpathname __P((char *, size_t, ino_t, ino_t));
void infohandler __P((int sig));
void inocleanup __P((void));
void inodirty __P((void));
struct inostat *inoinfo __P((ino_t));
int linkup __P((ino_t, ino_t, char *));
int makeentry __P((ino_t, ino_t, char *));
void pass1 __P((void));
void pass1b __P((void));
int pass1check __P((struct inodesc *));
void pass2 __P((void));
void pass3 __P((void));
void pass4 __P((void));
int pass4check __P((struct inodesc *));
void pass5 __P((void));
void pinode __P((ino_t));
void propagate __P((ino_t));
int reply __P((char *));
void setinodebuf __P((ino_t));
int setup __P((const char *));
void voidquit __P((int));
void adjust (struct inodesc *, int);
daddr_t allocblk (long);
ino_t allocdir (ino_t, ino_t, int);
ino_t allocino (ino_t request, int type);
void blkerror (ino_t, char *, daddr_t);
int bread (int, char *, daddr_t, long);
void bufinit (void);
void bwrite (int, char *, daddr_t, long);
void cacheino (union dinode *, ino_t);
void catch (int);
void catchquit (int);
int changeino (ino_t, char *, ino_t);
int chkrange (daddr_t, int);
void ckfini (void);
int ckinode (union dinode *, struct inodesc *);
int clearentry (struct inodesc *);
void clri (struct inodesc *, char *, int);
int cmpsblks (const struct fs *, struct fs *);
int cmpsblks42 (const struct fs *, struct fs *);
int cmpsblks44 (const struct fs *, struct fs *);
union dinode * getnextinode (ino_t);
void direrror (ino_t, char *);
int dirscan (struct inodesc *);
int dofix (struct inodesc *, char *);
void fileerror (ino_t, ino_t, char *);
int findino (struct inodesc *);
int findname (struct inodesc *);
void flush (int, struct bufarea *);
void freeblk (daddr_t, long);
void freeino (ino_t);
void freeinodebuf (void);
int ftypeok (union dinode *);
void getblk (struct bufarea *, daddr_t, long);
struct bufarea *getdatablk (daddr_t, long);
struct inoinfo *getinoinfo (ino_t);
union dinode *ginode (ino_t);
void getpathname (char *, size_t, ino_t, ino_t);
void infohandler (int sig);
void inocleanup (void);
void inodirty (void);
struct inostat *inoinfo (ino_t);
int linkup (ino_t, ino_t, char *);
int makeentry (ino_t, ino_t, char *);
void pass1 (void);
void pass1b (void);
int pass1check (struct inodesc *);
void pass2 (void);
void pass3 (void);
void pass4 (void);
int pass4check (struct inodesc *);
void pass5 (void);
void pinode (ino_t);
void propagate (ino_t);
int reply (char *);
void setinodebuf (ino_t);
int setup (const char *);
void voidquit (int);
void swap_cg __P((struct cg *, struct cg *));
void copyback_cg __P((struct bufarea *));
void swap_cg (struct cg *, struct cg *);
void copyback_cg (struct bufarea *);
void sb_oldfscompat_write(struct fs *, struct fs *);
void sb_oldfscompat_read(struct fs *, struct fs **);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fsck.h,v 1.41 2005/01/13 19:56:02 christos Exp $ */
/* $NetBSD: fsck.h,v 1.42 2005/01/19 17:33:58 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -165,7 +165,7 @@ enum fixstate {DONTKNOW, NOFIX, FIX, IGNORE};
struct inodesc {
enum fixstate id_fix; /* policy on fixing errors */
int (*id_func) /* function to be applied to blocks of inode */
__P((struct inodesc *));
(struct inodesc *);
ino_t id_number; /* inode number described */
ino_t id_parent; /* for DATA nodes, their parent */
daddr_t id_blkno; /* current block number being examined */
@ -305,9 +305,9 @@ struct ufs2_dinode ufs2_zino;
#define EEXIT 8 /* Standard error exit. */
/* some inline functs to help the byte-swapping mess */
static __inline u_int16_t iswap16 __P((u_int16_t));
static __inline u_int32_t iswap32 __P((u_int32_t));
static __inline u_int64_t iswap64 __P((u_int64_t));
static __inline u_int16_t iswap16 (u_int16_t);
static __inline u_int32_t iswap32 (u_int32_t);
static __inline u_int64_t iswap64 (u_int64_t);
static __inline u_int16_t iswap16(x)
u_int16_t x;

View File

@ -1,4 +1,4 @@
/* $NetBSD: inode.c,v 1.49 2004/10/08 17:33:52 dbj Exp $ */
/* $NetBSD: inode.c,v 1.50 2005/01/19 17:33:58 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: inode.c,v 1.49 2004/10/08 17:33:52 dbj Exp $");
__RCSID("$NetBSD: inode.c,v 1.50 2005/01/19 17:33:58 xtraeme Exp $");
#endif
#endif /* not lint */
@ -62,14 +62,12 @@ __RCSID("$NetBSD: inode.c,v 1.49 2004/10/08 17:33:52 dbj Exp $");
static ino_t startinum;
static int iblock __P((struct inodesc *, long, u_int64_t));
static int iblock (struct inodesc *, long, u_int64_t);
static void swap_dinode1(union dinode *, int);
static void swap_dinode2(union dinode *, int);
int
ckinode(dp, idesc)
union dinode *dp;
struct inodesc *idesc;
ckinode(union dinode *dp, struct inodesc *idesc)
{
int ret, offset, i;
union dinode dino;
@ -174,13 +172,10 @@ ckinode(dp, idesc)
}
static int
iblock(idesc, ilevel, isize)
struct inodesc *idesc;
long ilevel;
u_int64_t isize;
iblock(struct inodesc *idesc, long ilevel, u_int64_t isize)
{
struct bufarea *bp;
int i, n, (*func) __P((struct inodesc *)), nif;
int i, n, (*func) (struct inodesc *), nif;
u_int64_t sizepb;
char buf[BUFSIZ];
char pathbuf[MAXPATHLEN + 1];
@ -277,9 +272,7 @@ iblock(idesc, ilevel, isize)
* Return 0 if in range, 1 if out of range.
*/
int
chkrange(blk, cnt)
daddr_t blk;
int cnt;
chkrange(daddr_t blk, int cnt)
{
int c;
@ -324,8 +317,7 @@ chkrange(blk, cnt)
* General purpose interface for reading inodes.
*/
union dinode *
ginode(inumber)
ino_t inumber;
ginode(ino_t inumber)
{
daddr_t iblk;
int blkoff;
@ -395,8 +387,7 @@ long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize;
union dinode *inodebuf;
union dinode *
getnextinode(inumber)
ino_t inumber;
getnextinode(ino_t inumber)
{
long size;
daddr_t dblk;
@ -435,8 +426,7 @@ getnextinode(inumber)
}
void
setinodebuf(inum)
ino_t inum;
setinodebuf(ino_t inum)
{
if (inum % sblock->fs_ipg != 0)
@ -466,7 +456,7 @@ setinodebuf(inum)
}
void
freeinodebuf()
freeinodebuf(void)
{
if (inodebuf != NULL)
@ -482,9 +472,7 @@ freeinodebuf()
* Enter inodes into the cache.
*/
void
cacheino(dp, inumber)
union dinode *dp;
ino_t inumber;
cacheino(union dinode *dp, ino_t inumber)
{
struct inoinfo *inp;
struct inoinfo **inpp, **ninpsort;
@ -533,8 +521,7 @@ cacheino(dp, inumber)
* Look up an inode cache structure.
*/
struct inoinfo *
getinoinfo(inumber)
ino_t inumber;
getinoinfo(ino_t inumber)
{
struct inoinfo *inp;
@ -551,7 +538,7 @@ getinoinfo(inumber)
* Clean up all the inode cache structure.
*/
void
inocleanup()
inocleanup(void)
{
struct inoinfo **inpp;
@ -565,17 +552,14 @@ inocleanup()
}
void
inodirty()
inodirty(void)
{
dirty(pbp);
}
void
clri(idesc, type, flag)
struct inodesc *idesc;
char *type;
int flag;
clri(struct inodesc *idesc, char *type, int flag)
{
union dinode *dp;
@ -598,8 +582,7 @@ clri(idesc, type, flag)
}
int
findname(idesc)
struct inodesc *idesc;
findname(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@ -612,8 +595,7 @@ findname(idesc)
}
int
findino(idesc)
struct inodesc *idesc;
findino(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@ -628,8 +610,7 @@ findino(idesc)
}
int
clearentry(idesc)
struct inodesc *idesc;
clearentry(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@ -642,8 +623,7 @@ clearentry(idesc)
}
void
pinode(ino)
ino_t ino;
pinode(ino_t ino)
{
union dinode *dp;
char *p;
@ -671,10 +651,7 @@ pinode(ino)
}
void
blkerror(ino, type, blk)
ino_t ino;
char *type;
daddr_t blk;
blkerror(ino_t ino, char *type, daddr_t blk)
{
struct inostat *info;
@ -705,9 +682,7 @@ blkerror(ino, type, blk)
* allocate an unused inode
*/
ino_t
allocino(request, type)
ino_t request;
int type;
allocino(ino_t request, int type)
{
ino_t ino;
union dinode *dp;
@ -816,8 +791,7 @@ allocino(request, type)
* deallocate an inode
*/
void
freeino(ino)
ino_t ino;
freeino(ino_t ino)
{
struct inodesc idesc;
union dinode *dp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.55 2005/01/19 16:42:14 wiz Exp $ */
/* $NetBSD: main.c,v 1.56 2005/01/19 17:33:58 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
#else
__RCSID("$NetBSD: main.c,v 1.55 2005/01/19 16:42:14 wiz Exp $");
__RCSID("$NetBSD: main.c,v 1.56 2005/01/19 17:33:58 xtraeme Exp $");
#endif
#endif /* not lint */
@ -70,16 +70,12 @@ __RCSID("$NetBSD: main.c,v 1.55 2005/01/19 16:42:14 wiz Exp $");
int returntosingle;
int progress = 0;
int main __P((int, char *[]));
static int argtoi __P((int, char *, char *, int));
static int checkfilesys __P((const char *, char *, long, int));
static void usage __P((void));
static int argtoi (int, char *, char *, int);
static int checkfilesys (const char *, char *, long, int);
static void usage (void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
struct rlimit r;
int ch;
@ -208,10 +204,7 @@ main(argc, argv)
}
static int
argtoi(flag, req, str, base)
int flag;
char *req, *str;
int base;
argtoi(int flag, char *req, char *str, int base)
{
char *cp;
int ret;
@ -227,11 +220,7 @@ argtoi(flag, req, str, base)
*/
/* ARGSUSED */
static int
checkfilesys(filesys, mntpt, auxdata, child)
const char *filesys;
char *mntpt;
long auxdata;
int child;
checkfilesys(const char *filesys, char *mntpt, long auxdata, int child)
{
daddr_t n_ffree, n_bfree;
struct dups *dp;
@ -449,7 +438,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
}
static void
usage()
usage(void)
{
(void) fprintf(stderr,

View File

@ -1,4 +1,4 @@
/* $NetBSD: pass1.c,v 1.34 2005/01/13 19:56:02 christos Exp $ */
/* $NetBSD: pass1.c,v 1.35 2005/01/19 17:33:58 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: pass1.c,v 1.34 2005/01/13 19:56:02 christos Exp $");
__RCSID("$NetBSD: pass1.c,v 1.35 2005/01/19 17:33:58 xtraeme Exp $");
#endif
#endif /* not lint */
@ -59,11 +59,11 @@ __RCSID("$NetBSD: pass1.c,v 1.34 2005/01/13 19:56:02 christos Exp $");
static daddr_t badblk;
static daddr_t dupblk;
static void checkinode __P((ino_t, struct inodesc *));
static void checkinode (ino_t, struct inodesc *);
static ino_t lastino;
void
pass1()
pass1(void)
{
ino_t inumber, inosused;
int c;
@ -205,9 +205,7 @@ pass1()
}
static void
checkinode(inumber, idesc)
ino_t inumber;
struct inodesc *idesc;
checkinode(ino_t inumber, struct inodesc *idesc)
{
union dinode *dp;
struct zlncnt *zlnp;
@ -432,8 +430,7 @@ unknown:
}
int
pass1check(idesc)
struct inodesc *idesc;
pass1check(struct inodesc *idesc)
{
int res = KEEPON;
int anyout, nfrags;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pass1b.c,v 1.19 2005/01/13 19:56:02 christos Exp $ */
/* $NetBSD: pass1b.c,v 1.20 2005/01/19 17:33:58 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1b.c 8.4 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: pass1b.c,v 1.19 2005/01/13 19:56:02 christos Exp $");
__RCSID("$NetBSD: pass1b.c,v 1.20 2005/01/19 17:33:58 xtraeme Exp $");
#endif
#endif /* not lint */
@ -51,10 +51,10 @@ __RCSID("$NetBSD: pass1b.c,v 1.19 2005/01/13 19:56:02 christos Exp $");
#include "fsutil.h"
static struct dups *duphead;
static int pass1bcheck __P((struct inodesc *));
static int pass1bcheck (struct inodesc *);
void
pass1b()
pass1b(void)
{
int c, i;
union dinode *dp;
@ -95,8 +95,7 @@ pass1b()
}
static int
pass1bcheck(idesc)
struct inodesc *idesc;
pass1bcheck(struct inodesc *idesc)
{
struct dups *dlp;
int nfrags, res = KEEPON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pass2.c,v 1.39 2005/01/13 19:56:02 christos Exp $ */
/* $NetBSD: pass2.c,v 1.40 2005/01/19 17:33:59 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass2.c 8.9 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: pass2.c,v 1.39 2005/01/13 19:56:02 christos Exp $");
__RCSID("$NetBSD: pass2.c,v 1.40 2005/01/19 17:33:59 xtraeme Exp $");
#endif
#endif /* not lint */
@ -56,11 +56,11 @@ __RCSID("$NetBSD: pass2.c,v 1.39 2005/01/13 19:56:02 christos Exp $");
#define MINDIRSIZE (sizeof (struct dirtemplate))
static int blksort __P((const void *, const void *));
static int pass2check __P((struct inodesc *));
static int blksort (const void *, const void *);
static int pass2check (struct inodesc *);
void
pass2()
pass2(void)
{
union dinode *dp;
struct inoinfo **inpp, *inp, *pinp;
@ -315,8 +315,7 @@ pass2()
}
static int
pass2check(idesc)
struct inodesc *idesc;
pass2check(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
struct inoinfo *inp;
@ -607,8 +606,7 @@ again:
* Routine to sort disk blocks.
*/
static int
blksort(arg1, arg2)
const void *arg1, *arg2;
blksort(const void *arg1, const void *arg2)
{
return ((*(struct inoinfo **)arg1)->i_blks[0] -

View File

@ -1,4 +1,4 @@
/* $NetBSD: pass4.c,v 1.20 2005/01/13 19:56:02 christos Exp $ */
/* $NetBSD: pass4.c,v 1.21 2005/01/19 17:33:59 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass4.c 8.4 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: pass4.c,v 1.20 2005/01/13 19:56:02 christos Exp $");
__RCSID("$NetBSD: pass4.c,v 1.21 2005/01/19 17:33:59 xtraeme Exp $");
#endif
#endif /* not lint */
@ -53,7 +53,7 @@ __RCSID("$NetBSD: pass4.c,v 1.20 2005/01/13 19:56:02 christos Exp $");
#include "extern.h"
void
pass4()
pass4(void)
{
ino_t inumber;
struct zlncnt *zlnp;
@ -136,8 +136,7 @@ pass4()
}
int
pass4check(idesc)
struct inodesc *idesc;
pass4check(struct inodesc *idesc)
{
struct dups *dlp;
int nfrags, res = KEEPON;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pass5.c,v 1.43 2005/01/13 19:56:02 christos Exp $ */
/* $NetBSD: pass5.c,v 1.44 2005/01/19 17:33:59 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass5.c 8.9 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: pass5.c,v 1.43 2005/01/13 19:56:02 christos Exp $");
__RCSID("$NetBSD: pass5.c,v 1.44 2005/01/19 17:33:59 xtraeme Exp $");
#endif
#endif /* not lint */
@ -54,7 +54,7 @@ __RCSID("$NetBSD: pass5.c,v 1.43 2005/01/13 19:56:02 christos Exp $");
#include "fsck.h"
#include "extern.h"
void print_bmap __P((u_char *,u_int32_t));
void print_bmap (u_char *,u_int32_t);
void
pass5(void)
@ -499,9 +499,7 @@ pass5(void)
}
void
print_bmap(map, size)
u_char *map;
u_int32_t size;
print_bmap(u_char *map, u_int32_t size)
{
int i, j;

View File

@ -1,4 +1,4 @@
/* $NetBSD: setup.c,v 1.74 2004/10/29 19:02:17 dsl Exp $ */
/* $NetBSD: setup.c,v 1.75 2005/01/19 17:33:59 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95";
#else
__RCSID("$NetBSD: setup.c,v 1.74 2004/10/29 19:02:17 dsl Exp $");
__RCSID("$NetBSD: setup.c,v 1.75 2005/01/19 17:33:59 xtraeme Exp $");
#endif
#endif /* not lint */
@ -80,8 +80,7 @@ int16_t sblkpostbl[256];
* is already clean (preen mode only).
*/
int
setup(dev)
const char *dev;
setup(const char *dev)
{
long cg, size, asked, i, j;
long bmapsize;
@ -495,7 +494,7 @@ badsblabel:
}
static int
readappleufs()
readappleufs(void)
{
daddr_t label = APPLEUFS_LABEL_OFFSET / dev_bsize;
struct appleufslabel *appleufs;
@ -639,8 +638,7 @@ static off_t sblock_try[] = SBLOCKSEARCH;
* Read in the super block and its summary info.
*/
static int
readsb(listerr)
int listerr;
readsb(int listerr)
{
daddr_t super;
struct fs *fs;
@ -907,9 +905,7 @@ cmpsblks44(const struct fs *sb, struct fs *asb)
static void
badsb(listerr, s)
int listerr;
char *s;
badsb(int listerr, char *s)
{
if (!listerr)
@ -926,10 +922,7 @@ badsb(listerr, s)
* their needed information is available!
*/
static int
calcsb(dev, devfd, fs)
const char *dev;
int devfd;
struct fs *fs;
calcsb(const char *dev, int devfd, struct fs *fs)
{
struct disklabel *lp;
struct partition *pp;
@ -984,9 +977,7 @@ calcsb(dev, devfd, fs)
}
static struct disklabel *
getdisklabel(s, fd)
const char *s;
int fd;
getdisklabel(const char *s, int fd)
{
static struct disklabel lab;
@ -1000,9 +991,7 @@ getdisklabel(s, fd)
}
static struct partition *
getdisklabelpart(dev, lp)
const char *dev;
struct disklabel *lp;
getdisklabelpart(const char *dev, struct disklabel *lp)
{
char *cp;
int c;

View File

@ -1,4 +1,4 @@
/* $NetBSD: utilities.c,v 1.47 2004/06/12 01:35:46 mycroft Exp $ */
/* $NetBSD: utilities.c,v 1.48 2005/01/19 17:33:59 xtraeme Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95";
#else
__RCSID("$NetBSD: utilities.c,v 1.47 2004/06/12 01:35:46 mycroft Exp $");
__RCSID("$NetBSD: utilities.c,v 1.48 2005/01/19 17:33:59 xtraeme Exp $");
#endif
#endif /* not lint */
@ -61,13 +61,12 @@ __RCSID("$NetBSD: utilities.c,v 1.47 2004/06/12 01:35:46 mycroft Exp $");
long diskreads, totalreads; /* Disk cache statistics */
static void rwerror __P((char *, daddr_t));
static void rwerror (char *, daddr_t);
extern int returntosingle;
int
ftypeok(dp)
union dinode *dp;
ftypeok(union dinode *dp)
{
switch (iswap16(DIP(dp, mode)) & IFMT) {
@ -88,8 +87,7 @@ ftypeok(dp)
}
int
reply(question)
char *question;
reply(char *question)
{
int persevere;
char c;
@ -129,7 +127,7 @@ reply(question)
* Malloc buffers and set up cache.
*/
void
bufinit()
bufinit(void)
{
struct bufarea *bp;
long bufcnt, i;
@ -172,9 +170,7 @@ bufinit()
* Manage a cache of directory blocks.
*/
struct bufarea *
getdatablk(blkno, size)
daddr_t blkno;
long size;
getdatablk(daddr_t blkno, long size)
{
struct bufarea *bp;
@ -200,10 +196,7 @@ foundit:
}
void
getblk(bp, blk, size)
struct bufarea *bp;
daddr_t blk;
long size;
getblk(struct bufarea *bp, daddr_t blk, long size)
{
daddr_t dblk;
@ -219,9 +212,7 @@ getblk(bp, blk, size)
}
void
flush(fd, bp)
int fd;
struct bufarea *bp;
flush(int fd, struct bufarea *bp)
{
int i, j;
struct csum *ccsp;
@ -252,9 +243,7 @@ flush(fd, bp)
}
static void
rwerror(mesg, blk)
char *mesg;
daddr_t blk;
rwerror(char *mesg, daddr_t blk)
{
if (preen == 0)
@ -265,7 +254,7 @@ rwerror(mesg, blk)
}
void
ckfini()
ckfini(void)
{
struct bufarea *bp, *nbp;
int ofsmodified, cnt = 0;
@ -331,11 +320,7 @@ ckfini()
}
int
bread(fd, buf, blk, size)
int fd;
char *buf;
daddr_t blk;
long size;
bread(int fd, char *buf, daddr_t blk, long size)
{
char *cp;
int i, errs;
@ -366,11 +351,7 @@ bread(fd, buf, blk, size)
}
void
bwrite(fd, buf, blk, size)
int fd;
char *buf;
daddr_t blk;
long size;
bwrite(int fd, char *buf, daddr_t blk, long size)
{
int i;
char *cp;
@ -397,8 +378,7 @@ bwrite(fd, buf, blk, size)
* allocate a data block with the specified number of fragments
*/
daddr_t
allocblk(frags)
long frags;
allocblk(long frags)
{
int i, j, k, cg, baseblk;
struct cg *cgp = cgrp;
@ -445,9 +425,7 @@ allocblk(frags)
* Free a previously allocated block
*/
void
freeblk(blkno, frags)
daddr_t blkno;
long frags;
freeblk(daddr_t blkno, long frags)
{
struct inodesc idesc;
@ -460,10 +438,7 @@ freeblk(blkno, frags)
* Find a pathname
*/
void
getpathname(namebuf, namebuflen, curdir, ino)
char *namebuf;
size_t namebuflen;
ino_t curdir, ino;
getpathname(char *namebuf, size_t namebuflen, ino_t curdir, ino_t ino)
{
int len;
char *cp;
@ -518,8 +493,7 @@ getpathname(namebuf, namebuflen, curdir, ino)
}
void
catch(sig)
int sig;
catch(int sig)
{
if (!doinglevel2) {
markclean = 0;
@ -534,8 +508,7 @@ catch(sig)
* so that reboot sequence may be interrupted.
*/
void
catchquit(sig)
int sig;
catchquit(int sig)
{
int errsave = errno;
@ -550,8 +523,7 @@ catchquit(sig)
* Used by child processes in preen.
*/
void
voidquit(sig)
int sig;
voidquit(int sig)
{
int errsave = errno;
@ -565,9 +537,7 @@ voidquit(sig)
* determine whether an inode should be fixed.
*/
int
dofix(idesc, msg)
struct inodesc *idesc;
char *msg;
dofix(struct inodesc *idesc, char *msg)
{
switch (idesc->id_fix) {
@ -604,8 +574,7 @@ dofix(idesc, msg)
}
void
copyback_cg(blk)
struct bufarea *blk;
copyback_cg(struct bufarea *blk)
{
memcpy(blk->b_un.b_cg, cgrp, sblock->fs_cgsize);