lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 21 Jun 2007 13:16:14 -0600
From:	Andreas Dilger <adilger@...sterfs.com>
To:	Valerie Clement <valerie.clement@...l.net>
Cc:	Theodore Tso <tytso@....edu>,
	ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: [RFC][PATCH 2/11][take 2] add new macro EXT2_DESC_PER_BLOCK in e2fsprogs

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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists