#define FUSE_MAX_PATH 4096
-#define ENTRY_REVALIDATE_TIME 1.0 /* sec */
-#define ATTR_REVALIDATE_TIME 1.0 /* sec */
-
struct fuse {
struct fuse_ll *fll;
int flags;
uid_t uid;
gid_t gid;
mode_t umask;
+ double entry_timeout;
+ double attr_timeout;
};
struct node {
else {
e->ino = node->nodeid;
e->generation = node->generation;
- e->entry_timeout = ENTRY_REVALIDATE_TIME;
- e->attr_timeout = ATTR_REVALIDATE_TIME;
+ e->entry_timeout = f->entry_timeout;
+ e->attr_timeout = f->attr_timeout;
set_stat(f, e->ino, &e->attr);
if (f->flags & FUSE_DEBUG) {
printf(" NODEID: %lu\n", (unsigned long) e->ino);
pthread_rwlock_unlock(&f->tree_lock);
if (!err) {
set_stat(f, ino, &buf);
- fuse_reply_attr(req, &buf, ATTR_REVALIDATE_TIME);
+ fuse_reply_attr(req, &buf, f->attr_timeout);
} else
reply_err(req, err);
}
pthread_rwlock_unlock(&f->tree_lock);
if (!err) {
set_stat(f, ino, &buf);
- fuse_reply_attr(req, &buf, ATTR_REVALIDATE_TIME);
+ fuse_reply_attr(req, &buf, f->attr_timeout);
} else
reply_err(req, err);
}
strcmp(opt, "kernel_cache") == 0 ||
begins_with(opt, "umask=") ||
begins_with(opt, "uid=") ||
- begins_with(opt, "gid="))
+ begins_with(opt, "gid=") ||
+ begins_with(opt, "entry_timeout=") ||
+ begins_with(opt, "attr_timeout="))
return 1;
else
return 0;
f->flags |= FUSE_SET_UID;
else if(sscanf(opt, "gid=%u", &f->gid) == 1)
f->flags |= FUSE_SET_GID;
+ else if (sscanf(opt, "entry_timeout=%lf", &f->entry_timeout) == 1)
+ /* nop */;
+ else if (sscanf(opt, "attr_timeout=%lf", &f->attr_timeout) == 1)
+ /* nop */;
else
fprintf(stderr, "fuse: warning: unknown option `%s'\n", opt);
}
goto out;
}
+ f->entry_timeout = 1.0;
+ f->attr_timeout = 1.0;
+
if (parse_lib_opts(f, opts, &llopts) == -1)
goto out_free;