Commit d7ad41a1 authored by Weijie Yang's avatar Weijie Yang Committed by Linus Torvalds

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: default avatarWeijie Yang <weijie.yang@samsung.com>
Acked-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7d638093
...@@ -805,7 +805,9 @@ static void zram_reset_device(struct zram *zram) ...@@ -805,7 +805,9 @@ static void zram_reset_device(struct zram *zram)
memset(&zram->stats, 0, sizeof(zram->stats)); memset(&zram->stats, 0, sizeof(zram->stats));
zram->disksize = 0; zram->disksize = 0;
zram->max_comp_streams = 1; zram->max_comp_streams = 1;
set_capacity(zram->disk, 0); set_capacity(zram->disk, 0);
part_stat_set_all(&zram->disk->part0, 0);
up_write(&zram->init_lock); up_write(&zram->init_lock);
/* I/O operation under all of CPU are done so let's free */ /* I/O operation under all of CPU are done so let's free */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment