zram: use atomic64_t for all zram stats
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Mon, 7 Apr 2014 22:38:03 +0000 (15:38 -0700)
committerAlex Shi <alex.shi@linaro.org>
Mon, 11 May 2015 12:41:54 +0000 (20:41 +0800)
commit2385e8be54460cae2cf803a482a0b8b76cf8d001
treed6f8a5d4fddac902049d95b27bdc8dc65d8f67c3
parente700d5f0d65058709b17623728a356e2c16a3a3a
zram: use atomic64_t for all zram stats

This is a preparation patch for stats code duplication removal.

1) use atomic64_t for `pages_zero' and `pages_stored' zram stats.

2) `compr_size' and `pages_zero' struct zram_stats members did not
   follow the existing device attr naming scheme: zram_stats.ATTR has
   ATTR_show() function.  rename them:

   -- compr_size -> compr_data_size
   -- pages_zero -> zero_pages

Minchan Kim's note:
 If we really have trouble with atomic stat operation, we could
 change it with percpu_counter so that it could solve atomic overhead and
 unnecessary memory space by introducing unsigned long instead of 64bit
 atomic_t.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 90a7806ea9b9f7cb4751859cc2506e2d80e36ef1)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.h