Changeset View
Changeset View
Standalone View
Standalone View
sbin/fsck_msdosfs/ext.h
Show All 26 Lines | |||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef EXT_H | #ifndef EXT_H | ||||
#define EXT_H | #define EXT_H | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <stdbool.h> | |||||
#include "dosfs.h" | #include "dosfs.h" | ||||
#define LOSTDIR "LOST.DIR" | #define LOSTDIR "LOST.DIR" | ||||
/* | /* | ||||
* Options: | * Options: | ||||
*/ | */ | ||||
extern int alwaysno; /* assume "no" for all questions */ | extern int alwaysno; /* assume "no" for all questions */ | ||||
Show All 37 Lines | |||||
*/ | */ | ||||
int readboot(int, struct bootblock *); | int readboot(int, struct bootblock *); | ||||
/* | /* | ||||
* Correct the FSInfo block. | * Correct the FSInfo block. | ||||
*/ | */ | ||||
int writefsinfo(int, struct bootblock *); | int writefsinfo(int, struct bootblock *); | ||||
/* | /* Mark a cluster as used */ | ||||
* Read one of the FAT copies and return a pointer to the new | void fat_set_cl_used(cl_t); | ||||
* allocated array holding our description of it. | void fat_clear_cl_used(cl_t cl); | ||||
*/ | |||||
int readfat(int, struct bootblock *, u_int, struct fatEntry **); | |||||
/* Whether a cluster is previously marked as used */ | |||||
bool fat_is_cl_used(cl_t); | |||||
void fat_clear_cl_head(cl_t); | |||||
bool fat_is_cl_head(cl_t); | |||||
/* Opaque type */ | |||||
struct fat_descriptor; | |||||
cl_t fat_get_cl_next(struct fat_descriptor *, cl_t); | |||||
int fat_set_cl_next(struct fat_descriptor *, cl_t, cl_t); | |||||
struct bootblock* fat_get_boot(struct fat_descriptor *); | |||||
/* | /* | ||||
* Check two FAT copies for consistency and merge changes into the | * Read the FAT 0 and return a pointer to the newly allocated | ||||
* first if necessary. | * descriptor of it. | ||||
*/ | */ | ||||
int comparefat(struct bootblock *, struct fatEntry *, struct fatEntry *, u_int); | int readfat(int, struct bootblock *, struct fat_descriptor **); | ||||
/* | /* | ||||
* Check a FAT | * Check a FAT | ||||
*/ | */ | ||||
int checkfat(struct bootblock *, struct fatEntry *); | int checkfat(struct bootblock *, struct fat_descriptor *); | ||||
/* | /* | ||||
* Write back FAT entries | * Write back FAT entries | ||||
*/ | */ | ||||
int writefat(int, struct bootblock *, struct fatEntry *, int); | int writefat(int, struct bootblock *, struct fat_descriptor *); | ||||
/* | /* | ||||
* Read a directory | * Read a directory | ||||
*/ | */ | ||||
int resetDosDirSection(struct bootblock *, struct fatEntry *); | int resetDosDirSection(struct bootblock *, struct fat_descriptor *); | ||||
void finishDosDirSection(void); | void finishDosDirSection(void); | ||||
int handleDirTree(int, struct bootblock *, struct fatEntry *); | int handleDirTree(int, struct bootblock *, struct fat_descriptor *); | ||||
/* | /* | ||||
* Cross-check routines run after everything is completely in memory | * Cross-check routines run after everything is completely in memory | ||||
*/ | */ | ||||
int checkchain(struct fat_descriptor *, cl_t, size_t *); | |||||
/* | /* | ||||
* Check for lost cluster chains | * Check for lost cluster chains | ||||
*/ | */ | ||||
int checklost(int, struct bootblock *, struct fatEntry *); | int checklost(int, struct bootblock *, struct fat_descriptor *); | ||||
/* | /* | ||||
* Try to reconnect a lost cluster chain | * Try to reconnect a lost cluster chain | ||||
*/ | */ | ||||
int reconnect(int, struct bootblock *, struct fatEntry *, cl_t); | int reconnect(int, struct fat_descriptor *, cl_t, size_t); | ||||
void finishlf(void); | void finishlf(void); | ||||
/* | /* | ||||
* Small helper functions | * Small helper functions | ||||
*/ | */ | ||||
/* | /* | ||||
* Return the type of a reserved cluster as text | * Return the type of a reserved cluster as text | ||||
*/ | */ | ||||
const char *rsrvdcltype(cl_t); | const char *rsrvdcltype(cl_t); | ||||
/* | /* | ||||
* Clear a cluster chain in a FAT | * Clear a cluster chain in a FAT | ||||
*/ | */ | ||||
void clearchain(struct bootblock *, struct fatEntry *, cl_t); | void clearchain(struct bootblock *, struct fat_descriptor *, cl_t); | ||||
#endif | #endif |