From: root Date: Wed, 29 Nov 2017 14:02:39 +0000 (+0800) Subject: mds: get rid of the redundant code X-Git-Tag: v13.0.2~864^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e65e8cb825d443510d34c6300455d12010b82d06;p=ceph.git mds: get rid of the redundant code Signed-off-by: dongdong tao --- diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 4e6ab183bb8..ec18809930e 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -1016,11 +1016,8 @@ void EMetaBlob::get_paths( for (list >::const_iterator iter = fb_list.begin(); iter != fb_list.end(); ++iter) { std::string const &dentry = (*iter)->dn; - children[dir_ino].push_back(dentry); - ino_locations[(*iter)->inode.ino] = Location(dir_ino, dentry); if (children.find((*iter)->inode.ino) == children.end()) { leaf_locations.push_back(Location(dir_ino, dentry)); - } } @@ -1044,14 +1041,15 @@ void EMetaBlob::get_paths( Location const &loc = *i; std::string path = loc.second; inodeno_t ino = loc.first; - while(ino_locations.find(ino) != ino_locations.end()) { - Location const &loc = ino_locations[ino]; + std::map::iterator iter = ino_locations.find(ino); + while(iter != ino_locations.end()) { + Location const &loc = iter->second; if (!path.empty()) { path = loc.second + "/" + path; } else { path = loc.second + path; } - ino = loc.first; + iter = ino_locations.find(loc.first); } paths.push_back(path);