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
e4dc4c71
Commit
e4dc4c71
authored
Apr 29, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for CachingFileSystem.
parent
51c0d8dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
unionfs/cachingfs.go
unionfs/cachingfs.go
+5
-5
No files found.
unionfs/cachingfs.go
View file @
e4dc4c71
package
unionfs
package
unionfs
import
(
import
(
"fmt"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse"
)
)
var
_
=
fmt
.
Println
type
attrResponse
struct
{
type
attrResponse
struct
{
*
fuse
.
Attr
*
fuse
.
Attr
fuse
.
Status
fuse
.
Status
...
@@ -43,7 +44,6 @@ func readDir(fs fuse.FileSystem, name string) *dirResponse {
...
@@ -43,7 +44,6 @@ func readDir(fs fuse.FileSystem, name string) *dirResponse {
}
}
r
.
entries
=
append
(
r
.
entries
,
d
)
r
.
entries
=
append
(
r
.
entries
,
d
)
}
}
return
r
return
r
}
}
...
@@ -73,17 +73,17 @@ func NewCachingFileSystem(fs fuse.FileSystem, ttlNs int64) *CachingFileSystem {
...
@@ -73,17 +73,17 @@ func NewCachingFileSystem(fs fuse.FileSystem, ttlNs int64) *CachingFileSystem {
}
}
func
(
me
*
CachingFileSystem
)
GetAttr
(
name
string
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
func
(
me
*
CachingFileSystem
)
GetAttr
(
name
string
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
r
:=
me
.
attributes
.
Get
(
name
)
.
(
attrResponse
)
r
:=
me
.
attributes
.
Get
(
name
)
.
(
*
attrResponse
)
return
r
.
Attr
,
r
.
Status
return
r
.
Attr
,
r
.
Status
}
}
func
(
me
*
CachingFileSystem
)
Readlink
(
name
string
)
(
string
,
fuse
.
Status
)
{
func
(
me
*
CachingFileSystem
)
Readlink
(
name
string
)
(
string
,
fuse
.
Status
)
{
r
:=
me
.
attributes
.
Get
(
name
)
.
(
linkResponse
)
r
:=
me
.
attributes
.
Get
(
name
)
.
(
*
linkResponse
)
return
r
.
linkContent
,
r
.
Status
return
r
.
linkContent
,
r
.
Status
}
}
func
(
me
*
CachingFileSystem
)
OpenDir
(
name
string
)
(
stream
chan
fuse
.
DirEntry
,
status
fuse
.
Status
)
{
func
(
me
*
CachingFileSystem
)
OpenDir
(
name
string
)
(
stream
chan
fuse
.
DirEntry
,
status
fuse
.
Status
)
{
r
:=
me
.
dirs
.
Get
(
name
)
.
(
dirResponse
)
r
:=
me
.
dirs
.
Get
(
name
)
.
(
*
dirResponse
)
if
r
.
Status
==
fuse
.
OK
{
if
r
.
Status
==
fuse
.
OK
{
stream
=
make
(
chan
fuse
.
DirEntry
,
len
(
r
.
entries
))
stream
=
make
(
chan
fuse
.
DirEntry
,
len
(
r
.
entries
))
for
_
,
d
:=
range
r
.
entries
{
for
_
,
d
:=
range
r
.
entries
{
...
...
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