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
dcf4c93d
Commit
dcf4c93d
authored
Mar 04, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a WriteFile method.
parent
87f8ec9e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
file_system.go
file_system.go
+33
-2
No files found.
file_system.go
View file @
dcf4c93d
...
...
@@ -150,11 +150,16 @@ type FileSystem interface {
ctx
context
.
Context
,
req
*
OpenFileRequest
)
(
*
OpenFileResponse
,
error
)
// Read data from a file previously opened with OpenFile.
// Read data from a file previously opened with
CreateFile or
OpenFile.
ReadFile
(
ctx
context
.
Context
,
req
*
ReadFileRequest
)
(
*
ReadFileResponse
,
error
)
// Write data to a file previously opened with CreateFile or OpenFile.
WriteFile
(
ctx
context
.
Context
,
req
*
WriteFileRequest
)
(
*
WriteFileResponse
,
error
)
// Release a previously-minted file handle. The kernel calls this when there
// are no more references to an open file: all file descriptors are closed
// and all memory mappings are unmapped.
...
...
@@ -437,6 +442,7 @@ type CreateFileResponse struct {
// The handle may be supplied to the following methods:
//
// * ReadFile
// * WriteFile
// * ReleaseFileHandle
//
// The file system must ensure this ID remains valid until a later call to
...
...
@@ -602,6 +608,7 @@ type OpenFileResponse struct {
// The handle may be supplied to the following methods:
//
// * ReadFile
// * WriteFile
// * ReleaseFileHandle
//
// The file system must ensure this ID remains valid until a later call to
...
...
@@ -613,7 +620,7 @@ type ReadFileRequest struct {
Header
RequestHeader
// The file inode that we are reading, and the handle previously returned by
// OpenFile when opening that inode.
//
CreateFile or
OpenFile when opening that inode.
Inode
InodeID
Handle
HandleID
...
...
@@ -634,6 +641,30 @@ type ReadFileResponse struct {
Data
[]
byte
}
type
WriteFileRequest
struct
{
Header
RequestHeader
// The file inode that we are modifying, and the handle previously returned
// by CreateFile or OpenFile when opening that inode.
Inode
InodeID
Handle
HandleID
// The data to write, and the offset at which to write it.
//
// The FUSE documentation requires that exactly the number of bytes supplied
// be written, except on error (http://goo.gl/KUpwwn). This appears to be
// because it uses file mmapping machinery (http://goo.gl/SGxnaN) to write a
// page at a time.
//
// TODO(jacobsa): Figure out what the posix semantics are for extending the
// file, and document them here.
Data
[]
byte
Offset
int64
}
type
WriteFileResponse
struct
{
}
type
ReleaseFileHandleRequest
struct
{
Header
RequestHeader
...
...
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