Whamcloud - gitweb
LU-9019 obd: use 64-bit time for obd_recovery_* fields
[fs/lustre-release.git] / lustre / obdclass / md_attrs.c
index e06eb50..979c52d 100644 (file)
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
  */
 
 #include <lustre/lustre_idl.h>
+
+#include <llog_swab.h>
+#include <lustre_swab.h>
 #include <obd.h>
 #include <md_object.h>
 
@@ -60,12 +63,11 @@ EXPORT_SYMBOL(lustre_lma_init);
  */
 void lustre_lma_swab(struct lustre_mdt_attrs *lma)
 {
-       /* Use LUSTRE_MSG_MAGIC to detect local endianess. */
-       if (LUSTRE_MSG_MAGIC != cpu_to_le32(LUSTRE_MSG_MAGIC)) {
-               __swab32s(&lma->lma_compat);
-               __swab32s(&lma->lma_incompat);
-               lustre_swab_lu_fid(&lma->lma_self_fid);
-       }
+#ifdef __BIG_ENDIAN
+       __swab32s(&lma->lma_compat);
+       __swab32s(&lma->lma_incompat);
+       lustre_swab_lu_fid(&lma->lma_self_fid);
+#endif
 };
 EXPORT_SYMBOL(lustre_lma_swab);
 
@@ -77,13 +79,12 @@ EXPORT_SYMBOL(lustre_lma_swab);
  */
 void lustre_hsm_swab(struct hsm_attrs *attrs)
 {
-       /* Use LUSTRE_MSG_MAGIC to detect local endianess. */
-       if (LUSTRE_MSG_MAGIC != cpu_to_le32(LUSTRE_MSG_MAGIC)) {
-               __swab32s(&attrs->hsm_compat);
-               __swab32s(&attrs->hsm_flags);
-               __swab64s(&attrs->hsm_arch_id);
-               __swab64s(&attrs->hsm_arch_ver);
-       }
+#ifdef __BIG_ENDIAN
+       __swab32s(&attrs->hsm_compat);
+       __swab32s(&attrs->hsm_flags);
+       __swab64s(&attrs->hsm_arch_id);
+       __swab64s(&attrs->hsm_arch_ver);
+#endif
 };
 
 /*