summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mds/CInode.cc10
-rw-r--r--src/mds/CInode.h2
-rw-r--r--src/mds/MDCache.cc7
-rw-r--r--src/mds/Server.cc4
-rw-r--r--src/mds/journal.cc2
5 files changed, 14 insertions, 11 deletions
diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc
index ac4af11bd38..dd4888c038d 100644
--- a/src/mds/CInode.cc
+++ b/src/mds/CInode.cc
@@ -400,7 +400,7 @@ void CInode::pop_and_dirty_projected_inode(LogSegment *ls)
inode = front.inode;
if (inode.is_backtrace_updated())
- _mark_dirty_parent(ls, old_pool != inode.layout.pool_id);
+ mark_dirty_parent(ls, old_pool != inode.layout.pool_id);
if (front.xattrs) {
--num_projected_xattrs;
@@ -1350,7 +1350,7 @@ void CInode::fetch_backtrace(Context *fin, bufferlist *backtrace)
mdcache->fetch_backtrace(inode.ino, get_backtrace_pool(), *backtrace, fin);
}
-void CInode::_mark_dirty_parent(LogSegment *ls, bool dirty_pool)
+void CInode::mark_dirty_parent(LogSegment *ls, bool dirty_pool)
{
if (!state_test(STATE_DIRTYPARENT)) {
dout(10) << __func__ << dendl;
@@ -1398,7 +1398,7 @@ void CInode::verify_diri_backtrace(bufferlist &bl, int err)
mds->clog->error() << "bad backtrace on directory inode " << ino();
assert(!"bad backtrace" == (g_conf->mds_verify_backtrace > 1));
- _mark_dirty_parent(mds->mdlog->get_current_segment(), false);
+ mark_dirty_parent(mds->mdlog->get_current_segment(), false);
mds->mdlog->flush();
}
}
@@ -3881,7 +3881,7 @@ void CInode::decode_import(bufferlist::iterator& p,
}
if (is_dirty_parent()) {
get(PIN_DIRTYPARENT);
- _mark_dirty_parent(ls);
+ mark_dirty_parent(ls);
}
decode(pop, ceph_clock_now(), p);
@@ -4135,7 +4135,7 @@ next:
in->make_path_string(path);
in->mdcache->mds->clog->warn() << "bad backtrace on inode " << in->ino()
<< "(" << path << "), rewriting it";
- in->_mark_dirty_parent(in->mdcache->mds->mdlog->get_current_segment(),
+ in->mark_dirty_parent(in->mdcache->mds->mdlog->get_current_segment(),
false);
// Flag that we repaired this BT so that it won't go into damagetable
results->backtrace.repaired = true;
diff --git a/src/mds/CInode.h b/src/mds/CInode.h
index dc83aeea793..ddf2c4bd46d 100644
--- a/src/mds/CInode.h
+++ b/src/mds/CInode.h
@@ -807,7 +807,7 @@ protected:
*/
int64_t get_backtrace_pool() const;
public:
- void _mark_dirty_parent(LogSegment *ls, bool dirty_pool=false);
+ void mark_dirty_parent(LogSegment *ls, bool dirty_pool=false);
void clear_dirty_parent();
void verify_diri_backtrace(bufferlist &bl, int err);
bool is_dirty_parent() { return state_test(STATE_DIRTYPARENT); }
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index eb07de00ed1..bdb96c4dd57 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -439,7 +439,10 @@ void MDCache::create_empty_hierarchy(MDSGather *gather)
rootdir->mark_dirty(rootdir->pre_dirty(), mds->mdlog->get_current_segment());
rootdir->commit(0, gather->new_sub());
- root->store(gather->new_sub());
+ root->mark_clean();
+ root->mark_dirty(root->pre_dirty(), mds->mdlog->get_current_segment());
+ root->mark_dirty_parent(mds->mdlog->get_current_segment(), true);
+ root->flush(gather->new_sub());
}
void MDCache::create_mydir_hierarchy(MDSGather *gather)
@@ -469,7 +472,7 @@ void MDCache::create_mydir_hierarchy(MDSGather *gather)
straydir->mark_complete();
straydir->mark_dirty(straydir->pre_dirty(), ls);
straydir->commit(0, gather->new_sub());
- stray->_mark_dirty_parent(ls, true);
+ stray->mark_dirty_parent(ls, true);
stray->store_backtrace(gather->new_sub());
}
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 72032c7b336..cba7408d07d 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -3530,7 +3530,7 @@ public:
// dirty inode, dn, dir
newi->inode.version--; // a bit hacky, see C_MDS_mknod_finish
newi->mark_dirty(newi->inode.version+1, mdr->ls);
- newi->_mark_dirty_parent(mdr->ls, true);
+ newi->mark_dirty_parent(mdr->ls, true);
mdr->apply();
@@ -5157,7 +5157,7 @@ public:
// a new version of hte inode since it's just been created)
newi->inode.version--;
newi->mark_dirty(newi->inode.version + 1, mdr->ls);
- newi->_mark_dirty_parent(mdr->ls, true);
+ newi->mark_dirty_parent(mdr->ls, true);
// mkdir?
if (newi->inode.is_dir()) {
diff --git a/src/mds/journal.cc b/src/mds/journal.cc
index e0ed5d5e1df..23c2f15a54b 100644
--- a/src/mds/journal.cc
+++ b/src/mds/journal.cc
@@ -1317,7 +1317,7 @@ void EMetaBlob::replay(MDSRank *mds, LogSegment *logseg, MDSlaveUpdate *slaveup)
if (p->is_dirty())
in->_mark_dirty(logseg);
if (p->is_dirty_parent())
- in->_mark_dirty_parent(logseg, p->is_dirty_pool());
+ in->mark_dirty_parent(logseg, p->is_dirty_pool());
if (p->need_snapflush())
logseg->open_files.push_back(&in->item_open_file);
if (dn->is_auth())