On Jun 21, 2007  17:15 +0200, Valerie Clement wrote:
> -#define EXT2_DESC_PER_BLOCK(s)               (EXT2_BLOCK_SIZE(s) / sizeof 
> (struct ext2_group_desc))
> +#define EXT2_DESC_PER_BLOCK(s)               (EXT2_BLOCK_SIZE(s) / \
> +     ((EXT2_DESC_SIZE(s) >= EXT2_MIN_DESC_SIZE_64BIT) ? \
> +      (s)->s_desc_size : sizeof(struct ext2_group_desc)))

If EXT2_DESC_SIZE() is already checking the superblock flag, why not just use:

#define EXT2_DESC_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / EXT2_DESC_SIZE(s))

Even better would be (1 << (EXT2_BLOCK_SIZE_BITS(s) - EXT2_DESC_SIZE_BITS(s))).

Having the s_desc_size stored as an integer shift (128 << s_desc_bits) instead
of a number of bytes makes a lot of sense (forces power-of-two size, makes
math easy), but it might be too much of a format change at this point?


Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to