"show cache status");
assert(r == 0);
r = admin_socket->register_command("cache drop",
- "cache drop name=timeout,type=CephInt,range=1",
+ "cache drop name=timeout,type=CephInt,range=0,req=false",
asok_hook,
"drop cache");
assert(r == 0);
m->put();
}
-
struct MDSCommand {
string cmdstring;
string helpstring;
"name=heapcmd,type=CephChoices,strings=dump|start_profiler|stop_profiler|release|stats", \
"show heap usage info (available only if compiled with tcmalloc)", \
"mds", "*", "cli,rest")
-COMMAND("cache drop name=timeout,type=CephInt,range=1", "trim cache and optionally "
+COMMAND("cache drop name=timeout,type=CephInt,range=0,req=false", "trim cache and optionally "
"request client to release all caps and flush the journal", "mds",
"r", "cli,rest")
};
}
void start_timer() {
+ if (!timeout) {
+ return;
+ }
+
timer_task = new FunctionContext([this](int _) {
timer_task = nullptr;
complete(-ETIMEDOUT);
} else if (command == "cache drop") {
int64_t timeout;
if (!cmd_getval(g_ceph_context, cmdmap, "timeout", timeout)) {
- return false;
+ timeout = 0;
}
C_SaferCond cond;
} else if (prefix == "cache drop") {
int64_t timeout;
if (!cmd_getval(g_ceph_context, cmdmap, "timeout", timeout)) {
- return false;
+ timeout = 0;
}
JSONFormatter *f = new JSONFormatter(true);