From 5b4a08d0f480cf3afe26e6f471c033f1ab945243 Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Tue, 18 Aug 2009 14:06:05 -0700
Subject: [PATCH 1/5] Move ZPIOS chunk to linux-zpios topic branch

---
 configure.ac        | 2 +-
 scripts/Makefile.am | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 726ee1b831..770a15c060 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 /*
  * This file is part of the ZFS Linux port.
  *
- * Copyright (c) 2008 Lawrence Livermore National Security, LLC.
+ * Copyright (c) 2009 Lawrence Livermore National Security, LLC.
  * Produced at Lawrence Livermore National Laboratory
  * Written by:
  *         Brian Behlendorf <behlendorf1@llnl.gov>,
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 2737bb7875..2bc0f87f99 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -7,7 +7,6 @@ EXTRA_DIST = zfs-update.sh $(nobase_pkglibexec_SCRIPTS)
 
 ZFS=${top_srcdir}/scripts/zfs.sh
 ZTEST=${top_builddir}/cmd/ztest/ztest
-ZPIOS=${top_srcdir}/scripts/zpios.sh
 
 check:
 	@$(ZFS) -v

From d42b88372f1ba93a92eed18abc28983eb124ba9e Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Tue, 18 Aug 2009 14:07:25 -0700
Subject: [PATCH 2/5] Required build 121 updates for gcc-c90

---
 module/zfs/vdev.c        | 5 +++--
 module/zfs/vdev_mirror.c | 7 +++++--
 module/zfs/vdev_root.c   | 7 +++++--
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c
index 92b9958940..cb4a3e2524 100644
--- a/module/zfs/vdev.c
+++ b/module/zfs/vdev.c
@@ -1021,13 +1021,14 @@ vdev_open_children(vdev_t *vd)
 {
 	taskq_t *tq;
 	int children = vd->vdev_children;
+	int c;
 
 	tq = taskq_create("vdev_open", children, minclsyspri,
 	    children, children, TASKQ_PREPOPULATE);
 
-	for (int c = 0; c < children; c++)
+	for (c = 0; c < children; c++)
 		VERIFY(taskq_dispatch(tq, vdev_open_child, vd->vdev_child[c],
-		    TQ_SLEEP) != NULL);
+		    TQ_SLEEP) != 0);
 
 	taskq_destroy(tq);
 }
diff --git a/module/zfs/vdev_mirror.c b/module/zfs/vdev_mirror.c
index 58e3a53288..32615c0bc3 100644
--- a/module/zfs/vdev_mirror.c
+++ b/module/zfs/vdev_mirror.c
@@ -126,6 +126,7 @@ vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift)
 {
 	int numerrors = 0;
 	int lasterror = 0;
+	int c;
 
 	if (vd->vdev_children == 0) {
 		vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
@@ -134,7 +135,7 @@ vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift)
 
 	vdev_open_children(vd);
 
-	for (int c = 0; c < vd->vdev_children; c++) {
+	for (c = 0; c < vd->vdev_children; c++) {
 		vdev_t *cvd = vd->vdev_child[c];
 
 		if (cvd->vdev_open_error) {
@@ -158,7 +159,9 @@ vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift)
 static void
 vdev_mirror_close(vdev_t *vd)
 {
-	for (int c = 0; c < vd->vdev_children; c++)
+	int c;
+
+	for (c = 0; c < vd->vdev_children; c++)
 		vdev_close(vd->vdev_child[c]);
 }
 
diff --git a/module/zfs/vdev_root.c b/module/zfs/vdev_root.c
index 524c8e6060..dc9c0b9845 100644
--- a/module/zfs/vdev_root.c
+++ b/module/zfs/vdev_root.c
@@ -54,6 +54,7 @@ vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift)
 {
 	int lasterror = 0;
 	int numerrors = 0;
+	int c;
 
 	if (vd->vdev_children == 0) {
 		vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
@@ -62,7 +63,7 @@ vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift)
 
 	vdev_open_children(vd);
 
-	for (int c = 0; c < vd->vdev_children; c++) {
+	for (c = 0; c < vd->vdev_children; c++) {
 		vdev_t *cvd = vd->vdev_child[c];
 
 		if (cvd->vdev_open_error && !cvd->vdev_islog) {
@@ -85,7 +86,9 @@ vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift)
 static void
 vdev_root_close(vdev_t *vd)
 {
-	for (int c = 0; c < vd->vdev_children; c++)
+	int c;
+
+	for (c = 0; c < vd->vdev_children; c++)
 		vdev_close(vd->vdev_child[c]);
 }
 

From b29c1f87a02a75075ea30abbd10085a85f848f36 Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Tue, 18 Aug 2009 14:08:46 -0700
Subject: [PATCH 3/5] Required build 121 updates for gcc-missing-braces

---
 lib/libzfs/libzfs_dataset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c
index 75a11ec252..c5dffbc655 100644
--- a/lib/libzfs/libzfs_dataset.c
+++ b/lib/libzfs/libzfs_dataset.c
@@ -4099,7 +4099,7 @@ int
 zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag,
     boolean_t recursive)
 {
-	zfs_cmd_t zc = { 0 };
+	zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
 	libzfs_handle_t *hdl = zhp->zfs_hdl;
 
 	(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
@@ -4137,7 +4137,7 @@ int
 zfs_release(zfs_handle_t *zhp, const char *snapname, const char *tag,
     boolean_t recursive)
 {
-	zfs_cmd_t zc = { 0 };
+	zfs_cmd_t zc = { "\0", "\0", "\0", 0 };
 	libzfs_handle_t *hdl = zhp->zfs_hdl;
 
 	(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));

From 08f5b3c23decb0c86d6be8cc570fbbb36795f78e Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Tue, 18 Aug 2009 14:09:15 -0700
Subject: [PATCH 4/5] Required build 121 updates for gcc-shadow

---
 module/zfs/vdev_raidz.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/module/zfs/vdev_raidz.c b/module/zfs/vdev_raidz.c
index b3074173e0..0b2ba78467 100644
--- a/module/zfs/vdev_raidz.c
+++ b/module/zfs/vdev_raidz.c
@@ -1506,7 +1506,7 @@ vdev_raidz_combrec(zio_t *zio, int total_errors, int data_errors)
 	void *orig[VDEV_RAIDZ_MAXPARITY];
 	int tstore[VDEV_RAIDZ_MAXPARITY + 2];
 	int *tgts = &tstore[1];
-	int current, next, i, c, n;
+	int curr, next, i, c, n;
 	int code, ret = 0;
 
 	ASSERT(total_errors < rm->rm_firstdatacol);
@@ -1554,12 +1554,12 @@ vdev_raidz_combrec(zio_t *zio, int total_errors, int data_errors)
 
 		orig[n - 1] = zio_buf_alloc(rm->rm_col[0].rc_size);
 
-		current = 0;
-		next = tgts[current];
+		curr = 0;
+		next = tgts[curr];
 
-		while (current != n) {
-			tgts[current] = next;
-			current = 0;
+		while (curr != n) {
+			tgts[curr] = next;
+			curr = 0;
 
 			/*
 			 * Save off the original data that we're going to
@@ -1606,34 +1606,34 @@ vdev_raidz_combrec(zio_t *zio, int total_errors, int data_errors)
 
 			do {
 				/*
-				 * Find the next valid column after the current
+				 * Find the next valid column after the curr
 				 * position..
 				 */
