Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenfat.h
Go to the documentation of this file.
00001 /* fat.h - Read/write access to the FAT */ 00002 00003 /* Written 1993 by Werner Almesberger */ 00004 00005 00006 #ifndef _FAT_H 00007 #define _FAT_H 00008 00009 void read_fat(DOS_FS *fs); 00010 00011 /* Loads the FAT of the file system described by FS. Initializes the FAT, 00012 replaces broken FATs and rejects invalid cluster entries. */ 00013 00014 void set_fat(DOS_FS *fs,unsigned long cluster,unsigned long new); 00015 00016 /* Changes the value of the CLUSTERth cluster of the FAT of FS to NEW. Special 00017 values of NEW are -1 (EOF, 0xff8 or 0xfff8) and -2 (bad sector, 0xff7 or 00018 0xfff7) */ 00019 00020 int bad_cluster(DOS_FS *fs,unsigned long cluster); 00021 00022 /* Returns a non-zero integer if the CLUSTERth cluster is marked as bad or zero 00023 otherwise. */ 00024 00025 unsigned long next_cluster(DOS_FS *fs,unsigned long cluster); 00026 00027 /* Returns the number of the cluster following CLUSTER, or -1 if this is the 00028 last cluster of the respective cluster chain. CLUSTER must not be a bad 00029 cluster. */ 00030 00031 loff_t cluster_start(DOS_FS *fs,unsigned long cluster); 00032 00033 /* Returns the byte offset of CLUSTER, relative to the respective device. */ 00034 00035 void set_owner(DOS_FS *fs,unsigned long cluster,DOS_FILE *owner); 00036 00037 /* Sets the owner pointer of the respective cluster to OWNER. If OWNER was NULL 00038 before, it can be set to NULL or any non-NULL value. Otherwise, only NULL is 00039 accepted as the new value. */ 00040 00041 DOS_FILE *get_owner(DOS_FS *fs,unsigned long cluster); 00042 00043 /* Returns the owner of the repective cluster or NULL if the cluster has no 00044 owner. */ 00045 00046 void fix_bad(DOS_FS *fs); 00047 00048 /* Scans the disk for currently unused bad clusters and marks them as bad. */ 00049 00050 void reclaim_free(DOS_FS *fs); 00051 00052 /* Marks all allocated, but unused clusters as free. */ 00053 00054 void reclaim_file(DOS_FS *fs); 00055 00056 /* Scans the FAT for chains of allocated, but unused clusters and creates files 00057 for them in the root directory. Also tries to fix all inconsistencies (e.g. 00058 loops, shared clusters, etc.) in the process. */ 00059 00060 unsigned long update_free(DOS_FS *fs); 00061 00062 /* Updates free cluster count in FSINFO sector. */ 00063 00064 #endif Generated on Sat May 19 2012 04:16:48 for ReactOS by
1.7.6.1
|