Skip to content

Commit

Permalink
Fix the dirty percent calculation in update_sync_progress().
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohan Srinivasan committed Jan 23, 2011
1 parent 3e58042 commit 87bde9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/flashcache_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,14 @@ flashcache_dm_io_sync_vm(struct cache_c *dmc, struct dm_io_region *where, int rw
void
flashcache_update_sync_progress(struct cache_c *dmc)
{
int dirty_pct;
u_int64_t dirty_pct;

if (dmc->cleanings % 1000)
return;
if (!dmc->nr_dirty || !dmc->size)
return;
dirty_pct = (dmc->nr_dirty * 100) / dmc->size;
printk(KERN_INFO "Flashcache: Cleaning %d Dirty blocks, Dirty Blocks pct %d%%",
dirty_pct = ((u_int64_t)dmc->nr_dirty * 100) / dmc->size;
printk(KERN_INFO "Flashcache: Cleaning %d Dirty blocks, Dirty Blocks pct %llu%%",
dmc->nr_dirty, dirty_pct);
printk(KERN_INFO "\r");
}
Expand Down

0 comments on commit 87bde9c

Please sign in to comment.