Commit e8c92b25 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: document nodefs package.

parent 9adcb60f
// The nodefs package offers a high level API that resembles the
// kernel's idea of what an FS looks like. File systems can have
// multiple hard-links to one file, for example. It is also suited if
// the data to represent fits in memory: you can construct the
// complete file system tree at mount time
package nodefs package nodefs
import ( import (
...@@ -6,16 +12,12 @@ import ( ...@@ -6,16 +12,12 @@ import (
"github.com/hanwen/go-fuse/fuse" "github.com/hanwen/go-fuse/fuse"
) )
// FileSystem is a high level API that resembles the kernel's idea // The FileSystem is the unit that can be mounted. It's essential
// of what an FS looks like. FileSystems can have multiple // function is the Root() method, which provides access to the file
// hard-links to one file, for example. It is also suited if the data // system tree.
// to represent fits in memory: you can construct Node at mount
// time, and the filesystem will be ready.
type FileSystem interface { type FileSystem interface {
// OnUnmount is executed just before a submount is removed, // Root should return the inode for root of this file system.
// and when the process receives a forget for the FUSE root Root() Node
// node.
OnUnmount()
// OnMount is called just after a mount is executed, either // OnMount is called just after a mount is executed, either
// when the root is mounted, or when other filesystem are // when the root is mounted, or when other filesystem are
...@@ -23,8 +25,10 @@ type FileSystem interface { ...@@ -23,8 +25,10 @@ type FileSystem interface {
// access to Notify methods and Debug settings. // access to Notify methods and Debug settings.
OnMount(conn *FileSystemConnector) OnMount(conn *FileSystemConnector)
// Root should return the inode for root of this file system. // OnUnmount is executed just before a submount is removed,
Root() Node // and when the process receives a forget for the FUSE root
// node.
OnUnmount()
// Used for debug outputs // Used for debug outputs
String() string String() string
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment