Commit 8b325003 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

nodefs: document FS that uses Lookup

parent ab26406a
...@@ -43,11 +43,16 @@ ...@@ -43,11 +43,16 @@
// references, it is removed from the file system trees. // references, it is removed from the file system trees.
// //
// File system trees can also be constructed in advance. This is done // File system trees can also be constructed in advance. This is done
// by instantiating "persistent" inodes. Persistent inodes remain in // by instantiating "persistent" inodes from the Operations.OnAdd
// memory even if the kernel has forgotten them. See zip_test.go for // method. Persistent inodes remain in memory even if the kernel has
// an example of how to do this. // forgotten them. See zip_test.go for an example of how to do this.
// //
// XXX node example with Lookup. // File systems whose tree structures are on backing storage typically
// discover the file system tree on-demand, and if the kernel is tight
// on memory, parts of the tree are forgotten again. These file
// systems should implement Operations.Lookup instead. The loopback
// file system created by `NewLoopbackRoot` provides a straightforward
// example.
// //
package nodefs package nodefs
...@@ -142,8 +147,6 @@ type FileOperations interface { ...@@ -142,8 +147,6 @@ type FileOperations interface {
// is optional but recommended to return a FileHandle. // is optional but recommended to return a FileHandle.
Open(ctx context.Context, flags uint32) (fh FileHandle, fuseFlags uint32, status fuse.Status) Open(ctx context.Context, flags uint32) (fh FileHandle, fuseFlags uint32, status fuse.Status)
// File locking
// Reads data from a file. The data should be returned as // Reads data from a file. The data should be returned as
// ReadResult, which may be constructed from the incoming // ReadResult, which may be constructed from the incoming
// `dest` buffer. If the file was opened without FileHandle, // `dest` buffer. If the file was opened without FileHandle,
...@@ -178,8 +181,10 @@ type FileOperations interface { ...@@ -178,8 +181,10 @@ type FileOperations interface {
// never encounter ESPACE. // never encounter ESPACE.
Allocate(ctx context.Context, f FileHandle, off uint64, size uint64, mode uint32) (status fuse.Status) Allocate(ctx context.Context, f FileHandle, off uint64, size uint64, mode uint32) (status fuse.Status)
// FGetAttr is like GetAttr but provides a file handle if available.
FGetAttr(ctx context.Context, f FileHandle, out *fuse.AttrOut) fuse.Status FGetAttr(ctx context.Context, f FileHandle, out *fuse.AttrOut) fuse.Status
// FSetAttr is like SetAttr but provides a file handle if available.
FSetAttr(ctx context.Context, f FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) fuse.Status FSetAttr(ctx context.Context, f FileHandle, in *fuse.SetAttrIn, out *fuse.AttrOut) fuse.Status
} }
......
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