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
94dbb356
Commit
94dbb356
authored
Feb 27, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more file methods.
parent
971c6680
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
file_system.go
file_system.go
+48
-0
No files found.
file_system.go
View file @
94dbb356
...
@@ -87,6 +87,21 @@ type FileSystem interface {
...
@@ -87,6 +87,21 @@ type FileSystem interface {
OpenFile
(
OpenFile
(
ctx
context
.
Context
,
ctx
context
.
Context
,
req
*
OpenFileRequest
)
(
*
OpenFileResponse
,
error
)
req
*
OpenFileRequest
)
(
*
OpenFileResponse
,
error
)
// Read data from a file previously opened with OpenFile.
ReadFile
(
ctx
context
.
Context
,
req
*
ReadFileRequest
)
(
*
ReadFileResponse
,
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.
//
// The kernel guarantees that the handle ID will not be used in further calls
// to the file system (unless it is reissued by the file system).
ReleaseFileHandle
(
ctx
context
.
Context
,
req
*
ReleaseFileHandleRequest
)
(
*
ReleaseFileHandleResponse
,
error
)
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
@@ -415,3 +430,36 @@ type OpenFileResponse struct {
...
@@ -415,3 +430,36 @@ type OpenFileResponse struct {
// ReleaseFileHandle.
// ReleaseFileHandle.
Handle
HandleID
Handle
HandleID
}
}
type
ReadFileRequest
struct
{
// The file inode that we are reading, and the handle previously returned by
// OpenFile when opening that inode.
Inode
InodeID
Handle
HandleID
// The range of the file to 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
// (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
}
type
ReadFileResponse
struct
{
// The data read.
Data
[]
byte
}
type
ReleaseFileHandleRequest
struct
{
// The handle ID to be released. The kernel guarantees that this ID will not
// be used in further calls to the file system (unless it is reissued by the
// file system).
Handle
HandleID
}
type
ReleaseFileHandleResponse
struct
{
}
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