-				for (next = tgts[current] + 1;
+				for (next = tgts[curr] + 1;
 				    next < rm->rm_cols &&
 				    rm->rm_col[next].rc_error != 0; next++)
 					continue;
 
-				ASSERT(next <= tgts[current + 1]);
+				ASSERT(next <= tgts[curr + 1]);
 
 				/*
 				 * If that spot is available, we're done here.
 				 */
-				if (next != tgts[current + 1])
+				if (next != tgts[curr + 1])
 					break;
 
 				/*
 				 * Otherwise, find the next valid column after
 				 * the previous position.
 				 */
-				for (c = tgts[current - 1] + 1;
+				for (c = tgts[curr - 1] + 1;
 				    rm->rm_col[c].rc_error != 0; c++)
 					continue;
 
-				tgts[current] = c;
-				current++;
+				tgts[curr] = c;
+				curr++;
 
-			} while (current != n);
+			} while (curr != n);
 		}
 	}
 	n--;

From f9a74de46aaa894edc070bc5fdc86a217e7e839e Mon Sep 17 00:00:00 2001
From: Brian Behlendorf <behlendorf1@llnl.gov>
Date: Tue, 18 Aug 2009 14:09:35 -0700
Subject: [PATCH 5/5] Required build 121 updates for gcc-uninit

---
 module/zfs/vdev_raidz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/zfs/vdev_raidz.c b/module/zfs/vdev_raidz.c
index 728a9d4133..c45511fd24 100644
--- a/module/zfs/vdev_raidz.c
+++ b/module/zfs/vdev_raidz.c
@@ -1002,7 +1002,7 @@ vdev_raidz_matrix_reconstruct(raidz_map_t *rm, int n, int nmissing,
 	uint64_t ccount;
 	uint8_t *dst[VDEV_RAIDZ_MAXPARITY];
 	uint64_t dcount[VDEV_RAIDZ_MAXPARITY];
-	uint8_t log, val;
+	uint8_t log = 0, val;
 	int ll;
 	uint8_t *invlog[VDEV_RAIDZ_MAXPARITY];
 	uint8_t *p, *pp;