]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix overflow when calculating utilization on 32-bit
authorChangman Lee <cm224.lee@samsung.com>
Mon, 25 Feb 2013 08:38:02 +0000 (17:38 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Fri, 8 Mar 2013 01:02:56 +0000 (10:02 +0900)
commita3953509528e6329d5ad267e03113a5856e7f4db
tree09d54e3295705601aa0d600fd9a8e94aca444174
parentca0e6c2130c89e5aaf04f3cbc89f09fed0989101
f2fs: fix overflow when calculating utilization on 32-bit

Use div_u64 to fix overflow when calculating utilization.
*long int* is 4-bytes on 32-bit so (user blocks * 100) might be
overflow if disk size is over e.g. 512GB.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/segment.h