From: Yan, Zheng Date: Sun, 11 May 2014 05:32:46 +0000 (+0800) Subject: mds: avoid journaling unnecessary dir context X-Git-Tag: v0.81~15^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=54a903766506b2583af722b9b8a87c55cc38513d;p=ceph.git mds: avoid journaling unnecessary dir context If base inode is reached, try clearing the 'maybe' list, then stop. Signed-off-by: Yan, Zheng --- diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 35f124563c0..72c2f4ba354 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -314,14 +314,11 @@ void EMetaBlob::add_dir_context(CDir *dir, int mode) dout(20) << "EMetaBlob::add_dir_context(" << dir << ") have lump " << dir->dirfrag() << dendl; break; } - + // stop at root/stray CInode *diri = dir->get_inode(); CDentry *parent = diri->get_projected_parent_dn(); - if (!parent) - break; - if (mode == TO_AUTH_SUBTREE_ROOT) { // subtree root? if (dir->is_subtree_root() && !dir->state_test(CDir::STATE_EXPORTBOUND)) { @@ -355,6 +352,9 @@ void EMetaBlob::add_dir_context(CDir *dir, int mode) } } + if (!parent) + break; + if (maybenot) { dout(25) << "EMetaBlob::add_dir_context(" << dir << ") maybe " << *parent << dendl; maybe.push_front(parent);