About FAT16 file system cache

W

Watson

I make a FAT16 file system on ramdisk(Not Hard disk). But I found it's not
so timely when writing data to the ramdisk. That means when I copy files to
the ramdisk, there will be several seconds' delay after my copy action. The
FAT table about the copied-file info is created 2~5 seconds delay.

So the question is HOW to disable the file system's cache? In linux OS,
there's 'SYNC' command and synchronize time can be set. In WinXP, how to do?
Do I need to add something in my ramdisk driver?
Thanks your support if you can.
 
U

Uwe Sieber

Watson said:
I make a FAT16 file system on ramdisk(Not Hard disk). But I found it's not
so timely when writing data to the ramdisk. That means when I copy files to
the ramdisk, there will be several seconds' delay after my copy action. The
FAT table about the copied-file info is created 2~5 seconds delay.

So the question is HOW to disable the file system's cache? In linux OS,
there's 'SYNC' command and synchronize time can be set. In WinXP, how to do?
Do I need to add something in my ramdisk driver?
Thanks your support if you can.

You can call FlushFileBuffers with a read+write handle
to the storage volume to get a 'sync on request'. But
as far as I know there is no way to set a snychronize
time.
Deactivating the write cache might be possible by setting
the removal policy CM_REMOVAL_POLICY_EXPECT_SURPRISE_REMOVAL.

Try the newsgroup microsoft.public.win32.programmer.kernel,
they know better...


Uwe
 
K

Ken Blake, MVP

I make a FAT16 file system on ramdisk(Not Hard disk).


Although there may occasionally be a special situation where this
makes sense, for almost everyone running Windows, doing this is
counterproductive. Why are you doing this, and what do you hope to
gain?
 
D

David H. Lipman

From: "Ken Blake, MVP" <[email protected]>

| On Tue, 19 Feb 2008 00:41:00 -0800, Watson
|
| Although there may occasionally be a special situation where this
| makes sense, for almost everyone running Windows, doing this is
| counterproductive. Why are you doing this, and what do you hope to
| gain?
|

I agree. What does a WinXP user nees a RAM Disk for ??
 
K

Ken Blake, MVP

From: "Ken Blake, MVP" <[email protected]>

| On Tue, 19 Feb 2008 00:41:00 -0800, Watson

|
| Although there may occasionally be a special situation where this
| makes sense, for almost everyone running Windows, doing this is
| counterproductive. Why are you doing this, and what do you hope to
| gain?
|

I agree. What does a WinXP user nees a RAM Disk for ??


Usually it's because the poster mistakenly thinks it will speed up
Windows to put the page file there. In fact, that will slow down
Windows.
 
U

Uncle Grumpy

David H. Lipman said:
I agree. What does a WinXP user nees a RAM Disk for ??

The user has probably been using a RAM disk for centuries - like since
systems came with only a couple megs of RAM - and just can't let go.
 
P

Plato

David said:
|
| Although there may occasionally be a special situation where this
| makes sense, for almost everyone running Windows, doing this is
| counterproductive. Why are you doing this, and what do you hope to
| gain?

I agree. What does a WinXP user nees a RAM Disk for ??

Nothing at all....
 
W

Watson

Thanks, Uwe, everyone.
I have used FlushFileBuffers in my user mode application and it does work.
But my customer would like me to implement this 'sync' feature in ramdisk
driver. Is there any function call in driver mode like FlushFileBuffers? Or
is there a flag in driver to notify FAT 16 to do sync operation right now?

In fact, on my board I write this driver for a SRAM with battery. The SRAM
will store some files like a disk.
I used WinDBG to debug and found FAT file system would write the table
2~5seconds delay when do file copy/delete action. Thus when power is off
suddenly, the files would NOT occur on the SRAM disk because FAT table has
not finished writing. But the data have already been on SRAM disk.

Also, if you have any advice you can contact me with :
(e-mail address removed)
 
W

Watson

Thanks, Uwe, everyone.
I have used FlushFileBuffers in my user mode application and it does work.
But my customer would like me to implement this 'sync' feature in ramdisk
driver. Is there any function call in driver mode like FlushFileBuffers? Or
is there a flag in driver to notify FAT 16 to do sync operation right now?

In fact, on my board I write this driver for a SRAM with battery. The SRAM
will store some files like a disk.
I used WinDBG to debug and found FAT file system would write the table
2~5seconds delay when do file copy/delete action. Thus when power is off
suddenly, the files would NOT occur on the SRAM disk because FAT table has
not finished writing. But the data have already been on SRAM disk.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top