[PATCH 04/11] xfs: remove the if_ext_max field in struct xfs_ifork
Dave Chinner
david at fromorbit.com
Tue Dec 13 15:59:58 CST 2011
On Thu, Dec 08, 2011 at 10:57:59AM -0500, Christoph Hellwig wrote:
> We spent a lot of effort to maintain this field, but it always equalts to the
> fork size divided by the constant size of an extent. The prime use of it is
> to assert that the two stay in sync. Just divide the fork size by the extent
> size in the few places that we actually use it and remove the overhead
> of maintaining it.
Ok, so you are trading off the overhead of initialising once with
runtime overhead of a read, against a runtime overhead read and a
integer division. Some platforms have slow integer division, so at
face value this migh tbe a bit slower.
However, sizeof(struct xfs_bmbt_rec) == 16, which is determined at
compile time so the compiler can optimise that to a shift, which has
basically no overhead compared to a division on platforms where
division is slow.
More information about the xfs
mailing list