CernVM-FS
2.12.0
|
#include <fuse_evict.h>
Classes | |
struct | Command |
class | Handle |
struct | InvalDentryCommand |
struct | InvalInodesCommand |
struct | QuitCommand |
Public Member Functions | |
FuseInvalidator (MountPoint *mountpoint, void **fuse_channel_or_session, bool fuse_notify_invalidation) | |
~FuseInvalidator () | |
void | Spawn () |
void | InvalidateInodes (Handle *handle) |
void | InvalidateDentry (uint64_t parent_ino, const NameString &name) |
Static Public Member Functions | |
static bool | HasFuseNotifyInval () |
Private Member Functions | |
FRIEND_TEST (T_FuseInvalidator, StartStop) | |
FRIEND_TEST (T_FuseInvalidator, InvalidateTimeout) | |
FRIEND_TEST (T_FuseInvalidator, InvalidateOps) | |
FuseInvalidator (glue::InodeTracker *inode_tracker, glue::DentryTracker *dentry_tracker, void **fuse_channel_or_session, bool fuse_notify_invalidation) | |
Private Member Functions inherited from SingleCopy | |
SingleCopy () | |
Static Private Member Functions | |
static void * | MainInvalidator (void *data) |
Private Attributes | |
MountPoint * | mount_point_ |
glue::InodeTracker * | inode_tracker_ |
glue::DentryTracker * | dentry_tracker_ |
void ** | fuse_channel_or_session_ |
bool | spawned_ |
Channel< Command > | channel_ |
pthread_t | thread_invalidator_ |
atomic_int32 | terminated_ |
BigVector< uint64_t > | evict_list_ |
Static Private Attributes | |
static const unsigned | kTimeoutSafetyMarginSec = 1 |
static const unsigned | kCheckTimeoutFreqMs = 100 |
static const unsigned | kCheckTimeoutFreqOps = 256 |
static bool | g_fuse_notify_invalidation_ = true |
Friends | |
class | T_FuseInvalidator |
This class can poke all known dentries out of the kernel caches. This allows for faster remount/reload of the fuse module because caches don't need to drain out by timeout. If the fuse library doesn't provide fuse_lowlevel_notify_inval_entry, it falls back to waiting for drainout.
Evicting entries from the cache must be done from a separate thread to avoid a deadlock in the fuse callbacks (see Fuse documentation).
Definition at line 35 of file fuse_evict.h.
FuseInvalidator::FuseInvalidator | ( | MountPoint * | mountpoint, |
void ** | fuse_channel_or_session, | ||
bool | fuse_notify_invalidation | ||
) |
Definition at line 71 of file fuse_evict.cc.
FuseInvalidator::~FuseInvalidator | ( | ) |
Definition at line 103 of file fuse_evict.cc.
|
private |
CONSTRUCTOR ONLY FOR UNITTESTS - mountpoint will illegally be null ( we do not want to construct a full mountpoint in the unittest )
Definition at line 86 of file fuse_evict.cc.
|
private |
|
private |
|
private |
|
static |
Technically, also libfuse 2.8 has support. Libfuse 2.8 comes with EL6, which had bugs reported related to the fuse_notify_inval_...() functions. Since just waiting for the timeout works perfectly fine, there is no reason to optimize for forced cache eviction too aggressively.
TODO(jblomer): could we have libfuse 2.9 or higher with a very old kernel that doesn't support active invalidation? How old does the kernel need to be? Probably that situation is never triggered in practice.
Definition at line 56 of file fuse_evict.cc.
Referenced by MainInvalidator(), and MaintenanceMode().
void FuseInvalidator::InvalidateDentry | ( | uint64_t | parent_ino, |
const NameString & | name | ||
) |
Definition at line 121 of file fuse_evict.cc.
Referenced by FuseRemounter::InvalidateDentry().
void FuseInvalidator::InvalidateInodes | ( | Handle * | handle | ) |
|
staticprivate |
Definition at line 146 of file fuse_evict.cc.
Referenced by Spawn().
void FuseInvalidator::Spawn | ( | ) |
Definition at line 339 of file fuse_evict.cc.
Referenced by FuseRemounter::Spawn().
|
friend |
Definition at line 36 of file fuse_evict.h.
Definition at line 123 of file fuse_evict.h.
Referenced by InvalidateDentry(), InvalidateInodes(), MainInvalidator(), and ~FuseInvalidator().
|
private |
Definition at line 117 of file fuse_evict.h.
Referenced by MainInvalidator().
|
private |
Definition at line 130 of file fuse_evict.h.
Referenced by MainInvalidator().
|
private |
libfuse2 uses struct fuse_chan, libfuse3 uses struct fuse_session
Definition at line 121 of file fuse_evict.h.
Referenced by MainInvalidator().
|
staticprivate |
Definition at line 132 of file fuse_evict.h.
Referenced by FuseInvalidator(), and HasFuseNotifyInval().
|
private |
Definition at line 116 of file fuse_evict.h.
Referenced by MainInvalidator().
|
staticprivate |
If caches are drained out by timeout, set a polling interval.
Definition at line 105 of file fuse_evict.h.
Referenced by MainInvalidator(), and FuseInvalidator::Handle::WaitFor().
|
staticprivate |
If caches are actively drained out, check every so many operations if the caches are anyway drained out by timeout.
Definition at line 110 of file fuse_evict.h.
Referenced by MainInvalidator().
|
staticprivate |
Add one second to the caller-provided timeout to be on the safe side.
Definition at line 101 of file fuse_evict.h.
|
private |
Definition at line 114 of file fuse_evict.h.
Referenced by MainInvalidator().
|
private |
Definition at line 122 of file fuse_evict.h.
Referenced by Spawn(), and ~FuseInvalidator().
|
private |
An invalidation run can take some time. Allow for early cancellation if thread should be shut down.
Definition at line 129 of file fuse_evict.h.
Referenced by FuseInvalidator(), MainInvalidator(), and ~FuseInvalidator().
|
private |
Definition at line 124 of file fuse_evict.h.
Referenced by FuseInvalidator(), Spawn(), and ~FuseInvalidator().