Commit 54cbf810 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Print log if cache drop was forced.

parent dd442b25
...@@ -81,6 +81,10 @@ type UnionFsOptions struct { ...@@ -81,6 +81,10 @@ type UnionFsOptions struct {
DeletionDirName string DeletionDirName string
} }
const (
_DROP_CACHE = ".drop_cache"
)
func NewUnionFs(roots []string, options UnionFsOptions) *UnionFs { func NewUnionFs(roots []string, options UnionFsOptions) *UnionFs {
g := new(UnionFs) g := new(UnionFs)
...@@ -330,7 +334,8 @@ func (me *UnionFs) GetAttr(name string) (a *fuse.Attr, s fuse.Status) { ...@@ -330,7 +334,8 @@ func (me *UnionFs) GetAttr(name string) (a *fuse.Attr, s fuse.Status) {
if name == _READONLY { if name == _READONLY {
return nil, fuse.ENOENT return nil, fuse.ENOENT
} }
if name == ".drop_cache" { if name == _DROP_CACHE {
log.Println("Forced cache drop")
me.branchCache.Purge() me.branchCache.Purge()
me.deletionCache.DropCache() me.deletionCache.DropCache()
return nil, fuse.ENOENT return nil, fuse.ENOENT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment