From 0e89fe0f32e8f762d96cbbdd67bc50b19b8bf039 Mon Sep 17 00:00:00 2001 From: sage Date: Tue, 14 Jun 2005 21:19:32 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@316 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/config.cc | 2 +- ceph/include/lru.h | 26 ++++++++++++++++++++++++++ ceph/mds/MDCache.cc | 6 ++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ceph/config.cc b/ceph/config.cc index 0cb8542b3f973..c54c588eb9b1f 100644 --- a/ceph/config.cc +++ b/ceph/config.cc @@ -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, diff --git a/ceph/include/lru.h b/ceph/include/lru.h index a6b9fce0b94a9..da4ceab937775 100644 --- a/ceph/include/lru.h +++ b/ceph/include/lru.h @@ -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() { diff --git a/ceph/mds/MDCache.cc b/ceph/mds/MDCache.cc index ab11385a1b23d..3b4ef8339f222 100644 --- a/ceph/mds/MDCache.cc +++ b/ceph/mds/MDCache.cc @@ -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)); } } -- 2.47.3