summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_msdosfs/fat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fsck_msdosfs/fat.c')
-rw-r--r--sbin/fsck_msdosfs/fat.c68
1 files changed, 16 insertions, 52 deletions
diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c
index ff21f41..e8b004e 100644
--- a/sbin/fsck_msdosfs/fat.c
+++ b/sbin/fsck_msdosfs/fat.c
@@ -47,20 +47,16 @@ static const char rcsid[] =
#include "ext.h"
#include "fsutil.h"
-static int checkclnum __P((struct bootblock *, int, cl_t, cl_t *));
-static int clustdiffer __P((cl_t, cl_t *, cl_t *, int));
-static int tryclear __P((struct bootblock *, struct fatEntry *, cl_t, cl_t *));
-static int _readfat __P((int, struct bootblock *, int, u_char **));
+static int checkclnum(struct bootblock *, int, cl_t, cl_t *);
+static int clustdiffer(cl_t, cl_t *, cl_t *, int);
+static int tryclear(struct bootblock *, struct fatEntry *, cl_t, cl_t *);
+static int _readfat(int, struct bootblock *, int, u_char **);
/*
* Check a cluster number for valid value
*/
static int
-checkclnum(boot, fat, cl, next)
- struct bootblock *boot;
- int fat;
- cl_t cl;
- cl_t *next;
+checkclnum(struct bootblock *boot, int fat, cl_t cl, cl_t *next)
{
if (*next >= (CLUST_RSRVD&boot->ClustMask))
*next |= ~boot->ClustMask;
@@ -91,11 +87,7 @@ checkclnum(boot, fat, cl, next)
* Read a FAT from disk. Returns 1 if successful, 0 otherwise.
*/
static int
-_readfat(fs, boot, no, buffer)
- int fs;
- struct bootblock *boot;
- int no;
- u_char **buffer;
+_readfat(int fs, struct bootblock *boot, int no, u_char **buffer)
{
off_t off;
@@ -130,11 +122,7 @@ _readfat(fs, boot, no, buffer)
* Read a FAT and decode it into internal format
*/
int
-readfat(fs, boot, no, fp)
- int fs;
- struct bootblock *boot;
- int no;
- struct fatEntry **fp;
+readfat(int fs, struct bootblock *boot, int no, struct fatEntry **fp)
{
struct fatEntry *fat;
u_char *buffer, *p;
@@ -252,8 +240,7 @@ readfat(fs, boot, no, fp)
* Get type of reserved cluster
*/
char *
-rsrvdcltype(cl)
- cl_t cl;
+rsrvdcltype(cl_t cl)
{
if (cl == CLUST_FREE)
return "free";
@@ -265,11 +252,7 @@ rsrvdcltype(cl)
}
static int
-clustdiffer(cl, cp1, cp2, fatnum)
- cl_t cl;
- cl_t *cp1;
- cl_t *cp2;
- int fatnum;
+clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp2, int fatnum)
{
if (*cp1 == CLUST_FREE || *cp1 >= CLUST_RSRVD) {
if (*cp2 == CLUST_FREE || *cp2 >= CLUST_RSRVD) {
@@ -339,11 +322,8 @@ clustdiffer(cl, cp1, cp2, fatnum)
* into the first one.
*/
int
-comparefat(boot, first, second, fatnum)
- struct bootblock *boot;
- struct fatEntry *first;
- struct fatEntry *second;
- int fatnum;
+comparefat(struct bootblock *boot, struct fatEntry *first,
+ struct fatEntry *second, int fatnum)
{
cl_t cl;
int ret = FSOK;
@@ -355,10 +335,7 @@ comparefat(boot, first, second, fatnum)
}
void
-clearchain(boot, fat, head)
- struct bootblock *boot;
- struct fatEntry *fat;
- cl_t head;
+clearchain(struct bootblock *boot, struct fatEntry *fat, cl_t head)
{
cl_t p, q;
@@ -372,11 +349,7 @@ clearchain(boot, fat, head)
}
int
-tryclear(boot, fat, head, trunc)
- struct bootblock *boot;
- struct fatEntry *fat;
- cl_t head;
- cl_t *trunc;
+tryclear(struct bootblock *boot, struct fatEntry *fat, cl_t head, cl_t *trunc)
{
if (ask(0, "Clear chain starting at %u", head)) {
clearchain(boot, fat, head);
@@ -392,9 +365,7 @@ tryclear(boot, fat, head, trunc)
* Check a complete FAT in-memory for crosslinks
*/
int
-checkfat(boot, fat)
- struct bootblock *boot;
- struct fatEntry *fat;
+checkfat(struct bootblock *boot, struct fatEntry *fat)
{
cl_t head, p, h, n;
u_int len;
@@ -488,11 +459,7 @@ checkfat(boot, fat)
* Write out FATs encoding them from the internal format
*/
int
-writefat(fs, boot, fat, correct_fat)
- int fs;
- struct bootblock *boot;
- struct fatEntry *fat;
- int correct_fat;
+writefat(int fs, struct bootblock *boot, struct fatEntry *fat, int correct_fat)
{
u_char *buffer, *p;
cl_t cl;
@@ -600,10 +567,7 @@ writefat(fs, boot, fat, correct_fat)
* Check a complete in-memory FAT for lost cluster chains
*/
int
-checklost(dosfs, boot, fat)
- int dosfs;
- struct bootblock *boot;
- struct fatEntry *fat;
+checklost(int dosfs, struct bootblock *boot, struct fatEntry *fat)
{
cl_t head;
int mod = FSOK;
OpenPOWER on IntegriCloud