[Drbd-dev] [DRBD][PATCH] drbd_bitfild_endian.patch

Philipp Reisner philipp.reisner at linbit.com
Mon Dec 3 17:52:03 CET 2007

On Tuesday 27 November 2007 11:55:12 Lars Ellenberg wrote:
> On Tue, Nov 27, 2007 at 12:51:44PM +0000, Maxim Uvarov wrote:
> > By the way, Lars,  don't  use if defined(__LITTLE_ENDIAN) condition
> > because  __LITTLE_ENDIAN and __BIG_ENDIAN are always defined :)
> in userland, yes.
> in kernel, no.
> in kernel there is no "if BYTE_ORDER == __LITTLE_ENDIAN",
> there is only "ifdef __LITTLE_ENDIAN".
> unless you prove me wrong.


I have decided to go with Maxim's initial approach == Lars' approach.

I decided for that because according to GCC's documentation the
layout of bit-fields is part of the platform's ABI. It is not
compiler version dependant...

Please review commit 


Changing the protocol is not an option for drbd-8.0. The protocol
is frozen (for little endian).

That breaks of course rolling upgrades for users of existing
clusters on bit-endian machines.... if there are any.

BTW: If we really want we could even fix this, since we know
     that _pad is always 0 .... but it is not worth the effort
     when there are no users out there.

: Dipl-Ing Philipp Reisner                      Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH          Fax +43-1-8178292-82 :
: Vivenotgasse 48, 1120 Vienna, Austria        http://www.linbit.com :

More information about the drbd-dev mailing list