Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable stat cache expiration mechanism by -o stat_cache_expire=-1 #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/man/ossfs.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ maximum number of entries in the stat cache and symbolic link cache.
specify expire time (seconds) for entries in the stat cache and symbolic link cache. This expire time indicates the time since cached.
.TP
\fB\-o\fR stat_cache_interval_expire (default is 900)
specify expire time (seconds) for entries in the stat cache and symbolic link cache. This expire time is based on the time from the last access time of those cache.
specify expire time (seconds) for entries in the stat cache and symbolic link cache. This expire time is based on the time from the last access time of those cache. -1 value means disable.
This option is exclusive with stat_cache_expire, and is left for compatibility with older versions.
.TP
\fB\-o\fR enable_noobj_cache (default is disable)
Expand Down
9 changes: 7 additions & 2 deletions src/s3fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4324,9 +4324,14 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar
return 0;
}
if(is_prefix(arg, "stat_cache_expire=")){
time_t expr_time = static_cast<time_t>(cvt_strtoofft(strchr(arg, '=') + sizeof(char), 10));
auto value = cvt_strtoofft(strchr(arg, '=') + sizeof(char), /*base=*/ 10);
if(value == -1){
StatCache::getStatCacheData()->UnsetExpireTime();
return 0;
}
time_t expr_time = static_cast<time_t>(value);
StatCache::getStatCacheData()->SetExpireTime(expr_time);
return 0;
return 0;
}
// [NOTE]
// This option is for compatibility old version.
Expand Down
1 change: 1 addition & 0 deletions src/s3fs_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ static const char help_string[] =
" - specify expire time (seconds) for entries in the stat cache.\n"
" This expire time indicates the time since stat cached. and this\n"
" is also set to the expire time of the symbolic link cache.\n"
" -1 value means disable.\n"
"\n"
" stat_cache_interval_expire (default is 900)\n"
" - specify expire time (seconds) for entries in the stat cache(and\n"
Expand Down