OSDN Git Service

libext2fs: Make icount use a 32-bit counter
authorTheodore Ts'o <tytso@mit.edu>
Thu, 13 Mar 2008 17:37:29 +0000 (13:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 15 Mar 2008 05:39:19 +0000 (01:39 -0400)
commit60bbd1af533daf8c726d6e5e4f17b293494bd939
tree11724b929c9e7a9389bc1b326d38f598e2c8426a
parent199ddaaa445e14fca8113b0db85e2576267071c9
libext2fs: Make icount use a 32-bit counter

In order to more accurately count the number of directories, which
with the DIR_NLINKS feature can now be greater than 65,000, change
icount to use a 32-bit counter.  This doesn't cost us anything extra
when the icount data structures are stored in memory, since due to
padding for alignment reasons.

If the actual count is greater than 65,500, we return 65,500.  This is
because e2fsck doesn't actually need to know the exact count; it only
needs to know if the number of subdirectories is greater than 65,000.
In the future if someone really needs to know the exact number, we
could add a 32-bit interface.  One isn't needed now, though.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/icount.c