if (r == 0) {
fi->fh = (long)fh;
#if FUSE_VERSION >= FUSE_MAKE_VERSION(2, 8)
- fi->keep_cache = 1;
+ if (g_conf->fuse_use_invalidate_cb)
+ fi->keep_cache = 1;
#endif
fuse_reply_open(req, fi);
} else {
// go go gadget fuse
struct fuse_args args = FUSE_ARGS_INIT(newargc, (char**)newargv);
struct fuse_chan *ch = NULL;
+ struct fuse_chan *ch_inval = NULL;
struct fuse_session *se = NULL;
char *mountpoint = NULL;
int ret = 0;
}
fuse_session_add_chan(se, ch);
+ fuse_session_add_chan(se, ch_inval);
- client->ll_register_ino_invalidate_cb(invalidate_cb, ch);
+ if (g_conf->fuse_use_invalidate_cb)
+ client->ll_register_ino_invalidate_cb(invalidate_cb, ch);
ret = fuse_session_loop(se);
OPTION(client_oc_target_dirty, OPT_INT, 1024*1024* 8), // target dirty (keep this smallish)
// note: the max amount of "in flight" dirty data is roughly (max - target)
OPTION(client_oc_max_sync_write, OPT_U64, 128*1024), // sync writes >= this use wrlock
+ OPTION(fuse_use_invalidate_cb, OPT_BOOL, false), // use fuse 2.8+ invalidate callback to keep page cache consistent
OPTION(objecter_tick_interval, OPT_DOUBLE, 5.0),
OPTION(objecter_mon_retry_interval, OPT_DOUBLE, 5.0),
OPTION(objecter_timeout, OPT_DOUBLE, 10.0), // before we ask for a map
int client_notify_timeout;
+ // fuse
+ bool fuse_use_invalidate_cb;
+
// objecter
double objecter_mon_retry_interval;
double objecter_tick_interval;