}
}
+void Client::flush_mdlog_sync(Inode *in)
+{
+ if (in->unsafe_ops.empty()) {
+ return;
+ }
+
+ std::set<mds_rank_t> anchor;
+ for (auto &&p : in->unsafe_ops) {
+ anchor.emplace(p->mds);
+ }
+ if (in->auth_cap) {
+ anchor.emplace(in->auth_cap->session->mds_num);
+ }
+
+ for (auto &rank : anchor) {
+ auto session = &mds_sessions.at(rank);
+ flush_mdlog(session);
+ }
+}
+
void Client::flush_mdlog_sync()
{
- if (mds_requests.empty())
+ if (mds_requests.empty())
return;
for (auto &p : mds_sessions) {
flush_mdlog(&p.second);
} else ldout(cct, 10) << "no metadata needs to commit" << dendl;
if (!syncdataonly && !in->unsafe_ops.empty()) {
- flush_mdlog_sync();
+ flush_mdlog_sync(in);
MetaRequest *req = in->unsafe_ops.back();
ldout(cct, 15) << "waiting on unsafe requests, last tid " << req->get_tid() << dendl;
vinodeno_t map_faked_ino(ino_t ino);
//notify the mds to flush the mdlog
+ void flush_mdlog_sync(Inode *in);
void flush_mdlog_sync();
void flush_mdlog(MetaSession *session);