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
cbfa4d27
Commit
cbfa4d27
authored
Jun 30, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse/nodefs: more documentation.
parent
c38f937e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
fuse/nodefs/fsconnector.go
fuse/nodefs/fsconnector.go
+9
-11
No files found.
fuse/nodefs/fsconnector.go
View file @
cbfa4d27
...
...
@@ -19,15 +19,9 @@ import (
// Tests should set to true.
var
paranoia
=
false
// FilesystemConnector is a raw FUSE filesystem that manages
// in-process mounts and inodes. Its job is twofold:
//
// It translates between the raw kernel interface (padded structs of
// int32 and int64) and the more abstract Go-ish NodeFileSystem
// interface.
//
// It manages mounting and unmounting of NodeFileSystems into the
// directory hierarchy.
// FilesystemConnector that translates the raw FUSE protocol
// (serialized structs of uint32/uint64) to operations on Go objects
// representing files and directories.
type
FileSystemConnector
struct
{
// Used as the generation inodes. This must be 64-bit aligned,
// for sync/atomic on i386 to work properly.
...
...
@@ -47,6 +41,8 @@ type FileSystemConnector struct {
rootNode
*
Inode
}
// NewOptions generates FUSE options that correspond to libfuse's
// defaults.
func
NewOptions
()
*
Options
{
return
&
Options
{
NegativeTimeout
:
0
,
...
...
@@ -78,6 +74,7 @@ func NewFileSystemConnector(nodeFs FileSystem, opts *Options) (c *FileSystemConn
return
c
}
// SetDebug toggles printing of debug information.
func
(
c
*
FileSystemConnector
)
SetDebug
(
debug
bool
)
{
c
.
debug
=
debug
}
...
...
@@ -224,6 +221,9 @@ func (c *FileSystemConnector) Node(parent *Inode, fullPath string) (*Inode, []st
}
func
(
c
*
FileSystemConnector
)
LookupNode
(
parent
*
Inode
,
path
string
)
*
Inode
{
// TODO - this is broken. The internalLookups will cause
// Nlookup increments that the kernel does not know about.
if
path
==
""
{
return
parent
}
...
...
@@ -241,8 +241,6 @@ func (c *FileSystemConnector) LookupNode(parent *Inode, path string) *Inode {
return
parent
}
////////////////////////////////////////////////////////////////
func
(
c
*
FileSystemConnector
)
MountRoot
(
nodeFs
FileSystem
,
opts
*
Options
)
{
c
.
rootNode
.
mountFs
(
nodeFs
,
opts
)
c
.
rootNode
.
mount
.
connector
=
c
...
...
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