]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 14 Jun 2005 21:19:32 +0000 (21:19 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 14 Jun 2005 21:19:32 +0000 (21:19 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@316 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/config.cc
ceph/include/lru.h
ceph/mds/MDCache.cc

index 0cb8542b3f973500b9cfcedbc80b73b98de66b9b..c54c588eb9b1f7ea8510743bcbfacf4125b96f69 100644 (file)
@@ -21,7 +21,7 @@ md_config_t g_conf = {
   log_name: (char*)0,
 
   log_messages: true,
-  log_pins: false,
+  log_pins: true,
 
   fake_clock: false,
   fakemessenger_serialize: true,
index a6b9fce0b94a9196ca7a9abfccbcd7f4b2a35f7c..da4ceab937775175c334f5835c15fe8426012398 100644 (file)
@@ -116,7 +116,26 @@ class LRU {
        lru_num_pinned += !o->lru_expireable;
   }
 
+  // insert at bottom of lru
+  void lru_insert_bot(LRUObject *o) {
+       assert(!o->lru);
+       o->lru = this;
 
+       o->lru_in_top = false;
+       o->lru_next = NULL;
+       o->lru_prev = lru_bottail;
+       if (lru_bottail) {
+         lru_bottail->lru_next = o;
+       } else {
+         lru_bothead = o;
+       }
+       lru_bottail = o;
+       lru_nbot++;
+       lru_num++;
+       lru_num_pinned += !o->lru_expireable;
+  }
+
+  
 
 
   // adjust top/bot balance, as necessary
@@ -189,6 +208,13 @@ class LRU {
        return true;
   }
 
+  // touch item -- move to bottom
+  bool lru_bottouch(LRUObject *o) {
+       lru_remove(o);
+       lru_insert_bot(o);
+       return true;
+  }
+
 
   // expire -- expire a single item
   LRUObject *lru_expire() {
index ab11385a1b23d63c3fbe3326e92c02c19a10ec43..3b4ef8339f2229baa3442d11b9eb5271510acf94 100644 (file)
@@ -5675,6 +5675,9 @@ void MDCache::encode_export_inode(CInode *in, crope& state_rope, int new_auth)
   in->replica_nonce = CINODE_EXPORT_NONCE;
   
   // *** other state too?
+
+  // move to end of LRU so we drop it out of cache quickly!
+  lru.lru_bottouch(in);
 }
 
 
@@ -6436,8 +6439,7 @@ void MDCache::decode_import_inode(CDentry *dn, crope& r, int& off, int oldauth,
   // other
   if (in->is_dirty()) {
        dout(10) << "logging dirty import " << *in << endl;
-       mds->mdlog->submit_entry(new EInodeUpdate(in),
-                                                        NULL);   // FIXME pay attention to completion?
+       mds->mdlog->submit_entry(new EInodeUpdate(in));
   }
 }