Whamcloud - gitweb
Fix potential 2**32-1 overflow by using e2p_percent()
authorTheodore Ts'o <tytso@mit.edu>
Wed, 30 Aug 2006 07:08:13 +0000 (03:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 30 Aug 2006 07:08:13 +0000 (03:08 -0400)
commita8862d9e90d0d94761ba28dbbf9674308fd7d7c0
tree5fdfe5d2e83ac3c8c579b2579eb7dd76ee33f7b7
parent5830d6be9c33e23bb20c339036083e6e4fa6795e
Fix potential 2**32-1 overflow by using e2p_percent()

Add a new functiom, e2p_percent(), which correct calculates the percentage
of a number based on a given percentage, without worrying about overflow
issues.  This is used where we calculate the number of reserved blocks using
a percentage of the total number of blocks in a filesystem.

Based on patches from Eric Sandeen, but generalized to use this new function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
lib/e2p/ChangeLog
lib/e2p/Makefile.in
lib/e2p/e2p.h
lib/e2p/percent.c [new file with mode: 0644]
misc/ChangeLog
misc/mke2fs.c
misc/tune2fs.c
resize/ChangeLog
resize/online.c
resize/resize2fs.c