> I debuged this a bit further by testing the 4 changed functions
> individually. The problem only occurs with the new version of
> xfs_lowbit64.
Eh, uh, of course. Now that I look at that code it becomes obvious.
find_first_bit() works on unsigned longs, not 64-bit quantities, so
find_first_bit((unsigned long *)&t, 64) isn't equivalent to finding the
lowest bit set in a 64-bit quantity.
Think of the memory layout of a 64-bit word:
LE: low 32 bits | high 32 bits
BE: high 32 bits | low 32 bits
Take a look at the start of include/asm-powerpc/bitops.h, and note how
bitops don't define the memory layout at all :)
So find_first_bit(&t, 64) on BE will give you the number of the first
bit of the 32-bit rotated quantity, ie. of ((t<<32) | (t>>32)).
The problem doesn't happen with highbit64 because fls64 was specifically
coded for this purpose.
You really need to keep xfs_lowbit64 defined as it was before, or, maybe
even better, define ffs64 in parallel to fls64.
johannes
-- Attached file included as plaintext by Ecartis --
-- File: signature.asc
-- Desc: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Comment: Johannes Berg (powerbook)
iQIVAwUAR8RWU6Vg1VMiehFYAQK9aBAAsTDlaL2HWlkcmHyYc0NfH7i5R8uX9nRt
i6iqjbLXc69s1+Zr9BaUD/PYqtlstzh6LNbVazlzfjUAUCMW9p+NI+zwyAPFcuyJ
Jw6KqAj8SodXqA2gIj3Sf9+3sXZ8IVrKrEXLeMR58rB8CtmZBAotXU+rRkLfQZDP
Z1LWw8SPdbTZittKsoFwmn4q0lhmGDzcIrFhve0JMT50N6WVJrDhf380tpEGmhbA
kXwnhEylR6mmCaamOpzyuT1n5CWjhnCUTAl81clmh48ZBiBc3AdCm1OXmVL4ZWqt
YyoO+56BPHhnuCf10xF7Sd2eX1Dybn5sgarO9wj6RADhNqViKh1QQRq0OMNXj/eu
c+YZ/A/4is5EUlO0JjCXGQ3vkhr9BBNfx1CTv4I3iVqkWEIc5t+bkzCZMBjGl2tl
H4Lt/JPTYqo++WNNYn0S5G62aJf543Q+x8/n4jAHEJidxhlmF1woXJgdvLKu7gKw
Akf56E5iM3QQa5iyFWzHHw6SsEtPm2doINnq7qvbZhOnJdWen5u0QAb46gnARh4F
4QtK08rOEkBzoXZW09oyWQMBRf7OvXDuABJdaUdoLEGsMWmOOJ0VD2CUOYM6G1pq
HBI8Sm/nyN7xF4LtNOwq0Hn+wkhbaPV9mfCsb2N0HAl/8xhxRyWc8M7gbmxsO96V
eHR+384uLjM=
=SfPO
-----END PGP SIGNATURE-----
|