]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: move new stray dentries to end of lru
authorSage Weil <sage@newdream.net>
Tue, 6 Apr 2010 17:47:02 +0000 (10:47 -0700)
committerSage Weil <sage@newdream.net>
Tue, 6 Apr 2010 19:32:07 +0000 (12:32 -0700)
src/mds/MDCache.h
src/mds/Server.cc

index 3451fbbf2bbdddcfb9c7605e919a2c4ab8272a46..09c52ae8dc3d6e110c17cb0f5b1b2edcf605911d 100644 (file)
@@ -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);
index 3cbe1154102b00568417ba3f6717dde365a09ea2..4cfa045aa845849d580847740a0852d94380bb29 100644 (file)
@@ -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);
     }