diff options
author | Theodore Ts'o <tytso@mit.edu> | 2001-06-08 09:43:40 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2001-06-08 09:43:40 +0000 |
commit | 30e50b7cdd6f5bbd5f2d6a2ee8ce0d4522336397 (patch) | |
tree | 42f717e1de4c93061babc65ccb5e28723d4c305a /lib/ext2fs | |
parent | b705640ae162093d40fc9f77e716bec891561ffe (diff) | |
download | e2fsprogs-30e50b7cdd6f5bbd5f2d6a2ee8ce0d4522336397.tar.gz |
ChangeLog, icount.c:
icount.c (insert_icount_el): Fix the code used to estimate the size of
the new icount array to be more intelligent, to avoid reallocating the
array too many times.
ChangeLog, ext2_types.h.in:
ext2_types.h.in: Use unsigned ints in favor of unsigned longs when
trying to find a 32-bit wide type.
Diffstat (limited to 'lib/ext2fs')
-rw-r--r-- | lib/ext2fs/ChangeLog | 10 | ||||
-rw-r--r-- | lib/ext2fs/ext2_types.h.in | 8 | ||||
-rw-r--r-- | lib/ext2fs/icount.c | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index a93fb025..72327373 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,13 @@ +2001-06-08 Theodore Tso <tytso@valinux.com> + + * ext2_types.h.in: Use unsigned ints in favor of unsigned longs + when trying to find a 32-bit wide type. + + * icount.c (insert_icount_el): Fix the code used to estimate the + size of the new icount array to be more intelligent, to + avoid reallocating the array too many times. Thanks to + Enrique Perez-Terron for pointing this out. + 2001-06-02 Theodore Tso <tytso@valinux.com> * valid_blk.c (ext2fs_inode_has_valid_blocks): Only check i_blocks diff --git a/lib/ext2fs/ext2_types.h.in b/lib/ext2fs/ext2_types.h.in index 9b56bc83..0731a010 100644 --- a/lib/ext2fs/ext2_types.h.in +++ b/lib/ext2fs/ext2_types.h.in @@ -29,12 +29,12 @@ typedef unsigned short __u16; ?==error: undefined 16 bit type #endif -#if (@SIZEOF_LONG@ == 4) -typedef long __s32; -typedef unsigned long __u32; -#elif (@SIZEOF_INT@ == 4) +#if (@SIZEOF_INT@ == 4) typedef int __s32; typedef unsigned int __u32; +#elif (@SIZEOF_LONG@ == 4) +typedef long __s32; +typedef unsigned long __u32; #elif (@SIZEOF_SHORT@ == 4) typedef short __s32; typedef unsigned short __u32; diff --git a/lib/ext2fs/icount.c b/lib/ext2fs/icount.c index d6f4cfc4..1ad39402 100644 --- a/lib/ext2fs/icount.c +++ b/lib/ext2fs/icount.c @@ -170,7 +170,7 @@ static struct ext2_icount_el *insert_icount_el(ext2_icount_t icount, if (icount->count) { new_size = icount->list[(unsigned)icount->count-1].ino; new_size = (ext2_ino_t) (icount->count * - ((float) new_size / icount->num_inodes)); + ((float) icount->num_inodes / new_size)); } if (new_size < (icount->size + 100)) new_size = icount->size + 100; |