Documentation ¶
Overview ¶
Package openfiletable maintains a table of currently opened files, identified by the device number + inode number pair. This table is used by fusefrontend to centrally store the current file ID and to lock files against concurrent writes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unregister ¶
func Unregister(qi QIno)
Unregister decrements the reference count for "qi" and deletes the entry from the open file table if the reference count reaches 0.
func WriteOpCount ¶
func WriteOpCount() uint64
WriteOpCount returns the write lock counter value. This value is encremented each time writeLock.Lock() on a file table entry is called.
Types ¶
type Entry ¶
type Entry struct { // ContentLock guards the file content from concurrent writes. Every writer // must take this lock before modifying the file content. ContentLock countingMutex // HeaderLock guards the file ID (in this struct) and the file header (on // disk). Take HeaderLock.RLock() to make sure the file ID does not change // behind your back. If you modify the file ID, you must take // HeaderLock.Lock(). HeaderLock sync.RWMutex // ID is the file ID in the file header. ID []byte // contains filtered or unexported fields }
Entry is an entry in the open file table
type QIno ¶
QIno = Qualified Inode number. Uniquely identifies a backing file through the device number, inode number pair.
func QInoFromStat ¶
QInoFromStat fills a new QIno struct with the passed Stat_t info.