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
4c504db8
Commit
4c504db8
authored
Aug 15, 2010
by
Ivan Krasin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed GetAttr: it need to look at NodeId, not Fh. Also, tested that 0755 mode works
parent
38bf7a6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
fuse/fuse.go
fuse/fuse.go
+5
-9
fuse/fuse_test.go
fuse/fuse_test.go
+1
-7
No files found.
fuse/fuse.go
View file @
4c504db8
...
...
@@ -179,7 +179,7 @@ func getAttr(fs FileSystem, h *InHeader, ing interface{}, c *managerClient) (int
in
:=
ing
.
(
*
GetAttrIn
)
fmt
.
Printf
(
"FUSE_GETATTR: %v, Fh: %d
\n
"
,
in
,
in
.
Fh
)
out
:=
new
(
AttrOut
)
resp
:=
c
.
getPath
(
in
.
Fh
)
resp
:=
c
.
getPath
(
h
.
NodeId
)
if
resp
.
status
!=
OK
{
return
nil
,
resp
.
status
}
...
...
@@ -359,6 +359,7 @@ func startManager(fs FileSystem, requests chan *managerRequest) {
m
.
client
=
&
managerClient
{
requests
}
m
.
dirHandles
=
make
(
map
[
uint64
]
*
dirHandle
)
m
.
nodes
=
make
(
map
[
uint64
]
string
)
m
.
nodes
[
0
]
=
""
m
.
nodes
[
1
]
=
""
// Root
m
.
nodeMax
=
1
m
.
nodesByPath
=
make
(
map
[
string
]
uint64
)
...
...
@@ -391,8 +392,8 @@ func (c *managerClient) getDirReader(nodeId, fh uint64) (resp *managerResponse)
return
c
.
makeManagerRequest
(
nodeId
,
fh
,
getHandleOp
,
""
)
}
func
(
c
*
managerClient
)
getPath
(
fh
uint64
)
(
resp
*
managerResponse
)
{
return
c
.
makeManagerRequest
(
0
,
fh
,
getPathOp
,
""
)
func
(
c
*
managerClient
)
getPath
(
nodeId
uint64
)
(
resp
*
managerResponse
)
{
return
c
.
makeManagerRequest
(
nodeId
,
0
,
getPathOp
,
""
)
}
func
(
c
*
managerClient
)
closeDir
(
nodeId
,
fh
uint64
)
(
resp
*
managerResponse
)
{
...
...
@@ -490,12 +491,7 @@ func (m *manager) lookup(req *managerRequest) (resp *managerResponse) {
func
(
m
*
manager
)
getPath
(
req
*
managerRequest
)
(
resp
*
managerResponse
)
{
resp
=
new
(
managerResponse
)
h
,
ok
:=
m
.
dirHandles
[
req
.
fh
]
if
!
ok
{
resp
.
status
=
ENOENT
return
}
path
,
ok
:=
m
.
nodes
[
h
.
nodeId
]
path
,
ok
:=
m
.
nodes
[
req
.
nodeId
]
if
!
ok
{
resp
.
status
=
ENOENT
return
...
...
fuse/fuse_test.go
View file @
4c504db8
...
...
@@ -19,7 +19,7 @@ var (
type
testFuse
struct
{}
func
(
fs
*
testFuse
)
GetAttr
(
path
string
)
(
out
Attr
,
code
Status
)
{
out
.
Mode
=
S_IFDIR
out
.
Mode
=
S_IFDIR
+
0755
out
.
Mtime
=
uint64
(
time
.
Seconds
())
return
}
...
...
@@ -41,12 +41,6 @@ func errorHandler(errors chan os.Error) {
func
TestMount
(
t
*
testing
.
T
)
{
fs
:=
new
(
testFuse
)
// toW := make(chan [][]byte, 100)
// errors := make(chan os.Error, 100)
// in_data := []byte { 56, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 13, 0, 0, 0, 0, 0, 2, 0, 123, 0, 0, 0, }
// handle(fs, in_data, toW, errors)
// return
err
:=
os
.
Mkdir
(
tempMountDir
,
0777
)
if
err
!=
nil
{
...
...
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