fix
diff --git a/ChangeLog b/ChangeLog
index f3c3e89..c447832 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* Fix rare race betweeen abort and release caused by failed iget()
in fuse_create_open().
+ * Add 'ac_attr_timeout' option e.g. for filesystems which do their
+ own attribute caching.
+
2006-02-15 Miklos Szeredi <miklos@szeredi.hu>
* Work around FreeBSD runtime linker "feature" which binds an old
diff --git a/lib/fuse.c b/lib/fuse.c
index 68ff59f..ea17a3d 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -39,6 +39,8 @@
double entry_timeout;
double negative_timeout;
double attr_timeout;
+ double ac_attr_timeout;
+ int ac_attr_timeout_set;
int debug;
int hard_remove;
int use_ino;
@@ -1141,7 +1143,7 @@
struct timespec now;
curr_time(&now);
- if (diff_timespec(&now, &node->stat_updated) > f->conf.attr_timeout) {
+ if (diff_timespec(&now, &node->stat_updated) > f->conf.ac_attr_timeout) {
struct stat stbuf;
int err;
@@ -1936,6 +1938,8 @@
FUSE_LIB_OPT("gid=%d", gid, 0),
FUSE_LIB_OPT("entry_timeout=%lf", entry_timeout, 0),
FUSE_LIB_OPT("attr_timeout=%lf", attr_timeout, 0),
+ FUSE_LIB_OPT("ac_attr_timeout=%lf", ac_attr_timeout, 0),
+ FUSE_LIB_OPT("ac_attr_timeout=", ac_attr_timeout_set, 1),
FUSE_LIB_OPT("negative_timeout=%lf", negative_timeout, 0),
FUSE_OPT_END
};
@@ -1954,8 +1958,9 @@
" -o gid=N set file group\n"
" -o entry_timeout=T cache timeout for names (1.0s)\n"
" -o negative_timeout=T cache timeout for deleted names (0.0s)\n"
- " -o attr_timeout=T cache timeout for attributes (1.0s)\n"
- "\n");
+" -o attr_timeout=T cache timeout for attributes (1.0s)\n"
+" -o ac_attr_timeout=T auto cache timeout for attributes (attr_timeout)\n"
+"\n");
}
static int fuse_lib_opt_proc(void *data, const char *arg, int key,
@@ -2002,6 +2007,9 @@
if (fuse_opt_parse(args, &f->conf, fuse_lib_opts, fuse_lib_opt_proc) == -1)
goto out_free;
+ if (!f->conf.ac_attr_timeout_set)
+ f->conf.ac_attr_timeout = f->conf.attr_timeout;
+
#ifdef __FreeBSD__
/*
* In FreeBSD, we always use these settings as inode numbers are needed to