const struct logical_volume *lock_lv = lv_lock_holder(cache_lv);
struct lv_segment *cache_seg = first_seg(cache_lv);
struct lv_status_cache *status;
- int cleaner_policy, writeback;
+ int cleaner_policy = 0, writeback;
uint64_t dirty_blocks;
*is_clean = 0;
//FIXME: use polling to do this...
for (;;) {
sigint_allow();
+ if (cleaner_policy)
+ /* TODO: Use centralized place */
+ usleep(500000);
sigint_restore();
if (sigint_caught()) {
sigint_clear();
log_print_unless_silent("Flushing " FMTu64 " blocks for cache %s.",
dirty_blocks, display_lvname(cache_lv));
- if (cleaner_policy) {
- /* TODO: Use centralized place */
- sigint_allow();
- usleep(500000);
- sigint_restore();
+ if (cleaner_policy)
continue;
- }
if (!(cache_lv->status & LVM_WRITE)) {
log_warn("WARNING: Dirty blocks found on read-only cache volume %s.",