ShingledFS 2.0
SMR-AwareFUSE-basedFileSystem
|
Defines a Cached File record. More...
#include <buffercache.h>
Defines a Cached File record.
A thread will lock the structure by using the built-in mutex, increment the ref-count on open() or decrement it on close(), and pass the record to a worker thread to load/unload the file data from/to the EDI.
Should the file be in a loading state, a thread can increment/decrement the ref-count as applicable, and wait on the condition variable for the worker thread to wake it up once the transfer is complete.
Worker threads will load/save the file from/to the EDI, lock the mutex, and check the ref-count. If the ref-count is greater than 0, then the worker will broadcast on the condition variable to awaken any threads waiting for the transfer to finish.
path | The path to the open file |
inode | The inode number of the file |
stats | The attributes of the file, cached in memory for fast access |
fd | The file descriptor assigned to the open file |
ref_count | The reference count for the open file |
dirty | Flag describing whether the file was written to since the load |
state | Current state of the file |
mutex | The mutex protecting the open_file record |
cond_var | The condition variable used to wait on the open_file record |
prev | Pointer to the previous open file node |
next | Pointer to the next open file node |
Definition at line 77 of file buffercache.h.