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
fb412db2
Commit
fb412db2
authored
May 14, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make .drop_cache file visible (but not in readdir()).
parent
c6382a33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
unionfs/unionfs.go
unionfs/unionfs.go
+19
-7
No files found.
unionfs/unionfs.go
View file @
fb412db2
...
...
@@ -525,13 +525,9 @@ func (me *UnionFs) GetAttr(name string) (a *os.FileInfo, s fuse.Status) {
return
nil
,
fuse
.
ENOENT
}
if
name
==
_DROP_CACHE
{
log
.
Println
(
"Forced cache drop on"
,
me
.
roots
)
me
.
branchCache
.
DropAll
()
me
.
deletionCache
.
DropCache
()
for
_
,
fs
:=
range
me
.
cachingFileSystems
{
fs
.
DropCache
()
}
return
nil
,
fuse
.
ENOENT
return
&
os
.
FileInfo
{
Mode
:
fuse
.
S_IFREG
|
0777
,
},
fuse
.
OK
}
if
name
==
me
.
options
.
DeletionDirName
{
return
nil
,
fuse
.
ENOENT
...
...
@@ -672,7 +668,23 @@ func (me *UnionFs) Rename(src string, dst string) (code fuse.Status) {
return
code
}
func
(
me
*
UnionFs
)
DropCaches
()
{
log
.
Println
(
"Forced cache drop on"
,
me
.
roots
)
me
.
branchCache
.
DropAll
()
me
.
deletionCache
.
DropCache
()
for
_
,
fs
:=
range
me
.
cachingFileSystems
{
fs
.
DropCache
()
}
}
func
(
me
*
UnionFs
)
Open
(
name
string
,
flags
uint32
)
(
fuseFile
fuse
.
File
,
status
fuse
.
Status
)
{
if
name
==
_DROP_CACHE
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
me
.
DropCaches
()
}
return
fuse
.
NewDevNullFile
(),
fuse
.
OK
}
r
:=
me
.
getBranch
(
name
)
if
flags
&
fuse
.
O_ANYWRITE
!=
0
&&
r
.
branch
>
0
{
code
:=
me
.
Promote
(
name
,
r
)
...
...
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