mds: optimize MDCache::rejoin_scour_survivor_replicas()

avoid iterating dentries if dirfrag is non-auth

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2017-09-13 15:55:46 +08:00
parent fd447405be
commit d32a237604

View File

@ -4538,9 +4538,10 @@ void MDCache::rejoin_scour_survivor_replicas(mds_rank_t from, MMDSCacheRejoin *a
p != dfs.end();
++p) {
CDir *dir = *p;
if (!dir->is_auth())
continue;
if (dir->is_auth() &&
dir->is_replica(from) &&
if (dir->is_replica(from) &&
(ack == NULL || ack->strong_dirfrags.count(dir->dirfrag()) == 0)) {
dir->remove_replica(from);
dout(10) << " rem " << *dir << dendl;