From: Nikolaus R. <Nik...@ra...> - 2014-02-07 02:11:59
|
Hans Beckerus <han...@pu...> writes: > Hi all. I am using a sort of pass-through r/o file system written using > the high level API. That is, files on the real file system are massaged > before being exposed to the user in a FUSE mount point. Now, something > that confuses me is how the page cache works for files accessed through > a FUSE file system. > Is it the file/inode that is exposed through FUSE that will populate the > cache or is it the actual file accessed on the real file system? Both the underlying file and the inode exposed by FUSE will be cached independently. The kernel does not know about any connection between them. > I would like to flush the page cache in a controlled manner through e.g. > fsync(), but can I actually do that from the fs implementation? Which page cache do you mean? To flush the cache for the FUSE fs, you need to use the fuse_notify_* functions. To flush the page cache for the underlying file system, you can use fsync() as usual. Note that FUSE currently does not do write caching, and that fsync() only commits data to disk but does not empty the cache. Best, -Nikolaus -- Encrypted emails preferred. PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C »Time flies like an arrow, fruit flies like a Banana.« |