Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 May 2012 05:49:23 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235069 - head/sys/geom/multipath
Message-ID:  <201205060549.q465nNDZ098851@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun May  6 05:49:23 2012
New Revision: 235069
URL: http://svn.freebsd.org/changeset/base/235069

Log:
  Fix `gmultipath configure` for big-endian machines.
  
  MFC after:	1 week

Modified:
  head/sys/geom/multipath/g_multipath.c

Modified: head/sys/geom/multipath/g_multipath.c
==============================================================================
--- head/sys/geom/multipath/g_multipath.c	Sat May  5 23:51:24 2012	(r235068)
+++ head/sys/geom/multipath/g_multipath.c	Sun May  6 05:49:23 2012	(r235069)
@@ -944,7 +944,7 @@ g_multipath_ctl_configure(struct gctl_re
 	struct g_geom *gp;
 	struct g_consumer *cp;
 	struct g_provider *pp;
-	struct g_multipath_metadata *md;
+	struct g_multipath_metadata md;
 	const char *name;
 	int error, *val;
 	void *buf;
@@ -980,14 +980,15 @@ g_multipath_ctl_configure(struct gctl_re
 			return;
 		}
 		g_topology_unlock();
-		md = buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO);
-		strlcpy(md->md_magic, G_MULTIPATH_MAGIC, sizeof(md->md_magic));
-		memcpy(md->md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid));
-		strlcpy(md->md_name, name, sizeof(md->md_name));
-		md->md_version = G_MULTIPATH_VERSION;
-		md->md_size = pp->mediasize;
-		md->md_sectorsize = pp->sectorsize;
-		md->md_active_active = sc->sc_active_active;
+		buf = g_malloc(pp->sectorsize, M_WAITOK | M_ZERO);
+		strlcpy(md.md_magic, G_MULTIPATH_MAGIC, sizeof(md.md_magic));
+		memcpy(md.md_uuid, sc->sc_uuid, sizeof (sc->sc_uuid));
+		strlcpy(md.md_name, name, sizeof(md.md_name));
+		md.md_version = G_MULTIPATH_VERSION;
+		md.md_size = pp->mediasize;
+		md.md_sectorsize = pp->sectorsize;
+		md.md_active_active = sc->sc_active_active;
+		multipath_metadata_encode(&md, buf);
 		error = g_write_data(cp, pp->mediasize - pp->sectorsize,
 		    buf, pp->sectorsize);
 		g_topology_lock();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205060549.q465nNDZ098851>