i != objects.end();
++i)
assert(!i->size());
- assert(lru_rest.lru_get_size() == 0);
- assert(lru_dirty.lru_get_size() == 0);
+ assert(bh_lru_rest.lru_get_size() == 0);
+ assert(bh_lru_dirty.lru_get_size() == 0);
assert(dirty_bh.empty());
}
*/
loff_t did = 0;
while (amount == 0 || did < amount) {
- BufferHead *bh = (BufferHead*) lru_dirty.lru_get_next_expire();
+ BufferHead *bh = (BufferHead*) bh_lru_dirty.lru_get_next_expire();
if (!bh) break;
if (bh->last_write > cutoff) break;
<< dendl;
while (get_stat_clean() > max) {
- BufferHead *bh = (BufferHead*) lru_rest.lru_expire();
+ BufferHead *bh = (BufferHead*) bh_lru_rest.lru_expire();
if (!bh) break;
ldout(cct, 10) << "trim trimming " << *bh << dendl;
utime_t cutoff = ceph_clock_now(cct);
cutoff -= max_dirty_age;
BufferHead *bh = 0;
- while ((bh = (BufferHead*)lru_dirty.lru_get_next_expire()) != 0 &&
+ while ((bh = (BufferHead*)bh_lru_dirty.lru_get_next_expire()) != 0 &&
bh->last_write < cutoff) {
ldout(cct, 10) << "flusher flushing aged dirty bh " << *bh << dendl;
bh_write(bh);
{
// move between lru lists?
if (s == BufferHead::STATE_DIRTY && bh->get_state() != BufferHead::STATE_DIRTY) {
- lru_rest.lru_remove(bh);
- lru_dirty.lru_insert_top(bh);
+ bh_lru_rest.lru_remove(bh);
+ bh_lru_dirty.lru_insert_top(bh);
dirty_bh.insert(bh);
}
if (s != BufferHead::STATE_DIRTY && bh->get_state() == BufferHead::STATE_DIRTY) {
- lru_dirty.lru_remove(bh);
- lru_rest.lru_insert_top(bh);
+ bh_lru_dirty.lru_remove(bh);
+ bh_lru_rest.lru_insert_top(bh);
dirty_bh.erase(bh);
}
if (s != BufferHead::STATE_ERROR && bh->get_state() == BufferHead::STATE_ERROR) {
{
ob->add_bh(bh);
if (bh->is_dirty()) {
- lru_dirty.lru_insert_top(bh);
+ bh_lru_dirty.lru_insert_top(bh);
dirty_bh.insert(bh);
} else {
- lru_rest.lru_insert_top(bh);
+ bh_lru_rest.lru_insert_top(bh);
}
bh_stat_add(bh);
}
{
ob->remove_bh(bh);
if (bh->is_dirty()) {
- lru_dirty.lru_remove(bh);
+ bh_lru_dirty.lru_remove(bh);
dirty_bh.erase(bh);
} else {
- lru_rest.lru_remove(bh);
+ bh_lru_rest.lru_remove(bh);
}
bh_stat_sub(bh);
}
vector<hash_map<sobject_t, Object*> > objects; // indexed by pool_id
set<BufferHead*> dirty_bh;
- LRU lru_dirty, lru_rest;
+ LRU bh_lru_dirty, bh_lru_rest;
Cond flusher_cond;
bool flusher_stop;
void touch_bh(BufferHead *bh) {
if (bh->is_dirty())
- lru_dirty.lru_touch(bh);
+ bh_lru_dirty.lru_touch(bh);
else
- lru_rest.lru_touch(bh);
+ bh_lru_rest.lru_touch(bh);
}
// bh states
void mark_error(BufferHead *bh) { bh_set_state(bh, BufferHead::STATE_ERROR); };
void mark_dirty(BufferHead *bh) {
bh_set_state(bh, BufferHead::STATE_DIRTY);
- lru_dirty.lru_touch(bh);
+ bh_lru_dirty.lru_touch(bh);
//bh->set_dirty_stamp(ceph_clock_now(g_ceph_context));
};