Documentation
¶
Overview ¶
Package lockedfs serialises a go-filesystems driver behind one mutex while keeping exactly the optional capabilities the driver had, and latches the first failed fsync of the image so a retry cannot report success (fsyncgate).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lock ¶
func Lock(fsys filesystem.Filesystem) filesystem.Filesystem
Lock wraps a driver so that every caller shares one lock. See lockFS.
func LockImage ¶
func LockImage(fsys filesystem.Filesystem, img interface{ Sync() error }) filesystem.Filesystem
LockImage is Lock for a driver that reads and writes through img: a flush on a driver with no Sync of its own fsyncs img, and the first failure of that fsync (or of a handle's Sync) is latched for the life of the wrapper. See lockFSImage.
func Mutex ¶ added in v0.2.0
func Mutex(fsys filesystem.Filesystem) (*sync.Mutex, bool)
Mutex returns the one mutex behind a filesystem that Lock or LockImage returned, whatever capabilities it carries, and false for any other value. A caller that must run something exclusive with every call on the image (a driver setting that cannot run beside a mutator) takes it; it must not call back into the wrapper while holding it.
Types ¶
This section is empty.