Cache Coherence

Submitted by jcochett
on March 19, 2006 - 6:09pm

If you are keeping up to date on my blogging then you will know I have a program that opens a file, pulls the file's contents into memory (pulls a full block), gets a pointer to the file's contents, and then reads or overwrites at that location. The problem is that I need to get the data that is overwritten back down to the disk.

The procedure to do this has to be: 1. Mark the buffer (page?) dirty, then 2. Flush the buffer. Marking the buffer is the easy part, flushing is the harder part for some reason. I can successfully do this; however, it takes a full reboot. This isn't acceptable. Once I find the right function(s) to write my content back down to disk. I will have a way to write directly into slack space of a file.

fsync()? O_DIRECT? O_SYNC?

Anonymous (not verified)
on
March 28, 2006 - 5:09am

fsync()? O_DIRECT? O_SYNC?

Fsync

on
March 31, 2006 - 3:36pm

From your question I am assuming you are asking if I attempted to use fsync or a function there of. I have attempted to use fysnc directly from the command line as root; it had no effect.

As far as O_DIRECT and O_SYNC, I will begin researching them. They look promising. I will post what I find. Thanks for the help.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.