5 #define __STDC_FORMAT_MACROS
7 #include "cvmfs_config.h"
27 : timeout_s_((timeout_s == 0) ? 0 : (timeout_s + kTimeoutSafetyMarginSec))
71 void **fuse_channel_or_session,
72 bool fuse_notify_invalidation)
119 bool reported_missing_inval_support =
false;
132 char *name =
static_cast<char *
>(smalloc(len + 1));
136 if (!reported_missing_inval_support) {
138 "missing fuse support for dentry invalidation (%d/%s)",
140 reported_missing_inval_support =
true;
147 #if CVMFS_USE_LIBFUSE == 2
148 fuse_lowlevel_notify_inval_entry(*reinterpret_cast<struct fuse_chan**>(
151 fuse_lowlevel_notify_inval_entry(*reinterpret_cast<struct fuse_session**>(
171 if (atomic_read32(&invalidator->
terminated_) == 1) {
173 "cancel cache eviction due to termination");
197 inode = FUSE_ROOT_ID;
202 #if CVMFS_USE_LIBFUSE == 2
203 dbg_retval = fuse_lowlevel_notify_inval_inode(
204 *reinterpret_cast<struct fuse_chan**>(
207 dbg_retval = fuse_lowlevel_notify_inval_inode(
208 *reinterpret_cast<struct fuse_session**>(
212 "evicting inode %" PRIu64
" with retval: %d",
220 "cancel cache eviction after %u entries due to timeout", i);
223 if (atomic_read32(&invalidator->
terminated_) == 1) {
225 "cancel cache eviction due to termination");
236 uint64_t entry_parent;
239 while (dentries_copy->
NextEntry(&dentry_cursor, &entry_parent, &entry_name))
242 entry_parent, entry_name.
c_str());
244 #if CVMFS_USE_LIBFUSE == 2
245 struct fuse_chan* channel_or_session =
246 *
reinterpret_cast<struct fuse_chan**
>(
249 struct fuse_session* channel_or_session =
250 *
reinterpret_cast<struct fuse_session**
>(
256 #ifdef FUSE_CAP_EXPIRE_ONLY
257 fuse_lowlevel_notify_expire_entry(channel_or_session,
259 FUSE_LL_EXPIRE_ONLY);
261 fuse_lowlevel_notify_inval_entry(channel_or_session,
266 if (atomic_read32(&invalidator->
terminated_) == 1) {
268 "cancel cache eviction due to termination");
274 delete dentries_copy;
#define LogCvmfs(source, mask,...)
Item At(const size_t index) const
glue::DentryTracker * dentry_tracker_
FuseInvalidator(glue::InodeTracker *inode_tracker, glue::DentryTracker *dentry_tracker, void **fuse_channel_or_session, bool fuse_notify_invalidation)
assert((mem||(size==0))&&"Out Of Memory")
static const unsigned kCheckTimeoutFreqMs
bool NextEntry(Cursor *cursor, uint64_t *inode_parent, NameString *name)
void EndEnumerate(Cursor *cursor)
void MakePipe(int pipe_fd[2])
static bool HasFuseNotifyInval()
static const unsigned kTimeoutSafetyMarginSec
void EndEnumerate(Cursor *cursor)
static const unsigned kCheckTimeoutFreqOps
BigVector< uint64_t > evict_list_
void ** fuse_channel_or_session_
bool NextInode(Cursor *cursor, uint64_t *inode)
Handle(unsigned timeout_s)
void InvalidateDentry(uint64_t parent_ino, const NameString &name)
void PushBack(const Item &item)
glue::InodeTracker * inode_tracker_
static bool g_fuse_notify_invalidation_
void InvalidateInodes(Handle *handle)
pthread_t thread_invalidator_
void SafeSleepMs(const unsigned ms)
unsigned GetLength() const
const char * c_str() const
const char * GetChars() const
void WritePipe(int fd, const void *buf, size_t nbyte)
void ReadPipe(int fd, void *buf, size_t nbyte)
void ClosePipe(int pipe_fd[2])
static void * MainInvalidator(void *data)