From 39d2f7d6d17de692f07b3151c854fb077c568262 Mon Sep 17 00:00:00 2001 From: sageweil Date: Sun, 9 Sep 2007 18:38:35 +0000 Subject: [PATCH] performance tweak git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1798 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/mds/MDBalancer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trunk/ceph/mds/MDBalancer.cc b/trunk/ceph/mds/MDBalancer.cc index e031667f83d13..f9ebbaa884701 100644 --- a/trunk/ceph/mds/MDBalancer.cc +++ b/trunk/ceph/mds/MDBalancer.cc @@ -852,7 +852,7 @@ void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, double amount) bool hit_subtree = dir->is_auth(); // current auth subtree (if any) bool hit_subtree_nested = dir->is_auth(); // all nested auth subtrees - while (dir) { + while (1) { dir->pop_nested.get(type).hit(now, amount); if (rd_adj != 0.0) dir->pop_nested.get(META_POP_IRD).adjust(now, rd_adj); @@ -871,7 +871,9 @@ void MDBalancer::hit_dir(utime_t now, CDir *dir, int type, double amount) if (dir->is_subtree_root()) hit_subtree = false; // end of auth domain, stop hitting auth counters. - dir = dir->inode->get_parent_dir(); + + if (dir->inode->get_parent_dn() == 0) break; + dir = dir->inode->get_parent_dn()->get_dir(); } } -- 2.39.5