"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "fat.c" between
mtools-4.0.35.tar.bz2 and mtools-4.0.36.tar.bz2

About: Mtools is a collection of utilities to access MS-DOS disks from Unix without mounting them.

fat.c  (mtools-4.0.35.tar.bz2):fat.c  (mtools-4.0.36.tar.bz2)
skipping to change at line 43 skipping to change at line 43
fatBitMask dirty; fatBitMask dirty;
fatBitMask valid; fatBitMask valid;
} FatMap_t; } FatMap_t;
#define SECT_PER_ENTRY (sizeof(fatBitMask)*8) #define SECT_PER_ENTRY (sizeof(fatBitMask)*8)
#define ONE ((fatBitMask) 1) #define ONE ((fatBitMask) 1)
static __inline__ ssize_t readSector(Fs_t *This, char *buf, unsigned int off, static __inline__ ssize_t readSector(Fs_t *This, char *buf, unsigned int off,
size_t size) size_t size)
{ {
return READS(This->Next, buf, sectorsToBytes(This, off), return PREADS(This->head.Next, buf, sectorsToBytes(This, off),
size << This->sectorShift); size << This->sectorShift);
} }
static __inline__ ssize_t forceReadSector(Fs_t *This, char *buf, static __inline__ ssize_t forceReadSector(Fs_t *This, char *buf,
unsigned int off, size_t size) unsigned int off, size_t size)
{ {
return force_read(This->Next, buf, sectorsToBytes(This, off), return force_pread(This->head.Next, buf, sectorsToBytes(This, off),
size << This->sectorShift); size << This->sectorShift);
} }
static __inline__ ssize_t forceWriteSector(Fs_t *This, char *buf, unsigned int o ff, static __inline__ ssize_t forceWriteSector(Fs_t *This, char *buf, unsigned int o ff,
size_t size) size_t size)
{ {
return force_write(This->Next, buf, sectorsToBytes(This, off), return force_pwrite(This->head.Next, buf, sectorsToBytes(This, off),
size << This->sectorShift); size << This->sectorShift);
} }
static FatMap_t *GetFatMap(Fs_t *Stream) static FatMap_t *GetFatMap(Fs_t *Stream)
{ {
size_t nr_entries; size_t nr_entries;
size_t i; size_t i;
FatMap_t *map; FatMap_t *map;
Stream->fat_error = 0; Stream->fat_error = 0;
nr_entries = (Stream->fat_len + SECT_PER_ENTRY - 1) / SECT_PER_ENTRY; nr_entries = (Stream->fat_len + SECT_PER_ENTRY - 1) / SECT_PER_ENTRY;
skipping to change at line 845 skipping to change at line 845
} }
fprintf(stderr,"No free cluster %d %d\n", This->preallocatedClusters, fprintf(stderr,"No free cluster %d %d\n", This->preallocatedClusters,
This->last); This->last);
return 1; return 1;
exit_0: exit_0:
fprintf(stderr, "FAT error\n"); fprintf(stderr, "FAT error\n");
return 1; return 1;
} }
bool getSerialized(Fs_t *Fs) {
return Fs->serialized;
}
unsigned long getSerialNumber(Fs_t *Fs) {
return Fs->serial_number;
}
uint32_t getClusterBytes(Fs_t *Fs) {
return Fs->cluster_size * Fs->sector_size;
}
int fat_error(Stream_t *Dir) int fat_error(Stream_t *Dir)
{ {
Stream_t *Stream = GetFs(Dir); Stream_t *Stream = GetFs(Dir);
DeclareThis(Fs_t); DeclareThis(Fs_t);
if(This->fat_error) if(This->fat_error)
fprintf(stderr,"Fat error detected\n"); fprintf(stderr,"Fat error detected\n");
return This->fat_error; return This->fat_error;
} }
 End of changes. 4 change blocks. 
6 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)