diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-01-27 14:41:50 +0800 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2013-01-29 10:17:37 +0800 |
commit | 0e9c8124a1acfcd52cf2712e59dc8493209b42c6 (patch) | |
tree | 353342feb0e7e923b1823f681f63fe6a85a2f5f3 | |
parent | 77946dcdae2f34410694252afe03e1892cac571b (diff) | |
download | ceph-0e9c8124a1acfcd52cf2712e59dc8493209b42c6.tar.gz |
mds: add projected rename's subtree bounds to ESubtreeMap
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
-rw-r--r-- | src/mds/MDCache.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index c9be8caf1c5..84502b0918a 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -2333,7 +2333,11 @@ ESubtreeMap *MDCache::create_subtree_map() continue; } + bool journal_dir = false; if (dir->is_subtree_root()) { + if (le->subtrees.count(newparent->dirfrag()) && + oldparent->get_dir_auth() != newparent->get_dir_auth()) + journal_dir = true; // children are fine. change parent. _move_subtree_map_bound(dir->dirfrag(), oldparent->dirfrag(), newparent->dirfrag(), le->subtrees); @@ -2343,13 +2347,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 (le->subtrees.count(oldparent->dirfrag())) { le->subtrees[dir->dirfrag()].clear(); + journal_dir = true; + } // 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 + journal_dir = true; + } newparent = dir; - } + } // see if any old bounds move to the new parent. for (set<CDir*>::iterator p = subtrees[oldparent].begin(); @@ -2361,6 +2369,10 @@ ESubtreeMap *MDCache::create_subtree_map() le->subtrees); } } + if (journal_dir) { + le->metablob.add_dir_context(dir, EMetaBlob::TO_ROOT); + le->metablob.add_dir(dir, false); + } } } } |