tx buffers need to go on the bh_lru_rest as well, and removing erases
(not inserts) them into dirty_or_tx_bh.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
if (bh->is_dirty()) {
bh_lru_dirty.lru_insert_top(bh);
dirty_or_tx_bh.insert(bh);
- } else if (bh->is_tx()) {
- dirty_or_tx_bh.insert(bh);
} else {
bh_lru_rest.lru_insert_top(bh);
}
+
+ if (bh->is_tx()) {
+ dirty_or_tx_bh.insert(bh);
+ }
bh_stat_add(bh);
}
if (bh->is_dirty()) {
bh_lru_dirty.lru_remove(bh);
dirty_or_tx_bh.erase(bh);
- } else if (bh->is_tx()) {
- dirty_or_tx_bh.insert(bh);
} else {
bh_lru_rest.lru_remove(bh);
}
+
+ if (bh->is_tx()) {
+ dirty_or_tx_bh.erase(bh);
+ }
bh_stat_sub(bh);
}