svn commit: r235386 - stable/9/sys/geom/multipath

Alexander Motin mav at FreeBSD.org
Sun May 13 01:59:51 UTC 2012


Author: mav
Date: Sun May 13 01:59:50 2012
New Revision: 235386
URL: http://svn.freebsd.org/changeset/base/235386

Log:
  MFC r235069:
  Fix `gmultipath configure` for big-endian machines.

Modified:
  stable/9/sys/geom/multipath/g_multipath.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/multipath/g_multipath.c
==============================================================================
--- stable/9/sys/geom/multipath/g_multipath.c	Sun May 13 01:33:28 2012	(r235385)
+++ stable/9/sys/geom/multipath/g_multipath.c	Sun May 13 01:59:50 2012	(r235386)
@@ -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();


More information about the svn-src-stable-9 mailing list