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
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() {
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);
}
// 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));
}
}