Whamcloud - gitweb
LU-8049 obdclass: use __BIG_ENDIAN to detect local endianness 12/19812/3
authorFan Yong <fan.yong@intel.com>
Fri, 8 Apr 2016 13:12:33 +0000 (21:12 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 27 May 2016 00:58:37 +0000 (00:58 +0000)
commit82fcdd9b16aad0b1cd840383c6f3b18c40be00bd
treef80604a1818f40c6114c393b9de202134346bd6c
parent2b5ed7c24b3d91bcd704281dc563e71e4689990c
LU-8049 obdclass: use __BIG_ENDIAN to detect local endianness

Originally, we used LUSTRE_MSG_MAGIC to detect the local endianness
as "if (LUSTRE_MSG_MAGIC != cpu_to_le32(LUSTRE_MSG_MAGIC))". But it
is not a good way. It is gratuitously confusing for no reason not
only because it has nothing specific to do with LUSTRE_MSG_MAGIC,
but also because this is a compile-time check but looks like runtime
check. This patch fixes it by checking "__BIG_ENDIAN".

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I7fc15890119b15c178da22b6dc6eebe102403734
Reviewed-on: http://review.whamcloud.com/19812
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/obdclass/md_attrs.c