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
597d424f
Commit
597d424f
authored
Aug 14, 2010
by
Ivan Krasin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the problem with hanging: releaseDir didn't send a reply to the kernel
parent
1589f20c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
18 deletions
+27
-18
fuse/fuse.go
fuse/fuse.go
+27
-18
No files found.
fuse/fuse.go
View file @
597d424f
...
...
@@ -151,6 +151,7 @@ func initFuse(fs FileSystem, h *InHeader, r io.Reader, mr chan *managerRequest)
out
.
Major
=
FUSE_KERNEL_VERSION
out
.
Minor
=
FUSE_KERNEL_MINOR_VERSION
out
.
MaxReadAhead
=
in
.
MaxReadAhead
out
.
Flags
=
FUSE_ASYNC_READ
|
FUSE_POSIX_LOCKS
out
.
MaxWrite
=
65536
return
serialize
(
h
,
OK
,
out
)
}
...
...
@@ -213,8 +214,8 @@ func readDir(h *InHeader, r io.Reader, mr chan *managerRequest) (data [][]byte,
return
}
dirRespChan
:=
make
(
chan
*
dirResponse
,
1
)
fmt
.
Printf
(
"Sending dir request
\n
"
)
resp
.
dirReq
<-
&
dirRequest
{
false
,
dirRespChan
}
fmt
.
Printf
(
"Sending dir request
, in.Offset: %v
\n
"
,
in
.
Offset
)
resp
.
dirReq
<-
&
dirRequest
{
false
,
in
.
Offset
,
dirRespChan
}
fmt
.
Printf
(
"receiving dir response
\n
"
)
dirResp
:=
<-
dirRespChan
fmt
.
Printf
(
"received %v
\n
"
,
dirResp
)
...
...
@@ -232,7 +233,7 @@ func readDir(h *InHeader, r io.Reader, mr chan *managerRequest) (data [][]byte,
fmt
.
Printf
(
"len(dirResp.entries): %v
\n
"
,
len
(
dirResp
.
entries
))
buf
:=
new
(
bytes
.
Buffer
)
off
:=
uint64
(
0
)
off
:=
in
.
Offset
for
_
,
entry
:=
range
dirResp
.
entries
{
off
++
dirent
:=
new
(
Dirent
)
...
...
@@ -289,7 +290,10 @@ func releaseDir(h *InHeader, r io.Reader, mr chan *managerRequest) (data [][]byt
fmt
.
Printf
(
"FUSE_RELEASEDIR: %v
\n
"
,
in
)
resp
:=
makeManagerRequest
(
mr
,
h
.
NodeId
,
in
.
Fh
,
closeDirOp
,
""
)
err
=
resp
.
err
return
if
err
!=
nil
{
return
}
return
serialize
(
h
,
OK
,
nil
)
}
...
...
@@ -316,10 +320,10 @@ const (
)
type
managerRequest
struct
{
nodeId
uint64
fh
uint64
op
FileOp
resp
chan
*
managerResponse
nodeId
uint64
fh
uint64
op
FileOp
resp
chan
*
managerResponse
filename
string
}
...
...
@@ -328,8 +332,8 @@ type managerResponse struct {
fh
uint64
dirReq
chan
*
dirRequest
err
os
.
Error
code
Error
attr
*
Attr
code
Error
attr
*
Attr
}
type
dirEntry
struct
{
...
...
@@ -339,6 +343,7 @@ type dirEntry struct {
type
dirRequest
struct
{
isClose
bool
offset
uint64
resp
chan
*
dirResponse
}
...
...
@@ -354,12 +359,12 @@ type dirHandle struct {
}
type
manager
struct
{
fs
FileSystem
dirHandles
map
[
uint64
]
*
dirHandle
cnt
uint64
nodes
map
[
uint64
]
string
nodesByPath
map
[
string
]
uint64
nodeMax
uint64
fs
FileSystem
dirHandles
map
[
uint64
]
*
dirHandle
cnt
uint64
nodes
map
[
uint64
]
string
nodesByPath
map
[
string
]
uint64
nodeMax
uint64
}
func
startManager
(
fs
FileSystem
,
requests
chan
*
managerRequest
)
{
...
...
@@ -477,12 +482,16 @@ func readDirRoutine(requests chan *dirRequest) {
&
dirEntry
{
"bb"
,
S_IFDIR
},
&
dirEntry
{
"ddddd"
,
S_IFDIR
},
}
i
:=
0
i
:=
uint64
(
0
)
for
req
:=
range
requests
{
if
req
.
offset
!=
i
{
fmt
.
Printf
(
"readDirRoutine: i = %v, changing offset to %v
\n
"
,
i
,
req
.
offset
)
i
=
req
.
offset
}
if
req
.
isClose
{
return
}
if
i
<
len
(
entries
)
{
if
i
<
uint64
(
len
(
entries
)
)
{
req
.
resp
<-
&
dirResponse
{[]
*
dirEntry
{
entries
[
i
]},
nil
}
i
++
}
else
{
...
...
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