From 985a981059bcda0c1753590b0acbab7f8da1f26e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 6 Apr 2010 10:47:02 -0700 Subject: [PATCH] mds: move new stray dentries to end of lru --- src/mds/MDCache.h | 2 ++ src/mds/Server.cc | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 3451fbbf2bbd..09c52ae8dc3d 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -884,9 +884,11 @@ public: else lru.lru_midtouch(dn); } +public: void touch_dentry_bottom(CDentry *dn) { lru.lru_bottouch(dn); } +protected: void inode_remove_replica(CInode *in, int rep); void dentry_remove_replica(CDentry *dn, int rep); diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 3cbe1154102b..4cfa045aa845 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -3836,6 +3836,8 @@ void Server::_unlink_local_finish(MDRequest *mdr, straydnl->get_inode()->snaprealm->add_past_parent(oldparent); if (isnew) mdcache->do_realm_invalidate_and_update_notify(straydnl->get_inode(), CEPH_SNAP_OP_SPLIT); + + mdcache->touch_dentry_bottom(straydn); } dn->mark_dirty(dnpv, mdr->ls); @@ -4595,6 +4597,8 @@ void Server::_rename_apply(MDRequest *mdr, CDentry *srcdn, CDentry *destdn, CDen mdcache->do_realm_invalidate_and_update_notify(straydnl->get_inode(), CEPH_SNAP_OP_SPLIT); } + mdcache->touch_dentry_bottom(straydn); // drop dn as quickly as possible. + } else { destdn->get_dir()->unlink_inode(destdn); } -- 2.47.3