Chameleon

Chameleon Commit Details

Date:2010-08-05 03:30:22 (13 years 8 months ago)
Author:Tamás Kosárszky
Commit:304
Parents: 303
Message:Fixed cache size configuration in msdos.c.
Changes:
M/trunk/i386/libsaio/msdos.c

File differences

trunk/i386/libsaio/msdos.c
7575
7676
7777
78
7978
8079
8180
......
153152
154153
155154
156
155
157156
158157
159158
......
224223
225224
226225
227
228
226
229227
230228
231229
......
233231
234232
235233
236
237
234
235
238236
239237
240
241
238
239
242240
243241
244242
static CICell msdoscurrent = 0;
static int msdosrootcluster = 0;
static int msdosfatbits = 0;
static int msdosCacheBlockSize = 0;
#if UNUSED
/*
if (msdoscurrent == ih)
{
CacheInit(ih, msdosCacheBlockSize);
CacheInit(ih, msdosclustersize);
return 0;
}
msdosclustersize = msdosbps * spc;
msdoscurrent = ih;
msdosCacheBlockSize = (msdosclustersize > MAX_CACHE_BLOCKSIZE) ? msdosclustersize : MAX_CACHE_BLOCKSIZE;
CacheInit(ih, msdosCacheBlockSize);
CacheInit(ih, msdosclustersize);
free (buf);
return 0;
}
static int
readSectorAligned(CICell ih, off_t readOffset, char *buf, int size)
{
long long sectorOffset = (uint64_t)readOffset / msdosCacheBlockSize * msdosCacheBlockSize;
long relOffset = readOffset % msdosCacheBlockSize;
long long sectorOffset = (uint64_t)readOffset / msdosclustersize * msdosclustersize;
long relOffset = readOffset % msdosclustersize;
char *cacheBuffer;
cacheBuffer = malloc(msdosCacheBlockSize);
CacheRead(ih, cacheBuffer, sectorOffset, msdosCacheBlockSize, true);
cacheBuffer = malloc(msdosclustersize);
CacheRead(ih, cacheBuffer, sectorOffset, msdosclustersize, true);
bcopy(cacheBuffer + relOffset, buf, size);
free(cacheBuffer);

Archive Download the corresponding diff file

Revision: 304