From b5be88054f114ed068f2d3fe72f8f9b796cb2bdc Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Wed, 29 Jul 2015 15:32:49 +1000 Subject: [PATCH] Defined SetKeepCache and read behavior. --- samples/cachingfs/caching_fs.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/samples/cachingfs/caching_fs.go b/samples/cachingfs/caching_fs.go index 2565719..fa537d2 100644 --- a/samples/cachingfs/caching_fs.go +++ b/samples/cachingfs/caching_fs.go @@ -43,6 +43,10 @@ const ( // inode entries and attributes to be cached, used when responding to fuse // requests. It also exposes methods for renumbering inodes and updating mtimes // that are useful in testing that these durations are honored. +// +// Each file responds to reads with random contents. SetKeepCache can be used +// to control whether the response to OpenFileOp tells the kernel to keep the +// file's data in the page cache or not. type CachingFS interface { fuseutil.FileSystem @@ -236,6 +240,14 @@ func (fs *cachingFS) SetMtime(mtime time.Time) { fs.mtime = mtime } +// Instruct the file system whether or not to reply to OpenFileOp with +// FOPEN_KEEP_CACHE set. +// +// LOCKS_EXCLUDED(fs.mu) +func (fs *cachingFS) SetKeepCache(keep bool) { + // TODO +} + //////////////////////////////////////////////////////////////////////// // FileSystem methods ////////////////////////////////////////////////////////////////////////