summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-07-20 12:15:11 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-07-20 12:15:11 +0000
commit63e43206e05ab8498eab9f0560e152309dc9cdf1 (patch)
treee7aff55e7391ce693c868dad9fa453ed1d273786
parent75910928a4d405b3b465aa64cec1c6ba9eab8513 (diff)
parent614f1d633e921143ad22010eeec64ed7c6aa627c (diff)
downloadillumos-joyent-63e43206e05ab8498eab9f0560e152309dc9cdf1.tar.gz
[illumos-gate merge]
commit f44a1392c9d1c0ff0faf96d4eed0952a6b5cfbe0 9569 smbios(1M) could decode voltage and curent probes 9570 smbios(1M) could decode cooling devices 9571 smbios(1M) could decode temperature probes 9572 smb_impl.h structs should comment corresponding type 9573 overshifted smbios major version leads to undershifted data 9574 smbios(1M) shouldn't print non-existant bios versions commit 284ce987a33170d916c005f044ef6ce9ce8e1517 9641 want stack-clash mitigation commit 4b9a859a90a27a1aaf064cac9a4fa96bcca57337 9651 README.pkg: Extra zero in PKGVERS commit e4768a3447c8320148c66b297c2acb00217f575d 9477 loader: cstyle update of common/commands.c commit 49169a56b4da7a6f2d206ecc2166fbe2457343b9 9417 check_rtime: except more C++ commit 566b4223c74de6cad48ddbedf35a12d6a511c8c5 9133 ucbcmd: this statement may fall through commit 65d28c0b2556a9bb47ed2b033469a4182ff5b488 9184 Add ZFS performance test for fixed blocksize random read/write IO commit c2919acbea007fa95c709b60d073db9a24526e01 9577 remove zfs_dbuf_evict_key tsd commit 11f6a9680e013a7c9c57dc0b64d3e91e2eee1a6b 9591 ms_shift can be incorrectly changed in MOS config for indirect vdevs that have been historically expanded Conflicts: usr/src/uts/common/vm/vm_as.c usr/src/uts/common/vm/seg_hole.c usr/src/uts/common/sys/smbios.h usr/src/common/smbios/smb_info.c usr/src/cmd/smbios/smbios.c
-rw-r--r--exception_lists/check_rtime6
-rw-r--r--usr/src/boot/sys/boot/common/commands.c694
-rw-r--r--usr/src/cmd/smbios/smbios.c42
-rw-r--r--usr/src/common/ficl/emu/loader_emu.c20
-rw-r--r--usr/src/common/smbios/smb_info.c8
-rw-r--r--usr/src/pkg/README.pkg2
-rw-r--r--usr/src/pkg/manifests/system-test-zfstest.mf5
-rw-r--r--usr/src/test/zfs-tests/runfiles/perf-regression.run3
-rw-r--r--usr/src/test/zfs-tests/tests/functional/removal/Makefile51
-rw-r--r--usr/src/test/zfs-tests/tests/functional/removal/remove_expanded.ksh89
-rw-r--r--usr/src/test/zfs-tests/tests/perf/fio/random_readwrite_fixed.fio35
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/random_reads.ksh8
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/random_readwrite_fixed.ksh82
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/random_writes.ksh8
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/sequential_reads.ksh8
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached.ksh10
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached_clone.ksh10
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_dbuf_cached.ksh4
-rw-r--r--usr/src/test/zfs-tests/tests/perf/regression/sequential_writes.ksh8
-rw-r--r--usr/src/ucbcmd/sed/sed.h7
-rw-r--r--usr/src/ucbcmd/sed/sed0.c3
-rw-r--r--usr/src/ucbcmd/sed/sed1.c7
-rw-r--r--usr/src/ucbcmd/stty/stty.c1
-rw-r--r--usr/src/ucbcmd/tset/tset.c12
-rw-r--r--usr/src/uts/common/fs/zfs/dbuf.c69
-rw-r--r--usr/src/uts/common/fs/zfs/dnode.c7
-rw-r--r--usr/src/uts/common/fs/zfs/dnode_sync.c17
-rw-r--r--usr/src/uts/common/fs/zfs/spa_config.c14
-rw-r--r--usr/src/uts/common/fs/zfs/sys/dbuf.h4
-rw-r--r--usr/src/uts/common/fs/zfs/sys/dnode.h4
-rw-r--r--usr/src/uts/common/fs/zfs/vdev.c4
-rw-r--r--usr/src/uts/common/sys/smbios.h5
-rw-r--r--usr/src/uts/common/sys/smbios_impl.h3
-rw-r--r--usr/src/uts/common/vm/seg_hole.c2
34 files changed, 717 insertions, 535 deletions
diff --git a/exception_lists/check_rtime b/exception_lists/check_rtime
index 39f86feed4..422287b8ea 100644
--- a/exception_lists/check_rtime
+++ b/exception_lists/check_rtime
@@ -125,7 +125,7 @@ UNUSED_RPATH /usr/snadm/lib.*\ from\ .*/usr/snadm/lib/libspmicommon\.so\.1
UNUSED_RPATH /usr/gcc/.*/lib.*\ from\ .*
# Unused runpaths for reasons not captured above
-UNUSED_RPATH /usr/lib/smbsrv.*\ from\ .*libsmb\.so\.1 # future needs
+UNUSED_RPATH /usr/lib/smbsrv.*\ from\ .*libsmb\.so\.1 # future needs
# Unreferenced objects of non-OSnet objects we can't change
UNREF_OBJ /lib.*\ of\ .*libcimapi\.so
@@ -159,6 +159,7 @@ UNREF_OBJ /libgcc_s.*\ of\ .*libgmodule-2\.0\.so\.0
# Unreferenced object of objects we can't change for other reasons
UNREF_OBJ /libmapmalloc\.so\.1;\ unused\ dependency\ of # interposer
UNREF_OBJ /libstdc\+\+\.so\.6;\ unused\ dependency\ of # gcc build
+UNREF_OBJ /libgcc_s\.so\.1;\ unused\ dependency\ of # gcc build
UNREF_OBJ /libgcc_s\.so\.1.*\ of\ .*libstdc\+\+\.so\.6 # omnios gcc mix
UNREF_OBJ /libm\.so\.2.*\ of\ .*libstdc\+\+\.so\.6 # gcc build
UNREF_OBJ /lib.*\ of\ .*/lib/picl/plugins/ # picl
@@ -195,8 +196,11 @@ OLDDEP libw\.so\.1 # on297 build 7
#
NOSYMSORT opt/SUNWdtrt/tst/common/pid/tst.weak2.exe # DTrace test
NOSYMSORT ld\.so\.1 # libc_pic.a user
+NOSYMSORT usr/bin/audioconvert # C++
+NOSYMSORT usr/bin/make # C++
NOSYMSORT usr/MACH(lib)/libsun_fc\.so\.1 # C++
NOSYMSORT usr/MACH(lib)/libfru\.so\.1 # C++
+NOSYMSORT usr/lib/libnisdb\.so\.2 # C++
# The majority of illumos deliverables should not depend on the GCC runtime
# (any necessary runtime symbol should be provided by libc.so, instead).
diff --git a/usr/src/boot/sys/boot/common/commands.c b/usr/src/boot/sys/boot/common/commands.c
index 942e6d09fb..04a2bf591f 100644
--- a/usr/src/boot/sys/boot/common/commands.c
+++ b/usr/src/boot/sys/boot/common/commands.c
@@ -37,10 +37,11 @@ char command_errbuf[COMMAND_ERRBUFSZ];
static int page_file(char *filename);
+/* BEGIN CSTYLED */
/*
* Help is read from a formatted text file.
*
- * Entries in the file are formatted as
+ * Entries in the file are formatted as
# Ttopic [Ssubtopic] Ddescription
help
@@ -57,158 +58,165 @@ here
*
* If no argument(s) are supplied by the user, the help for 'help' is displayed.
*/
+/* END CSTYLED */
COMMAND_SET(help, "help", "detailed help", command_help);
static int
-help_getnext(int fd, char **topic, char **subtopic, char **desc)
+help_getnext(int fd, char **topic, char **subtopic, char **desc)
{
- char line[81], *cp, *ep;
-
- /* Make sure we provide sane values. */
- *topic = *subtopic = *desc = NULL;
- for (;;) {
- if (fgetstr(line, 80, fd) < 0)
- return(0);
-
- if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' '))
- continue;
-
- cp = line + 2;
- while ((cp != NULL) && (*cp != 0)) {
- ep = strchr(cp, ' ');
- if ((*cp == 'T') && (*topic == NULL)) {
- if (ep != NULL)
- *ep++ = 0;
- *topic = strdup(cp + 1);
- } else if ((*cp == 'S') && (*subtopic == NULL)) {
- if (ep != NULL)
- *ep++ = 0;
- *subtopic = strdup(cp + 1);
- } else if (*cp == 'D') {
- *desc = strdup(cp + 1);
- ep = NULL;
- }
- cp = ep;
- }
- if (*topic == NULL) {
- free(*subtopic);
- free(*desc);
- *subtopic = *desc = NULL;
- continue;
+ char line[81], *cp, *ep;
+
+ /* Make sure we provide sane values. */
+ *topic = *subtopic = *desc = NULL;
+ for (;;) {
+ if (fgetstr(line, 80, fd) < 0)
+ return (0);
+
+ if (strlen(line) < 3 || line[0] != '#' || line[1] != ' ')
+ continue;
+
+ *topic = *subtopic = *desc = NULL;
+ cp = line + 2;
+ while (cp != NULL && *cp != 0) {
+ ep = strchr(cp, ' ');
+ if (*cp == 'T' && *topic == NULL) {
+ if (ep != NULL)
+ *ep++ = 0;
+ *topic = strdup(cp + 1);
+ } else if (*cp == 'S' && *subtopic == NULL) {
+ if (ep != NULL)
+ *ep++ = 0;
+ *subtopic = strdup(cp + 1);
+ } else if (*cp == 'D') {
+ *desc = strdup(cp + 1);
+ ep = NULL;
+ }
+ cp = ep;
+ }
+ if (*topic == NULL) {
+ free(*subtopic);
+ free(*desc);
+ *subtopic = *desc = NULL;
+ continue;
+ }
+ return (1);
}
- return(1);
- }
}
static int
help_emitsummary(char *topic, char *subtopic, char *desc)
{
- int i;
-
- pager_output(" ");
- pager_output(topic);
- i = strlen(topic);
- if (subtopic != NULL) {
- pager_output(" ");
- pager_output(subtopic);
- i += strlen(subtopic) + 1;
- }
- if (desc != NULL) {
- do {
- pager_output(" ");
- } while (i++ < 30);
- pager_output(desc);
- }
- return (pager_output("\n"));
+ int i;
+
+ pager_output(" ");
+ pager_output(topic);
+ i = strlen(topic);
+ if (subtopic != NULL) {
+ pager_output(" ");
+ pager_output(subtopic);
+ i += strlen(subtopic) + 1;
+ }
+ if (desc != NULL) {
+ do {
+ pager_output(" ");
+ } while (i++ < 30);
+ pager_output(desc);
+ }
+ return (pager_output("\n"));
}
-
+
static int
-command_help(int argc, char *argv[])
+command_help(int argc, char *argv[])
{
- char buf[81]; /* XXX buffer size? */
- int hfd, matched, doindex;
- char *topic, *subtopic, *t, *s, *d;
-
- /* page the help text from our load path */
- snprintf(buf, sizeof (buf), "%s/boot/loader.help", getenv("loaddev"));
- if ((hfd = open(buf, O_RDONLY)) < 0) {
- printf("Verbose help not available, use '?' to list commands\n");
- return(CMD_OK);
- }
-
- /* pick up request from arguments */
- topic = subtopic = NULL;
- switch(argc) {
- case 3:
- subtopic = strdup(argv[2]);
- case 2:
- topic = strdup(argv[1]);
- break;
- case 1:
- topic = strdup("help");
- break;
- default:
- command_errmsg = "usage is 'help <topic> [<subtopic>]";
- close(hfd);
- return(CMD_ERROR);
- }
-
- /* magic "index" keyword */
- doindex = !strcmp(topic, "index");
- matched = doindex;
-
- /* Scan the helpfile looking for help matching the request */
- pager_open();
- while (help_getnext(hfd, &t, &s, &d)) {
-
- if (doindex) { /* dink around formatting */
- if (help_emitsummary(t, s, d))
- break;
+ char buf[81]; /* XXX buffer size? */
+ int hfd, matched, doindex;
+ char *topic, *subtopic, *t, *s, *d;
+
+ /* page the help text from our load path */
+ snprintf(buf, sizeof (buf), "%s/boot/loader.help", getenv("loaddev"));
+ if ((hfd = open(buf, O_RDONLY)) < 0) {
+ printf("Verbose help not available, "
+ "use '?' to list commands\n");
+ return (CMD_OK);
+ }
- } else if (strcmp(topic, t)) {
- /* topic mismatch */
- if (matched) /* nothing more on this topic, stop scanning */
+ /* pick up request from arguments */
+ topic = subtopic = NULL;
+ switch (argc) {
+ case 3:
+ subtopic = strdup(argv[2]);
+ /* FALLTHROUGH */
+ case 2:
+ topic = strdup(argv[1]);
+ break;
+ case 1:
+ topic = strdup("help");
break;
+ default:
+ command_errmsg = "usage is 'help <topic> [<subtopic>]";
+ close(hfd);
+ return (CMD_ERROR);
+ }
- } else {
- /* topic matched */
- matched = 1;
- if (((subtopic == NULL) && (s == NULL)) ||
- ((subtopic != NULL) && (s != NULL) && !strcmp(subtopic, s))) {
- /* exact match, print text */
- while ((fgetstr(buf, 80, hfd) >= 0) && (buf[0] != '#')) {
- if (pager_output(buf))
- break;
- if (pager_output("\n"))
- break;
+ /* magic "index" keyword */
+ doindex = strcmp(topic, "index") == 0? 1 : 0;
+ matched = doindex;
+
+ /* Scan the helpfile looking for help matching the request */
+ pager_open();
+ while (help_getnext(hfd, &t, &s, &d)) {
+
+ if (doindex) { /* dink around formatting */
+ if (help_emitsummary(t, s, d))
+ break;
+
+ } else if (strcmp(topic, t)) {
+ /* topic mismatch */
+ if (matched) {
+ /* nothing more on this topic, stop scanning */
+ break;
+ }
+ } else {
+ /* topic matched */
+ matched = 1;
+ if ((subtopic == NULL && s == NULL) ||
+ (subtopic != NULL && s != NULL &&
+ strcmp(subtopic, s) == 0)) {
+ /* exact match, print text */
+ while (fgetstr(buf, 80, hfd) >= 0 &&
+ buf[0] != '#') {
+ if (pager_output(buf))
+ break;
+ if (pager_output("\n"))
+ break;
+ }
+ } else if (subtopic == NULL && s != NULL) {
+ /* topic match, list subtopics */
+ if (help_emitsummary(t, s, d))
+ break;
+ }
}
- } else if ((subtopic == NULL) && (s != NULL)) {
- /* topic match, list subtopics */
- if (help_emitsummary(t, s, d))
- break;
- }
+ free(t);
+ free(s);
+ free(d);
+ t = s = d = NULL;
}
free(t);
free(s);
free(d);
- t = s = d = NULL;
- }
- free(t);
- free(s);
- free(d);
- pager_close();
- close(hfd);
- if (!matched) {
- snprintf(command_errbuf, sizeof (command_errbuf),
- "no help available for '%s'", topic);
+ pager_close();
+ close(hfd);
+ if (!matched) {
+ snprintf(command_errbuf, sizeof (command_errbuf),
+ "no help available for '%s'", topic);
+ free(topic);
+ free(subtopic);
+ return (CMD_ERROR);
+ }
free(topic);
free(subtopic);
- return(CMD_ERROR);
- }
- free(topic);
- free(subtopic);
- return(CMD_OK);
+ return (CMD_OK);
}
COMMAND_SET(commandlist, "?", "list commands", command_commandlist);
@@ -216,25 +224,26 @@ COMMAND_SET(commandlist, "?", "list commands", command_commandlist);
static int
command_commandlist(int argc __unused, char *argv[] __unused)
{
- struct bootblk_command **cmdp;
- int res;
- char name[20];
-
- res = 0;
- pager_open();
- res = pager_output("Available commands:\n");
- SET_FOREACH(cmdp, Xcommand_set) {
- if (res)
- break;
- if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL)) {
- snprintf(name, sizeof (name), " %-15s ", (*cmdp)->c_name);
- pager_output(name);
- pager_output((*cmdp)->c_desc);
- res = pager_output("\n");
+ struct bootblk_command **cmdp;
+ int res;
+ char name[20];
+
+ res = 0;
+ pager_open();
+ res = pager_output("Available commands:\n");
+ SET_FOREACH(cmdp, Xcommand_set) {
+ if (res)
+ break;
+ if ((*cmdp)->c_name != NULL && (*cmdp)->c_desc != NULL) {
+ snprintf(name, sizeof (name)," %-15s ",
+ (*cmdp)->c_name);
+ pager_output(name);
+ pager_output((*cmdp)->c_desc);
+ res = pager_output("\n");
+ }
}
- }
- pager_close();
- return(CMD_OK);
+ pager_close();
+ return (CMD_OK);
}
/*
@@ -247,35 +256,35 @@ COMMAND_SET(show, "show", "show variable(s)", command_show);
static int
command_show(int argc, char *argv[])
{
- struct env_var *ev;
- char *cp;
-
- if (argc < 2) {
- /*
- * With no arguments, print everything.
- */
- pager_open();
- for (ev = environ; ev != NULL; ev = ev->ev_next) {
- pager_output(ev->ev_name);
- cp = getenv(ev->ev_name);
- if (cp != NULL) {
- pager_output("=");
- pager_output(cp);
- }
- if (pager_output("\n"))
- break;
- }
- pager_close();
- } else {
- if ((cp = getenv(argv[1])) != NULL) {
- printf("%s\n", cp);
+ struct env_var *ev;
+ char *cp;
+
+ if (argc < 2) {
+ /*
+ * With no arguments, print everything.
+ */
+ pager_open();
+ for (ev = environ; ev != NULL; ev = ev->ev_next) {
+ pager_output(ev->ev_name);
+ cp = getenv(ev->ev_name);
+ if (cp != NULL) {
+ pager_output("=");
+ pager_output(cp);
+ }
+ if (pager_output("\n"))
+ break;
+ }
+ pager_close();
} else {
- snprintf(command_errbuf, sizeof (command_errbuf),
- "variable '%s' not found", argv[1]);
- return(CMD_ERROR);
+ if ((cp = getenv(argv[1])) != NULL) {
+ printf("%s\n", cp);
+ } else {
+ snprintf(command_errbuf, sizeof (command_errbuf),
+ "variable '%s' not found", argv[1]);
+ return (CMD_ERROR);
+ }
}
- }
- return(CMD_OK);
+ return (CMD_OK);
}
COMMAND_SET(set, "set", "set a variable", command_set);
@@ -283,18 +292,18 @@ COMMAND_SET(set, "set", "set a variable", command_set);
static int
command_set(int argc, char *argv[])
{
- int err;
-
- if (argc != 2) {
- command_errmsg = "wrong number of arguments";
- return(CMD_ERROR);
- } else {
- if ((err = putenv(argv[1])) != 0) {
- command_errmsg = strerror(err);
- return(CMD_ERROR);
+ int err;
+
+ if (argc != 2) {
+ command_errmsg = "wrong number of arguments";
+ return (CMD_ERROR);
+ } else {
+ if ((err = putenv(argv[1])) != 0) {
+ command_errmsg = strerror(err);
+ return (CMD_ERROR);
+ }
}
- }
- return(CMD_OK);
+ return (CMD_OK);
}
COMMAND_SET(setprop, "setprop", "set a variable", command_setprop);
@@ -302,37 +311,37 @@ COMMAND_SET(setprop, "setprop", "set a variable", command_setprop);
static int
command_setprop(int argc, char *argv[])
{
- int err;
-
- if (argc != 3) {
- command_errmsg = "wrong number of arguments";
- return(CMD_ERROR);
- } else {
- if ((err = setenv(argv[1], argv[2], 1)) != 0) {
- command_errmsg = strerror(err);
- return(CMD_ERROR);
+ int err;
+
+ if (argc != 3) {
+ command_errmsg = "wrong number of arguments";
+ return (CMD_ERROR);
+ } else {
+ if ((err = setenv(argv[1], argv[2], 1)) != 0) {
+ command_errmsg = strerror(err);
+ return (CMD_ERROR);
+ }
}
- }
- return(CMD_OK);
+ return (CMD_OK);
}
COMMAND_SET(unset, "unset", "unset a variable", command_unset);
static int
-command_unset(int argc, char *argv[])
+command_unset(int argc, char *argv[])
{
- int err;
-
- if (argc != 2) {
- command_errmsg = "wrong number of arguments";
- return(CMD_ERROR);
- } else {
- if ((err = unsetenv(argv[1])) != 0) {
- command_errmsg = strerror(err);
- return(CMD_ERROR);
+ int err;
+
+ if (argc != 2) {
+ command_errmsg = "wrong number of arguments";
+ return (CMD_ERROR);
+ } else {
+ if ((err = unsetenv(argv[1])) != 0) {
+ command_errmsg = strerror(err);
+ return (CMD_ERROR);
+ }
}
- }
- return(CMD_OK);
+ return (CMD_OK);
}
COMMAND_SET(echo, "echo", "echo arguments", command_echo);
@@ -340,34 +349,34 @@ COMMAND_SET(echo, "echo", "echo arguments", command_echo);
static int
command_echo(int argc, char *argv[])
{
- char *s;
- int nl, ch;
-
- nl = 0;
- optind = 1;
- optreset = 1;
- while ((ch = getopt(argc, argv, "n")) != -1) {
- switch(ch) {
- case 'n':
- nl = 1;
- break;
- case '?':
- default:
- /* getopt has already reported an error */
- return(CMD_OK);
+ char *s;
+ int nl, ch;
+
+ nl = 0;
+ optind = 1;
+ optreset = 1;
+ while ((ch = getopt(argc, argv, "n")) != -1) {
+ switch (ch) {
+ case 'n':
+ nl = 1;
+ break;
+ case '?':
+ default:
+ /* getopt has already reported an error */
+ return (CMD_OK);
+ }
}
- }
- argv += (optind);
- argc -= (optind);
+ argv += (optind);
+ argc -= (optind);
- s = unargv(argc, argv);
- if (s != NULL) {
- printf("%s", s);
- free(s);
- }
- if (!nl)
- printf("\n");
- return(CMD_OK);
+ s = unargv(argc, argv);
+ if (s != NULL) {
+ printf("%s", s);
+ free(s);
+ }
+ if (!nl)
+ printf("\n");
+ return (CMD_OK);
}
/*
@@ -379,55 +388,55 @@ COMMAND_SET(read, "read", "read input from the terminal", command_read);
static int
command_read(int argc, char *argv[])
{
- char *prompt;
- int timeout;
- time_t when;
- char *cp;
- char *name;
- char buf[256]; /* XXX size? */
- int c;
-
- timeout = -1;
- prompt = NULL;
- optind = 1;
- optreset = 1;
- while ((c = getopt(argc, argv, "p:t:")) != -1) {
- switch(c) {
-
- case 'p':
- prompt = optarg;
- break;
- case 't':
- timeout = strtol(optarg, &cp, 0);
- if (cp == optarg) {
- snprintf(command_errbuf, sizeof (command_errbuf),
- "bad timeout '%s'", optarg);
- return(CMD_ERROR);
- }
- break;
- default:
- return(CMD_OK);
+ char *prompt;
+ int timeout;
+ time_t when;
+ char *cp;
+ char *name;
+ char buf[256]; /* XXX size? */
+ int c;
+
+ timeout = -1;
+ prompt = NULL;
+ optind = 1;
+ optreset = 1;
+ while ((c = getopt(argc, argv, "p:t:")) != -1) {
+ switch (c) {
+ case 'p':
+ prompt = optarg;
+ break;
+ case 't':
+ timeout = strtol(optarg, &cp, 0);
+ if (cp == optarg) {
+ snprintf(command_errbuf,
+ sizeof (command_errbuf),
+ "bad timeout '%s'", optarg);
+ return (CMD_ERROR);
+ }
+ break;
+ default:
+ return (CMD_OK);
+ }
}
- }
-
- argv += (optind);
- argc -= (optind);
- name = (argc > 0) ? argv[0]: NULL;
-
- if (prompt != NULL)
- printf("%s", prompt);
- if (timeout >= 0) {
- when = time(NULL) + timeout;
- while (!ischar())
- if (time(NULL) >= when)
- return(CMD_OK); /* is timeout an error? */
- }
-
- ngets(buf, sizeof(buf));
-
- if (name != NULL)
- setenv(name, buf, 1);
- return(CMD_OK);
+
+ argv += (optind);
+ argc -= (optind);
+ name = (argc > 0) ? argv[0]: NULL;
+
+ if (prompt != NULL)
+ printf("%s", prompt);
+ if (timeout >= 0) {
+ when = time(NULL) + timeout;
+ while (!ischar())
+ if (time(NULL) >= when)
+ return (CMD_OK); /* is timeout an error? */
+ }
+
+ ngets(buf, sizeof (buf));
+
+ if (name != NULL)
+ setenv(name, buf, 1);
+ return (CMD_OK);
}
/*
@@ -438,44 +447,46 @@ COMMAND_SET(more, "more", "show contents of a file", command_more);
static int
command_more(int argc, char *argv[])
{
- int i;
- int res;
- char line[80];
-
- res=0;
- pager_open();
- for (i = 1; (i < argc) && (res == 0); i++) {
- snprintf(line, sizeof (line), "*** FILE %s BEGIN ***\n", argv[i]);
- if (pager_output(line))
- break;
- res = page_file(argv[i]);
- if (!res) {
- snprintf(line, sizeof (line), "*** FILE %s END ***\n", argv[i]);
- res = pager_output(line);
+ int i;
+ int res;
+ char line[80];
+
+ res = 0;
+ pager_open();
+ for (i = 1; (i < argc) && (res == 0); i++) {
+ snprintf(line, sizeof (line), "*** FILE %s BEGIN ***\n",
+ argv[i]);
+ if (pager_output(line))
+ break;
+ res = page_file(argv[i]);
+ if (!res) {
+ snprintf(line, sizeof (line), "*** FILE %s END ***\n",
+ argv[i]);
+ res = pager_output(line);
+ }
}
- }
- pager_close();
+ pager_close();
- if (res == 0)
- return CMD_OK;
- else
- return CMD_ERROR;
+ if (res == 0)
+ return (CMD_OK);
+ else
+ return (CMD_ERROR);
}
static int
page_file(char *filename)
{
- int result;
+ int result;
- result = pager_file(filename);
+ result = pager_file(filename);
- if (result == -1) {
- snprintf(command_errbuf, sizeof (command_errbuf),
- "error showing %s", filename);
- }
+ if (result == -1) {
+ snprintf(command_errbuf, sizeof (command_errbuf),
+ "error showing %s", filename);
+ }
- return result;
-}
+ return (result);
+}
/*
* List all disk-like devices
@@ -485,37 +496,38 @@ COMMAND_SET(lsdev, "lsdev", "list all devices", command_lsdev);
static int
command_lsdev(int argc, char *argv[])
{
- int verbose, ch, i;
- char line[80];
-
- verbose = 0;
- optind = 1;
- optreset = 1;
- while ((ch = getopt(argc, argv, "v")) != -1) {
- switch(ch) {
- case 'v':
- verbose = 1;
- break;
- case '?':
- default:
- /* getopt has already reported an error */
- return(CMD_OK);
+ int verbose, ch, i;
+ char line[80];
+
+ verbose = 0;
+ optind = 1;
+ optreset = 1;
+ while ((ch = getopt(argc, argv, "v")) != -1) {
+ switch (ch) {
+ case 'v':
+ verbose = 1;
+ break;
+ case '?':
+ default:
+ /* getopt has already reported an error */
+ return (CMD_OK);
+ }
}
- }
- argv += (optind);
- argc -= (optind);
-
- pager_open();
- for (i = 0; devsw[i] != NULL; i++) {
- if (devsw[i]->dv_print != NULL){
- if (devsw[i]->dv_print(verbose))
- break;
- } else {
- snprintf(line, sizeof (line), "%s: (unknown)\n", devsw[i]->dv_name);
- if (pager_output(line))
- break;
+ argv += (optind);
+ argc -= (optind);
+
+ pager_open();
+ for (i = 0; devsw[i] != NULL; i++) {
+ if (devsw[i]->dv_print != NULL) {
+ if (devsw[i]->dv_print(verbose))
+ break;
+ } else {
+ snprintf(line, sizeof (line), "%s: (unknown)\n",
+ devsw[i]->dv_name);
+ if (pager_output(line))
+ break;
+ }
}
- }
- pager_close();
- return(CMD_OK);
+ pager_close();
+ return (CMD_OK);
}
diff --git a/usr/src/cmd/smbios/smbios.c b/usr/src/cmd/smbios/smbios.c
index 34764f3828..658d512b55 100644
--- a/usr/src/cmd/smbios/smbios.c
+++ b/usr/src/cmd/smbios/smbios.c
@@ -1019,21 +1019,21 @@ print_vprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
desc_printf(smbios_vprobe_status_desc(vp.smbvp_status),
fp, " Status: %u", vp.smbvp_status);
- if (vp.smbvp_maxval != 0x8000) {
+ if (vp.smbvp_maxval != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Maximum Possible Voltage: %u mV\n",
vp.smbvp_maxval);
} else {
oprintf(fp, " Maximum Possible Voltage: unknown\n");
}
- if (vp.smbvp_minval != 0x8000) {
+ if (vp.smbvp_minval != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Minimum Possible Voltage: %u mV\n",
vp.smbvp_minval);
} else {
oprintf(fp, " Minimum Possible Voltage: unknown\n");
}
- if (vp.smbvp_resolution != 0x8000) {
+ if (vp.smbvp_resolution != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Resolution: %u.%u mV\n",
vp.smbvp_resolution / 10,
vp.smbvp_resolution % 10);
@@ -1041,14 +1041,14 @@ print_vprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
oprintf(fp, " Probe Resolution: unknown\n");
}
- if (vp.smbvp_tolerance != 0x8000) {
+ if (vp.smbvp_tolerance != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Tolerance: +/-%u mV\n",
vp.smbvp_tolerance);
} else {
oprintf(fp, " Probe Tolerance: unknown\n");
}
- if (vp.smbvp_accuracy != 0x8000) {
+ if (vp.smbvp_accuracy != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Accuracy: +/-%u.%02u%%\n",
vp.smbvp_accuracy / 100,
vp.smbvp_accuracy % 100);
@@ -1058,7 +1058,7 @@ print_vprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
oprintf(fp, " OEM- or BIOS- defined value: 0x%x\n", vp.smbvp_oem);
- if (vp.smbvp_nominal != 0x8000) {
+ if (vp.smbvp_nominal != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Nominal Value: %u mV\n", vp.smbvp_nominal);
} else {
oprintf(fp, " Probe Nominal Value: unknown\n");
@@ -1076,14 +1076,14 @@ print_cooldev(smbios_hdl_t *shp, id_t id, FILE *fp)
return;
}
- oprintf(fp, " Temperature Probe Handle: %u\n", cd.smbcd_tprobe);
+ id_printf(fp, " Temperature Probe Handle: ", cd.smbcd_tprobe);
desc_printf(smbios_cooldev_type_desc(cd.smbcd_type),
fp, " Device Type: %u", cd.smbcd_type);
desc_printf(smbios_cooldev_status_desc(cd.smbcd_status),
fp, " Status: %u", cd.smbcd_status);
oprintf(fp, " Cooling Unit Group: %u\n", cd.smbcd_group);
oprintf(fp, " OEM- or BIOS- defined data: 0x%x\n", cd.smbcd_oem);
- if (cd.smbcd_nominal != 0x8000) {
+ if (cd.smbcd_nominal != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Nominal Speed: %u RPM\n", cd.smbcd_nominal);
} else {
oprintf(fp, " Nominal Speed: unknown\n");
@@ -1112,21 +1112,21 @@ print_tprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
desc_printf(smbios_tprobe_status_desc(tp.smbtp_status),
fp, " Status: %u", tp.smbtp_status);
- if (tp.smbtp_maxval != 0x8000) {
+ if (tp.smbtp_maxval != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Maximum Possible Temperature: %u.%u C\n",
tp.smbtp_maxval / 10, tp.smbtp_maxval % 10);
} else {
oprintf(fp, " Maximum Possible Temperature: unknown\n");
}
- if (tp.smbtp_minval != 0x8000) {
+ if (tp.smbtp_minval != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Minimum Possible Temperature: %u.%u C\n",
tp.smbtp_minval / 10, tp.smbtp_minval % 10);
} else {
oprintf(fp, " Minimum Possible Temperature: unknown\n");
}
- if (tp.smbtp_resolution != 0x8000) {
+ if (tp.smbtp_resolution != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Resolution: %u.%03u C\n",
tp.smbtp_resolution / 1000,
tp.smbtp_resolution % 1000);
@@ -1134,14 +1134,14 @@ print_tprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
oprintf(fp, " Probe Resolution: unknown\n");
}
- if (tp.smbtp_tolerance != 0x8000) {
+ if (tp.smbtp_tolerance != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Tolerance: +/-%u.%u C\n",
tp.smbtp_tolerance / 10, tp.smbtp_tolerance % 10);
} else {
oprintf(fp, " Probe Tolerance: unknown\n");
}
- if (tp.smbtp_accuracy != 0x8000) {
+ if (tp.smbtp_accuracy != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Accuracy: +/-%u.%02u%%\n",
tp.smbtp_accuracy / 100,
tp.smbtp_accuracy % 100);
@@ -1151,8 +1151,8 @@ print_tprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
oprintf(fp, " OEM- or BIOS- defined value: 0x%x\n", tp.smbtp_oem);
- if (tp.smbtp_nominal != 0x8000) {
- oprintf(fp, " Probe Nominal Value: %u C\n",
+ if (tp.smbtp_nominal != SMB_PROBE_UNKNOWN_VALUE) {
+ oprintf(fp, " Probe Nominal Value: %u.%u C\n",
tp.smbtp_nominal / 10, tp.smbtp_nominal % 10);
} else {
oprintf(fp, " Probe Nominal Value: unknown\n");
@@ -1176,21 +1176,21 @@ print_iprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
desc_printf(smbios_iprobe_status_desc(ip.smbip_status),
fp, " Status: %u", ip.smbip_status);
- if (ip.smbip_maxval != 0x8000) {
+ if (ip.smbip_maxval != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Maximum Possible Current: %u mA\n",
ip.smbip_maxval);
} else {
oprintf(fp, " Maximum Possible Current: unknown\n");
}
- if (ip.smbip_minval != 0x8000) {
+ if (ip.smbip_minval != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Minimum Possible Current: %u mA\n",
ip.smbip_minval);
} else {
oprintf(fp, " Minimum Possible Current: unknown\n");
}
- if (ip.smbip_resolution != 0x8000) {
+ if (ip.smbip_resolution != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Resolution: %u.%u mA\n",
ip.smbip_resolution / 10,
ip.smbip_resolution % 10);
@@ -1198,14 +1198,14 @@ print_iprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
oprintf(fp, " Probe Resolution: unknown\n");
}
- if (ip.smbip_tolerance != 0x8000) {
+ if (ip.smbip_tolerance != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Tolerance: +/-%u mA\n",
ip.smbip_tolerance);
} else {
oprintf(fp, " Probe Tolerance: unknown\n");
}
- if (ip.smbip_accuracy != 0x8000) {
+ if (ip.smbip_accuracy != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Accuracy: +/-%u.%02u%%\n",
ip.smbip_accuracy / 100,
ip.smbip_accuracy % 100);
@@ -1215,7 +1215,7 @@ print_iprobe(smbios_hdl_t *shp, id_t id, FILE *fp)
oprintf(fp, " OEM- or BIOS- defined value: 0x%x\n", ip.smbip_oem);
- if (ip.smbip_nominal != 0x8000) {
+ if (ip.smbip_nominal != SMB_PROBE_UNKNOWN_VALUE) {
oprintf(fp, " Probe Nominal Value: %u mA\n", ip.smbip_nominal);
} else {
oprintf(fp, " Probe Nominal Value: unknown\n");
diff --git a/usr/src/common/ficl/emu/loader_emu.c b/usr/src/common/ficl/emu/loader_emu.c
index ad5ce87cbc..51e368cc99 100644
--- a/usr/src/common/ficl/emu/loader_emu.c
+++ b/usr/src/common/ficl/emu/loader_emu.c
@@ -1074,18 +1074,18 @@ help_getnext(int fd, char **topic, char **subtopic, char **desc)
if (fgetstr(line, 80, fd) < 0)
return (0);
- if ((strlen(line) < 3) || (line[0] != '#') || (line[1] != ' '))
+ if (strlen(line) < 3 || line[0] != '#' || line[1] != ' ')
continue;
*topic = *subtopic = *desc = NULL;
cp = line + 2;
- while ((cp != NULL) && (*cp != 0)) {
+ while (cp != NULL && *cp != 0) {
ep = strchr(cp, ' ');
- if ((*cp == 'T') && (*topic == NULL)) {
+ if (*cp == 'T' && *topic == NULL) {
if (ep != NULL)
*ep++ = 0;
*topic = strdup(cp + 1);
- } else if ((*cp == 'S') && (*subtopic == NULL)) {
+ } else if (*cp == 'S' && *subtopic == NULL) {
if (ep != NULL)
*ep++ = 0;
*subtopic = strdup(cp + 1);
@@ -1178,18 +1178,18 @@ command_help(int argc, char *argv[])
} else {
/* topic matched */
matched = 1;
- if (((subtopic == NULL) && (s == NULL)) ||
- ((subtopic != NULL) && (s != NULL) &&
+ if ((subtopic == NULL && s == NULL) ||
+ (subtopic != NULL && s != NULL &&
strcmp(subtopic, s) == 0)) {
/* exact match, print text */
- while ((fgetstr(buf, 80, hfd) >= 0) &&
- (buf[0] != '#')) {
+ while (fgetstr(buf, 80, hfd) >= 0 &&
+ buf[0] != '#') {
if (pager_output(buf))
break;
if (pager_output("\n"))
break;
}
- } else if ((subtopic == NULL) && (s != NULL)) {
+ } else if (subtopic == NULL && s != NULL) {
/* topic match, list subtopics */
if (help_emitsummary(t, s, d))
break;
@@ -1231,7 +1231,7 @@ command_commandlist(int argc __unused, char *argv[] __unused)
STAILQ_FOREACH(cmdp, &commands, next) {
if (res)
break;
- if ((cmdp->c_name != NULL) && (cmdp->c_desc != NULL)) {
+ if (cmdp->c_name != NULL && cmdp->c_desc != NULL) {
snprintf(name, sizeof (name), " %-15s ",
cmdp->c_name);
pager_output(name);
diff --git a/usr/src/common/smbios/smb_info.c b/usr/src/common/smbios/smb_info.c
index b834f09863..b28413d6a5 100644
--- a/usr/src/common/smbios/smb_info.c
+++ b/usr/src/common/smbios/smb_info.c
@@ -1348,7 +1348,7 @@ smbios_info_vprobe(smbios_hdl_t *shp, id_t id, smbios_vprobe_t *vprobe)
if (stp->smbst_hdr->smbh_len >= SMB_VPROBE_NOMINAL_MINLEN) {
vprobe->smbvp_nominal = vp.smbvpr_nominal;
} else {
- vprobe->smbvp_nominal = 0x8000;
+ vprobe->smbvp_nominal = SMB_PROBE_UNKNOWN_VALUE;
}
return (0);
@@ -1380,7 +1380,7 @@ smbios_info_cooldev(smbios_hdl_t *shp, id_t id, smbios_cooldev_t *cooldev)
if (stp->smbst_hdr->smbh_len >= SMB_COOLDEV_NOMINAL_MINLEN) {
cooldev->smbcd_nominal = cd.smbcdev_nominal;
} else {
- cooldev->smbcd_nominal = 0x8000;
+ cooldev->smbcd_nominal = SMB_PROBE_UNKNOWN_VALUE;
}
/*
@@ -1430,7 +1430,7 @@ smbios_info_tprobe(smbios_hdl_t *shp, id_t id, smbios_tprobe_t *tprobe)
if (stp->smbst_hdr->smbh_len >= SMB_TPROBE_NOMINAL_MINLEN) {
tprobe->smbtp_nominal = tp.smbtpr_nominal;
} else {
- tprobe->smbtp_nominal = 0x8000;
+ tprobe->smbtp_nominal = SMB_PROBE_UNKNOWN_VALUE;
}
return (0);
@@ -1465,7 +1465,7 @@ smbios_info_iprobe(smbios_hdl_t *shp, id_t id, smbios_iprobe_t *iprobe)
if (sip->smbst_hdr->smbh_len >= SMB_IPROBE_NOMINAL_MINLEN) {
iprobe->smbip_nominal = ip.smbipr_nominal;
} else {
- iprobe->smbip_nominal = 0x8000;
+ iprobe->smbip_nominal = SMB_PROBE_UNKNOWN_VALUE;
}
return (0);
diff --git a/usr/src/pkg/README.pkg b/usr/src/pkg/README.pkg
index 823e3cf152..9c4d86ad3f 100644
--- a/usr/src/pkg/README.pkg
+++ b/usr/src/pkg/README.pkg
@@ -218,7 +218,7 @@ These are the PKGMOG_DEFINES in usr/src/pkg/Makefile.
$(ARCH32)
$(ARCH64)
$(PKGVERS), which is set to
- $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-0.$(PKGVERS_BRANCH)
+ $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
pkgmogrify(1) also allows us to include a set of default transformations.
The definitions for these transforms are in usr/src/pkg/transforms/. An
diff --git a/usr/src/pkg/manifests/system-test-zfstest.mf b/usr/src/pkg/manifests/system-test-zfstest.mf
index 140fc1221e..a009ec8392 100644
--- a/usr/src/pkg/manifests/system-test-zfstest.mf
+++ b/usr/src/pkg/manifests/system-test-zfstest.mf
@@ -2365,7 +2365,7 @@ file path=opt/zfs-tests/tests/functional/refreserv/refreserv_004_pos mode=0555
file path=opt/zfs-tests/tests/functional/refreserv/refreserv_005_pos mode=0555
file path=opt/zfs-tests/tests/functional/refreserv/setup mode=0555
file path=opt/zfs-tests/tests/functional/removal/cleanup mode=0555
-file path=opt/zfs-tests/tests/functional/removal/removal.kshlib mode=0555
+file path=opt/zfs-tests/tests/functional/removal/removal.kshlib mode=0444
file path=opt/zfs-tests/tests/functional/removal/removal_all_vdev mode=0555
file path=opt/zfs-tests/tests/functional/removal/removal_check_space mode=0555
file path=opt/zfs-tests/tests/functional/removal/removal_condense_export \
@@ -2396,6 +2396,7 @@ file path=opt/zfs-tests/tests/functional/removal/removal_with_snapshot \
mode=0555
file path=opt/zfs-tests/tests/functional/removal/removal_with_write mode=0555
file path=opt/zfs-tests/tests/functional/removal/removal_with_zdb mode=0555
+file path=opt/zfs-tests/tests/functional/removal/remove_expanded mode=0555
file path=opt/zfs-tests/tests/functional/removal/remove_mirror mode=0555
file path=opt/zfs-tests/tests/functional/removal/remove_mirror_sanity \
mode=0555
@@ -2719,12 +2720,14 @@ file path=opt/zfs-tests/tests/longevity/slop_space_test mode=0555
file path=opt/zfs-tests/tests/perf/fio/mkfiles.fio mode=0444
file path=opt/zfs-tests/tests/perf/fio/random_reads.fio mode=0444
file path=opt/zfs-tests/tests/perf/fio/random_readwrite.fio mode=0444
+file path=opt/zfs-tests/tests/perf/fio/random_readwrite_fixed.fio mode=0444
file path=opt/zfs-tests/tests/perf/fio/random_writes.fio mode=0444
file path=opt/zfs-tests/tests/perf/fio/sequential_reads.fio mode=0444
file path=opt/zfs-tests/tests/perf/fio/sequential_writes.fio mode=0444
file path=opt/zfs-tests/tests/perf/perf.shlib mode=0444
file path=opt/zfs-tests/tests/perf/regression/random_reads mode=0555
file path=opt/zfs-tests/tests/perf/regression/random_readwrite mode=0555
+file path=opt/zfs-tests/tests/perf/regression/random_readwrite_fixed mode=0555
file path=opt/zfs-tests/tests/perf/regression/random_writes mode=0555
file path=opt/zfs-tests/tests/perf/regression/random_writes_zil mode=0555
file path=opt/zfs-tests/tests/perf/regression/sequential_reads mode=0555
diff --git a/usr/src/test/zfs-tests/runfiles/perf-regression.run b/usr/src/test/zfs-tests/runfiles/perf-regression.run
index b28f0e7f78..7e72e5c984 100644
--- a/usr/src/test/zfs-tests/runfiles/perf-regression.run
+++ b/usr/src/test/zfs-tests/runfiles/perf-regression.run
@@ -26,5 +26,6 @@ outputdir = /var/tmp/test_results
[/opt/zfs-tests/tests/perf/regression]
tests = ['sequential_writes', 'sequential_reads', 'sequential_reads_arc_cached',
'sequential_reads_arc_cached_clone', 'sequential_reads_dbuf_cached',
- 'random_reads', 'random_writes', 'random_readwrite', 'random_writes_zil']
+ 'random_reads', 'random_writes', 'random_readwrite', 'random_writes_zil',
+ 'random_readwrite_fixed']
post =
diff --git a/usr/src/test/zfs-tests/tests/functional/removal/Makefile b/usr/src/test/zfs-tests/tests/functional/removal/Makefile
index b4b9fa0031..f889ceb372 100644
--- a/usr/src/test/zfs-tests/tests/functional/removal/Makefile
+++ b/usr/src/test/zfs-tests/tests/functional/removal/Makefile
@@ -10,57 +10,12 @@
#
#
-# Copyright (c) 2014, 2017 by Delphix. All rights reserved.
+# Copyright (c) 2014, 2018 by Delphix. All rights reserved.
#
include $(SRC)/Makefile.master
ROOTOPTPKG = $(ROOT)/opt/zfs-tests
-TESTDIR = $(ROOTOPTPKG)/tests/functional/removal
+TARGETDIR = $(ROOTOPTPKG)/tests/functional/removal
-PROGS = cleanup \
- removal_all_vdev \
- removal_check_space \
- removal_condense_export \
- removal_multiple_indirection \
- removal_remap \
- removal_reservation \
- removal_sanity \
- removal_remap_deadlists \
- removal_with_add \
- removal_with_create_fs \
- removal_with_dedup \
- removal_with_export \
- removal_with_ganging \
- removal_with_remap \
- removal_with_remove \
- removal_with_scrub \
- removal_with_send \
- removal_with_send_recv \
- removal_with_snapshot \
- removal_with_write \
- removal_with_zdb \
- removal_resume_export \
- remove_mirror \
- remove_mirror_sanity \
- remove_raidz
-
-FILES = removal.kshlib
-
-CMDS = $(PROGS:%=$(TESTDIR)/%) $(FILES:%=$(TESTDIR)/%)
-$(CMDS) := FILEMODE = 0555
-
-all lint clean clobber:
-
-install: $(CMDS)
-
-$(CMDS): $(TESTDIR)
-
-$(TESTDIR):
- $(INS.dir)
-
-$(TESTDIR)/%: %.ksh
- $(INS.rename)
-
-$(TESTDIR)/%: %
- $(INS.file)
+include $(SRC)/test/zfs-tests/Makefile.com
diff --git a/usr/src/test/zfs-tests/tests/functional/removal/remove_expanded.ksh b/usr/src/test/zfs-tests/tests/functional/removal/remove_expanded.ksh
new file mode 100644
index 0000000000..9beb84e591
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/removal/remove_expanded.ksh
@@ -0,0 +1,89 @@
+#! /bin/ksh -p
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2018 by Delphix. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/removal/removal.kshlib
+
+#
+# BACKGROUND:
+#
+# ztest hit an issue where it ran zdb and zdb failed because
+# it couldn't access some indirect mappings at the end of a
+# vdev. The issue was that the vdev's ms_shift had changed after
+# it was removed by the addition of another vdev. This test is
+# a regression test for ensuring this case doesn't come up again.
+#
+
+
+TMPDIR=${TMPDIR:-/tmp}
+DISK0=$TMPDIR/dsk0
+DISK1=$TMPDIR/dsk1
+DISK2=$TMPDIR/dsk2
+
+log_must mkfile -n $MINVDEVSIZE $DISK0
+log_must mkfile -n $(($MINVDEVSIZE * 3)) $DISK1
+log_must mkfile -n $MINVDEVSIZE $DISK2
+
+function cleanup
+{
+ default_cleanup_noexit
+ log_must rm -f $DISK0 $DISK1 $DISK2
+}
+
+#
+# Setup the pool with one disk .
+#
+log_must default_setup_noexit "$DISK0"
+log_onexit cleanup
+
+#
+# Expand vdev.
+#
+log_must truncate -s $(($MINVDEVSIZE * 2)) $DISK0
+log_must zpool reopen $TESTPOOL
+log_must zpool online -e $TESTPOOL $DISK0
+
+#
+# Fill up the whole vdev.
+#
+dd if=/dev/urandom of=$TESTDIR/$TESTFILE0 bs=8M
+
+#
+# Add another vdev and remove the first vdev creating indirect
+# mappings for nearly all the allocatable space from the first
+# vdev. Wait for removal to finish.
+#
+log_must zpool add $TESTPOOL $DISK1
+log_must zpool remove $TESTPOOL $DISK0
+log_must wait_for_removal $TESTPOOL
+
+#
+# Add a new vdev that will trigger a change in the config.
+# Run sync once to ensure that the config actually changed.
+#
+log_must zpool add $TESTPOOL $DISK2
+log_must sync
+
+#
+# Ensure that zdb does not find any problems with this.
+#
+log_must zdb $TESTPOOL
+
+log_pass "Removal of expanded vdev doesn't cause any problems."
diff --git a/usr/src/test/zfs-tests/tests/perf/fio/random_readwrite_fixed.fio b/usr/src/test/zfs-tests/tests/perf/fio/random_readwrite_fixed.fio
new file mode 100644
index 0000000000..ed44955532
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/perf/fio/random_readwrite_fixed.fio
@@ -0,0 +1,35 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2017 by Delphix. All rights reserved.
+#
+
+[global]
+filename_format=file$jobnum
+nrfiles=16
+group_reporting=1
+fallocate=0
+overwrite=0
+thread=1
+rw=randrw
+rwmixread=70
+time_based=1
+directory=${DIRECTORY}
+runtime=${RUNTIME}
+bs=${BLOCKSIZE}
+ioengine=psync
+sync=${SYNC_TYPE}
+numjobs=${NUMJOBS}
+buffer_compress_percentage=66
+buffer_compress_chunk=4096
+
+[job]
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/random_reads.ksh b/usr/src/test/zfs-tests/tests/perf/regression/random_reads.ksh
index 5679a8d7eb..99b961abca 100644
--- a/usr/src/test/zfs-tests/tests/perf/regression/random_reads.ksh
+++ b/usr/src/test/zfs-tests/tests/perf/regression/random_reads.ksh
@@ -58,7 +58,7 @@ if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
- export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
+ export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 128k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
@@ -81,9 +81,9 @@ lun_list=$(pool_to_lun_list $PERFPOOL)
log_note "Collecting backend IO stats with lun list $lun_list"
export collect_scripts=(
"kstat zfs:0 1" "kstat"
- "vmstat 1" "vmstat"
- "mpstat 1" "mpstat"
- "iostat -xcnz 1" "iostat"
+ "vmstat -T d 1" "vmstat"
+ "mpstat -T d 1" "mpstat"
+ "iostat -T d -xcnz 1" "iostat"
"dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
"dtrace -s $PERF_SCRIPTS/profile.d" "profile"
)
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/random_readwrite_fixed.ksh b/usr/src/test/zfs-tests/tests/perf/regression/random_readwrite_fixed.ksh
new file mode 100644
index 0000000000..fb62731eda
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/perf/regression/random_readwrite_fixed.ksh
@@ -0,0 +1,82 @@
+#!/usr/bin/ksh
+# file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2017 by Delphix. All rights reserved.
+#
+
+#
+# Description:
+# Trigger fio runs using the random_readwrite_fixed job file. The number of runs and
+# data collected is determined by the PERF_* variables. See do_fio_run for
+# details about these variables.
+#
+# The files to read and write from are created prior to the first fio run,
+# and used for all fio runs. The ARC is cleared with `zinject -a` prior to
+# each run so reads will go to disk.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/perf/perf.shlib
+
+function cleanup
+{
+ recreate_perf_pool
+}
+
+log_onexit cleanup
+
+recreate_perf_pool
+populate_perf_filesystems
+
+# Aim to fill the pool to 50% capacity while accounting for a 3x compressratio.
+export TOTAL_SIZE=$(($(get_prop avail $PERFPOOL) * 3 / 2))
+
+# Variables for use by fio.
+if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
+ export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
+ export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
+ export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
+ export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
+ export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'0 1'}
+ export PERF_IOSIZES='8k 64k'
+elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
+ export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
+ export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
+ export PERF_NTHREADS=${PERF_NTHREADS:-'64 128'}
+ export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
+ export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
+ export PERF_IOSIZES='8k'
+fi
+
+# Layout the files to be used by the readwrite tests. Create as many files
+# as the largest number of threads. An fio run with fewer threads will use
+# a subset of the available files.
+export NUMJOBS=$(get_max $PERF_NTHREADS)
+export FILE_SIZE=$((TOTAL_SIZE / NUMJOBS))
+export DIRECTORY=$(get_directory)
+log_must fio $FIO_SCRIPTS/mkfiles.fio
+
+# Set up the scripts and output files that will log performance data.
+lun_list=$(pool_to_lun_list $PERFPOOL)
+log_note "Collecting backend IO stats with lun list $lun_list"
+export collect_scripts=(
+ "kstat zfs:0 1" "kstat"
+ "vmstat -T d 1" "vmstat"
+ "mpstat -T d 1" "mpstat"
+ "iostat -T d -xcnz 1" "iostat"
+ "dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
+ "dtrace -s $PERF_SCRIPTS/profile.d" "profile"
+)
+
+log_note "Random reads and writes with $PERF_RUNTYPE settings"
+do_fio_run random_readwrite_fixed.fio false true
+log_pass "Measure IO stats during random read and write load"
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/random_writes.ksh b/usr/src/test/zfs-tests/tests/perf/regression/random_writes.ksh
index fdb6421887..223d9b384c 100644
--- a/usr/src/test/zfs-tests/tests/perf/regression/random_writes.ksh
+++ b/usr/src/test/zfs-tests/tests/perf/regression/random_writes.ksh
@@ -57,7 +57,7 @@ if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_NTHREADS=${PERF_NTHREADS:-'1 4 8 16 32 64 128'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'0 1'}
- export PERF_IOSIZES=${PERF_IOSIZES:-'8k'}
+ export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 256k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
@@ -72,9 +72,9 @@ lun_list=$(pool_to_lun_list $PERFPOOL)
log_note "Collecting backend IO stats with lun list $lun_list"
export collect_scripts=(
"kstat zfs:0 1" "kstat"
- "vmstat 1" "vmstat"
- "mpstat 1" "mpstat"
- "iostat -xcnz 1" "iostat"
+ "vmstat -T d 1" "vmstat"
+ "mpstat -T d 1" "mpstat"
+ "iostat -T d -xcnz 1" "iostat"
"dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
"dtrace -s $PERF_SCRIPTS/profile.d" "profile"
)
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads.ksh b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads.ksh
index 6034a03151..49295a1c40 100644
--- a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads.ksh
+++ b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads.ksh
@@ -58,7 +58,7 @@ if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
- export PERF_IOSIZES=${PERF_IOSIZES:-'64k 128k 1m'}
+ export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 128k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
@@ -81,9 +81,9 @@ lun_list=$(pool_to_lun_list $PERFPOOL)
log_note "Collecting backend IO stats with lun list $lun_list"
export collect_scripts=(
"kstat zfs:0 1" "kstat"
- "vmstat 1" "vmstat"
- "mpstat 1" "mpstat"
- "iostat -xcnz 1" "iostat"
+ "vmstat -T d 1" "vmstat"
+ "mpstat -T d 1" "mpstat"
+ "iostat -T d -xcnz 1" "iostat"
"dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
"dtrace -Cs $PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch"
"dtrace -s $PERF_SCRIPTS/profile.d" "profile"
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached.ksh b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached.ksh
index 4a0cc7ace7..addbd75010 100644
--- a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached.ksh
+++ b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached.ksh
@@ -45,10 +45,10 @@ export TOTAL_SIZE=$(($(get_max_arc_size) / 2))
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
- export PERF_NTHREADS=${PERF_NTHREADS:-'16 64'}
+ export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
- export PERF_IOSIZES=${PERF_IOSIZES:-'64k 128k 1m'}
+ export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 128k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
@@ -71,9 +71,9 @@ lun_list=$(pool_to_lun_list $PERFPOOL)
log_note "Collecting backend IO stats with lun list $lun_list"
export collect_scripts=(
"kstat zfs:0 1" "kstat"
- "vmstat 1" "vmstat"
- "mpstat 1" "mpstat"
- "iostat -xcnz 1" "iostat"
+ "vmstat -T d 1" "vmstat"
+ "mpstat -T d 1" "mpstat"
+ "iostat -T d -xcnz 1" "iostat"
"dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
"dtrace -Cs $PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch"
"dtrace -s $PERF_SCRIPTS/profile.d" "profile"
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached_clone.ksh b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached_clone.ksh
index 6f71811012..4ffe1f21c0 100644
--- a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached_clone.ksh
+++ b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_arc_cached_clone.ksh
@@ -51,10 +51,10 @@ export TOTAL_SIZE=$(($(get_max_arc_size) / 2))
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
- export PERF_NTHREADS=${PERF_NTHREADS:-'16 64'}
+ export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
- export PERF_IOSIZES=${PERF_IOSIZES:-'64k 128k 1m'}
+ export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 128k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
@@ -97,9 +97,9 @@ lun_list=$(pool_to_lun_list $PERFPOOL)
log_note "Collecting backend IO stats with lun list $lun_list"
export collect_scripts=(
"kstat zfs:0 1" "kstat"
- "vmstat 1" "vmstat"
- "mpstat 1" "mpstat"
- "iostat -xcnz 1" "iostat"
+ "vmstat -T d 1" "vmstat"
+ "mpstat -T d 1" "mpstat"
+ "iostat -T d -xcnz 1" "iostat"
"dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
"dtrace -Cs $PERF_SCRIPTS/prefetch_io.d $PERFPOOL 1" "prefetch"
"dtrace -s $PERF_SCRIPTS/profile.d" "profile"
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_dbuf_cached.ksh b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_dbuf_cached.ksh
index ff17d93e67..140a05e4ac 100644
--- a/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_dbuf_cached.ksh
+++ b/usr/src/test/zfs-tests/tests/perf/regression/sequential_reads_dbuf_cached.ksh
@@ -49,10 +49,10 @@ export TOTAL_SIZE=$(($(get_max_dbuf_cache_size) * 3 / 4))
if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_WEEKLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'weekly'}
- export PERF_NTHREADS=${PERF_NTHREADS:-'16 64'}
+ export PERF_NTHREADS=${PERF_NTHREADS:-'8 16 32 64'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'1'}
- export PERF_IOSIZES=${PERF_IOSIZES:-'64k'}
+ export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 128k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
diff --git a/usr/src/test/zfs-tests/tests/perf/regression/sequential_writes.ksh b/usr/src/test/zfs-tests/tests/perf/regression/sequential_writes.ksh
index 1007ea1c9c..ec671a425f 100644
--- a/usr/src/test/zfs-tests/tests/perf/regression/sequential_writes.ksh
+++ b/usr/src/test/zfs-tests/tests/perf/regression/sequential_writes.ksh
@@ -57,7 +57,7 @@ if [[ -n $PERF_REGRESSION_WEEKLY ]]; then
export PERF_NTHREADS=${PERF_NTHREADS:-'1 4 8 16 32 64 128'}
export PERF_NTHREADS_PER_FS=${PERF_NTHREADS_PER_FS:-'0'}
export PERF_SYNC_TYPES=${PERF_SYNC_TYPES:-'0 1'}
- export PERF_IOSIZES=${PERF_IOSIZES:-'8k 128k 1m'}
+ export PERF_IOSIZES=${PERF_IOSIZES:-'8k 64k 256k'}
elif [[ -n $PERF_REGRESSION_NIGHTLY ]]; then
export PERF_RUNTIME=${PERF_RUNTIME:-$PERF_RUNTIME_NIGHTLY}
export PERF_RUNTYPE=${PERF_RUNTYPE:-'nightly'}
@@ -72,9 +72,9 @@ lun_list=$(pool_to_lun_list $PERFPOOL)
log_note "Collecting backend IO stats with lun list $lun_list"
export collect_scripts=(
"kstat zfs:0 1" "kstat"
- "vmstat 1" "vmstat"
- "mpstat 1" "mpstat"
- "iostat -xcnz 1" "iostat"
+ "vmstat -T d 1" "vmstat"
+ "mpstat -T d 1" "mpstat"
+ "iostat -T d -xcnz 1" "iostat"
"dtrace -Cs $PERF_SCRIPTS/io.d $PERFPOOL $lun_list 1" "io"
"dtrace -s $PERF_SCRIPTS/profile.d" "profile"
)
diff --git a/usr/src/ucbcmd/sed/sed.h b/usr/src/ucbcmd/sed/sed.h
index f814ce4ef6..465d38613d 100644
--- a/usr/src/ucbcmd/sed/sed.h
+++ b/usr/src/ucbcmd/sed/sed.h
@@ -30,8 +30,6 @@
#ifndef _SED_H
#define _SED_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* sed -- stream editor
*/
@@ -49,7 +47,6 @@
#define PEEKC() (*sp)
#define UNGETC(c) (--sp)
#define RETURN(c) cp = sp; return(ep);
-#define ERROR(c) regerr(c)
#define CEND 16
#define CLNUM 14
@@ -153,7 +150,9 @@ char *compsub();
struct label *search();
char *gline();
char *place();
-void comperr(char *);
+void comperr(char *) __NORETURN;
+void regerr(int) __NORETURN;
+#define ERROR(c) regerr(c)
void execute(char *);
#endif /* _SED_H */
diff --git a/usr/src/ucbcmd/sed/sed0.c b/usr/src/ucbcmd/sed/sed0.c
index 5be6112e36..1b5e3881bf 100644
--- a/usr/src/ucbcmd/sed/sed0.c
+++ b/usr/src/ucbcmd/sed/sed0.c
@@ -27,6 +27,7 @@
/* All Rights Reserved */
#include <stdio.h>
+#include <stdlib.h>
#include <sys/param.h>
#include "sed.h"
@@ -70,8 +71,6 @@ char TOOBIG[] = "Suffix too large - 512 max: %s";
extern int sed; /* IMPORTANT flag !!! */
extern char *comple();
-extern char *malloc();
-
static void dechain(void);
static void fcomp(void);
diff --git a/usr/src/ucbcmd/sed/sed1.c b/usr/src/ucbcmd/sed/sed1.c
index c5f5d89144..c4777340df 100644
--- a/usr/src/ucbcmd/sed/sed1.c
+++ b/usr/src/ucbcmd/sed/sed1.c
@@ -27,10 +27,8 @@
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -667,7 +665,7 @@ char *ep;
return(p);
}
-int
+void
regerr(int err)
{
switch(err) {
@@ -726,7 +724,6 @@ regerr(int err)
exit(2);
break;
}
- return (0);
}
static void
diff --git a/usr/src/ucbcmd/stty/stty.c b/usr/src/ucbcmd/stty/stty.c
index 65e79501d8..127a118c78 100644
--- a/usr/src/ucbcmd/stty/stty.c
+++ b/usr/src/ucbcmd/stty/stty.c
@@ -28,6 +28,7 @@
/* All Rights Reserved */
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <sys/types.h>
#include <termio.h>
diff --git a/usr/src/ucbcmd/tset/tset.c b/usr/src/ucbcmd/tset/tset.c
index dcdbcac983..9e520f6a23 100644
--- a/usr/src/ucbcmd/tset/tset.c
+++ b/usr/src/ucbcmd/tset/tset.c
@@ -268,6 +268,7 @@
#define oldintr oldmodes.c_cc[VINTR]
#include <stdio.h>
+#include <stdlib.h>
#include <termio.h>
#include <signal.h>
@@ -322,8 +323,6 @@
#define DEFTYPE "unknown"
-#define NOTTY 'x'
-
/*
* Baud Rate Conditionals
*/
@@ -390,7 +389,6 @@ char Kill_char; /* new kill character */
char Intr_char; /* new interrupt character */
char Specialerase; /* set => Erase_char only on terminals with backspace */
-char Ttyid = NOTTY; /* terminal identifier */
char *TtyType; /* type of terminal */
char *DefType; /* default type if none other computed */
char *NewType; /* mapping identifier based on old flags */
@@ -559,6 +557,7 @@ main(int argc, char *argv[])
/* special erase: operate on all but TTY33 */
Specialerase = YES;
/* explicit fall-through to -e case */
+ /* FALLTHROUGH */
case 'e': /* erase character */
if (*p == NULL)
@@ -775,14 +774,11 @@ mapold: Map->Ident = NewType;
if (bufp && *bufp != '/')
(void) strcpy(bufp-8, "NOTHING"); /* overwrite only "TERMCAP" */
/* get current idea of terminal type from environment */
- if (!Dash_h && TtyType == 0)
+ if (!Dash_h && TtyType == NULL)
TtyType = getenv("TERM");
- if (!RepOnly && Ttyid == NOTTY && (TtyType == 0 || !Dash_h))
- Ttyid = ttyname(FILEDES);
-
/* If still undefined, use DEFTYPE */
- if (TtyType == 0) {
+ if (TtyType == NULL) {
TtyType = DEFTYPE;
}
diff --git a/usr/src/uts/common/fs/zfs/dbuf.c b/usr/src/uts/common/fs/zfs/dbuf.c
index 8fd277042f..f82040d035 100644
--- a/usr/src/uts/common/fs/zfs/dbuf.c
+++ b/usr/src/uts/common/fs/zfs/dbuf.c
@@ -51,8 +51,6 @@
#include <sys/cityhash.h>
#include <sys/spa_impl.h>
-uint_t zfs_dbuf_evict_key;
-
static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx);
static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx);
@@ -524,14 +522,6 @@ dbuf_evict_one(void)
ASSERT(!MUTEX_HELD(&dbuf_evict_lock));
- /*
- * Set the thread's tsd to indicate that it's processing evictions.
- * Once a thread stops evicting from the dbuf cache it will
- * reset its tsd to NULL.
- */
- ASSERT3P(tsd_get(zfs_dbuf_evict_key), ==, NULL);
- (void) tsd_set(zfs_dbuf_evict_key, (void *)B_TRUE);
-
dmu_buf_impl_t *db = multilist_sublist_tail(mls);
while (db != NULL && mutex_tryenter(&db->db_mtx) == 0) {
db = multilist_sublist_prev(mls, db);
@@ -551,7 +541,6 @@ dbuf_evict_one(void)
} else {
multilist_sublist_unlock(mls);
}
- (void) tsd_set(zfs_dbuf_evict_key, NULL);
}
/*
@@ -605,29 +594,6 @@ dbuf_evict_thread(void *unused)
static void
dbuf_evict_notify(void)
{
-
- /*
- * We use thread specific data to track when a thread has
- * started processing evictions. This allows us to avoid deeply
- * nested stacks that would have a call flow similar to this:
- *
- * dbuf_rele()-->dbuf_rele_and_unlock()-->dbuf_evict_notify()
- * ^ |
- * | |
- * +-----dbuf_destroy()<--dbuf_evict_one()<--------+
- *
- * The dbuf_eviction_thread will always have its tsd set until
- * that thread exits. All other threads will only set their tsd
- * if they are participating in the eviction process. This only
- * happens if the eviction thread is unable to process evictions
- * fast enough. To keep the dbuf cache size in check, other threads
- * can evict from the dbuf cache directly. Those threads will set
- * their tsd values so that we ensure that they only evict one dbuf
- * from the dbuf cache.
- */
- if (tsd_get(zfs_dbuf_evict_key) != NULL)
- return;
-
/*
* We check if we should evict without holding the dbuf_evict_lock,
* because it's OK to occasionally make the wrong decision here,
@@ -704,7 +670,6 @@ retry:
refcount_create(&dbuf_caches[dcs].size);
}
- tsd_create(&zfs_dbuf_evict_key, NULL);
dbuf_evict_thread_exit = B_FALSE;
mutex_init(&dbuf_evict_lock, NULL, MUTEX_DEFAULT, NULL);
cv_init(&dbuf_evict_cv, NULL, CV_DEFAULT, NULL);
@@ -731,7 +696,6 @@ dbuf_fini(void)
cv_wait(&dbuf_evict_cv, &dbuf_evict_lock);
}
mutex_exit(&dbuf_evict_lock);
- tsd_destroy(&zfs_dbuf_evict_key);
mutex_destroy(&dbuf_evict_lock);
cv_destroy(&dbuf_evict_cv);
@@ -1011,7 +975,7 @@ dbuf_read_done(zio_t *zio, arc_buf_t *buf, void *vdb)
db->db_state = DB_CACHED;
}
cv_broadcast(&db->db_changed);
- dbuf_rele_and_unlock(db, NULL);
+ dbuf_rele_and_unlock(db, NULL, B_FALSE);
}
static void
@@ -2182,7 +2146,8 @@ dbuf_destroy(dmu_buf_impl_t *db)
* value in dnode_move(), since DB_DNODE_EXIT doesn't actually
* release any lock.
*/
- dnode_rele(dn, db);
+ mutex_enter(&dn->dn_mtx);
+ dnode_rele_and_unlock(dn, db, B_TRUE);
db->db_dnode_handle = NULL;
dbuf_hash_remove(db);
@@ -2209,8 +2174,10 @@ dbuf_destroy(dmu_buf_impl_t *db)
* If this dbuf is referenced from an indirect dbuf,
* decrement the ref count on the indirect dbuf.
*/
- if (parent && parent != dndb)
- dbuf_rele(parent, db);
+ if (parent && parent != dndb) {
+ mutex_enter(&parent->db_mtx);
+ dbuf_rele_and_unlock(parent, db, B_TRUE);
+ }
}
/*
@@ -2834,7 +2801,7 @@ void
dbuf_rele(dmu_buf_impl_t *db, void *tag)
{
mutex_enter(&db->db_mtx);
- dbuf_rele_and_unlock(db, tag);
+ dbuf_rele_and_unlock(db, tag, B_FALSE);
}
void
@@ -2845,10 +2812,19 @@ dmu_buf_rele(dmu_buf_t *db, void *tag)
/*
* dbuf_rele() for an already-locked dbuf. This is necessary to allow
- * db_dirtycnt and db_holds to be updated atomically.
+ * db_dirtycnt and db_holds to be updated atomically. The 'evicting'
+ * argument should be set if we are already in the dbuf-evicting code
+ * path, in which case we don't want to recursively evict. This allows us to
+ * avoid deeply nested stacks that would have a call flow similar to this:
+ *
+ * dbuf_rele()-->dbuf_rele_and_unlock()-->dbuf_evict_notify()
+ * ^ |
+ * | |
+ * +-----dbuf_destroy()<--dbuf_evict_one()<--------+
+ *
*/
void
-dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag)
+dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, boolean_t evicting)
{
int64_t holds;
@@ -2951,7 +2927,8 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag)
db->db.db_size, db);
mutex_exit(&db->db_mtx);
- if (db->db_caching_status == DB_DBUF_CACHE) {
+ if (db->db_caching_status == DB_DBUF_CACHE &&
+ !evicting) {
dbuf_evict_notify();
}
}
@@ -3214,7 +3191,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
kmem_free(dr, sizeof (dbuf_dirty_record_t));
ASSERT(db->db_dirtycnt > 0);
db->db_dirtycnt -= 1;
- dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg);
+ dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg, B_FALSE);
return;
}
@@ -3564,7 +3541,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb)
ASSERT(db->db_dirtycnt > 0);
db->db_dirtycnt -= 1;
db->db_data_pending = NULL;
- dbuf_rele_and_unlock(db, (void *)(uintptr_t)tx->tx_txg);
+ dbuf_rele_and_unlock(db, (void *)(uintptr_t)tx->tx_txg, B_FALSE);
}
static void
diff --git a/usr/src/uts/common/fs/zfs/dnode.c b/usr/src/uts/common/fs/zfs/dnode.c
index 2d7d780192..2720cdbce4 100644
--- a/usr/src/uts/common/fs/zfs/dnode.c
+++ b/usr/src/uts/common/fs/zfs/dnode.c
@@ -1229,11 +1229,11 @@ void
dnode_rele(dnode_t *dn, void *tag)
{
mutex_enter(&dn->dn_mtx);
- dnode_rele_and_unlock(dn, tag);
+ dnode_rele_and_unlock(dn, tag, B_FALSE);
}
void
-dnode_rele_and_unlock(dnode_t *dn, void *tag)
+dnode_rele_and_unlock(dnode_t *dn, void *tag, boolean_t evicting)
{
uint64_t refs;
/* Get while the hold prevents the dnode from moving. */
@@ -1264,7 +1264,8 @@ dnode_rele_and_unlock(dnode_t *dn, void *tag)
* that the handle has zero references, but that will be
* asserted anyway when the handle gets destroyed.
*/
- dbuf_rele(db, dnh);
+ mutex_enter(&db->db_mtx);
+ dbuf_rele_and_unlock(db, dnh, evicting);
}
}
diff --git a/usr/src/uts/common/fs/zfs/dnode_sync.c b/usr/src/uts/common/fs/zfs/dnode_sync.c
index 2ee75c90c2..02f263c82e 100644
--- a/usr/src/uts/common/fs/zfs/dnode_sync.c
+++ b/usr/src/uts/common/fs/zfs/dnode_sync.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
*/
@@ -439,6 +439,19 @@ dnode_evict_dbufs(dnode_t *dn)
avl_insert_here(&dn->dn_dbufs, &db_marker, db,
AVL_BEFORE);
+ /*
+ * We need to use the "marker" dbuf rather than
+ * simply getting the next dbuf, because
+ * dbuf_destroy() may actually remove multiple dbufs.
+ * It can call itself recursively on the parent dbuf,
+ * which may also be removed from dn_dbufs. The code
+ * flow would look like:
+ *
+ * dbuf_destroy():
+ * dnode_rele_and_unlock(parent_dbuf, evicting=TRUE):
+ * if (!cacheable || pending_evict)
+ * dbuf_destroy()
+ */
dbuf_destroy(db);
db_next = AVL_NEXT(&dn->dn_dbufs, &db_marker);
@@ -497,7 +510,7 @@ dnode_undirty_dbufs(list_t *list)
list_destroy(&dr->dt.di.dr_children);
}
kmem_free(dr, sizeof (dbuf_dirty_record_t));
- dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg);
+ dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg, B_FALSE);
}
}
diff --git a/usr/src/uts/common/fs/zfs/spa_config.c b/usr/src/uts/common/fs/zfs/spa_config.c
index 1fe675337f..7d568ffcf8 100644
--- a/usr/src/uts/common/fs/zfs/spa_config.c
+++ b/usr/src/uts/common/fs/zfs/spa_config.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2018 by Delphix. All rights reserved.
* Copyright 2017 Joyent, Inc.
*/
@@ -510,6 +510,18 @@ spa_config_update(spa_t *spa, int what)
*/
for (c = 0; c < rvd->vdev_children; c++) {
vdev_t *tvd = rvd->vdev_child[c];
+
+ /*
+ * Explicitly skip vdevs that are indirect or
+ * log vdevs that are being removed. The reason
+ * is that both of those can have vdev_ms_array
+ * set to 0 and we wouldn't want to change their
+ * metaslab size nor call vdev_expand() on them.
+ */
+ if (!vdev_is_concrete(tvd) ||
+ (tvd->vdev_islog && tvd->vdev_removing))
+ continue;
+
if (tvd->vdev_ms_array == 0)
vdev_metaslab_set_size(tvd);
vdev_expand(tvd, txg);
diff --git a/usr/src/uts/common/fs/zfs/sys/dbuf.h b/usr/src/uts/common/fs/zfs/sys/dbuf.h
index f467878b72..ec966432f2 100644
--- a/usr/src/uts/common/fs/zfs/sys/dbuf.h
+++ b/usr/src/uts/common/fs/zfs/sys/dbuf.h
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
*/
@@ -303,7 +303,7 @@ boolean_t dbuf_try_add_ref(dmu_buf_t *db, objset_t *os, uint64_t obj,
uint64_t dbuf_refcount(dmu_buf_impl_t *db);
void dbuf_rele(dmu_buf_impl_t *db, void *tag);
-void dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag);
+void dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, boolean_t evicting);
dmu_buf_impl_t *dbuf_find(struct objset *os, uint64_t object, uint8_t level,
uint64_t blkid);
diff --git a/usr/src/uts/common/fs/zfs/sys/dnode.h b/usr/src/uts/common/fs/zfs/sys/dnode.h
index 5566c70add..89a7b2ef60 100644
--- a/usr/src/uts/common/fs/zfs/sys/dnode.h
+++ b/usr/src/uts/common/fs/zfs/sys/dnode.h
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
*/
@@ -291,7 +291,7 @@ int dnode_hold_impl(struct objset *dd, uint64_t object, int flag,
void *ref, dnode_t **dnp);
boolean_t dnode_add_ref(dnode_t *dn, void *ref);
void dnode_rele(dnode_t *dn, void *ref);
-void dnode_rele_and_unlock(dnode_t *dn, void *tag);
+void dnode_rele_and_unlock(dnode_t *dn, void *tag, boolean_t evicting);
void dnode_setdirty(dnode_t *dn, dmu_tx_t *tx);
void dnode_sync(dnode_t *dn, dmu_tx_t *tx);
void dnode_allocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, int ibs,
diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c
index 43c6e4c9a1..f6845f3dcb 100644
--- a/usr/src/uts/common/fs/zfs/vdev.c
+++ b/usr/src/uts/common/fs/zfs/vdev.c
@@ -4086,11 +4086,11 @@ vdev_expand(vdev_t *vd, uint64_t txg)
{
ASSERT(vd->vdev_top == vd);
ASSERT(spa_config_held(vd->vdev_spa, SCL_ALL, RW_WRITER) == SCL_ALL);
+ ASSERT(vdev_is_concrete(vd));
vdev_set_deflate_ratio(vd);
- if ((vd->vdev_asize >> vd->vdev_ms_shift) > vd->vdev_ms_count &&
- vdev_is_concrete(vd)) {
+ if ((vd->vdev_asize >> vd->vdev_ms_shift) > vd->vdev_ms_count) {
VERIFY(vdev_metaslab_init(vd, txg) == 0);
vdev_config_dirty(vd);
}
diff --git a/usr/src/uts/common/sys/smbios.h b/usr/src/uts/common/sys/smbios.h
index fa43ad687a..d28141e668 100644
--- a/usr/src/uts/common/sys/smbios.h
+++ b/usr/src/uts/common/sys/smbios.h
@@ -1298,6 +1298,11 @@ typedef struct smbios_hwsec {
#define SMB_HWSEC_PS_UNKNOWN 0x03 /* password status unknown */
/*
+ * This value is used to represent a probe that has an unknown value.
+ */
+#define SMB_PROBE_UNKNOWN_VALUE 0x8000
+
+/*
* SMBIOS Voltage Probe. See DSP0134 Section 7.27 for more information.
* Please see the specification for the units of each value.
*/
diff --git a/usr/src/uts/common/sys/smbios_impl.h b/usr/src/uts/common/sys/smbios_impl.h
index dbb4c86262..66edfb027a 100644
--- a/usr/src/uts/common/sys/smbios_impl.h
+++ b/usr/src/uts/common/sys/smbios_impl.h
@@ -555,6 +555,9 @@ typedef struct smb_powersup {
#define SMB_PSU_CHARS_STATUS(x) (((x) >> 7) & 0x7)
#define SMB_PSU_CHARS_TYPE(x) (((x) >> 10) & 0xf)
+/*
+ * SMBIOS implementation structure for SMB_TYPE_OBDEVEXT.
+ */
typedef struct smb_obdev_ext {
smb_header_t smbobe_hdr; /* structure header */
uint8_t smbobe_name; /* reference designation */
diff --git a/usr/src/uts/common/vm/seg_hole.c b/usr/src/uts/common/vm/seg_hole.c
index e0dbee34e6..14b2153718 100644
--- a/usr/src/uts/common/vm/seg_hole.c
+++ b/usr/src/uts/common/vm/seg_hole.c
@@ -119,8 +119,6 @@ seghole_dup(struct seg *seg, struct seg *newseg)
static int
seghole_unmap(struct seg *seg, caddr_t addr, size_t len)
{
- seghole_data_t *sud = (seghole_data_t *)seg->s_data;
-
ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
/* Entire segment is being unmapped */