Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3b2734f authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging/lustre/lov: convert magic to host-endian in lov_dump_lmm()

In lov_dump_lmm(), convert the lmm_magic from little-endian to
host-endian byte order before the switch statement, as the other
lov_dump_xxx() and lov_verify_xxx() functions already do.  Remove the
unused macro LMM_ASSERT().

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3297
Lustre-change: http://review.whamcloud.com/6290


Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarLi Wei <wei.g.li@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarPeng Tao <bergwolf@gmail.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2a0f0eac
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -105,24 +105,22 @@ void lov_dump_lmm(int level, void *lmm)
{
	int magic;

	magic = ((struct lov_mds_md_v1 *)(lmm))->lmm_magic;
	magic = le32_to_cpu(((struct lov_mds_md *)lmm)->lmm_magic);
	switch (magic) {
	case LOV_MAGIC_V1:
		return lov_dump_lmm_v1(level, (struct lov_mds_md_v1 *)(lmm));
		lov_dump_lmm_v1(level, (struct lov_mds_md_v1 *)lmm);
		break;
	case LOV_MAGIC_V3:
		return lov_dump_lmm_v3(level, (struct lov_mds_md_v3 *)(lmm));
		lov_dump_lmm_v3(level, (struct lov_mds_md_v3 *)lmm);
		break;
	default:
		CERROR("Cannot recognize lmm_magic %x", magic);
		CDEBUG(level, "unrecognized lmm_magic %x, assuming %x\n",
		       magic, LOV_MAGIC_V1);
		lov_dump_lmm_common(level, lmm);
		break;
	}
	return;
}

#define LMM_ASSERT(test)						\
do {								    \
	if (!(test)) lov_dump_lmm(D_ERROR, lmm);			\
	LASSERT(test); /* so we know what assertion failed */	   \
} while (0)

/* Pack LOV object metadata for disk storage.  It is packed in LE byte
 * order and is opaque to the networking layer.
 *