Home | Info | Community | Development | myReactOS | Contact Us
Flushes all Write cache buffers with no active Handles.
Definition at line 297 of file ff_ioman.c.
Referenced by FF_Close(), FF_CreateFile(), FF_MkDir(), FF_Move(), FF_RmDir(), FF_RmFile(), FF_Seek(), and FF_UnmountPartition().
{ FF_T_UINT16 i,x; if(!pIoman) { return FF_ERR_NULL_POINTER | FF_FLUSHCACHE; } FF_PendSemaphore(pIoman->pSemaphore); { for(i = 0; i < pIoman->CacheSize; i++) { if((pIoman->pBuffers + i)->NumHandles == 0 && (pIoman->pBuffers + i)->Modified == FF_TRUE) { FF_BlockWrite(pIoman, (pIoman->pBuffers + i)->Sector, 1, (pIoman->pBuffers + i)->pBuffer); // Buffer has now been flushed, mark it as a read buffer and unmodified. (pIoman->pBuffers + i)->Mode = FF_MODE_READ; (pIoman->pBuffers + i)->Modified = FF_FALSE; // Search for other buffers that used this sector, and mark them as modified // So that further requests will result in the new sector being fetched. for(x = 0; x < pIoman->CacheSize; x++) { if(x != i) { if((pIoman->pBuffers + x)->Sector == (pIoman->pBuffers + i)->Sector && (pIoman->pBuffers + x)->Mode == FF_MODE_READ) { (pIoman->pBuffers + x)->Modified = FF_TRUE; } } } } } } FF_ReleaseSemaphore(pIoman->pSemaphore); return FF_ERR_NONE; }