assert(f != NULL);
std::stringstream ss;
- const int r = _command_flush_journal(&ss);
+ const int r = _command_flush_journal(ss);
f->open_object_section("result");
f->dump_string("message", ss.str());
f->dump_int("return_code", r);
* Optionally populate with a human readable string describing the
* reason for any unexpected return status.
*/
-int MDSRank::_command_flush_journal(std::stringstream *ss)
+int MDSRank::_command_flush_journal(std::ostream& ss)
{
- assert(ss != NULL);
-
Mutex::Locker l(mds_lock);
if (mdcache->is_readonly()) {
r = mdlog_flushed.wait();
mds_lock.Lock();
if (r != 0) {
- *ss << "Error " << r << " (" << cpp_strerror(r) << ") while flushing journal";
+ ss << "Error " << r << " (" << cpp_strerror(r) << ") while flushing journal";
return r;
}
}
r = mdlog_cleared.wait();
mds_lock.Lock();
if (r != 0) {
- *ss << "Error " << r << " (" << cpp_strerror(r) << ") while flushing journal";
+ ss << "Error " << r << " (" << cpp_strerror(r) << ") while flushing journal";
return r;
}
}
dout(5) << __func__ << ": beginning segment expiry" << dendl;
r = mdlog->trim_all();
if (r != 0) {
- *ss << "Error " << r << " (" << cpp_strerror(r) << ") while trimming log";
+ ss << "Error " << r << " (" << cpp_strerror(r) << ") while trimming log";
return r;
}
r = wrote_head.wait();
mds_lock.Lock();
if (r != 0) {
- *ss << "Error " << r << " (" << cpp_strerror(r) << ") while writing header";
+ ss << "Error " << r << " (" << cpp_strerror(r) << ") while writing header";
return r;
}
}
bool MDSRank::evict_client(int64_t session_id,
- bool wait, bool blacklist, std::stringstream& err_ss,
+ bool wait, bool blacklist, std::ostream& err_ss,
Context *on_killed)
{
assert(mds_lock.is_locked_by_me());
}
bool evict_client(int64_t session_id, bool wait, bool blacklist,
- std::stringstream& ss, Context *on_killed=nullptr);
+ std::ostream& ss, Context *on_killed=nullptr);
void mark_base_recursively_scrubbed(inodeno_t ino);
std::ostream &ss,
Formatter *f);
int _command_export_dir(std::string_view path, mds_rank_t dest);
- int _command_flush_journal(std::stringstream *ss);
+ int _command_flush_journal(std::ostream& ss);
CDir *_command_dirfrag_get(
const cmdmap_t &cmdmap,
std::ostream &ss);