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
Show 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 {
// offset, and return array offsets into that cached listing.
Offset
DirOffset
// The maximum number of bytes to return in ReadDirResponse.Data. A smaller
// number is acceptable.
Size
int
// Set by the file system: a buffer consisting of a sequence of FUSE
// directory entries in the format generated by fuse_add_direntry
// (http://goo.gl/qCcHCV), which is consumed by parse_dirfile
// (http://goo.gl/2WUmD2). Use fuseutil.AppendDirent to generate this data.
// The destination buffer, whose length gives the size of the read.
//
// 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
// 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
// is okay for the final entry to be truncated; parse_dirfile copes with this
// by ignoring the partial record.
// It is okay for the final entry to be truncated if it doesn't fit;
// parse_dirfile copes with this by ignoring the partial record.
//
// 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
// information.
//
// An empty buffer indicates the end of the directory has been reached.
Data
[]
byte
Dst
[]
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
...
...
@@ -455,20 +455,21 @@ type ReadFileOp struct {
Inode
InodeID
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
//
returned, except in the case of EOF or error (http://goo.gl/ZgfBkF). This
// appears to be because it uses file mmapping machinery
// The FUSE documentation requires that exactly the
requested number of bytes
//
be returned, except in the case of EOF or error (http://goo.gl/ZgfBkF).
//
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
// where EOF is by checking the inode size (http://goo.gl/0BkqKD), returned
// by a previous call to LookUpInode, GetInodeAttributes, etc.
Offset
int64
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
BytesRead
int
}
// 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