Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DifferenceOperations ¶
type DifferenceOperations interface { ResolveDiff(string, string) error Create(string) error Link(string, string) error Symlink(string) error Unlink(string) error Rmdir(string) error Mkdir(string) error Mknod(string) error // Stop checks if the differ needs to stop because of cancellation or error had happened Stop() bool }
DifferenceOperations is the operations interface for consumers. All strings
- contain paths, but no string contains the prefix to the mountpoint. Our
- caller is expected to know that. *
- ResolveDiff (origin string, target string)
- origin is the path on the origin mount
- target is the path on the target mount *
- Both data and metadata are differenced. *
- Creat(path string)
- path in target containing regular file to be recreated. *
- Link(path string, dst string)
- path is where we create the link
- dst is the link's target *
- Symlink(path string)
- path is location in target of symlink to recreate. *
- Unlink(path string)
- path is where the unlink command is executed *
- Rmdir(path string)
- path is where the rmdir command is executed *
- Mkdir(path string)
- path is location in target of directory to recreate. *
- Mknod(path string)
- path is location in target of node to recreate. *
- This is expected to handle block devices, character devices, fifos and
- unix domain sockets. *
- MkTmpDir(path string) - Not implemented yet
- path to make directory with default permissions. It is to be empty at
- the end and also unlinked. The only valid operation involving this
- directory is Rename. *
- Rename(src string, dst string) - Not implemented yet
- Neither of these need correspond to things in the origin or target
- snapshots. It just needs to be sent to the other side to enable us to
- perform a POSIX conformant transofmration of the hierachy. This is used
- in conjunction with MkTmpDir. *
- Operational methods:
- ErrorChannel() chan<- error
- Returns the internal error reporting channel
- ExErrorChannel() chan<- error
- Returns the external error reporting channel
type State ¶
type State struct {
// contains filtered or unexported fields
}
State encapsulates global state for the delta algorithm
func Alloc ¶
func Alloc(origin string, target string, dops DifferenceOperations, xattrMetadata bool) *State
Alloc is our State constructor
func (*State) DoParsing ¶
DoParsing does a depth first search traversal of the filesystem using the openat and getdents system calls to generate a parse graph. Each directory has 1 open() operation and 1 or more getdents operations on each snapshot. The number of getdents operations can be reduced on snapshots with large directories by increasing getdentsBufSize. Absolute paths are used for the root directories while relative paths are used for all other directories. This speeds up path lookups inside the kernel.