Kill __P(), ANSIfy, remove main() prototype; WARNS=2
This commit is contained in:
parent
a31e08fdfc
commit
ccde05f070
@ -1,8 +1,9 @@
|
||||
# $NetBSD: Makefile,v 1.9 2002/08/19 10:16:53 lukem Exp $
|
||||
# $NetBSD: Makefile,v 1.10 2005/01/19 19:31:28 xtraeme Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/5/93
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
WARNS= 2
|
||||
PROG= fsck_ext2fs
|
||||
MAN= fsck_ext2fs.8
|
||||
SRCS= dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dir.c,v 1.11 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: dir.c,v 1.12 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dir.c 8.5 (Berkeley) 12/8/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: dir.c,v 1.11 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: dir.c,v 1.12 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -93,19 +93,19 @@ struct ext2fs_dirtemplate dirhead = {
|
||||
};
|
||||
#undef DIRBLKSIZ
|
||||
|
||||
static int expanddir __P((struct ext2fs_dinode *, char *));
|
||||
static void freedir __P((ino_t, ino_t));
|
||||
static struct ext2fs_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 *));
|
||||
static int chgino __P((struct inodesc *));
|
||||
static int expanddir(struct ext2fs_dinode *, char *);
|
||||
static void freedir(ino_t, ino_t);
|
||||
static struct ext2fs_direct *fsck_readdir(struct inodesc *);
|
||||
static struct bufarea *getdirblk(daddr_t, long);
|
||||
static int lftempname(char *, ino_t);
|
||||
static int mkentry(struct inodesc *);
|
||||
static int chgino(struct inodesc *);
|
||||
|
||||
/*
|
||||
* Propagate connected state through the tree.
|
||||
*/
|
||||
void
|
||||
propagate()
|
||||
propagate(void)
|
||||
{
|
||||
struct inoinfo **inpp, *inp, *pinp;
|
||||
struct inoinfo **inpend;
|
||||
@ -141,8 +141,7 @@ propagate()
|
||||
* Scan each entry in a directory block.
|
||||
*/
|
||||
int
|
||||
dirscan(idesc)
|
||||
struct inodesc *idesc;
|
||||
dirscan(struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_direct *dp;
|
||||
struct bufarea *bp;
|
||||
@ -190,8 +189,7 @@ dirscan(idesc)
|
||||
* get next entry in a directory.
|
||||
*/
|
||||
static struct ext2fs_direct *
|
||||
fsck_readdir(idesc)
|
||||
struct inodesc *idesc;
|
||||
fsck_readdir(struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_direct *dp, *ndp;
|
||||
struct bufarea *bp;
|
||||
@ -252,9 +250,7 @@ dpok:
|
||||
* This is a superset of the checks made in the kernel.
|
||||
*/
|
||||
int
|
||||
dircheck(idesc, dp)
|
||||
struct inodesc *idesc;
|
||||
struct ext2fs_direct *dp;
|
||||
dircheck(struct inodesc *idesc, struct ext2fs_direct *dp)
|
||||
{
|
||||
int size;
|
||||
char *cp;
|
||||
@ -285,18 +281,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)
|
||||
{
|
||||
struct ext2fs_dinode *dp;
|
||||
char pathbuf[MAXPATHLEN + 1];
|
||||
@ -318,9 +310,7 @@ fileerror(cwd, ino, errmesg)
|
||||
}
|
||||
|
||||
void
|
||||
adjust(idesc, lcnt)
|
||||
struct inodesc *idesc;
|
||||
short lcnt;
|
||||
adjust(struct inodesc *idesc, short lcnt)
|
||||
{
|
||||
struct ext2fs_dinode *dp;
|
||||
|
||||
@ -349,8 +339,7 @@ adjust(idesc, lcnt)
|
||||
}
|
||||
|
||||
static int
|
||||
mkentry(idesc)
|
||||
struct inodesc *idesc;
|
||||
mkentry(struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_direct *dirp = idesc->id_dirp;
|
||||
struct ext2fs_direct newent;
|
||||
@ -379,8 +368,7 @@ mkentry(idesc)
|
||||
}
|
||||
|
||||
static int
|
||||
chgino(idesc)
|
||||
struct inodesc *idesc;
|
||||
chgino(struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_direct *dirp = idesc->id_dirp;
|
||||
u_int16_t namlen = dirp->e2d_namlen;
|
||||
@ -398,9 +386,7 @@ chgino(idesc)
|
||||
}
|
||||
|
||||
int
|
||||
linkup(orphan, parentdir)
|
||||
ino_t orphan;
|
||||
ino_t parentdir;
|
||||
linkup(ino_t orphan, ino_t parentdir)
|
||||
{
|
||||
struct ext2fs_dinode *dp;
|
||||
int lostdir;
|
||||
@ -505,10 +491,7 @@ linkup(orphan, parentdir)
|
||||
* 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;
|
||||
|
||||
@ -526,9 +509,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 ext2fs_dinode *dp;
|
||||
struct inodesc idesc;
|
||||
@ -564,9 +545,7 @@ makeentry(parent, ino, name)
|
||||
* Attempt to expand the size of a directory
|
||||
*/
|
||||
static int
|
||||
expanddir(dp, name)
|
||||
struct ext2fs_dinode *dp;
|
||||
char *name;
|
||||
expanddir(struct ext2fs_dinode *dp, char *name)
|
||||
{
|
||||
daddr_t lastbn, newblk;
|
||||
struct bufarea *bp;
|
||||
@ -624,9 +603,7 @@ bad:
|
||||
* allocate a new directory
|
||||
*/
|
||||
int
|
||||
allocdir(parent, request, mode)
|
||||
ino_t parent, request;
|
||||
int mode;
|
||||
allocdir(ino_t parent, ino_t request, int mode)
|
||||
{
|
||||
ino_t ino;
|
||||
struct ext2fs_dinode *dp;
|
||||
@ -686,8 +663,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 ext2fs_dinode *dp;
|
||||
|
||||
@ -703,9 +679,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;
|
||||
@ -730,9 +704,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)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: extern.h,v 1.3 2003/07/13 08:22:55 itojun Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.4 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Manuel Bouyer.
|
||||
@ -25,51 +25,51 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
void adjust __P((struct inodesc *, short));
|
||||
int allocblk __P((void));
|
||||
int allocdir __P((ino_t, ino_t, int));
|
||||
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((struct ext2fs_dinode *, ino_t));
|
||||
int changeino __P((ino_t, char *, ino_t));
|
||||
void adjust(struct inodesc *, short);
|
||||
int allocblk(void);
|
||||
int allocdir(ino_t, ino_t, int);
|
||||
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(struct ext2fs_dinode *, ino_t);
|
||||
int changeino(ino_t, char *, ino_t);
|
||||
struct fstab;
|
||||
int chkrange __P((daddr_t, int));
|
||||
void ckfini __P((int));
|
||||
int ckinode __P((struct ext2fs_dinode *, struct inodesc *));
|
||||
void clri __P((struct inodesc *, char *, int));
|
||||
int dircheck __P((struct inodesc *, struct ext2fs_direct *));
|
||||
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));
|
||||
void freeino __P((ino_t));
|
||||
void freeinodebuf __P((void));
|
||||
int ftypeok __P((struct ext2fs_dinode *));
|
||||
void getpathname __P((char *, size_t, ino_t, ino_t));
|
||||
void inocleanup __P((void));
|
||||
void inodirty __P((void));
|
||||
int linkup __P((ino_t, ino_t));
|
||||
int makeentry __P((ino_t, ino_t, char *));
|
||||
void pass1 __P((void));
|
||||
void pass1b __P((void));
|
||||
void pass2 __P((void));
|
||||
void pass3 __P((void));
|
||||
void pass4 __P((void));
|
||||
int pass1check __P((struct inodesc *));
|
||||
int pass4check __P((struct inodesc *));
|
||||
void pass5 __P((void));
|
||||
void pinode __P((ino_t));
|
||||
void propagate __P((void));
|
||||
int reply __P((char *));
|
||||
void resetinodebuf __P((void));
|
||||
int setup __P((const char *));
|
||||
struct ext2fs_dinode * getnextinode __P((ino_t));
|
||||
void catch __P((int));
|
||||
void catchquit __P((int));
|
||||
void voidquit __P((int));
|
||||
int chkrange(daddr_t, int);
|
||||
void ckfini(int);
|
||||
int ckinode(struct ext2fs_dinode *, struct inodesc *);
|
||||
void clri(struct inodesc *, char *, int);
|
||||
int dircheck(struct inodesc *, struct ext2fs_direct *);
|
||||
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);
|
||||
void freeino(ino_t);
|
||||
void freeinodebuf(void);
|
||||
int ftypeok(struct ext2fs_dinode *);
|
||||
void getpathname(char *, size_t, ino_t, ino_t);
|
||||
void inocleanup(void);
|
||||
void inodirty(void);
|
||||
int linkup(ino_t, ino_t);
|
||||
int makeentry(ino_t, ino_t, char *);
|
||||
void pass1(void);
|
||||
void pass1b(void);
|
||||
void pass2(void);
|
||||
void pass3(void);
|
||||
void pass4(void);
|
||||
int pass1check(struct inodesc *);
|
||||
int pass4check(struct inodesc *);
|
||||
void pass5(void);
|
||||
void pinode(ino_t);
|
||||
void propagate(void);
|
||||
int reply(char *);
|
||||
void resetinodebuf(void);
|
||||
int setup(const char *);
|
||||
struct ext2fs_dinode * getnextinode(ino_t);
|
||||
void catch(int);
|
||||
void catchquit(int);
|
||||
void voidquit(int);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fsck.h,v 1.10 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: fsck.h,v 1.11 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -107,7 +107,7 @@ struct bufarea sblk; /* file system superblock */
|
||||
struct bufarea asblk; /* first alternate superblock */
|
||||
struct bufarea *pdirbp; /* current directory contents */
|
||||
struct bufarea *pbp; /* current inode block */
|
||||
struct bufarea *getdatablk __P((daddr_t, long));
|
||||
struct bufarea *getdatablk(daddr_t, long);
|
||||
struct m_ext2fs sblock;
|
||||
|
||||
#define dirty(bp) (bp)->b_dirty = 1
|
||||
@ -123,7 +123,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 */
|
||||
@ -234,9 +234,9 @@ struct ext2fs_dinode zino;
|
||||
#define ALTERED 0x08
|
||||
#define FOUND 0x10
|
||||
|
||||
struct ext2fs_dinode *ginode __P((ino_t));
|
||||
struct inoinfo *getinoinfo __P((ino_t));
|
||||
void getblk __P((struct bufarea *, daddr_t, long));
|
||||
ino_t allocino __P((ino_t, int));
|
||||
void copyback_sb __P((struct bufarea*));
|
||||
daddr_t cgoverhead __P((int)); /* overhead per cg */
|
||||
struct ext2fs_dinode *ginode(ino_t);
|
||||
struct inoinfo *getinoinfo(ino_t);
|
||||
void getblk(struct bufarea *, daddr_t, long);
|
||||
ino_t allocino(ino_t, int);
|
||||
void copyback_sb(struct bufarea*);
|
||||
daddr_t cgoverhead(int); /* overhead per cg */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: inode.c,v 1.14 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: inode.c,v 1.15 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: inode.c,v 1.14 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: inode.c,v 1.15 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -98,12 +98,10 @@ __RCSID("$NetBSD: inode.c,v 1.14 2004/03/22 19:46:53 bouyer Exp $");
|
||||
|
||||
static ino_t startinum;
|
||||
|
||||
static int iblock __P((struct inodesc *, long, u_int64_t));
|
||||
static int iblock(struct inodesc *, long, u_int64_t);
|
||||
|
||||
int
|
||||
ckinode(dp, idesc)
|
||||
struct ext2fs_dinode *dp;
|
||||
struct inodesc *idesc;
|
||||
ckinode(struct ext2fs_dinode *dp, struct inodesc *idesc)
|
||||
{
|
||||
u_int32_t *ap;
|
||||
long ret, n, ndb;
|
||||
@ -187,10 +185,7 @@ 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)
|
||||
{
|
||||
/* XXX ondisk32 */
|
||||
int32_t *ap;
|
||||
@ -276,9 +271,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, overh;
|
||||
|
||||
@ -325,8 +318,7 @@ chkrange(blk, cnt)
|
||||
* General purpose interface for reading inodes.
|
||||
*/
|
||||
struct ext2fs_dinode *
|
||||
ginode(inumber)
|
||||
ino_t inumber;
|
||||
ginode(ino_t inumber)
|
||||
{
|
||||
daddr_t iblk;
|
||||
|
||||
@ -353,8 +345,7 @@ long readcnt, readpercg, fullcnt, inobufsize, partialcnt, partialsize;
|
||||
struct ext2fs_dinode *inodebuf;
|
||||
|
||||
struct ext2fs_dinode *
|
||||
getnextinode(inumber)
|
||||
ino_t inumber;
|
||||
getnextinode(ino_t inumber)
|
||||
{
|
||||
long size;
|
||||
daddr_t dblk;
|
||||
@ -379,7 +370,7 @@ getnextinode(inumber)
|
||||
}
|
||||
|
||||
void
|
||||
resetinodebuf()
|
||||
resetinodebuf(void)
|
||||
{
|
||||
|
||||
startinum = 0;
|
||||
@ -406,7 +397,7 @@ resetinodebuf()
|
||||
}
|
||||
|
||||
void
|
||||
freeinodebuf()
|
||||
freeinodebuf(void)
|
||||
{
|
||||
|
||||
if (inodebuf != NULL)
|
||||
@ -422,9 +413,7 @@ freeinodebuf()
|
||||
* Enter inodes into the cache.
|
||||
*/
|
||||
void
|
||||
cacheino(dp, inumber)
|
||||
struct ext2fs_dinode *dp;
|
||||
ino_t inumber;
|
||||
cacheino(struct ext2fs_dinode *dp, ino_t inumber)
|
||||
{
|
||||
struct inoinfo *inp;
|
||||
struct inoinfo **inpp;
|
||||
@ -466,8 +455,7 @@ cacheino(dp, inumber)
|
||||
* Look up an inode cache structure.
|
||||
*/
|
||||
struct inoinfo *
|
||||
getinoinfo(inumber)
|
||||
ino_t inumber;
|
||||
getinoinfo(ino_t inumber)
|
||||
{
|
||||
struct inoinfo *inp;
|
||||
|
||||
@ -484,7 +472,7 @@ getinoinfo(inumber)
|
||||
* Clean up all the inode cache structure.
|
||||
*/
|
||||
void
|
||||
inocleanup()
|
||||
inocleanup(void)
|
||||
{
|
||||
struct inoinfo **inpp;
|
||||
|
||||
@ -498,17 +486,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 ext2fs_dinode *dp;
|
||||
|
||||
@ -530,8 +515,7 @@ clri(idesc, type, flag)
|
||||
}
|
||||
|
||||
int
|
||||
findname(idesc)
|
||||
struct inodesc *idesc;
|
||||
findname(struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_direct *dirp = idesc->id_dirp;
|
||||
u_int16_t namlen = dirp->e2d_namlen;
|
||||
@ -544,8 +528,7 @@ findname(idesc)
|
||||
}
|
||||
|
||||
int
|
||||
findino(idesc)
|
||||
struct inodesc *idesc;
|
||||
findino(struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_direct *dirp = idesc->id_dirp;
|
||||
u_int32_t ino = fs2h32(dirp->e2d_ino);
|
||||
@ -562,8 +545,7 @@ findino(idesc)
|
||||
}
|
||||
|
||||
void
|
||||
pinode(ino)
|
||||
ino_t ino;
|
||||
pinode(ino_t ino)
|
||||
{
|
||||
struct ext2fs_dinode *dp;
|
||||
char *p;
|
||||
@ -591,10 +573,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)
|
||||
{
|
||||
|
||||
pfatal("%lld %s I=%u", (long long)blk, type, ino);
|
||||
@ -623,9 +602,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 ext2fs_dinode *dp;
|
||||
@ -677,8 +654,7 @@ allocino(request, type)
|
||||
* deallocate an inode
|
||||
*/
|
||||
void
|
||||
freeino(ino)
|
||||
ino_t ino;
|
||||
freeino(ino_t ino)
|
||||
{
|
||||
struct inodesc idesc;
|
||||
struct ext2fs_dinode *dp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.19 2005/01/13 15:22:35 christos Exp $ */
|
||||
/* $NetBSD: main.c,v 1.20 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.19 2005/01/13 15:22:35 christos Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.20 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -92,16 +92,13 @@ __RCSID("$NetBSD: main.c,v 1.19 2005/01/13 15:22:35 christos Exp $");
|
||||
|
||||
int returntosingle;
|
||||
|
||||
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[])
|
||||
{
|
||||
int ch;
|
||||
int ret = 0;
|
||||
@ -178,10 +175,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;
|
||||
@ -197,11 +191,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_bfree;
|
||||
struct dups *dp;
|
||||
@ -353,7 +343,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
|
||||
}
|
||||
|
||||
static void
|
||||
usage()
|
||||
usage(void)
|
||||
{
|
||||
|
||||
(void) fprintf(stderr,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass1.c,v 1.12 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: pass1.c,v 1.13 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: pass1.c,v 1.12 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: pass1.c,v 1.13 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -86,10 +86,10 @@ __RCSID("$NetBSD: pass1.c,v 1.12 2004/03/22 19:46:53 bouyer Exp $");
|
||||
|
||||
static daddr_t badblk;
|
||||
static daddr_t dupblk;
|
||||
static void checkinode __P((ino_t, struct inodesc *));
|
||||
static void checkinode(ino_t, struct inodesc *);
|
||||
|
||||
void
|
||||
pass1()
|
||||
pass1(void)
|
||||
{
|
||||
ino_t inumber;
|
||||
int c, i;
|
||||
@ -155,9 +155,7 @@ pass1()
|
||||
}
|
||||
|
||||
static void
|
||||
checkinode(inumber, idesc)
|
||||
ino_t inumber;
|
||||
struct inodesc *idesc;
|
||||
checkinode(ino_t inumber, struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_dinode *dp;
|
||||
struct zlncnt *zlnp;
|
||||
@ -325,8 +323,7 @@ unknown:
|
||||
}
|
||||
|
||||
int
|
||||
pass1check(idesc)
|
||||
struct inodesc *idesc;
|
||||
pass1check(struct inodesc *idesc)
|
||||
{
|
||||
int res = KEEPON;
|
||||
int anyout, nfrags;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass1b.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: pass1b.c,v 1.6 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pass1b.c 8.1 (Berkeley) 6/5/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: pass1b.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: pass1b.c,v 1.6 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -76,11 +76,11 @@ __RCSID("$NetBSD: pass1b.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $");
|
||||
#include "fsck.h"
|
||||
#include "extern.h"
|
||||
|
||||
static int pass1bcheck __P((struct inodesc *));
|
||||
static struct dups *duphead;
|
||||
static int pass1bcheck(struct inodesc *);
|
||||
static struct dups *duphead;
|
||||
|
||||
void
|
||||
pass1b()
|
||||
pass1b(void)
|
||||
{
|
||||
int c, i;
|
||||
struct ext2fs_dinode *dp;
|
||||
@ -108,8 +108,7 @@ pass1b()
|
||||
}
|
||||
|
||||
static int
|
||||
pass1bcheck(idesc)
|
||||
struct inodesc *idesc;
|
||||
pass1bcheck(struct inodesc *idesc)
|
||||
{
|
||||
struct dups *dlp;
|
||||
int nfrags, res = KEEPON;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass2.c,v 1.10 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: pass2.c,v 1.11 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pass2.c 8.6 (Berkeley) 10/27/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: pass2.c,v 1.10 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: pass2.c,v 1.11 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -85,11 +85,11 @@ __RCSID("$NetBSD: pass2.c,v 1.10 2004/03/22 19:46:53 bouyer Exp $");
|
||||
|
||||
#define MINDIRSIZE (sizeof (struct ext2fs_dirtemplate))
|
||||
|
||||
static int pass2check __P((struct inodesc *));
|
||||
static int blksort __P((const void *, const void *));
|
||||
static int pass2check(struct inodesc *);
|
||||
static int blksort(const void *, const void *);
|
||||
|
||||
void
|
||||
pass2()
|
||||
pass2(void)
|
||||
{
|
||||
struct ext2fs_dinode *dp;
|
||||
struct inoinfo **inpp, *inp;
|
||||
@ -224,8 +224,7 @@ pass2()
|
||||
}
|
||||
|
||||
static int
|
||||
pass2check(idesc)
|
||||
struct inodesc *idesc;
|
||||
pass2check(struct inodesc *idesc)
|
||||
{
|
||||
struct ext2fs_direct *dirp = idesc->id_dirp;
|
||||
struct inoinfo *inp;
|
||||
@ -468,8 +467,7 @@ again:
|
||||
* Routine to sort disk blocks.
|
||||
*/
|
||||
static int
|
||||
blksort(inpp1, inpp2)
|
||||
const void *inpp1, *inpp2;
|
||||
blksort(const void *inpp1, const void *inpp2)
|
||||
{
|
||||
return ((* (struct inoinfo **) inpp1)->i_blks[0] -
|
||||
(* (struct inoinfo **) inpp2)->i_blks[0]);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass3.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: pass3.c,v 1.6 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pass3.c 8.1 (Berkeley) 6/5/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: pass3.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: pass3.c,v 1.6 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -75,7 +75,7 @@ __RCSID("$NetBSD: pass3.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $");
|
||||
#include "extern.h"
|
||||
|
||||
void
|
||||
pass3()
|
||||
pass3(void)
|
||||
{
|
||||
struct inoinfo **inpp, *inp;
|
||||
ino_t orphan;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass4.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: pass4.c,v 1.6 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pass4.c 8.1 (Berkeley) 6/5/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: pass4.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: pass4.c,v 1.6 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -79,7 +79,7 @@ __RCSID("$NetBSD: pass4.c,v 1.5 2004/03/22 19:46:53 bouyer Exp $");
|
||||
#include "extern.h"
|
||||
|
||||
void
|
||||
pass4()
|
||||
pass4(void)
|
||||
{
|
||||
ino_t inumber;
|
||||
struct zlncnt *zlnp;
|
||||
@ -140,8 +140,7 @@ pass4()
|
||||
}
|
||||
|
||||
int
|
||||
pass4check(idesc)
|
||||
struct inodesc *idesc;
|
||||
pass4check(struct inodesc *idesc)
|
||||
{
|
||||
struct dups *dlp;
|
||||
int nfrags, res = KEEPON;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pass5.c,v 1.10 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: pass5.c,v 1.11 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pass5.c 8.6 (Berkeley) 11/30/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: pass5.c,v 1.10 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: pass5.c,v 1.11 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -82,10 +82,10 @@ __RCSID("$NetBSD: pass5.c,v 1.10 2004/03/22 19:46:53 bouyer Exp $");
|
||||
#include "extern.h"
|
||||
|
||||
|
||||
void print_bmap __P((u_char *,u_int32_t));
|
||||
void print_bmap(u_char *,u_int32_t);
|
||||
|
||||
void
|
||||
pass5()
|
||||
pass5(void)
|
||||
{
|
||||
int c;
|
||||
struct m_ext2fs *fs = &sblock;
|
||||
@ -266,9 +266,7 @@ pass5()
|
||||
}
|
||||
|
||||
void
|
||||
print_bmap(map, size)
|
||||
u_char *map;
|
||||
u_int32_t size;
|
||||
print_bmap(u_char *map, u_int32_t size)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: preen.c,v 1.6 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: preen.c,v 1.7 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)preen.c 8.3 (Berkeley) 12/6/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: preen.c,v 1.6 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: preen.c,v 1.7 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -95,13 +95,11 @@ int nrun, ndisks;
|
||||
char hotroot;
|
||||
|
||||
char *rawname(), *unrawname(), *blockcheck();
|
||||
void addpart __P((char *, char *, long));
|
||||
int startdisk __P((struct disk *, int (*)() ));
|
||||
void addpart(char *, char *, long);
|
||||
int startdisk(struct disk *, int (*)() );
|
||||
|
||||
int
|
||||
checkfstab(preen, maxrun, docheck, chkit)
|
||||
int preen, maxrun;
|
||||
int (*docheck)(), (*chkit)();
|
||||
checkfstab(int preen, int maxrun, int (*docheck)(), int (*chkit)())
|
||||
{
|
||||
struct fstab *fsp;
|
||||
struct disk *dk, *nextdisk;
|
||||
@ -223,8 +221,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
||||
}
|
||||
|
||||
struct disk *
|
||||
finddisk(name)
|
||||
char *name;
|
||||
finddisk(char *name)
|
||||
{
|
||||
struct disk *dk, **dkp;
|
||||
char *p;
|
||||
@ -262,9 +259,7 @@ finddisk(name)
|
||||
}
|
||||
|
||||
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;
|
||||
@ -292,9 +287,7 @@ addpart(name, fsname, auxdata)
|
||||
}
|
||||
|
||||
int
|
||||
startdisk(dk, checkit)
|
||||
struct disk *dk;
|
||||
int (*checkit)();
|
||||
startdisk(struct disk *dk, int (*checkit)())
|
||||
{
|
||||
struct part *pt = dk->part;
|
||||
|
||||
@ -310,8 +303,7 @@ startdisk(dk, checkit)
|
||||
}
|
||||
|
||||
char *
|
||||
blockcheck(origname)
|
||||
char *origname;
|
||||
blockcheck(char *origname)
|
||||
{
|
||||
struct stat stslash, stblock, stchar;
|
||||
char *newname, *raw;
|
||||
@ -363,8 +355,7 @@ retry:
|
||||
}
|
||||
|
||||
char *
|
||||
unrawname(name)
|
||||
char *name;
|
||||
unrawname(char *name)
|
||||
{
|
||||
char *dp;
|
||||
struct stat stb;
|
||||
@ -382,8 +373,7 @@ unrawname(name)
|
||||
}
|
||||
|
||||
char *
|
||||
rawname(name)
|
||||
char *name;
|
||||
rawname(char *name)
|
||||
{
|
||||
static char rawbuf[32];
|
||||
char *dp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: setup.c,v 1.16 2004/10/29 17:37:30 dsl Exp $ */
|
||||
/* $NetBSD: setup.c,v 1.17 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)setup.c 8.5 (Berkeley) 11/23/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: setup.c,v 1.16 2004/10/29 17:37:30 dsl Exp $");
|
||||
__RCSID("$NetBSD: setup.c,v 1.17 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -89,14 +89,13 @@ __RCSID("$NetBSD: setup.c,v 1.16 2004/10/29 17:37:30 dsl Exp $");
|
||||
|
||||
#define POWEROF2(num) (((num) & ((num) - 1)) == 0)
|
||||
|
||||
void badsb __P((int, char *));
|
||||
int calcsb __P((const char *, int, struct m_ext2fs *));
|
||||
static struct disklabel *getdisklabel __P((const char *, int));
|
||||
static int readsb __P((int));
|
||||
void badsb(int, char *);
|
||||
int calcsb(const char *, int, struct m_ext2fs *);
|
||||
static struct disklabel *getdisklabel(const char *, int);
|
||||
static int readsb(int);
|
||||
|
||||
int
|
||||
setup(dev)
|
||||
const char *dev;
|
||||
setup(const char *dev)
|
||||
{
|
||||
long cg, asked, i;
|
||||
long bmapsize;
|
||||
@ -286,8 +285,7 @@ badsblabel:
|
||||
* Read in the super block and its summary info, convert to host byte order.
|
||||
*/
|
||||
static int
|
||||
readsb(listerr)
|
||||
int listerr;
|
||||
readsb(int listerr)
|
||||
{
|
||||
daddr_t super = bflag ? bflag : SBOFF / dev_bsize;
|
||||
|
||||
@ -402,8 +400,7 @@ readsb(listerr)
|
||||
}
|
||||
|
||||
void
|
||||
copyback_sb(bp)
|
||||
struct bufarea *bp;
|
||||
copyback_sb(struct bufarea *bp)
|
||||
{
|
||||
/* Copy the in-memory superblock back to buffer */
|
||||
bp->b_un.b_fs->e2fs_icount = fs2h32(sblock.e2fs.e2fs_icount);
|
||||
@ -435,9 +432,7 @@ copyback_sb(bp)
|
||||
}
|
||||
|
||||
void
|
||||
badsb(listerr, s)
|
||||
int listerr;
|
||||
char *s;
|
||||
badsb(int listerr, char *s)
|
||||
{
|
||||
|
||||
if (!listerr)
|
||||
@ -455,10 +450,7 @@ badsb(listerr, s)
|
||||
*/
|
||||
|
||||
int
|
||||
calcsb(dev, devfd, fs)
|
||||
const char *dev;
|
||||
int devfd;
|
||||
struct m_ext2fs *fs;
|
||||
calcsb(const char *dev, int devfd, struct m_ext2fs *fs)
|
||||
{
|
||||
struct disklabel *lp;
|
||||
struct partition *pp;
|
||||
@ -501,9 +493,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;
|
||||
|
||||
@ -517,8 +507,7 @@ getdisklabel(s, fd)
|
||||
}
|
||||
|
||||
daddr_t
|
||||
cgoverhead(c)
|
||||
int c;
|
||||
cgoverhead(int c)
|
||||
{
|
||||
int overh;
|
||||
overh = 1 /* block bitmap */ +
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: utilities.c,v 1.11 2004/03/22 19:46:53 bouyer Exp $ */
|
||||
/* $NetBSD: utilities.c,v 1.12 2005/01/19 19:31:28 xtraeme Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
@ -63,7 +63,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/5/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: utilities.c,v 1.11 2004/03/22 19:46:53 bouyer Exp $");
|
||||
__RCSID("$NetBSD: utilities.c,v 1.12 2005/01/19 19:31:28 xtraeme Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -85,13 +85,12 @@ __RCSID("$NetBSD: utilities.c,v 1.11 2004/03/22 19:46:53 bouyer 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)
|
||||
struct ext2fs_dinode *dp;
|
||||
ftypeok(struct ext2fs_dinode *dp)
|
||||
{
|
||||
switch (fs2h16(dp->e2di_mode) & IFMT) {
|
||||
|
||||
@ -112,8 +111,7 @@ ftypeok(dp)
|
||||
}
|
||||
|
||||
int
|
||||
reply(question)
|
||||
char *question;
|
||||
reply(char *question)
|
||||
{
|
||||
int persevere;
|
||||
char c;
|
||||
@ -148,7 +146,7 @@ reply(question)
|
||||
* Malloc buffers and set up cache.
|
||||
*/
|
||||
void
|
||||
bufinit()
|
||||
bufinit(void)
|
||||
{
|
||||
struct bufarea *bp;
|
||||
long bufcnt, i;
|
||||
@ -182,9 +180,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;
|
||||
|
||||
@ -212,10 +208,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;
|
||||
|
||||
@ -229,9 +222,7 @@ getblk(bp, blk, size)
|
||||
}
|
||||
|
||||
void
|
||||
flush(fd, bp)
|
||||
int fd;
|
||||
struct bufarea *bp;
|
||||
flush(int fd, struct bufarea *bp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -255,9 +246,7 @@ flush(fd, bp)
|
||||
}
|
||||
|
||||
static void
|
||||
rwerror(mesg, blk)
|
||||
char *mesg;
|
||||
daddr_t blk;
|
||||
rwerror(char *mesg, daddr_t blk)
|
||||
{
|
||||
|
||||
if (preen == 0)
|
||||
@ -268,8 +257,7 @@ rwerror(mesg, blk)
|
||||
}
|
||||
|
||||
void
|
||||
ckfini(markclean)
|
||||
int markclean;
|
||||
ckfini(int markclean)
|
||||
{
|
||||
struct bufarea *bp, *nbp;
|
||||
int cnt = 0;
|
||||
@ -320,11 +308,7 @@ ckfini(markclean)
|
||||
}
|
||||
|
||||
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;
|
||||
@ -360,11 +344,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,7 +377,7 @@ bwrite(fd, buf, blk, size)
|
||||
* allocate a data block
|
||||
*/
|
||||
int
|
||||
allocblk()
|
||||
allocblk(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -415,8 +395,7 @@ allocblk()
|
||||
* Free a previously allocated block
|
||||
*/
|
||||
void
|
||||
freeblk(blkno)
|
||||
daddr_t blkno;
|
||||
freeblk(daddr_t blkno)
|
||||
{
|
||||
struct inodesc idesc;
|
||||
|
||||
@ -429,10 +408,7 @@ freeblk(blkno)
|
||||
* 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;
|
||||
@ -486,8 +462,7 @@ getpathname(namebuf, namebuflen, curdir, ino)
|
||||
}
|
||||
|
||||
void
|
||||
catch(n)
|
||||
int n;
|
||||
catch(int n)
|
||||
{
|
||||
ckfini(0);
|
||||
exit(12);
|
||||
@ -499,8 +474,7 @@ catch(n)
|
||||
* so that reboot sequence may be interrupted.
|
||||
*/
|
||||
void
|
||||
catchquit(n)
|
||||
int n;
|
||||
catchquit(int n)
|
||||
{
|
||||
printf("returning to single-user after filesystem check\n");
|
||||
returntosingle = 1;
|
||||
@ -512,8 +486,7 @@ catchquit(n)
|
||||
* Used by child processes in preen.
|
||||
*/
|
||||
void
|
||||
voidquit(n)
|
||||
int n;
|
||||
voidquit(int n)
|
||||
{
|
||||
|
||||
sleep(1);
|
||||
@ -525,9 +498,7 @@ voidquit(n)
|
||||
* 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user