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
2eb340ae
Commit
2eb340ae
authored
May 11, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support rewinddir. Untested.
parent
9dd4fe7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
README
README
+0
-2
fuse/direntry.go
fuse/direntry.go
+13
-2
fuse/fsops.go
fuse/fsops.go
+1
-0
No files found.
README
View file @
2eb340ae
...
...
@@ -105,8 +105,6 @@ Grep source code for TODO. Major topics:
* Use splice for transporting data, use io.Reader in API.
* Opendir/Readdir does not support seeking
* Missing support for network FS file locking: FUSE_GETLK, FUSE_SETLK,
FUSE_SETLKW
...
...
fuse/direntry.go
View file @
2eb340ae
...
...
@@ -79,16 +79,26 @@ type rawDir interface {
}
type
connectorDir
struct
{
node
FsNode
stream
[]
DirEntry
lastOffset
uint64
}
func
(
d
*
connectorDir
)
ReadDir
(
input
*
ReadIn
)
(
*
DirEntryList
,
Status
)
{
func
(
d
*
connectorDir
)
ReadDir
(
input
*
ReadIn
)
(
list
*
DirEntryList
,
code
Status
)
{
if
d
.
stream
==
nil
{
return
nil
,
OK
}
// rewinddir() should be as if reopening directory.
// TODO - test this.
if
d
.
lastOffset
>
0
&&
input
.
Offset
==
0
{
d
.
stream
,
code
=
d
.
node
.
OpenDir
(
nil
)
if
!
code
.
Ok
()
{
return
nil
,
code
}
}
off
:=
input
.
Offset
list
:
=
NewDirEntryList
(
int
(
input
.
Size
),
off
)
list
=
NewDirEntryList
(
int
(
input
.
Size
),
off
)
todo
:=
d
.
stream
[
off
:
]
for
_
,
e
:=
range
todo
{
...
...
@@ -96,6 +106,7 @@ func (d *connectorDir) ReadDir(input *ReadIn) (*DirEntryList, Status) {
break
}
}
d
.
lastOffset
=
list
.
offset
return
list
,
OK
}
...
...
fuse/fsops.go
View file @
2eb340ae
...
...
@@ -114,6 +114,7 @@ func (c *FileSystemConnector) OpenDir(header *raw.InHeader, input *raw.OpenIn) (
}
stream
=
append
(
stream
,
node
.
getMountDirEntries
()
...
)
de
:=
&
connectorDir
{
node
:
node
.
FsNode
(),
stream
:
append
(
stream
,
DirEntry
{
S_IFDIR
,
"."
},
DirEntry
{
S_IFDIR
,
".."
}),
}
h
,
opened
:=
node
.
mount
.
registerFileHandle
(
node
,
de
,
nil
,
input
.
Flags
)
...
...
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