Prototype some things.

This commit is contained in:
pk 1994-05-02 10:18:21 +00:00
parent 394be046a5
commit 77c9a3fa5b
6 changed files with 110 additions and 22 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)fsck.h 5.17 (Berkeley) 7/27/90
* $Id: fsck.h,v 1.4 1993/08/01 18:27:27 mycroft Exp $
* $Id: fsck.h,v 1.5 1994/05/02 10:18:21 pk Exp $
*/
#define MAXDUP 10 /* limit on dup blks (per inode) */
@ -78,7 +78,6 @@ struct bufarea sblk; /* file system superblock */
struct bufarea cgblk; /* cylinder group blocks */
struct bufarea *pdirbp; /* current directory contents */
struct bufarea *pbp; /* current inode block */
struct bufarea *getdatablk();
#define dirty(bp) (bp)->b_dirty = 1
#define initbarea(bp) \
@ -204,9 +203,32 @@ struct dinode zino;
#define ALTERED 0x08
#define FOUND 0x10
time_t time();
struct dinode *ginode();
struct inoinfo *getinoinfo();
void getblk();
ino_t allocino();
int findino();
int ckinode __P((struct dinode *, struct inodesc *));
int iblock __P((struct inodesc *, long, u_long));
int chkrange __P((daddr_t, int));
struct dinode *ginode __P((ino_t));
struct dinode *getnextinode __P((ino_t));
void cacheino __P((struct dinode *, ino_t));
struct inoinfo *getinoinfo __P((ino_t));
void resetinodebuf __P((void));
void freeinodebuf __P((void));
void inocleanup __P((void));
void inodirty __P((void));
void clri __P((struct inodesc *, char *, int));
int findname __P((struct inodesc *));
int findino __P((struct inodesc *));
void pinode __P((ino_t));
void blkerror __P((ino_t, char *, daddr_t));
ino_t allocino __P((ino_t, int));
void freeino __P((ino_t));
int ftypeok __P((struct dinode *));
struct bufarea *getdatablk __P((daddr_t, long));
void getblk __P((struct bufarea *, daddr_t, long));
void flush __P((int, struct bufarea *));
int bread __P((int, char *, daddr_t, long));
int bwrite __P((int, char *, daddr_t, long));
int allocblk __P((long));
void freeblk __P((daddr_t, long));
void getpathname __P((char *, ino_t, ino_t));

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)inode.c 5.18 (Berkeley) 3/19/91";*/
static char rcsid[] = "$Id: inode.c,v 1.7 1994/04/25 18:28:25 cgd Exp $";
static char rcsid[] = "$Id: inode.c,v 1.8 1994/05/02 10:18:23 pk Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -50,6 +50,7 @@ static char rcsid[] = "$Id: inode.c,v 1.7 1994/04/25 18:28:25 cgd Exp $";
static ino_t startinum;
int
ckinode(dp, idesc)
struct dinode *dp;
register struct inodesc *idesc;
@ -96,6 +97,7 @@ ckinode(dp, idesc)
return (KEEPON);
}
int
iblock(idesc, ilevel, isize)
struct inodesc *idesc;
register long ilevel;
@ -159,6 +161,7 @@ iblock(idesc, ilevel, isize)
* Check that a block in a legal block number.
* Return 0 if in range, 1 if out of range.
*/
int
chkrange(blk, cnt)
daddr_t blk;
int cnt;
@ -248,6 +251,7 @@ getnextinode(inumber)
return (dp++);
}
void
resetinodebuf()
{
@ -273,6 +277,7 @@ resetinodebuf()
(void)getnextinode(nextino);
}
void
freeinodebuf()
{
@ -288,6 +293,7 @@ freeinodebuf()
*
* Enter inodes into the cache.
*/
void
cacheino(dp, inumber)
register struct dinode *dp;
ino_t inumber;
@ -344,6 +350,7 @@ getinoinfo(inumber)
/*
* Clean up all the inode cache structure.
*/
void
inocleanup()
{
register struct inoinfo **inpp;
@ -356,13 +363,15 @@ inocleanup()
free((char *)inpsort);
inphead = inpsort = NULL;
}
void
inodirty()
{
dirty(pbp);
}
void
clri(idesc, type, flag)
register struct inodesc *idesc;
char *type;
@ -387,6 +396,7 @@ clri(idesc, type, flag)
}
}
int
findname(idesc)
struct inodesc *idesc;
{
@ -398,6 +408,7 @@ findname(idesc)
return (STOP|FOUND);
}
int
findino(idesc)
struct inodesc *idesc;
{
@ -413,6 +424,7 @@ findino(idesc)
return (KEEPON);
}
void
pinode(ino)
ino_t ino;
{
@ -440,6 +452,7 @@ pinode(ino)
printf("MTIME=%12.12s %4.4s ", &p[4], &p[20]);
}
void
blkerror(ino, type, blk)
ino_t ino;
char *type;
@ -519,6 +532,7 @@ allocino(request, type)
/*
* deallocate an inode
*/
void
freeino(ino)
ino_t ino;
{

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)utilities.c 5.30 (Berkeley) 7/26/91";*/
static char rcsid[] = "$Id: utilities.c,v 1.7 1994/04/25 18:29:08 cgd Exp $";
static char rcsid[] = "$Id: utilities.c,v 1.8 1994/05/02 10:18:25 pk Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -49,6 +49,7 @@ static char rcsid[] = "$Id: utilities.c,v 1.7 1994/04/25 18:29:08 cgd Exp $";
long diskreads, totalreads; /* Disk cache statistics */
int
ftypeok(dp)
struct dinode *dp;
{
@ -70,6 +71,7 @@ ftypeok(dp)
}
}
int
reply(question)
char *question;
{
@ -105,6 +107,7 @@ reply(question)
/*
* Malloc buffers and set up cache.
*/
void
bufinit()
{
register struct bufarea *bp;
@ -189,6 +192,7 @@ getblk(bp, blk, size)
}
}
void
flush(fd, bp)
int fd;
register struct bufarea *bp;
@ -214,6 +218,7 @@ flush(fd, bp)
}
}
void
rwerror(mesg, blk)
char *mesg;
daddr_t blk;
@ -226,6 +231,7 @@ rwerror(mesg, blk)
errexit("Program terminated\n");
}
void
ckfini()
{
register struct bufarea *bp, *nbp;
@ -355,6 +361,7 @@ allocblk(frags)
/*
* Free a previously allocated block
*/
void
freeblk(blkno, frags)
daddr_t blkno;
long frags;
@ -369,6 +376,7 @@ freeblk(blkno, frags)
/*
* Find a pathname
*/
void
getpathname(namebuf, curdir, ino)
char *namebuf;
ino_t curdir, ino;

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)fsck.h 5.17 (Berkeley) 7/27/90
* $Id: fsck.h,v 1.4 1993/08/01 18:27:27 mycroft Exp $
* $Id: fsck.h,v 1.5 1994/05/02 10:18:21 pk Exp $
*/
#define MAXDUP 10 /* limit on dup blks (per inode) */
@ -78,7 +78,6 @@ struct bufarea sblk; /* file system superblock */
struct bufarea cgblk; /* cylinder group blocks */
struct bufarea *pdirbp; /* current directory contents */
struct bufarea *pbp; /* current inode block */
struct bufarea *getdatablk();
#define dirty(bp) (bp)->b_dirty = 1
#define initbarea(bp) \
@ -204,9 +203,32 @@ struct dinode zino;
#define ALTERED 0x08
#define FOUND 0x10
time_t time();
struct dinode *ginode();
struct inoinfo *getinoinfo();
void getblk();
ino_t allocino();
int findino();
int ckinode __P((struct dinode *, struct inodesc *));
int iblock __P((struct inodesc *, long, u_long));
int chkrange __P((daddr_t, int));
struct dinode *ginode __P((ino_t));
struct dinode *getnextinode __P((ino_t));
void cacheino __P((struct dinode *, ino_t));
struct inoinfo *getinoinfo __P((ino_t));
void resetinodebuf __P((void));
void freeinodebuf __P((void));
void inocleanup __P((void));
void inodirty __P((void));
void clri __P((struct inodesc *, char *, int));
int findname __P((struct inodesc *));
int findino __P((struct inodesc *));
void pinode __P((ino_t));
void blkerror __P((ino_t, char *, daddr_t));
ino_t allocino __P((ino_t, int));
void freeino __P((ino_t));
int ftypeok __P((struct dinode *));
struct bufarea *getdatablk __P((daddr_t, long));
void getblk __P((struct bufarea *, daddr_t, long));
void flush __P((int, struct bufarea *));
int bread __P((int, char *, daddr_t, long));
int bwrite __P((int, char *, daddr_t, long));
int allocblk __P((long));
void freeblk __P((daddr_t, long));
void getpathname __P((char *, ino_t, ino_t));

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)inode.c 5.18 (Berkeley) 3/19/91";*/
static char rcsid[] = "$Id: inode.c,v 1.7 1994/04/25 18:28:25 cgd Exp $";
static char rcsid[] = "$Id: inode.c,v 1.8 1994/05/02 10:18:23 pk Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -50,6 +50,7 @@ static char rcsid[] = "$Id: inode.c,v 1.7 1994/04/25 18:28:25 cgd Exp $";
static ino_t startinum;
int
ckinode(dp, idesc)
struct dinode *dp;
register struct inodesc *idesc;
@ -96,6 +97,7 @@ ckinode(dp, idesc)
return (KEEPON);
}
int
iblock(idesc, ilevel, isize)
struct inodesc *idesc;
register long ilevel;
@ -159,6 +161,7 @@ iblock(idesc, ilevel, isize)
* Check that a block in a legal block number.
* Return 0 if in range, 1 if out of range.
*/
int
chkrange(blk, cnt)
daddr_t blk;
int cnt;
@ -248,6 +251,7 @@ getnextinode(inumber)
return (dp++);
}
void
resetinodebuf()
{
@ -273,6 +277,7 @@ resetinodebuf()
(void)getnextinode(nextino);
}
void
freeinodebuf()
{
@ -288,6 +293,7 @@ freeinodebuf()
*
* Enter inodes into the cache.
*/
void
cacheino(dp, inumber)
register struct dinode *dp;
ino_t inumber;
@ -344,6 +350,7 @@ getinoinfo(inumber)
/*
* Clean up all the inode cache structure.
*/
void
inocleanup()
{
register struct inoinfo **inpp;
@ -356,13 +363,15 @@ inocleanup()
free((char *)inpsort);
inphead = inpsort = NULL;
}
void
inodirty()
{
dirty(pbp);
}
void
clri(idesc, type, flag)
register struct inodesc *idesc;
char *type;
@ -387,6 +396,7 @@ clri(idesc, type, flag)
}
}
int
findname(idesc)
struct inodesc *idesc;
{
@ -398,6 +408,7 @@ findname(idesc)
return (STOP|FOUND);
}
int
findino(idesc)
struct inodesc *idesc;
{
@ -413,6 +424,7 @@ findino(idesc)
return (KEEPON);
}
void
pinode(ino)
ino_t ino;
{
@ -440,6 +452,7 @@ pinode(ino)
printf("MTIME=%12.12s %4.4s ", &p[4], &p[20]);
}
void
blkerror(ino, type, blk)
ino_t ino;
char *type;
@ -519,6 +532,7 @@ allocino(request, type)
/*
* deallocate an inode
*/
void
freeino(ino)
ino_t ino;
{

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)utilities.c 5.30 (Berkeley) 7/26/91";*/
static char rcsid[] = "$Id: utilities.c,v 1.7 1994/04/25 18:29:08 cgd Exp $";
static char rcsid[] = "$Id: utilities.c,v 1.8 1994/05/02 10:18:25 pk Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -49,6 +49,7 @@ static char rcsid[] = "$Id: utilities.c,v 1.7 1994/04/25 18:29:08 cgd Exp $";
long diskreads, totalreads; /* Disk cache statistics */
int
ftypeok(dp)
struct dinode *dp;
{
@ -70,6 +71,7 @@ ftypeok(dp)
}
}
int
reply(question)
char *question;
{
@ -105,6 +107,7 @@ reply(question)
/*
* Malloc buffers and set up cache.
*/
void
bufinit()
{
register struct bufarea *bp;
@ -189,6 +192,7 @@ getblk(bp, blk, size)
}
}
void
flush(fd, bp)
int fd;
register struct bufarea *bp;
@ -214,6 +218,7 @@ flush(fd, bp)
}
}
void
rwerror(mesg, blk)
char *mesg;
daddr_t blk;
@ -226,6 +231,7 @@ rwerror(mesg, blk)
errexit("Program terminated\n");
}
void
ckfini()
{
register struct bufarea *bp, *nbp;
@ -355,6 +361,7 @@ allocblk(frags)
/*
* Free a previously allocated block
*/
void
freeblk(blkno, frags)
daddr_t blkno;
long frags;
@ -369,6 +376,7 @@ freeblk(blkno, frags)
/*
* Find a pathname
*/
void
getpathname(namebuf, curdir, ino)
char *namebuf;
ino_t curdir, ino;