Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
e09493f4
Commit
e09493f4
authored
Jul 29, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make DropAll take a []string argument to have selective cache drops.
parent
15487a16
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
unionfs/cachingfs.go
unionfs/cachingfs.go
+1
-1
unionfs/timedcache.go
unionfs/timedcache.go
+9
-2
unionfs/unionfs.go
unionfs/unionfs.go
+3
-5
No files found.
unionfs/cachingfs.go
View file @
e09493f4
...
...
@@ -100,7 +100,7 @@ func NewCachingFileSystem(fs fuse.FileSystem, ttlNs int64) *CachingFileSystem {
func
(
me
*
CachingFileSystem
)
DropCache
()
{
for
_
,
c
:=
range
[]
*
TimedCache
{
me
.
attributes
,
me
.
dirs
,
me
.
links
,
me
.
xattr
}
{
c
.
DropAll
()
c
.
DropAll
(
nil
)
}
}
...
...
unionfs/timedcache.go
View file @
e09493f4
...
...
@@ -103,8 +103,15 @@ func (me *TimedCache) RecurringPurge() {
func
()
{
me
.
RecurringPurge
()
})
}
func
(
me
*
TimedCache
)
DropAll
()
{
func
(
me
*
TimedCache
)
DropAll
(
names
[]
string
)
{
me
.
cacheMapMutex
.
Lock
()
defer
me
.
cacheMapMutex
.
Unlock
()
me
.
cacheMap
=
make
(
map
[
string
]
*
cacheEntry
,
len
(
me
.
cacheMap
))
if
names
==
nil
{
me
.
cacheMap
=
make
(
map
[
string
]
*
cacheEntry
,
len
(
me
.
cacheMap
))
}
else
{
for
_
,
nm
:=
range
names
{
me
.
cacheMap
[
nm
]
=
nil
,
false
}
}
}
unionfs/unionfs.go
View file @
e09493f4
...
...
@@ -716,10 +716,8 @@ func (me *UnionFs) Rename(src string, dst string) (code fuse.Status) {
return
code
}
// TODO - a DropBranchCache which takes a list of names.
func
(
me
*
UnionFs
)
DropBranchCache
()
{
me
.
branchCache
.
DropAll
()
func
(
me
*
UnionFs
)
DropBranchCache
(
names
[]
string
)
{
me
.
branchCache
.
DropAll
(
names
)
}
func
(
me
*
UnionFs
)
DropDeletionCache
()
{
...
...
@@ -743,7 +741,7 @@ func (me *UnionFs) Open(name string, flags uint32) (fuseFile fuse.File, status f
if
name
==
_DROP_CACHE
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
log
.
Println
(
"Forced cache drop on"
,
me
.
Name
())
me
.
DropBranchCache
()
me
.
DropBranchCache
(
nil
)
me
.
DropDeletionCache
()
me
.
DropSubFsCaches
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment