Re: Alignment of bitmaps for ext2_set_bit et al.

From: Andrew Morton
Date: Thu Aug 19 2004 - 06:28:40 EST


Paul Mackerras <paulus@xxxxxxxxx> wrote:
>
> What can we assume about the alignment of the bitmap pointer passed to
> the ext2_{set,clear}_bit_atomic functions? Can we assume that they
> will be aligned to an long boundary (8 bytes on 64-bit)?

For ext2 and ext3 it's safe to assume that they are 1024-byte aligned.

But it's possible that other filesystems are using these (awfully named)
functions.

Well. I doubt if anyone is using the _atomic versions yet.

> Olof has made a patch that uses atomics for these on ppc64 rather than
> locking and unlocking a lock, but it will only work correctly if the
> bitmap is always 8-byte aligned.

Sounds sane, as long as you get firmly notified when a poorly-aligned
address is fed in.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/