Simplified inode renumbering.
parent
8e194826f0
commit
064452dcc9
|
@ -23,14 +23,6 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Constants that define the relative offsets of the inodes exported by the
|
|
||||||
// file system. See notes on the RenumberInodes method.
|
|
||||||
const (
|
|
||||||
FooInodeOffset = iota
|
|
||||||
DirInodeOffset
|
|
||||||
BarInodeOffset
|
|
||||||
)
|
|
||||||
|
|
||||||
// A file system with a fixed structure that looks like this:
|
// A file system with a fixed structure that looks like this:
|
||||||
//
|
//
|
||||||
// foo
|
// foo
|
||||||
|
@ -44,18 +36,13 @@ const (
|
||||||
type CachingFS interface {
|
type CachingFS interface {
|
||||||
fuse.FileSystem
|
fuse.FileSystem
|
||||||
|
|
||||||
// Cause inodes to receive IDs according to the following rules in further
|
// Return the current inode ID of the file/directory with the given name.
|
||||||
// responses to fuse:
|
FooID() fuse.InodeID
|
||||||
//
|
DirID() fuse.InodeID
|
||||||
// * The ID of "foo" is base + FooInodeOffset.
|
BarID() fuse.InodeID
|
||||||
// * The ID of "dir" is base + DirInodeOffset.
|
|
||||||
// * The ID of "dir/bar" is base + BarInodeOffset.
|
// Cause the inode IDs to change to values that have never before been used.
|
||||||
//
|
RenumberInodes()
|
||||||
// If this method has never been called, the file system behaves as if it
|
|
||||||
// were called with base set to fuse.RootInodeID + 1.
|
|
||||||
//
|
|
||||||
// REQUIRES: base > fuse.RootInodeID
|
|
||||||
RenumberInodes(base fuse.InodeID)
|
|
||||||
|
|
||||||
// Cause further queries for the attributes of inodes to use the supplied
|
// Cause further queries for the attributes of inodes to use the supplied
|
||||||
// time as the inode's mtime.
|
// time as the inode's mtime.
|
||||||
|
|
Loading…
Reference in New Issue