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
38bf7a6f
Commit
38bf7a6f
authored
Aug 15, 2010
by
Ivan Krasin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified FileSystem: *Attr -> Attr
parent
2409b436
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
fuse/fuse.go
fuse/fuse.go
+4
-9
fuse/fuse_test.go
fuse/fuse_test.go
+1
-2
No files found.
fuse/fuse.go
View file @
38bf7a6f
...
...
@@ -14,7 +14,7 @@ const (
type
FileSystem
interface
{
List
(
parent
string
)
(
names
[]
string
,
status
Status
)
GetAttr
(
path
string
)
(
out
*
Attr
,
status
Status
)
GetAttr
(
path
string
)
(
out
Attr
,
status
Status
)
}
type
Mounted
interface
{
...
...
@@ -187,11 +187,7 @@ func getAttr(fs FileSystem, h *InHeader, ing interface{}, c *managerClient) (int
if
res
!=
OK
{
return
nil
,
res
}
if
attr
!=
nil
{
out
.
Attr
=
*
attr
}
else
{
return
nil
,
EIO
}
out
.
Attr
=
attr
out
.
Ino
=
h
.
NodeId
return
out
,
OK
}
...
...
@@ -266,7 +262,7 @@ func lookup(h *InHeader, r *bytes.Buffer, c *managerClient) (interface{}, Status
}
out
:=
new
(
EntryOut
)
out
.
NodeId
=
resp
.
nodeId
out
.
Attr
=
*
resp
.
attr
out
.
Attr
=
resp
.
attr
out
.
AttrValid
=
60
out
.
EntryValid
=
60
return
out
,
OK
...
...
@@ -319,7 +315,7 @@ type managerResponse struct {
fh
uint64
dirReq
chan
*
dirRequest
status
Status
attr
*
Attr
attr
Attr
path
string
}
...
...
@@ -478,7 +474,6 @@ func (m *manager) lookup(req *managerRequest) (resp *managerResponse) {
if
status
!=
OK
{
resp
.
status
=
status
}
// TODO: sanitize return values, like checking attr != nil
resp
.
attr
=
attr
fullPath
:=
path
.
Clean
(
path
.
Join
(
parent
,
req
.
filename
))
nodeId
,
ok
:=
m
.
nodesByPath
[
fullPath
]
...
...
fuse/fuse_test.go
View file @
38bf7a6f
...
...
@@ -18,8 +18,7 @@ var (
type
testFuse
struct
{}
func
(
fs
*
testFuse
)
GetAttr
(
path
string
)
(
out
*
Attr
,
code
Status
)
{
out
=
new
(
Attr
)
func
(
fs
*
testFuse
)
GetAttr
(
path
string
)
(
out
Attr
,
code
Status
)
{
out
.
Mode
=
S_IFDIR
out
.
Mtime
=
uint64
(
time
.
Seconds
())
return
...
...
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