diff mbox

[2/6] mds: add projected rename's subtree bounds to ESubtreeMap

Message ID 1359340106-24257-3-git-send-email-zheng.z.yan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yan, Zheng Jan. 28, 2013, 2:28 a.m. UTC
From: "Yan, Zheng" <zheng.z.yan@intel.com>

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 src/mds/MDCache.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc
index 5d88075..9ad6919 100644
--- a/src/mds/MDCache.cc
+++ b/src/mds/MDCache.cc
@@ -2343,11 +2343,17 @@  ESubtreeMap *MDCache::create_subtree_map()
 	  if (oldparent->get_dir_auth() != newparent->get_dir_auth()) {
 	    dout(10) << " creating subtree for " << dir->dirfrag() << dendl;
 	    // if oldparent is auth, subtree is mine; include it.
-	    if (oldparent->get_dir_auth().first == mds->whoami)
+	    if (oldparent->get_dir_auth().first == mds->whoami) {
 	      le->subtrees[dir->dirfrag()].clear();
+	      le->metablob.add_dir_context(dir, EMetaBlob::TO_ROOT);
+	      le->metablob.add_dir(dir, false);
+	    }
 	    // if newparent is auth, subtree is a new bound
-	    if (le->subtrees.count(newparent->dirfrag()))
+	    if (le->subtrees.count(newparent->dirfrag())) {
 	      le->subtrees[newparent->dirfrag()].push_back(dir->dirfrag());  // newparent is auth; new bound
+	      le->metablob.add_dir_context(dir, EMetaBlob::TO_ROOT);
+	      le->metablob.add_dir(dir, false);
+	    }
 	    newparent = dir;
 	}