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
Kirill Smelkov
go-fuse
Commits
ce46e694
Commit
ce46e694
authored
May 27, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document and move ReadResult interface to api.go.
parent
24136e0d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
fuse/api.go
fuse/api.go
+16
-0
fuse/read.go
fuse/read.go
+4
-14
No files found.
fuse/api.go
View file @
ce46e694
...
@@ -144,6 +144,7 @@ type PathNodeFsOptions struct {
...
@@ -144,6 +144,7 @@ type PathNodeFsOptions struct {
ClientInodes
bool
ClientInodes
bool
}
}
// A File object should be returned from FileSystem.Open and
// A File object should be returned from FileSystem.Open and
// FileSystem.Create. Include DefaultFile into the struct to inherit
// FileSystem.Create. Include DefaultFile into the struct to inherit
// a default null implementation.
// a default null implementation.
...
@@ -176,6 +177,21 @@ type File interface {
...
@@ -176,6 +177,21 @@ type File interface {
Utimens
(
atimeNs
int64
,
mtimeNs
int64
)
Status
Utimens
(
atimeNs
int64
,
mtimeNs
int64
)
Status
}
}
// The result of Read is an array of bytes, but for performance
// reasons, we can also return data as a file-descriptor/offset/size
// tuple. If the backing store for a file is another filesystem, this
// reduces the amount of copying between the kernel and the FUSE
// server. The ReadResult interface captures both cases.
type
ReadResult
interface
{
// Returns the raw bytes for the read, possibly using the
// passed buffer. The buffer should be larger than the return
// value from Size.
Bytes
(
buf
[]
byte
)
[]
byte
// Size returns how many bytes this return value takes at most.
Size
()
int
}
// Wrap a File return in this to set FUSE flags. Also used internally
// Wrap a File return in this to set FUSE flags. Also used internally
// to store open file data.
// to store open file data.
type
WithFlags
struct
{
type
WithFlags
struct
{
...
...
fuse/read.go
View file @
ce46e694
...
@@ -5,19 +5,9 @@ import (
...
@@ -5,19 +5,9 @@ import (
"syscall"
"syscall"
)
)
type
ReadResult
interface
{
Bytes
(
buf
[]
byte
)
[]
byte
Size
()
int
}
// The result of Read is an array of bytes, but for performance
// reasons, we can also return data as a file-descriptor/offset/size
// ReadResultData is the read return for returning bytes directly.
// tuple. If the backing store for a file is another filesystem, this
// reduces the amount of copying between the kernel and the FUSE
// server
//
// If at any point, the raw data is needed, ReadResult.Read() will
// load the raw data into the Data member.
type
ReadResultData
struct
{
type
ReadResultData
struct
{
// Raw bytes for the read.
// Raw bytes for the read.
Data
[]
byte
Data
[]
byte
...
@@ -31,9 +21,9 @@ func (r *ReadResultData) Bytes(buf []byte) []byte {
...
@@ -31,9 +21,9 @@ func (r *ReadResultData) Bytes(buf []byte) []byte {
return
r
.
Data
return
r
.
Data
}
}
// ReadResultFd is the read return for zero-copy file data.
type
ReadResultFd
struct
{
type
ReadResultFd
struct
{
// If Data is nil and Status OK, splice from the following
// Splice from the following file.
// file.
Fd
uintptr
Fd
uintptr
// Offset within Fd, or -1 to use current offset.
// Offset within Fd, or -1 to use current offset.
...
...
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