Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
f5d80cf9
Commit
f5d80cf9
authored
Jul 29, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Defined the new API for ReadFileOp and ReadDirOp.
parent
314b93c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
fuseops/ops.go
fuseops/ops.go
+25
-24
No files found.
fuseops/ops.go
View file @
f5d80cf9
...
@@ -384,25 +384,25 @@ type ReadDirOp struct {
...
@@ -384,25 +384,25 @@ type ReadDirOp struct {
// offset, and return array offsets into that cached listing.
// offset, and return array offsets into that cached listing.
Offset
DirOffset
Offset
DirOffset
// The maximum number of bytes to return in ReadDirResponse.Data. A smaller
// The destination buffer, whose length gives the size of the read.
// number is acceptable.
//
Size
int
// The output data should consist of a sequence of FUSE directory entries in
// the format generated by fuse_add_direntry (http://goo.gl/qCcHCV), which is
// Set by the file system: a buffer consisting of a sequence of FUSE
// consumed by parse_dirfile (http://goo.gl/2WUmD2). Use
// directory entries in the format generated by fuse_add_direntry
// fuseutil.AppendDirent to generate this data.
// (http://goo.gl/qCcHCV), which is consumed by parse_dirfile
// (http://goo.gl/2WUmD2). Use fuseutil.AppendDirent to generate this data.
//
//
// The buffer must not exceed the length specified in ReadDirRequest.Size. It
// It is okay for the final entry to be truncated if it doesn't fit;
// is okay for the final entry to be truncated; parse_dirfile copes with this
// parse_dirfile copes with this by ignoring the partial record.
// by ignoring the partial record.
//
//
// Each entry returned exposes a directory offset to the user that may later
// Each entry returned exposes a directory offset to the user that may later
// show up in ReadDirRequest.Offset. See notes on that field for more
// show up in ReadDirRequest.Offset. See notes on that field for more
// information.
// information.
//
Dst
[]
byte
// An empty buffer indicates the end of the directory has been reached.
Data
[]
byte
// Set by the file system: the number of bytes read into Dst. It is okay for
// this to be less than len(Dst) if there is less data available. A value of
// zero means that the end of the directory has been reached.
BytesRead
int
}
}
// Release a previously-minted directory handle. The kernel sends this when
// Release a previously-minted directory handle. The kernel sends this when
...
@@ -455,20 +455,21 @@ type ReadFileOp struct {
...
@@ -455,20 +455,21 @@ type ReadFileOp struct {
Inode
InodeID
Inode
InodeID
Handle
HandleID
Handle
HandleID
// The range of the file to read.
// The offset within the file at which to read.
Offset
int64
// The destination buffer, whose length gives the size of the read.
Dst
[]
byte
// Set by the file system: the number of bytes read.
//
//
// The FUSE documentation requires that exactly the
number of bytes be
// The FUSE documentation requires that exactly the
requested number of bytes
//
returned, except in the case of EOF or error (http://goo.gl/ZgfBkF). This
//
be returned, except in the case of EOF or error (http://goo.gl/ZgfBkF).
// appears to be because it uses file mmapping machinery
//
This
appears to be because it uses file mmapping machinery
// (http://goo.gl/SGxnaN) to read a page at a time. It appears to understand
// (http://goo.gl/SGxnaN) to read a page at a time. It appears to understand
// where EOF is by checking the inode size (http://goo.gl/0BkqKD), returned
// where EOF is by checking the inode size (http://goo.gl/0BkqKD), returned
// by a previous call to LookUpInode, GetInodeAttributes, etc.
// by a previous call to LookUpInode, GetInodeAttributes, etc.
Offset
int64
BytesRead
int
Size
int
// Set by the file system: the data read. If this is less than the requested
// size, it indicates EOF. An error should not be returned in this case.
Data
[]
byte
}
}
// Write data to a file previously opened with CreateFile or OpenFile.
// Write data to a file previously opened with CreateFile or OpenFile.
...
...
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