mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
make attr, entry, negative_entry cache timeouts runtime configurable
This commit is contained in:
parent
a64c7c97ad
commit
0918dfd117
12 changed files with 253 additions and 31 deletions
21
src/num.cpp
21
src/num.cpp
|
|
@ -47,6 +47,11 @@ namespace num
|
|||
tmp *= (1024 * 1024 * 1024);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
case 'T':
|
||||
tmp *= (1024ULL * 1024 * 1024 * 1024);
|
||||
break;
|
||||
|
||||
case '\0':
|
||||
break;
|
||||
|
||||
|
|
@ -59,6 +64,22 @@ namespace num
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
to_double(const std::string &str_,
|
||||
double *d_)
|
||||
{
|
||||
double tmp;
|
||||
char *endptr;
|
||||
|
||||
tmp = strtod(str_.c_str(),&endptr);
|
||||
if(*endptr != '\0')
|
||||
return -1;
|
||||
|
||||
*d_ = tmp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
to_time_t(const std::string &str,
|
||||
time_t &value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue