]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: avoid journaling unnecessary dir context
authorYan, Zheng <zheng.z.yan@intel.com>
Sun, 11 May 2014 05:32:46 +0000 (13:32 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Mon, 12 May 2014 03:14:51 +0000 (11:14 +0800)
If base inode is reached, try clearing the 'maybe' list, then stop.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/journal.cc

index 35f124563c05246f686a190e6e830ddfe716115b..72c2f4ba3541323e967e2ab8f7765c47b893e2cf 100644 (file)
@@ -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);