summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-03-20 22:57:10 +0000
committerimp <imp@FreeBSD.org>2002-03-20 22:57:10 +0000
commit120c3c211a8089f3738404796935729d10069e44 (patch)
treeb0afc6442896204ba707723c961e59b4de37a932 /sbin/fsck_ffs
parent90c76cbe1ef31e40c4b9b9cd46731d2716307ef0 (diff)
downloadFreeBSD-src-120c3c211a8089f3738404796935729d10069e44.zip
FreeBSD-src-120c3c211a8089f3738404796935729d10069e44.tar.gz
o __P removed
o ansi function prototypes o unifdef -D__STDC__ o __dead2 on usage prototype o remove now-bogus main prototype
Diffstat (limited to 'sbin/fsck_ffs')
-rw-r--r--sbin/fsck_ffs/dir.c79
-rw-r--r--sbin/fsck_ffs/fsck.h128
-rw-r--r--sbin/fsck_ffs/fsutil.c98
-rw-r--r--sbin/fsck_ffs/inode.c66
-rw-r--r--sbin/fsck_ffs/main.c26
-rw-r--r--sbin/fsck_ffs/pass1.c11
-rw-r--r--sbin/fsck_ffs/pass1b.c7
-rw-r--r--sbin/fsck_ffs/pass2.c12
-rw-r--r--sbin/fsck_ffs/pass3.c2
-rw-r--r--sbin/fsck_ffs/pass4.c5
-rw-r--r--sbin/fsck_ffs/pass5.c25
-rw-r--r--sbin/fsck_ffs/preen.c25
-rw-r--r--sbin/fsck_ffs/setup.c27
-rw-r--r--sbin/fsck_ffs/utilities.c6
14 files changed, 181 insertions, 336 deletions
diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c
index 3599c2e..84c8f02 100644
--- a/sbin/fsck_ffs/dir.c
+++ b/sbin/fsck_ffs/dir.c
@@ -67,20 +67,20 @@ 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((struct dinode *dp, char *name));
-static void freedir __P((ino_t ino, ino_t parent));
-static struct direct *fsck_readdir __P((struct inodesc *));
-static struct bufarea *getdirblk __P((ufs_daddr_t blkno, long size));
-static int lftempname __P((char *bufp, ino_t ino));
-static int mkentry __P((struct inodesc *));
+static int chgino(struct inodesc *);
+static int dircheck(struct inodesc *, struct direct *);
+static int expanddir(struct dinode *dp, char *name);
+static void freedir(ino_t ino, ino_t parent);
+static struct direct *fsck_readdir(struct inodesc *);
+static struct bufarea *getdirblk(ufs_daddr_t blkno, long size);
+static int lftempname(char *bufp, ino_t ino);
+static int mkentry(struct inodesc *);
/*
* Propagate connected state through the tree.
*/
void
-propagate()
+propagate(void)
{
struct inoinfo **inpp, *inp;
struct inoinfo **inpend;
@@ -106,8 +106,7 @@ propagate()
* Scan each entry in a directory block.
*/
int
-dirscan(idesc)
- struct inodesc *idesc;
+dirscan(struct inodesc *idesc)
{
struct direct *dp;
struct bufarea *bp;
@@ -170,8 +169,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;
@@ -232,9 +230,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;
@@ -281,18 +277,14 @@ bad:
}
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)
{
struct dinode *dp;
char pathbuf[MAXPATHLEN + 1];
@@ -314,9 +306,7 @@ fileerror(cwd, ino, errmesg)
}
void
-adjust(idesc, lcnt)
- struct inodesc *idesc;
- int lcnt;
+adjust(struct inodesc *idesc, int lcnt)
{
struct dinode *dp;
int saveresolved;
@@ -384,8 +374,7 @@ adjust(idesc, lcnt)
}
static int
-mkentry(idesc)
- struct inodesc *idesc;
+mkentry(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
struct direct newent;
@@ -429,8 +418,7 @@ mkentry(idesc)
}
static int
-chgino(idesc)
- struct inodesc *idesc;
+chgino(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@@ -445,10 +433,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)
{
struct dinode *dp;
int lostdir;
@@ -567,10 +552,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;
@@ -588,9 +570,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)
{
struct dinode *dp;
struct inodesc idesc;
@@ -624,9 +604,7 @@ makeentry(parent, ino, name)
* Attempt to expand the size of a directory
*/
static int
-expanddir(dp, name)
- struct dinode *dp;
- char *name;
+expanddir(struct dinode *dp, char *name)
{
ufs_daddr_t lastbn, newblk;
struct bufarea *bp;
@@ -681,9 +659,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;
@@ -742,8 +718,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)
{
struct dinode *dp;
@@ -759,9 +734,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;
@@ -786,9 +759,7 @@ lftempname(bufp, ino)
* Insure that it is held until another is requested.
*/
static struct bufarea *
-getdirblk(blkno, size)
- ufs_daddr_t blkno;
- long size;
+getdirblk(ufs_daddr_t blkno, long size)
{
if (pdirbp != 0)
diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h
index f9905b1..f220026 100644
--- a/sbin/fsck_ffs/fsck.h
+++ b/sbin/fsck_ffs/fsck.h
@@ -257,67 +257,67 @@ struct dinode zino;
struct fstab;
-void adjust __P((struct inodesc *, int lcnt));
-ufs_daddr_t allocblk __P((long frags));
-ino_t allocdir __P((ino_t parent, ino_t request, int mode));
-ino_t allocino __P((ino_t request, int type));
-void blkerror __P((ino_t ino, char *type, ufs_daddr_t blk));
-char *blockcheck __P((char *name));
-int bread __P((int fd, char *buf, ufs_daddr_t blk, long size));
-void bufinit __P((void));
-void bwrite __P((int fd, char *buf, ufs_daddr_t blk, long size));
-void cacheino __P((struct dinode *dp, ino_t inumber));
-void catch __P((int));
-void catchquit __P((int));
-int changeino __P((ino_t dir, char *name, ino_t newnum));
-int chkrange __P((ufs_daddr_t blk, int cnt));
-void ckfini __P((int markclean));
-int ckinode __P((struct dinode *dp, struct inodesc *));
-void clri __P((struct inodesc *, char *type, int flag));
-int clearentry __P((struct inodesc *));
-void direrror __P((ino_t ino, char *errmesg));
-int dirscan __P((struct inodesc *));
-int dofix __P((struct inodesc *, char *msg));
-void ffs_clrblock __P((struct fs *, u_char *, ufs_daddr_t));
-void ffs_fragacct __P((struct fs *, int, int32_t [], int));
-int ffs_isblock __P((struct fs *, u_char *, ufs_daddr_t));
-void ffs_setblock __P((struct fs *, u_char *, ufs_daddr_t));
-void fileerror __P((ino_t cwd, ino_t ino, char *errmesg));
-int findino __P((struct inodesc *));
-int findname __P((struct inodesc *));
-void flush __P((int fd, struct bufarea *bp));
-void freeblk __P((ufs_daddr_t blkno, long frags));
-void freeino __P((ino_t ino));
-void freeinodebuf __P((void));
-int ftypeok __P((struct dinode *dp));
-void getblk __P((struct bufarea *bp, ufs_daddr_t blk, long size));
-struct bufarea *getdatablk __P((ufs_daddr_t blkno, long size));
-struct inoinfo *getinoinfo __P((ino_t inumber));
-struct dinode *getnextinode __P((ino_t inumber));
-void getpathname __P((char *namebuf, ino_t curdir, ino_t ino));
-struct dinode *ginode __P((ino_t inumber));
-void infohandler __P((int sig));
-void inocleanup __P((void));
-void inodirty __P((void));
-struct inostat *inoinfo __P((ino_t inum));
-int linkup __P((ino_t orphan, ino_t parentdir, char *name));
-int makeentry __P((ino_t parent, ino_t ino, char *name));
-void panic __P((const char *fmt, ...)) __printflike(1, 2);
-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 pfatal __P((const char *fmt, ...)) __printflike(1, 2);
-void pinode __P((ino_t ino));
-void propagate __P((void));
-void pwarn __P((const char *fmt, ...)) __printflike(1, 2);
-int readsb __P((int listerr));
-int reply __P((char *question));
-void rwerror __P((char *mesg, ufs_daddr_t blk));
-void sblock_init __P((void));
-void setinodebuf __P((ino_t));
-int setup __P((char *dev));
+void adjust(struct inodesc *, int lcnt);
+ufs_daddr_t allocblk(long frags);
+ino_t allocdir(ino_t parent, ino_t request, int mode);
+ino_t allocino(ino_t request, int type);
+void blkerror(ino_t ino, char *type, ufs_daddr_t blk);
+char *blockcheck(char *name);
+int bread(int fd, char *buf, ufs_daddr_t blk, long size);
+void bufinit(void);
+void bwrite(int fd, char *buf, ufs_daddr_t blk, long size);
+void cacheino(struct dinode *dp, ino_t inumber);
+void catch(int);
+void catchquit(int);
+int changeino(ino_t dir, char *name, ino_t newnum);
+int chkrange(ufs_daddr_t blk, int cnt);
+void ckfini(int markclean);
+int ckinode(struct dinode *dp, struct inodesc *);
+void clri(struct inodesc *, char *type, int flag);
+int clearentry(struct inodesc *);
+void direrror(ino_t ino, char *errmesg);
+int dirscan(struct inodesc *);
+int dofix(struct inodesc *, char *msg);
+void ffs_clrblock(struct fs *, u_char *, ufs_daddr_t);
+void ffs_fragacct(struct fs *, int, int32_t [], int);
+int ffs_isblock(struct fs *, u_char *, ufs_daddr_t);
+void ffs_setblock(struct fs *, u_char *, ufs_daddr_t);
+void fileerror(ino_t cwd, ino_t ino, char *errmesg);
+int findino(struct inodesc *);
+int findname(struct inodesc *);
+void flush(int fd, struct bufarea *bp);
+void freeblk(ufs_daddr_t blkno, long frags);
+void freeino(ino_t ino);
+void freeinodebuf(void);
+int ftypeok(struct dinode *dp);
+void getblk(struct bufarea *bp, ufs_daddr_t blk, long size);
+struct bufarea *getdatablk(ufs_daddr_t blkno, long size);
+struct inoinfo *getinoinfo(ino_t inumber);
+struct dinode *getnextinode(ino_t inumber);
+void getpathname(char *namebuf, ino_t curdir, ino_t ino);
+struct dinode *ginode(ino_t inumber);
+void infohandler(int sig);
+void inocleanup(void);
+void inodirty(void);
+struct inostat *inoinfo(ino_t inum);
+int linkup(ino_t orphan, ino_t parentdir, char *name);
+int makeentry(ino_t parent, ino_t ino, char *name);
+void panic(const char *fmt, ...) __printflike(1, 2);
+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 pfatal(const char *fmt, ...) __printflike(1, 2);
+void pinode(ino_t ino);
+void propagate(void);
+void pwarn(const char *fmt, ...) __printflike(1, 2);
+int readsb(int listerr);
+int reply(char *question);
+void rwerror(char *mesg, ufs_daddr_t blk);
+void sblock_init(void);
+void setinodebuf(ino_t);
+int setup(char *dev);
diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c
index 1067693..2595b16 100644
--- a/sbin/fsck_ffs/fsutil.c
+++ b/sbin/fsck_ffs/fsutil.c
@@ -62,8 +62,7 @@ static const char rcsid[] =
long diskreads, totalreads; /* Disk cache statistics */
int
-ftypeok(dp)
- struct dinode *dp;
+ftypeok(struct dinode *dp)
{
switch (dp->di_mode & IFMT) {
@@ -84,8 +83,7 @@ ftypeok(dp)
}
int
-reply(question)
- char *question;
+reply(char *question)
{
int persevere;
char c;
@@ -125,8 +123,7 @@ reply(question)
* Look up state information for an inode.
*/
struct inostat *
-inoinfo(inum)
- ino_t inum;
+inoinfo(ino_t inum)
{
static struct inostat unallocated = { USTATE, 0, 0 };
struct inostatlist *ilp;
@@ -145,7 +142,7 @@ inoinfo(inum)
* Malloc buffers and set up cache.
*/
void
-bufinit()
+bufinit(void)
{
struct bufarea *bp;
long bufcnt, i;
@@ -183,9 +180,7 @@ bufinit()
* Manage a cache of directory blocks.
*/
struct bufarea *
-getdatablk(blkno, size)
- ufs_daddr_t blkno;
- long size;
+getdatablk(ufs_daddr_t blkno, long size)
{
struct bufarea *bp;
@@ -212,10 +207,7 @@ foundit:
}
void
-getblk(bp, blk, size)
- struct bufarea *bp;
- ufs_daddr_t blk;
- long size;
+getblk(struct bufarea *bp, ufs_daddr_t blk, long size)
{
ufs_daddr_t dblk;
@@ -230,9 +222,7 @@ getblk(bp, blk, size)
}
void
-flush(fd, bp)
- int fd;
- struct bufarea *bp;
+flush(int fd, struct bufarea *bp)
{
int i, j;
@@ -260,9 +250,7 @@ flush(fd, bp)
}
void
-rwerror(mesg, blk)
- char *mesg;
- ufs_daddr_t blk;
+rwerror(char *mesg, ufs_daddr_t blk)
{
if (bkgrdcheck)
@@ -275,8 +263,7 @@ rwerror(mesg, blk)
}
void
-ckfini(markclean)
- int markclean;
+ckfini(int markclean)
{
struct bufarea *bp, *nbp;
int ofsmodified, cnt = 0;
@@ -348,11 +335,7 @@ ckfini(markclean)
}
int
-bread(fd, buf, blk, size)
- int fd;
- char *buf;
- ufs_daddr_t blk;
- long size;
+bread(int fd, char *buf, ufs_daddr_t blk, long size)
{
char *cp;
int i, errs;
@@ -389,11 +372,7 @@ bread(fd, buf, blk, size)
}
void
-bwrite(fd, buf, blk, size)
- int fd;
- char *buf;
- ufs_daddr_t blk;
- long size;
+bwrite(int fd, char *buf, ufs_daddr_t blk, long size)
{
int i;
char *cp;
@@ -427,8 +406,7 @@ bwrite(fd, buf, blk, size)
* allocate a data block with the specified number of fragments
*/
ufs_daddr_t
-allocblk(frags)
- long frags;
+allocblk(long frags)
{
int i, j, k, cg, baseblk;
struct cg *cgp = &cgrp;
@@ -471,9 +449,7 @@ allocblk(frags)
* Free a previously allocated block
*/
void
-freeblk(blkno, frags)
- ufs_daddr_t blkno;
- long frags;
+freeblk(ufs_daddr_t blkno, long frags)
{
struct inodesc idesc;
@@ -486,9 +462,7 @@ freeblk(blkno, frags)
* Find a pathname
*/
void
-getpathname(namebuf, curdir, ino)
- char *namebuf;
- ino_t curdir, ino;
+getpathname(char *namebuf, ino_t curdir, ino_t ino)
{
int len;
char *cp;
@@ -543,8 +517,7 @@ getpathname(namebuf, curdir, ino)
}
void
-catch(sig)
- int sig;
+catch(int sig)
{
if (!doinglevel2)
ckfini(0);
@@ -557,8 +530,7 @@ catch(sig)
* so that reboot sequence may be interrupted.
*/
void
-catchquit(sig)
- int sig;
+catchquit(int sig)
{
printf("returning to single-user after filesystem check\n");
returntosingle = 1;
@@ -569,9 +541,7 @@ catchquit(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) {
@@ -607,11 +577,7 @@ dofix(idesc, msg)
return (0);
}
-#if __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
/*
* An unexpected inconsistency occured.
@@ -619,20 +585,10 @@ dofix(idesc, msg)
* otherwise just print message and continue.
*/
void
-#if __STDC__
pfatal(const char *fmt, ...)
-#else
-pfatal(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
if (!preen) {
(void)vfprintf(stdout, fmt, ap);
va_end(ap);
@@ -680,20 +636,10 @@ pfatal(fmt, va_alist)
* protocol, or a warning (preceded by filename) when preening.
*/
void
-#if __STDC__
pwarn(const char *fmt, ...)
-#else
-pwarn(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
if (preen)
(void)fprintf(stdout, "%s: ", cdevname);
(void)vfprintf(stdout, fmt, ap);
@@ -704,20 +650,10 @@ pwarn(fmt, va_alist)
* Stub for routines from kernel.
*/
void
-#if __STDC__
panic(const char *fmt, ...)
-#else
-panic(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
pfatal("INTERNAL INCONSISTENCY:");
(void)vfprintf(stdout, fmt, ap);
va_end(ap);
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index c1713d5..a30591b 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -55,12 +55,10 @@ static const char rcsid[] =
static ino_t startinum;
-static int iblock __P((struct inodesc *, long ilevel, quad_t isize));
+static int iblock(struct inodesc *, long ilevel, quad_t isize);
int
-ckinode(dp, idesc)
- struct dinode *dp;
- struct inodesc *idesc;
+ckinode(struct dinode *dp, struct inodesc *idesc)
{
ufs_daddr_t *ap;
int ret;
@@ -152,10 +150,7 @@ ckinode(dp, idesc)
}
static int
-iblock(idesc, ilevel, isize)
- struct inodesc *idesc;
- long ilevel;
- quad_t isize;
+iblock(struct inodesc *idesc, long ilevel, quad_t isize)
{
ufs_daddr_t *ap;
ufs_daddr_t *aplim;
@@ -242,9 +237,7 @@ iblock(idesc, ilevel, isize)
* Return 0 if in range, 1 if out of range.
*/
int
-chkrange(blk, cnt)
- ufs_daddr_t blk;
- int cnt;
+chkrange(ufs_daddr_t blk, int cnt)
{
int c;
@@ -288,8 +281,7 @@ chkrange(blk, cnt)
* General purpose interface for reading inodes.
*/
struct dinode *
-ginode(inumber)
- ino_t inumber;
+ginode(ino_t inumber)
{
ufs_daddr_t iblk;
@@ -315,8 +307,7 @@ static long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize;
static struct dinode *inodebuf;
struct dinode *
-getnextinode(inumber)
- ino_t inumber;
+getnextinode(ino_t inumber)
{
long size;
ufs_daddr_t dblk;
@@ -345,8 +336,7 @@ getnextinode(inumber)
}
void
-setinodebuf(inum)
- ino_t inum;
+setinodebuf(ino_t inum)
{
if (inum % sblock.fs_ipg != 0)
@@ -374,7 +364,7 @@ setinodebuf(inum)
}
void
-freeinodebuf()
+freeinodebuf(void)
{
if (inodebuf != NULL)
@@ -390,9 +380,7 @@ freeinodebuf()
* Enter inodes into the cache.
*/
void
-cacheino(dp, inumber)
- struct dinode *dp;
- ino_t inumber;
+cacheino(struct dinode *dp, ino_t inumber)
{
struct inoinfo *inp;
struct inoinfo **inpp;
@@ -428,8 +416,7 @@ cacheino(dp, inumber)
* Look up an inode cache structure.
*/
struct inoinfo *
-getinoinfo(inumber)
- ino_t inumber;
+getinoinfo(ino_t inumber)
{
struct inoinfo *inp;
@@ -446,7 +433,7 @@ getinoinfo(inumber)
* Clean up all the inode cache structure.
*/
void
-inocleanup()
+inocleanup(void)
{
struct inoinfo **inpp;
@@ -460,17 +447,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)
{
struct dinode *dp;
@@ -503,8 +487,7 @@ clri(idesc, type, flag)
}
int
-findname(idesc)
- struct inodesc *idesc;
+findname(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@@ -517,8 +500,7 @@ findname(idesc)
}
int
-findino(idesc)
- struct inodesc *idesc;
+findino(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@@ -533,8 +515,7 @@ findino(idesc)
}
int
-clearentry(idesc)
- struct inodesc *idesc;
+clearentry(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
@@ -547,8 +528,7 @@ clearentry(idesc)
}
void
-pinode(ino)
- ino_t ino;
+pinode(ino_t ino)
{
struct dinode *dp;
char *p;
@@ -574,10 +554,7 @@ pinode(ino)
}
void
-blkerror(ino, type, blk)
- ino_t ino;
- char *type;
- ufs_daddr_t blk;
+blkerror(ino_t ino, char *type, ufs_daddr_t blk)
{
pfatal("%ld %s I=%lu", (long)blk, type, (u_long)ino);
@@ -606,9 +583,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;
struct dinode *dp;
@@ -667,8 +642,7 @@ allocino(request, type)
* deallocate an inode
*/
void
-freeino(ino)
- ino_t ino;
+freeino(ino_t ino)
{
struct inodesc idesc;
struct dinode *dp;
diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c
index 59b09d8..6b25aa0 100644
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
@@ -65,16 +65,13 @@ static const char rcsid[] =
#include "fsck.h"
-static void usage __P((void));
-static int argtoi __P((int flag, char *req, char *str, int base));
-static int checkfilesys __P((char *filesys));
-static struct statfs *getmntpt __P((const char *));
-int main __P((int argc, char *argv[]));
+static void usage(void) __dead2;
+static int argtoi(int flag, char *req, char *str, int base);
+static int checkfilesys(char *filesys);
+static struct statfs *getmntpt(const char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
struct rlimit rlimit;
@@ -164,10 +161,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;
@@ -183,8 +177,7 @@ argtoi(flag, req, str, base)
*/
/* ARGSUSED */
static int
-checkfilesys(filesys)
- char *filesys;
+checkfilesys(char *filesys)
{
ufs_daddr_t n_ffree, n_bfree;
struct ufs_args args;
@@ -464,8 +457,7 @@ checkfilesys(filesys)
* Get the mount point information for name.
*/
static struct statfs *
-getmntpt(name)
- const char *name;
+getmntpt(const char *name)
{
struct stat devstat, mntdevstat;
char device[sizeof(_PATH_DEV) - 1 + MNAMELEN];
@@ -502,7 +494,7 @@ getmntpt(name)
}
static void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c
index 58dfc47..e3fd6ea 100644
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
@@ -56,10 +56,10 @@ static ufs_daddr_t badblk;
static ufs_daddr_t dupblk;
static ino_t lastino; /* last inode in use */
-static void checkinode __P((ino_t inumber, struct inodesc *));
+static void checkinode(ino_t inumber, struct inodesc *);
void
-pass1()
+pass1(void)
{
u_int8_t *cp;
ino_t inumber;
@@ -178,9 +178,7 @@ pass1()
}
static void
-checkinode(inumber, idesc)
- ino_t inumber;
- struct inodesc *idesc;
+checkinode(ino_t inumber, struct inodesc *idesc)
{
struct dinode *dp;
struct zlncnt *zlnp;
@@ -374,8 +372,7 @@ unknown:
}
int
-pass1check(idesc)
- struct inodesc *idesc;
+pass1check(struct inodesc *idesc)
{
int res = KEEPON;
int anyout, nfrags;
diff --git a/sbin/fsck_ffs/pass1b.c b/sbin/fsck_ffs/pass1b.c
index 5aecb92..dbb401b 100644
--- a/sbin/fsck_ffs/pass1b.c
+++ b/sbin/fsck_ffs/pass1b.c
@@ -49,10 +49,10 @@ static const char rcsid[] =
#include "fsck.h"
static struct dups *duphead;
-static int pass1bcheck __P((struct inodesc *));
+static int pass1bcheck(struct inodesc *);
void
-pass1b()
+pass1b(void)
{
int c, i;
struct dinode *dp;
@@ -86,8 +86,7 @@ pass1b()
}
static int
-pass1bcheck(idesc)
- struct inodesc *idesc;
+pass1bcheck(struct inodesc *idesc)
{
struct dups *dlp;
int nfrags, res = KEEPON;
diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c
index b46c3e1..838dcb7 100644
--- a/sbin/fsck_ffs/pass2.c
+++ b/sbin/fsck_ffs/pass2.c
@@ -52,11 +52,11 @@ static const char rcsid[] =
#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)
{
struct dinode *dp;
struct inoinfo **inpp, *inp;
@@ -220,8 +220,7 @@ pass2()
}
static int
-pass2check(idesc)
- struct inodesc *idesc;
+pass2check(struct inodesc *idesc)
{
struct direct *dirp = idesc->id_dirp;
struct inoinfo *inp;
@@ -488,8 +487,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] -
diff --git a/sbin/fsck_ffs/pass3.c b/sbin/fsck_ffs/pass3.c
index 0cc0722..f9bbfa7 100644
--- a/sbin/fsck_ffs/pass3.c
+++ b/sbin/fsck_ffs/pass3.c
@@ -50,7 +50,7 @@ static const char rcsid[] =
#include "fsck.h"
void
-pass3()
+pass3(void)
{
struct inoinfo *inp;
int loopcnt, inpindex, state;
diff --git a/sbin/fsck_ffs/pass4.c b/sbin/fsck_ffs/pass4.c
index c6f0aff..6683ae4 100644
--- a/sbin/fsck_ffs/pass4.c
+++ b/sbin/fsck_ffs/pass4.c
@@ -50,7 +50,7 @@ static const char rcsid[] =
#include "fsck.h"
void
-pass4()
+pass4(void)
{
ino_t inumber;
struct zlncnt *zlnp;
@@ -121,8 +121,7 @@ pass4()
}
int
-pass4check(idesc)
- struct inodesc *idesc;
+pass4check(struct inodesc *idesc)
{
struct dups *dlp;
int nfrags, res = KEEPON;
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 5102673..e927ff5 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -50,11 +50,10 @@ static const char rcsid[] =
#include "fsck.h"
-static void check_maps __P((u_char *, u_char *, int, int, char *, int *,
- int, int));
+static void check_maps(u_char *, u_char *, int, int, char *, int *, int, int);
void
-pass5()
+pass5(void)
{
int c, blk, frags, basesize, sumsize, mapsize, savednrpos = 0;
int inomapsize, blkmapsize;
@@ -363,21 +362,21 @@ pass5()
}
static void
-check_maps(map1, map2, mapsize, startvalue, name, opcode, skip, limit)
- u_char *map1; /* map of claimed allocations */
- u_char *map2; /* map of determined allocations */
- int mapsize; /* size of above two maps */
- int startvalue; /* resource value for first element in map */
- char *name; /* name of resource found in maps */
- int *opcode; /* sysctl opcode to free resource */
- int skip; /* number of entries to skip before starting to free */
- int limit; /* limit on number of entries to free */
+check_maps(
+ u_char *map1, /* map of claimed allocations */
+ u_char *map2, /* map of determined allocations */
+ int mapsize, /* size of above two maps */
+ int startvalue, /* resource value for first element in map */
+ char *name, /* name of resource found in maps */
+ int *opcode, /* sysctl opcode to free resource */
+ int skip, /* number of entries to skip before starting to free */
+ int limit) /* limit on number of entries to free */
{
# define BUFSIZE 16
char buf[BUFSIZE];
long i, j, k, l, m, n, size;
int astart, aend, ustart, uend;
- void (*msg) __P((const char *fmt, ...));
+ void (*msg)(const char *fmt, ...);
if (bkgrdflag)
msg = pfatal;
diff --git a/sbin/fsck_ffs/preen.c b/sbin/fsck_ffs/preen.c
index 84ad2a2..371d344 100644
--- a/sbin/fsck_ffs/preen.c
+++ b/sbin/fsck_ffs/preen.c
@@ -69,17 +69,13 @@ struct disk {
int nrun, ndisks;
-static void addpart __P((char *name, char *fsname, long auxdata));
-static struct disk *finddisk __P((char *name));
-static int startdisk __P((struct disk *dk,
- int (*checkit)(char *, char *, long, int)));
+static void addpart(char *name, char *fsname, long auxdata);
+static struct disk *finddisk(char *name);
+static int startdisk(struct disk *dk,int (*checkit)(char *, char *, long, int));
int
-checkfstab(preen, maxrun, docheck, chkit)
- int preen;
- int maxrun;
- int (*docheck)(struct fstab *);
- int (*chkit)(char *, char *, long, int);
+checkfstab(int preen, int maxrun, int (*docheck)(struct fstab *),
+ int (*chkit)(char *, char *, long, int))
{
struct fstab *fsp;
struct disk *dk, *nextdisk;
@@ -202,8 +198,7 @@ checkfstab(preen, maxrun, docheck, chkit)
}
static struct disk *
-finddisk(name)
- char *name;
+finddisk(char *name)
{
struct disk *dk, **dkp;
char *p;
@@ -240,9 +235,7 @@ finddisk(name)
}
static void
-addpart(name, fsname, auxdata)
- char *name, *fsname;
- long auxdata;
+addpart(char *name, char *fsname, long auxdata)
{
struct disk *dk = finddisk(name);
struct part *pt, **ppt = &dk->part;
@@ -272,9 +265,7 @@ addpart(name, fsname, auxdata)
}
static int
-startdisk(dk, checkit)
- struct disk *dk;
- int (*checkit)(char *, char *, long, int);
+startdisk(struct disk *dk, int (*checkit)(char *, char *, long, int))
{
struct part *pt = dk->part;
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c
index a33c976..529945a 100644
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
@@ -60,9 +60,9 @@ struct bufarea asblk;
#define altsblock (*asblk.b_un.b_fs)
#define POWEROF2(num) (((num) & ((num) - 1)) == 0)
-static void badsb __P((int listerr, char *s));
-static int calcsb __P((char *dev, int devfd, struct fs *fs));
-static struct disklabel *getdisklabel __P((char *s, int fd));
+static void badsb(int listerr, char *s);
+static int calcsb(char *dev, int devfd, struct fs *fs);
+static struct disklabel *getdisklabel(char *s, int fd);
/*
* Read in a superblock finding an alternate if necessary.
@@ -70,8 +70,7 @@ static struct disklabel *getdisklabel __P((char *s, int fd));
* is already clean (preen mode only).
*/
int
-setup(dev)
- char *dev;
+setup(char *dev)
{
long cg, asked, i, j;
long bmapsize;
@@ -360,8 +359,7 @@ badsb:
* Read in the super block and its summary info.
*/
int
-readsb(listerr)
- int listerr;
+readsb(int listerr)
{
ufs_daddr_t super = bflag ? bflag : SBOFF / dev_bsize;
@@ -468,9 +466,7 @@ readsb(listerr)
}
static void
-badsb(listerr, s)
- int listerr;
- char *s;
+badsb(int listerr, char *s)
{
if (!listerr)
@@ -481,7 +477,7 @@ badsb(listerr, s)
}
void
-sblock_init()
+sblock_init(void)
{
struct disklabel *lp;
@@ -507,10 +503,7 @@ sblock_init()
* their needed information is available!
*/
static int
-calcsb(dev, devfd, fs)
- char *dev;
- int devfd;
- struct fs *fs;
+calcsb(char *dev, int devfd, struct fs *fs)
{
struct disklabel *lp;
struct partition *pp;
@@ -568,9 +561,7 @@ calcsb(dev, devfd, fs)
}
static struct disklabel *
-getdisklabel(s, fd)
- char *s;
- int fd;
+getdisklabel(char *s, int fd)
{
static struct disklabel lab;
diff --git a/sbin/fsck_ffs/utilities.c b/sbin/fsck_ffs/utilities.c
index 2d7b23f..8c57c44 100644
--- a/sbin/fsck_ffs/utilities.c
+++ b/sbin/fsck_ffs/utilities.c
@@ -61,8 +61,7 @@ static const char rcsid[] =
char *
-blockcheck(origname)
- char *origname;
+blockcheck(char *origname)
{
struct stat stblock;
char *newname, *cp;
@@ -114,8 +113,7 @@ retry:
}
void
-infohandler(sig)
- int sig;
+infohandler(int sig)
{
got_siginfo = 1;
}
OpenPOWER on IntegriCloud