diff options
author | Weijie Yang <[email protected]> | 2015-06-10 11:14:49 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2015-06-10 16:43:43 -0700 |
commit | d7ad41a1c498729b7584c257710b1b437a0c1470 (patch) | |
tree | 9ec97b27b4c5022d7d166bc1cc21240e799f3fe9 | |
parent | 7d638093d4b0e9ef15bd78f38f11f126e773cc14 (diff) |
zram: clear disk io accounting when reset zram device
Clear zram disk io accounting when resetting the zram device. Otherwise
the residual io accounting stat will affect the diskstat in the next
zram active cycle.
Signed-off-by: Weijie Yang <[email protected]>
Acked-by: Sergey Senozhatsky <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | drivers/block/zram/zram_drv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 8dcbced0eafd..6e134f4759c0 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -805,7 +805,9 @@ static void zram_reset_device(struct zram *zram) memset(&zram->stats, 0, sizeof(zram->stats)); zram->disksize = 0; zram->max_comp_streams = 1; + set_capacity(zram->disk, 0); + part_stat_set_all(&zram->disk->part0, 0); up_write(&zram->init_lock); /* I/O operation under all of CPU are done so let's free */ |