From owner-svn-src-stable-10@FreeBSD.ORG Sun Jan 12 14:37:40 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 3C8EE4AF;
Sun, 12 Jan 2014 14:37:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 2793C161C;
Sun, 12 Jan 2014 14:37:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0CEbeHK052330;
Sun, 12 Jan 2014 14:37:40 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0CEbePe052329;
Sun, 12 Jan 2014 14:37:40 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201401121437.s0CEbePe052329@svn.freebsd.org>
From: Dimitry Andric
Date: Sun, 12 Jan 2014 14:37:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260564 - stable/10/sys/conf
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sun, 12 Jan 2014 14:37:40 -0000
Author: dim
Date: Sun Jan 12 14:37:39 2014
New Revision: 260564
URL: http://svnweb.freebsd.org/changeset/base/260564
Log:
MFC r260494:
Fix a braino with r259730: we cannot currently use CFLAGS.gcc or
CFLAGS.clang in sys/conf/Makefile.arm, since the main kernel build does
not use . So revert that particular change for now.
Pointy hat to: me
Noticed by: zbb
Modified:
stable/10/sys/conf/Makefile.arm
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/conf/Makefile.arm
==============================================================================
--- stable/10/sys/conf/Makefile.arm Sun Jan 12 13:16:25 2014 (r260563)
+++ stable/10/sys/conf/Makefile.arm Sun Jan 12 14:37:39 2014 (r260564)
@@ -39,16 +39,20 @@ SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscri
STRIP_FLAGS = -S
.endif
-CFLAGS.gcc += -mno-thumb-interwork
+.if ${COMPILER_TYPE} != "clang"
+CFLAGS += -mno-thumb-interwork
+.endif
.if empty(DDB_ENABLED)
-.if defined(WITHOUT_ARM_EABI)
-CFLAGS.gcc += -mno-apcs-frame
+.if defined(WITHOUT_ARM_EABI) && ${COMPILER_TYPE} != "clang"
+CFLAGS += -mno-apcs-frame
.endif
.elif !defined(WITHOUT_ARM_EABI)
CFLAGS += -funwind-tables
+.if ${COMPILER_TYPE} == "clang"
# clang requires us to tell it to emit assembly with unwind information
-CFLAGS.clang += -mllvm -arm-enable-ehabi
+CFLAGS += -mllvm -arm-enable-ehabi
+.endif
.endif
SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \
From owner-svn-src-stable-10@FreeBSD.ORG Sun Jan 12 20:09:18 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 767B265A;
Sun, 12 Jan 2014 20:09:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 5686A1D7F;
Sun, 12 Jan 2014 20:09:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0CK9IUH088738;
Sun, 12 Jan 2014 20:09:18 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0CK9H2r088733;
Sun, 12 Jan 2014 20:09:17 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201401122009.s0CK9H2r088733@svn.freebsd.org>
From: "Pedro F. Giffuni"
Date: Sun, 12 Jan 2014 20:09:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260568 - in stable/10/contrib/gcc: . doc
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sun, 12 Jan 2014 20:09:18 -0000
Author: pfg
Date: Sun Jan 12 20:09:17 2014
New Revision: 260568
URL: http://svnweb.freebsd.org/changeset/base/260568
Log:
MFC r259920:
gcc: Implement -Wmost for compatibility with clang.
This is equivalent to -Wall -Wno-parentheses.
Obtained from: Apple GCC 4.2 - 5531
Modified:
stable/10/contrib/gcc/c-opts.c
stable/10/contrib/gcc/c.opt
stable/10/contrib/gcc/doc/invoke.texi
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/gcc/c-opts.c
==============================================================================
--- stable/10/contrib/gcc/c-opts.c Sun Jan 12 19:04:20 2014 (r260567)
+++ stable/10/contrib/gcc/c-opts.c Sun Jan 12 20:09:17 2014 (r260568)
@@ -385,12 +385,17 @@ c_common_handle_option (size_t scode, co
break;
case OPT_Wall:
+ /* APPLE LOCAL -Wmost */
+ case OPT_Wmost:
set_Wunused (value);
set_Wformat (value);
set_Wimplicit (value);
warn_char_subscripts = value;
warn_missing_braces = value;
- warn_parentheses = value;
+ /* APPLE LOCAL begin -Wmost --dpatel */
+ if (code != OPT_Wmost)
+ warn_parentheses = value;
+ /* APPLE LOCAL end -Wmost --dpatel */
warn_return_type = value;
warn_sequence_point = value; /* Was C only. */
if (c_dialect_cxx ())
Modified: stable/10/contrib/gcc/c.opt
==============================================================================
--- stable/10/contrib/gcc/c.opt Sun Jan 12 19:04:20 2014 (r260567)
+++ stable/10/contrib/gcc/c.opt Sun Jan 12 20:09:17 2014 (r260568)
@@ -284,6 +284,12 @@ Wmissing-prototypes
C ObjC Var(warn_missing_prototypes)
Warn about global functions without prototypes
+; APPLE LOCAL begin -Wmost
+Wmost
+C ObjC C++ ObjC++
+Like -Wall but without -Wparentheses
+; APPLE LOCAL end -Wmost
+
Wmultichar
C ObjC C++ ObjC++
Warn about use of multi-character character constants
Modified: stable/10/contrib/gcc/doc/invoke.texi
==============================================================================
--- stable/10/contrib/gcc/doc/invoke.texi Sun Jan 12 19:04:20 2014 (r260567)
+++ stable/10/contrib/gcc/doc/invoke.texi Sun Jan 12 20:09:17 2014 (r260568)
@@ -222,6 +222,8 @@ in the following sections.
-Wmain -Wmissing-braces -Wmissing-field-initializers @gol
-Wmissing-format-attribute -Wmissing-include-dirs @gol
-Wmissing-noreturn @gol
+@c APPLE LOCAL -Wmost
+-Wmost (APPLE ONLY) @gol
-Wno-multichar -Wnonnull -Wno-overflow @gol
-Woverlength-strings -Wpacked -Wpadded @gol
-Wparentheses -Wpointer-arith -Wno-pointer-to-int-cast @gol
@@ -2652,7 +2654,12 @@ warnings about constructions that some u
that are easy to avoid (or modify to prevent the warning), even in
conjunction with macros. This also enables some language-specific
warnings described in @ref{C++ Dialect Options}.
+@c APPLE LOCAL begin -Wmost
+@item -Wmost
+@opindex Wmost
+This is equivalent to -Wall -Wno-parentheses. (Apple compatible)
@end table
+@c APPLE LOCAL end -Wmost
The following @option{-W@dots{}} options are not implied by @option{-Wall}.
Some of them warn about constructions that users generally do not
From owner-svn-src-stable-10@FreeBSD.ORG Sun Jan 12 21:16:28 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 2C3BAE29;
Sun, 12 Jan 2014 21:16:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 0CB2F11CC;
Sun, 12 Jan 2014 21:16:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0CLGRwf016344;
Sun, 12 Jan 2014 21:16:27 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0CLGQIj016333;
Sun, 12 Jan 2014 21:16:26 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201401122116.s0CLGQIj016333@svn.freebsd.org>
From: "Pedro F. Giffuni"
Date: Sun, 12 Jan 2014 21:16:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260573 - in stable/10/contrib: gcc/config gcclibs/libcpp
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sun, 12 Jan 2014 21:16:28 -0000
Author: pfg
Date: Sun Jan 12 21:16:26 2014
New Revision: 260573
URL: http://svnweb.freebsd.org/changeset/base/260573
Log:
MFC r260310:
libcpp: misc fixes from Apple's GCC.
Fixes some bugs detected by Apple:
#error with unmatched quotes
pragma mark
Obtained from: Apple GCC 4.2 - 5553
Modified:
stable/10/contrib/gcc/config/darwin.h
stable/10/contrib/gcclibs/libcpp/ChangeLog.apple
stable/10/contrib/gcclibs/libcpp/charset.c
stable/10/contrib/gcclibs/libcpp/directives.c
stable/10/contrib/gcclibs/libcpp/internal.h
stable/10/contrib/gcclibs/libcpp/lex.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/gcc/config/darwin.h
==============================================================================
--- stable/10/contrib/gcc/config/darwin.h Sun Jan 12 20:47:08 2014 (r260572)
+++ stable/10/contrib/gcc/config/darwin.h Sun Jan 12 21:16:26 2014 (r260573)
@@ -873,7 +873,9 @@ enum machopic_addr_class {
#define DARWIN_REGISTER_TARGET_PRAGMAS() \
do { \
- c_register_pragma (0, "mark", darwin_pragma_ignore); \
+ /* APPLE LOCAL begin pragma mark 5614511 */ \
+ /* Removed mark. */ \
+ /* APPLE LOCAL end pragma mark 5614511 */ \
c_register_pragma (0, "options", darwin_pragma_options); \
c_register_pragma (0, "segment", darwin_pragma_ignore); \
c_register_pragma (0, "unused", darwin_pragma_unused); \
Modified: stable/10/contrib/gcclibs/libcpp/ChangeLog.apple
==============================================================================
--- stable/10/contrib/gcclibs/libcpp/ChangeLog.apple Sun Jan 12 20:47:08 2014 (r260572)
+++ stable/10/contrib/gcclibs/libcpp/ChangeLog.apple Sun Jan 12 21:16:26 2014 (r260573)
@@ -3,6 +3,11 @@
Radar 6121572
* charset.c (_cpp_convert_input): Don't read to.text[-1].
+2008-05-01 Mike Stump
+
+ Radar 5774975
+ * charset.c (_cpp_convert_input): Eat UTF-8 BOM.
+
2005-02-17 Devang Patel
Radar 3958387
Modified: stable/10/contrib/gcclibs/libcpp/charset.c
==============================================================================
--- stable/10/contrib/gcclibs/libcpp/charset.c Sun Jan 12 20:47:08 2014 (r260572)
+++ stable/10/contrib/gcclibs/libcpp/charset.c Sun Jan 12 21:16:26 2014 (r260573)
@@ -1597,6 +1597,17 @@ _cpp_convert_input (cpp_reader *pfile, c
input_cset = init_iconv_desc (pfile, SOURCE_CHARSET, input_charset);
if (input_cset.func == convert_no_conversion)
{
+ /* APPLE LOCAL begin UTF-8 BOM 5774975 */
+ /* Eat the UTF-8 BOM. */
+ if (len >= 3
+ && input[0] == 0xef
+ && input[1] == 0xbb
+ && input[2] == 0xbf)
+ {
+ memmove (&input[0], &input[3], size-3);
+ len -= 3;
+ }
+ /* APPLE LOCAL end UTF-8 BOM 5774975 */
to.text = input;
to.asize = size;
to.len = len;
Modified: stable/10/contrib/gcclibs/libcpp/directives.c
==============================================================================
--- stable/10/contrib/gcclibs/libcpp/directives.c Sun Jan 12 20:47:08 2014 (r260572)
+++ stable/10/contrib/gcclibs/libcpp/directives.c Sun Jan 12 21:16:26 2014 (r260573)
@@ -991,7 +991,11 @@ do_diagnostic (cpp_reader *pfile, int co
if (print_dir)
fprintf (stderr, "#%s ", pfile->directive->name);
pfile->state.prevent_expansion++;
+ /* APPLE LOCAL #error with unmatched quotes 5607574 */
+ pfile->state.in_diagnostic++;
cpp_output_line (pfile, stderr);
+ /* APPLE LOCAL #error with unmatched quotes 5607574 */
+ pfile->state.in_diagnostic--;
pfile->state.prevent_expansion--;
}
}
@@ -1173,12 +1177,25 @@ cpp_register_deferred_pragma (cpp_reader
}
}
+/* APPLE LOCAL begin pragma mark 5614511 */
+/* Handle #pragma mark. */
+static void
+do_pragma_mark (cpp_reader *pfile)
+{
+ ++pfile->state.skipping;
+ skip_rest_of_line (pfile);
+ --pfile->state.skipping;
+}
+/* APPLE LOCAL end pragma mark 5614511 */
+
/* Register the pragmas the preprocessor itself handles. */
void
_cpp_init_internal_pragmas (cpp_reader *pfile)
{
/* Pragmas in the global namespace. */
register_pragma_internal (pfile, 0, "once", do_pragma_once);
+ /* APPLE LOCAL pragma mark 5614511 */
+ register_pragma_internal (pfile, 0, "mark", do_pragma_mark);
/* New GCC-specific pragmas should be put in the GCC namespace. */
register_pragma_internal (pfile, "GCC", "poison", do_pragma_poison);
Modified: stable/10/contrib/gcclibs/libcpp/internal.h
==============================================================================
--- stable/10/contrib/gcclibs/libcpp/internal.h Sun Jan 12 20:47:08 2014 (r260572)
+++ stable/10/contrib/gcclibs/libcpp/internal.h Sun Jan 12 21:16:26 2014 (r260573)
@@ -220,6 +220,11 @@ struct lexer_state
/* Nonzero if the deferred pragma being handled allows macro expansion. */
unsigned char pragma_allow_expansion;
+
+ /* APPLE LOCAL begin #error with unmatched quotes 5607574 */
+ /* Nonzero when handling #error and #warning to allow unmatched quotes. */
+ unsigned char in_diagnostic;
+ /* APPLE LOCAL end #error with unmatched quotes 5607574 */
};
/* Special nodes - identifiers with predefined significance. */
Modified: stable/10/contrib/gcclibs/libcpp/lex.c
==============================================================================
--- stable/10/contrib/gcclibs/libcpp/lex.c Sun Jan 12 20:47:08 2014 (r260572)
+++ stable/10/contrib/gcclibs/libcpp/lex.c Sun Jan 12 21:16:26 2014 (r260573)
@@ -658,7 +658,12 @@ lex_string (cpp_reader *pfile, cpp_token
cpp_error (pfile, CPP_DL_WARNING,
"null character(s) preserved in literal");
- if (type == CPP_OTHER && CPP_OPTION (pfile, lang) != CLK_ASM)
+ /* APPLE LOCAL begin #error with unmatched quotes 5607574 */
+ if (type == CPP_OTHER
+ && CPP_OPTION (pfile, lang) != CLK_ASM
+ && !pfile->state.in_diagnostic
+ && !pfile->state.skipping)
+ /* APPLE LOCAL end #error with unmatched quotes 5607574 */
cpp_error (pfile, CPP_DL_PEDWARN, "missing terminating %c character",
(int) terminator);
From owner-svn-src-stable-10@FreeBSD.ORG Sun Jan 12 22:17:57 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 236BF56A;
Sun, 12 Jan 2014 22:17:57 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 0F51B1633;
Sun, 12 Jan 2014 22:17:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0CMHuDn039991;
Sun, 12 Jan 2014 22:17:56 GMT (envelope-from jmmv@svn.freebsd.org)
Received: (from jmmv@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0CMHucD039990;
Sun, 12 Jan 2014 22:17:56 GMT (envelope-from jmmv@svn.freebsd.org)
Message-Id: <201401122217.s0CMHucD039990@svn.freebsd.org>
From: Julio Merino
Date: Sun, 12 Jan 2014 22:17:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260578 - stable/10/contrib/atf/atf-c++/detail
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sun, 12 Jan 2014 22:17:57 -0000
Author: jmmv
Date: Sun Jan 12 22:17:56 2014
New Revision: 260578
URL: http://svnweb.freebsd.org/changeset/base/260578
Log:
MFC r260491: Use .cpp as the extension for temporary C++ files.
Modified:
stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp
==============================================================================
--- stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp Sun Jan 12 22:17:10 2014 (r260577)
+++ stable/10/contrib/atf/atf-c++/detail/test_helpers.cpp Sun Jan 12 22:17:56 2014 (r260578)
@@ -67,14 +67,14 @@ build_check_cxx_o(const atf::tests::tc&
void
header_check(const char *hdrname)
{
- std::ofstream srcfile("test.c");
+ std::ofstream srcfile("test.cpp");
ATF_REQUIRE(srcfile);
srcfile << "#include <" << hdrname << ">\n";
srcfile.close();
const std::string failmsg = std::string("Header check failed; ") +
hdrname + " is not self-contained";
- build_check_cxx_o_aux(atf::fs::path("test.c"), failmsg.c_str(), true);
+ build_check_cxx_o_aux(atf::fs::path("test.cpp"), failmsg.c_str(), true);
}
atf::fs::path
From owner-svn-src-stable-10@FreeBSD.ORG Sun Jan 12 23:17:57 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 16D93203;
Sun, 12 Jan 2014 23:17:57 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id DCE9619F8;
Sun, 12 Jan 2014 23:17:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0CNHulA063329;
Sun, 12 Jan 2014 23:17:56 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0CNHufM063327;
Sun, 12 Jan 2014 23:17:56 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201401122317.s0CNHufM063327@svn.freebsd.org>
From: Jilles Tjoelker
Date: Sun, 12 Jan 2014 23:17:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260579 - stable/10/usr.bin/find
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Sun, 12 Jan 2014 23:17:57 -0000
Author: jilles
Date: Sun Jan 12 23:17:56 2014
New Revision: 260579
URL: http://svnweb.freebsd.org/changeset/base/260579
Log:
MFC r260336,r260355: find: Fix -lname and -ilname:
* Take into account that readlink() does not add a terminating '\0'.
* Do not match symlinks that are followed because of -H or -L. This is
explicitly documented in GNU find's info file and is like -type l.
* Fix matching symlinks in subdirectories when fts changes directories.
As before, symlinks of length PATH_MAX or more are not handled correctly.
(These can only be created on other operating systems.)
Also, avoid some readlink() calls on files that are obviously not symlinks
(because of fts(3) restrictions, not all of them).
PR: bin/185393
Submitted by: Ben Reser (parts, original version)
Modified:
stable/10/usr.bin/find/find.1
stable/10/usr.bin/find/function.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.bin/find/find.1
==============================================================================
--- stable/10/usr.bin/find/find.1 Sun Jan 12 22:17:56 2014 (r260578)
+++ stable/10/usr.bin/find/find.1 Sun Jan 12 23:17:56 2014 (r260579)
@@ -31,7 +31,7 @@
.\" @(#)find.1 8.7 (Berkeley) 5/9/95
.\" $FreeBSD$
.\"
-.Dd November 18, 2012
+.Dd January 5, 2014
.Dt FIND 1
.Os
.Sh NAME
@@ -520,6 +520,8 @@ Like
.Ic -name ,
but the contents of the symbolic link are matched instead of the file
name.
+Note that this only matches broken symbolic links
+if symbolic links are being followed.
This is a GNU find extension.
.It Ic -ls
This primary always evaluates to true.
Modified: stable/10/usr.bin/find/function.c
==============================================================================
--- stable/10/usr.bin/find/function.c Sun Jan 12 22:17:56 2014 (r260578)
+++ stable/10/usr.bin/find/function.c Sun Jan 12 23:17:56 2014 (r260579)
@@ -1122,11 +1122,24 @@ f_name(PLAN *plan, FTSENT *entry)
{
char fn[PATH_MAX];
const char *name;
+ ssize_t len;
if (plan->flags & F_LINK) {
- name = fn;
- if (readlink(entry->fts_path, fn, sizeof(fn)) == -1)
+ /*
+ * The below test both avoids obviously useless readlink()
+ * calls and ensures that symlinks with existent target do
+ * not match if symlinks are being followed.
+ * Assumption: fts will stat all symlinks that are to be
+ * followed and will return the stat information.
+ */
+ if (entry->fts_info != FTS_NSOK && entry->fts_info != FTS_SL &&
+ entry->fts_info != FTS_SLNONE)
+ return 0;
+ len = readlink(entry->fts_accpath, fn, sizeof(fn) - 1);
+ if (len == -1)
return 0;
+ fn[len] = '\0';
+ name = fn;
} else
name = entry->fts_name;
return !fnmatch(plan->c_data, name,
From owner-svn-src-stable-10@FreeBSD.ORG Mon Jan 13 19:34:24 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 325B18EA;
Mon, 13 Jan 2014 19:34:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 1DEEB1F85;
Mon, 13 Jan 2014 19:34:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0DJYNwA033399;
Mon, 13 Jan 2014 19:34:23 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0DJYNKL033398;
Mon, 13 Jan 2014 19:34:23 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201401131934.s0DJYNKL033398@svn.freebsd.org>
From: Xin LI
Date: Mon, 13 Jan 2014 19:34:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260603 - stable/10/sys/dev/oce
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Mon, 13 Jan 2014 19:34:24 -0000
Author: delphij
Date: Mon Jan 13 19:34:23 2014
New Revision: 260603
URL: http://svnweb.freebsd.org/changeset/base/260603
Log:
MFC r260110:
Eliminate unused drbr_stats_update implementation in oce(4) driver.
Noticed by: dim
Modified:
stable/10/sys/dev/oce/oce_if.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/oce/oce_if.c
==============================================================================
--- stable/10/sys/dev/oce/oce_if.c Mon Jan 13 19:14:29 2014 (r260602)
+++ stable/10/sys/dev/oce/oce_if.c Mon Jan 13 19:34:23 2014 (r260603)
@@ -1233,18 +1233,6 @@ oce_wq_handler(void *arg)
}
-#if __FreeBSD_version >= 1000000
-static __inline void
-drbr_stats_update(struct ifnet *ifp, int len, int mflags)
-{
-#ifndef NO_SLOW_STATS
- ifp->if_obytes += len;
- if (mflags & M_MCAST)
- ifp->if_omcasts++;
-#endif
-}
-#endif
-
static int
oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq)
{
From owner-svn-src-stable-10@FreeBSD.ORG Mon Jan 13 22:07:37 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 8470DA12;
Mon, 13 Jan 2014 22:07:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 6ECD81DE0;
Mon, 13 Jan 2014 22:07:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0DM7boY011767;
Mon, 13 Jan 2014 22:07:37 GMT
(envelope-from bdrewery@svn.freebsd.org)
Received: (from bdrewery@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0DM7bar011766;
Mon, 13 Jan 2014 22:07:37 GMT
(envelope-from bdrewery@svn.freebsd.org)
Message-Id: <201401132207.s0DM7bar011766@svn.freebsd.org>
From: Bryan Drewery
Date: Mon, 13 Jan 2014 22:07:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260608 - stable/10/share/keys/pkg/trusted
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Mon, 13 Jan 2014 22:07:37 -0000
Author: bdrewery
Date: Mon Jan 13 22:07:36 2014
New Revision: 260608
URL: http://svnweb.freebsd.org/changeset/base/260608
Log:
MFC r260605:
Remove scary comment about this being a test key.
There has been no need to regenerate the signing key.
Early MFC as it is just a comment and needs to get into releng/10.0.
Approved by: bapt (mentor, implicit)
Modified:
stable/10/share/keys/pkg/trusted/pkg.freebsd.org.2013102301
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/share/keys/pkg/trusted/pkg.freebsd.org.2013102301
==============================================================================
--- stable/10/share/keys/pkg/trusted/pkg.freebsd.org.2013102301 Mon Jan 13 21:44:17 2014 (r260607)
+++ stable/10/share/keys/pkg/trusted/pkg.freebsd.org.2013102301 Mon Jan 13 22:07:36 2014 (r260608)
@@ -1,5 +1,4 @@
# $FreeBSD$
-# This key is for testing purposes only and will be revoked before 10.0-RELEASE
function: "sha256"
fingerprint: "b0170035af3acc5f3f3ae1859dc717101b4e6c1d0a794ad554928ca0cbb2f438"
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 01:28:09 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 4FE246FE;
Tue, 14 Jan 2014 01:28:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 39EE71E46;
Tue, 14 Jan 2014 01:28:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0E1S9rH091927;
Tue, 14 Jan 2014 01:28:09 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0E1S85F091924;
Tue, 14 Jan 2014 01:28:08 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201401140128.s0E1S85F091924@svn.freebsd.org>
From: Xin LI
Date: Tue, 14 Jan 2014 01:28:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260617 - in stable/10: cddl/contrib/opensolaris/cmd/zhack
sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 01:28:09 -0000
Author: delphij
Date: Tue Jan 14 01:28:08 2014
New Revision: 260617
URL: http://svnweb.freebsd.org/changeset/base/260617
Log:
MFC r259811:
MFV r258373:
4168 ztest assertion failure in dbuf_undirty
4169 verbatim import causes zdb to segfa
4170 zhack leaves pool in ACTIVE state
illumos/illumos-gate@7fdd916c474ea52896c671bbe7b56ba34a1ca132
Modified:
stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Jan 14 01:04:11 2014 (r260616)
+++ stable/10/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Jan 14 01:28:08 2014 (r260617)
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
*/
@@ -85,10 +85,15 @@ usage(void)
static void
-fatal(const char *fmt, ...)
+fatal(spa_t *spa, void *tag, const char *fmt, ...)
{
va_list ap;
+ if (spa != NULL) {
+ spa_close(spa, tag);
+ (void) spa_export(g_pool, NULL, B_TRUE, B_FALSE);
+ }
+
va_start(ap, fmt);
(void) fprintf(stderr, "%s: ", cmdname);
(void) vfprintf(stderr, fmt, ap);
@@ -159,13 +164,14 @@ import_pool(const char *target, boolean_
g_importargs.can_be_active = B_TRUE;
if (zpool_search_import(g_zfs, &g_importargs) != NULL ||
spa_open(target, &spa, FTAG) == 0) {
- fatal("cannot import '%s': pool is active; run "
- "\"zpool export %s\" first\n",
- g_pool, g_pool);
+ fatal(spa, FTAG, "cannot import '%s': pool is "
+ "active; run " "\"zpool export %s\" "
+ "first\n", g_pool, g_pool);
}
}
- fatal("cannot import '%s': no such pool available\n", g_pool);
+ fatal(NULL, FTAG, "cannot import '%s': no such pool "
+ "available\n", g_pool);
}
elem = nvlist_next_nvpair(pools, NULL);
@@ -186,7 +192,8 @@ import_pool(const char *target, boolean_
error = 0;
if (error)
- fatal("can't import '%s': %s", name, strerror(error));
+ fatal(NULL, FTAG, "can't import '%s': %s", name,
+ strerror(error));
}
static void
@@ -201,10 +208,11 @@ zhack_spa_open(const char *target, boole
zfeature_checks_disable = B_FALSE;
if (err != 0)
- fatal("cannot open '%s': %s", target, strerror(err));
+ fatal(*spa, FTAG, "cannot open '%s': %s", target,
+ strerror(err));
if (spa_version(*spa) < SPA_VERSION_FEATURES) {
- fatal("'%s' has version %d, features not enabled", target,
- (int)spa_version(*spa));
+ fatal(*spa, FTAG, "'%s' has version %d, features not enabled",
+ target, (int)spa_version(*spa));
}
}
@@ -336,15 +344,16 @@ zhack_do_feature_enable(int argc, char *
feature.fi_guid = argv[1];
if (!zfeature_is_valid_guid(feature.fi_guid))
- fatal("invalid feature guid: %s", feature.fi_guid);
+ fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid);
zhack_spa_open(target, B_FALSE, FTAG, &spa);
mos = spa->spa_meta_objset;
if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
- fatal("'%s' is a real feature, will not enable");
+ fatal(spa, FTAG, "'%s' is a real feature, will not enable");
if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
- fatal("feature already enabled: %s", feature.fi_guid);
+ fatal(spa, FTAG, "feature already enabled: %s",
+ feature.fi_guid);
VERIFY0(dsl_sync_task(spa_name(spa), NULL,
feature_enable_sync, &feature, 5));
@@ -423,13 +432,14 @@ zhack_do_feature_ref(int argc, char **ar
feature.fi_guid = argv[1];
if (!zfeature_is_valid_guid(feature.fi_guid))
- fatal("invalid feature guid: %s", feature.fi_guid);
+ fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid);
zhack_spa_open(target, B_FALSE, FTAG, &spa);
mos = spa->spa_meta_objset;
if (0 == zfeature_lookup_guid(feature.fi_guid, NULL))
- fatal("'%s' is a real feature, will not change refcount");
+ fatal(spa, FTAG, "'%s' is a real feature, will not change "
+ "refcount");
if (0 == zap_contains(mos, spa->spa_feat_for_read_obj,
feature.fi_guid)) {
@@ -438,11 +448,12 @@ zhack_do_feature_ref(int argc, char **ar
feature.fi_guid)) {
feature.fi_can_readonly = B_TRUE;
} else {
- fatal("feature is not enabled: %s", feature.fi_guid);
+ fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid);
}
if (decr && !spa_feature_is_active(spa, &feature))
- fatal("feature refcount already 0: %s", feature.fi_guid);
+ fatal(spa, FTAG, "feature refcount already 0: %s",
+ feature.fi_guid);
VERIFY0(dsl_sync_task(spa_name(spa), NULL,
decr ? feature_decr_sync : feature_incr_sync, &feature, 5));
@@ -530,8 +541,8 @@ main(int argc, char **argv)
usage();
}
- if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) {
- fatal("pool export failed; "
+ if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_FALSE) != 0) {
+ fatal(NULL, FTAG, "pool export failed; "
"changes may not be committed to disk\n");
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Jan 14 01:04:11 2014 (r260616)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Jan 14 01:28:08 2014 (r260617)
@@ -1329,14 +1329,6 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
DB_DNODE_ENTER(db);
dn = DB_DNODE(db);
- /*
- * Note: This code will probably work even if there are concurrent
- * holders, but it is untested in that scenerio, as the ZPL and
- * ztest have additional locking (the range locks) that prevents
- * that type of concurrent access.
- */
- ASSERT3U(refcount_count(&db->db_holds), ==, db->db_dirtycnt);
-
dprintf_dbuf(db, "size=%llx\n", (u_longlong_t)db->db.db_size);
ASSERT(db->db.db_size != 0);
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 14 01:04:11 2014 (r260616)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 14 01:28:08 2014 (r260617)
@@ -4021,8 +4021,6 @@ spa_import(const char *pool, nvlist_t *c
spa_config_sync(spa, B_FALSE, B_TRUE);
mutex_exit(&spa_namespace_lock);
- spa_history_log_version(spa, "import");
-
return (0);
}
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 09:49:42 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id E8642A41;
Tue, 14 Jan 2014 09:49:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id D412012AB;
Tue, 14 Jan 2014 09:49:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0E9ngD3086974;
Tue, 14 Jan 2014 09:49:42 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0E9ngsH086972;
Tue, 14 Jan 2014 09:49:42 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201401140949.s0E9ngsH086972@svn.freebsd.org>
From: Sergey Kandaurov
Date: Tue, 14 Jan 2014 09:49:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260623 - stable/10/lib/libc/sys
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 09:49:43 -0000
Author: pluknet
Date: Tue Jan 14 09:49:42 2014
New Revision: 260623
URL: http://svnweb.freebsd.org/changeset/base/260623
Log:
MFC r259921,259950:
Provide the manual page for aio_fsync(2).
Added:
stable/10/lib/libc/sys/aio_fsync.2
- copied, changed from r259921, head/lib/libc/sys/aio_fsync.2
Modified:
stable/10/lib/libc/sys/Makefile.inc
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/lib/libc/sys/Makefile.inc
==============================================================================
--- stable/10/lib/libc/sys/Makefile.inc Tue Jan 14 08:43:38 2014 (r260622)
+++ stable/10/lib/libc/sys/Makefile.inc Tue Jan 14 09:49:42 2014 (r260623)
@@ -85,6 +85,7 @@ MAN+= abort2.2 \
adjtime.2 \
aio_cancel.2 \
aio_error.2 \
+ aio_fsync.2 \
aio_mlock.2 \
aio_read.2 \
aio_return.2 \
Copied and modified: stable/10/lib/libc/sys/aio_fsync.2 (from r259921, head/lib/libc/sys/aio_fsync.2)
==============================================================================
--- head/lib/libc/sys/aio_fsync.2 Thu Dec 26 19:16:30 2013 (r259921, copy source)
+++ stable/10/lib/libc/sys/aio_fsync.2 Tue Jan 14 09:49:42 2014 (r260623)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 4, 2013
+.Dd December 27, 2013
.Dt AIO_FSYNC 2
.Os
.Sh NAME
@@ -49,7 +49,7 @@ completed at the time the call returns.
.Pp
The
.Fa op
-argument could be set only to
+argument can only be set to
.Dv O_SYNC
to cause all currently queued I/O operations to be completed
as if by a call to
@@ -109,7 +109,8 @@ returned in
.It Bq Er EBADF
The
.Fa iocb->aio_fildes
-is invalid for writing.
+argument
+is not a valid descriptor.
.It Bq Er EINVAL
This implementation does not support synchronized I/O for this file.
.El
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 12:01:37 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id C1A0C309;
Tue, 14 Jan 2014 12:01:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id AC2CE1E49;
Tue, 14 Jan 2014 12:01:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0EC1bEW040672;
Tue, 14 Jan 2014 12:01:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0EC1agf040667;
Tue, 14 Jan 2014 12:01:36 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201401141201.s0EC1agf040667@svn.freebsd.org>
From: Alexander Motin
Date: Tue, 14 Jan 2014 12:01:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260626 - in stable/10/sys/cam: . scsi
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 12:01:37 -0000
Author: mav
Date: Tue Jan 14 12:01:36 2014
New Revision: 260626
URL: http://svnweb.freebsd.org/changeset/base/260626
Log:
MFC r260541, r260547:
Take additional reference on SCSI probe periph to cover its freeze count.
Otherwise periph may be invalidated and freed before single-stepping freeze
is dropped, causing use after free panic.
Modified:
stable/10/sys/cam/cam_periph.c
stable/10/sys/cam/cam_periph.h
stable/10/sys/cam/cam_xpt.c
stable/10/sys/cam/scsi/scsi_xpt.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cam/cam_periph.c
==============================================================================
--- stable/10/sys/cam/cam_periph.c Tue Jan 14 10:03:31 2014 (r260625)
+++ stable/10/sys/cam/cam_periph.c Tue Jan 14 12:01:36 2014 (r260626)
@@ -376,6 +376,17 @@ cam_periph_acquire(struct cam_periph *pe
}
void
+cam_periph_doacquire(struct cam_periph *periph)
+{
+
+ xpt_lock_buses();
+ KASSERT(periph->refcount >= 1,
+ ("cam_periph_doacquire() with refcount == %d", periph->refcount));
+ periph->refcount++;
+ xpt_unlock_buses();
+}
+
+void
cam_periph_release_locked_buses(struct cam_periph *periph)
{
Modified: stable/10/sys/cam/cam_periph.h
==============================================================================
--- stable/10/sys/cam/cam_periph.h Tue Jan 14 10:03:31 2014 (r260625)
+++ stable/10/sys/cam/cam_periph.h Tue Jan 14 12:01:36 2014 (r260626)
@@ -152,6 +152,7 @@ cam_status cam_periph_alloc(periph_ctor_
struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
int cam_periph_list(struct cam_path *, struct sbuf *);
cam_status cam_periph_acquire(struct cam_periph *periph);
+void cam_periph_doacquire(struct cam_periph *periph);
void cam_periph_release(struct cam_periph *periph);
void cam_periph_release_locked(struct cam_periph *periph);
void cam_periph_release_locked_buses(struct cam_periph *periph);
Modified: stable/10/sys/cam/cam_xpt.c
==============================================================================
--- stable/10/sys/cam/cam_xpt.c Tue Jan 14 10:03:31 2014 (r260625)
+++ stable/10/sys/cam/cam_xpt.c Tue Jan 14 12:01:36 2014 (r260626)
@@ -3154,9 +3154,7 @@ restart:
}
if (periph->flags & CAM_PERIPH_RUN_TASK)
break;
- xpt_lock_buses();
- periph->refcount++; /* Unconditionally acquire */
- xpt_unlock_buses();
+ cam_periph_doacquire(periph);
periph->flags |= CAM_PERIPH_RUN_TASK;
taskqueue_enqueue(xsoftc.xpt_taskq,
&periph->periph_run_task);
Modified: stable/10/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- stable/10/sys/cam/scsi/scsi_xpt.c Tue Jan 14 10:03:31 2014 (r260625)
+++ stable/10/sys/cam/scsi/scsi_xpt.c Tue Jan 14 12:01:36 2014 (r260626)
@@ -890,12 +890,14 @@ again:
/*timeout*/60 * 1000);
break;
}
+done:
/*
* We'll have to do without, let our probedone
* routine finish up for us.
*/
start_ccb->csio.data_ptr = NULL;
cam_freeze_devq(periph->path);
+ cam_periph_doacquire(periph);
probedone(periph, start_ccb);
return;
}
@@ -921,14 +923,7 @@ again:
/*timeout*/60 * 1000);
break;
}
- /*
- * We'll have to do without, let our probedone
- * routine finish up for us.
- */
- start_ccb->csio.data_ptr = NULL;
- cam_freeze_devq(periph->path);
- probedone(periph, start_ccb);
- return;
+ goto done;
}
case PROBE_SERIAL_NUM:
{
@@ -961,19 +956,13 @@ again:
/*timeout*/60 * 1000);
break;
}
- /*
- * We'll have to do without, let our probedone
- * routine finish up for us.
- */
- start_ccb->csio.data_ptr = NULL;
- cam_freeze_devq(periph->path);
- probedone(periph, start_ccb);
- return;
+ goto done;
}
default:
panic("probestart: invalid action state 0x%x\n", softc->action);
}
start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE;
+ cam_periph_doacquire(periph);
xpt_action(start_ccb);
}
@@ -1121,7 +1110,7 @@ probedone(struct cam_periph *periph, uni
if (cam_periph_error(done_ccb, 0,
SF_NO_PRINT, NULL) == ERESTART) {
-out:
+outr:
/* Drop freeze taken due to CAM_DEV_QFREEZE */
cam_release_devq(path, 0, 0, 0, FALSE);
return;
@@ -1135,7 +1124,11 @@ out:
PROBE_SET_ACTION(softc, PROBE_INQUIRY);
xpt_release_ccb(done_ccb);
xpt_schedule(periph, priority);
- goto out;
+out:
+ /* Drop freeze taken due to CAM_DEV_QFREEZE and release. */
+ cam_release_devq(path, 0, 0, 0, FALSE);
+ cam_periph_release_locked(periph);
+ return;
}
case PROBE_INQUIRY:
case PROBE_FULL_INQUIRY:
@@ -1222,7 +1215,7 @@ out:
? SF_RETRY_UA|SF_QUIET_IR
: SF_RETRY_UA,
&softc->saved_ccb) == ERESTART) {
- goto out;
+ goto outr;
} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
/* Don't wedge the queue */
xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
@@ -1263,7 +1256,7 @@ out:
done_ccb->ccb_h.target_lun > 0 ?
SF_RETRY_UA|SF_QUIET_IR : SF_RETRY_UA,
&softc->saved_ccb) == ERESTART) {
- goto out;
+ goto outr;
}
if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
xpt_release_devq(done_ccb->ccb_h.path, 1,
@@ -1373,7 +1366,7 @@ out:
} else if (cam_periph_error(done_ccb, 0,
SF_RETRY_UA|SF_NO_PRINT,
&softc->saved_ccb) == ERESTART) {
- goto out;
+ goto outr;
} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
/* Don't wedge the queue */
xpt_release_devq(done_ccb->ccb_h.path,
@@ -1416,7 +1409,7 @@ out:
} else if (cam_periph_error(done_ccb, 0,
SF_RETRY_UA|SF_NO_PRINT,
&softc->saved_ccb) == ERESTART) {
- goto out;
+ goto outr;
} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
/* Don't wedge the queue */
xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
@@ -1461,7 +1454,7 @@ out:
} else if (cam_periph_error(done_ccb, 0,
SF_RETRY_UA,
&softc->saved_ccb) == ERESTART) {
- goto out;
+ goto outr;
} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
/* Don't wedge the queue */
xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
@@ -1516,7 +1509,7 @@ probe_device_check:
} else if (cam_periph_error(done_ccb, 0,
SF_RETRY_UA|SF_NO_PRINT,
&softc->saved_ccb) == ERESTART) {
- goto out;
+ goto outr;
} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
/* Don't wedge the queue */
xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
@@ -1699,6 +1692,7 @@ probe_device_check:
CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n"));
/* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */
cam_release_devq(path, 0, 0, 0, FALSE);
+ cam_periph_release_locked(periph);
cam_periph_invalidate(periph);
cam_periph_release_locked(periph);
} else {
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 14:03:29 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 0ECFB24E;
Tue, 14 Jan 2014 14:03:29 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id D3C221857;
Tue, 14 Jan 2014 14:03:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0EE3Sv4086716;
Tue, 14 Jan 2014 14:03:28 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0EE3Sc9086715;
Tue, 14 Jan 2014 14:03:28 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201401141403.s0EE3Sc9086715@svn.freebsd.org>
From: Sergey Kandaurov
Date: Tue, 14 Jan 2014 14:03:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260627 - stable/10/tools/tools/syscall_timing
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 14:03:29 -0000
Author: pluknet
Date: Tue Jan 14 14:03:28 2014
New Revision: 260627
URL: http://svnweb.freebsd.org/changeset/base/260627
Log:
MFC r257705:
Clean up -Wtautological-compare -Wformat warnings.
Modified:
stable/10/tools/tools/syscall_timing/syscall_timing.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/tools/tools/syscall_timing/syscall_timing.c
==============================================================================
--- stable/10/tools/tools/syscall_timing/syscall_timing.c Tue Jan 14 12:01:36 2014 (r260626)
+++ stable/10/tools/tools/syscall_timing/syscall_timing.c Tue Jan 14 14:03:28 2014 (r260627)
@@ -192,7 +192,8 @@ test_pipe(uintmax_t num, uintmax_t int_a
uintmax_t
test_socket_stream(uintmax_t num, uintmax_t int_arg, const char *path)
{
- uintmax_t i, so;
+ uintmax_t i;
+ int so;
so = socket(int_arg, SOCK_STREAM, 0);
if (so < 0)
@@ -214,7 +215,8 @@ test_socket_stream(uintmax_t num, uintma
uintmax_t
test_socket_dgram(uintmax_t num, uintmax_t int_arg, const char *path)
{
- uintmax_t i, so;
+ uintmax_t i;
+ int so;
so = socket(int_arg, SOCK_DGRAM, 0);
if (so < 0)
@@ -408,7 +410,8 @@ test_dup(uintmax_t num, uintmax_t int_ar
uintmax_t
test_shmfd(uintmax_t num, uintmax_t int_arg, const char *path)
{
- uintmax_t i, shmfd;
+ uintmax_t i;
+ int shmfd;
shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600);
if (shmfd < 0)
@@ -431,7 +434,8 @@ uintmax_t
test_fstat_shmfd(uintmax_t num, uintmax_t int_arg, const char *path)
{
struct stat sb;
- uintmax_t i, shmfd;
+ uintmax_t i;
+ int shmfd;
shmfd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0600);
if (shmfd < 0)
@@ -785,7 +789,7 @@ main(int argc, char *argv[])
path);
timespecsub(&ts_end, &ts_start);
printf("%s\t%d\t", the_test->t_name, k);
- printf("%ju.%09ju\t%d\t", (uintmax_t)ts_end.tv_sec,
+ printf("%ju.%09ju\t%ju\t", (uintmax_t)ts_end.tv_sec,
(uintmax_t)ts_end.tv_nsec, calls);
/*
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 15:20:34 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 71F3728D;
Tue, 14 Jan 2014 15:20:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 5DD661FD0;
Tue, 14 Jan 2014 15:20:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0EFKY0X016028;
Tue, 14 Jan 2014 15:20:34 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0EFKYMd016027;
Tue, 14 Jan 2014 15:20:34 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201401141520.s0EFKYMd016027@svn.freebsd.org>
From: "Pedro F. Giffuni"
Date: Tue, 14 Jan 2014 15:20:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260629 - stable/10/sys/fs/ext2fs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 15:20:34 -0000
Author: pfg
Date: Tue Jan 14 15:20:33 2014
New Revision: 260629
URL: http://svnweb.freebsd.org/changeset/base/260629
Log:
MFC r260545:
ext2fs: fix inode flag conversion.
After r252890 we are naively attempting to pass through the
inode flags. This is technically incorrect as the ext2
inode flags don't match the UFS/system values used in
FreeBSD and a clean conversion is needed.
Some filtering was left in place so the change didn't cause
significant changes in FreeBSD but some of the garbage passed
is likely to be the cause for warning messages in linux.
Fix the issue by resetting the flags before conversion as was
done previously. This also means we will not pass the EXT4_*
inode flags into FreeBSD's inode.
PR: kern/185448
Modified:
stable/10/sys/fs/ext2fs/ext2_inode_cnv.c
Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c
==============================================================================
--- stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Tue Jan 14 14:05:29 2014 (r260628)
+++ stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Tue Jan 14 15:20:33 2014 (r260629)
@@ -104,7 +104,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, stru
ip->i_birthtime = ei->e2di_crtime;
ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra);
}
- ip->i_flags = ei->e2di_flags;
+ ip->i_flags = 0;
ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0;
ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0;
ip->i_flags |= (ei->e2di_flags & EXT2_NODUMP) ? UF_NODUMP : 0;
@@ -152,7 +152,7 @@ ext2_i2ei(struct inode *ip, struct ext2f
ei->e2di_crtime = ip->i_birthtime;
ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec);
}
- ei->e2di_flags = ip->i_flags;
+ ei->e2di_flags = 0;
ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0;
ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0;
ei->e2di_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP: 0;
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 19:02:15 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 8E8FDC6B;
Tue, 14 Jan 2014 19:02:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 79BEC14D1;
Tue, 14 Jan 2014 19:02:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0EJ2FMH003737;
Tue, 14 Jan 2014 19:02:15 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0EJ2FPw003736;
Tue, 14 Jan 2014 19:02:15 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201401141902.s0EJ2FPw003736@svn.freebsd.org>
From: Xin LI
Date: Tue, 14 Jan 2014 19:02:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260638 - stable/10/contrib/bsnmp/lib
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 19:02:15 -0000
Author: delphij
Date: Tue Jan 14 19:02:14 2014
New Revision: 260638
URL: http://svnweb.freebsd.org/changeset/base/260638
Log:
MFC r260636:
Fix bsnmpd remote denial of service vulnerability.
Reported by: dinoex
Submitted by: harti
Security: FreeBSD-SA-14:01.bsnmpd
Security: CVE-2014-1452
Modified:
stable/10/contrib/bsnmp/lib/snmpagent.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/bsnmp/lib/snmpagent.c
==============================================================================
--- stable/10/contrib/bsnmp/lib/snmpagent.c Tue Jan 14 18:59:00 2014 (r260637)
+++ stable/10/contrib/bsnmp/lib/snmpagent.c Tue Jan 14 19:02:14 2014 (r260638)
@@ -499,6 +499,11 @@ snmp_getbulk(struct snmp_pdu *pdu, struc
for (cnt = 0; cnt < pdu->error_index; cnt++) {
eomib = 1;
for (i = non_rep; i < pdu->nbindings; i++) {
+
+ if (resp->nbindings == SNMP_MAX_BINDINGS)
+ /* PDU is full */
+ goto done;
+
if (cnt == 0)
result = do_getnext(&context, &pdu->bindings[i],
&resp->bindings[resp->nbindings], pdu);
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 19:04:33 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id A53E2DD8;
Tue, 14 Jan 2014 19:04:33 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 90FDA14F4;
Tue, 14 Jan 2014 19:04:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0EJ4X6J004102;
Tue, 14 Jan 2014 19:04:33 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0EJ4X0x004101;
Tue, 14 Jan 2014 19:04:33 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201401141904.s0EJ4X0x004101@svn.freebsd.org>
From: Xin LI
Date: Tue, 14 Jan 2014 19:04:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260639 - stable/10/contrib/ntp/ntpd
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 19:04:33 -0000
Author: delphij
Date: Tue Jan 14 19:04:33 2014
New Revision: 260639
URL: http://svnweb.freebsd.org/changeset/base/260639
Log:
MFC r260637:
Disable 'monitor' feature in ntpd by default.
Security: FreeBSD-SA-14:02.ntpd
Approved by: so
Modified:
stable/10/contrib/ntp/ntpd/ntp_config.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/ntp/ntpd/ntp_config.c
==============================================================================
--- stable/10/contrib/ntp/ntpd/ntp_config.c Tue Jan 14 19:02:14 2014 (r260638)
+++ stable/10/contrib/ntp/ntpd/ntp_config.c Tue Jan 14 19:04:33 2014 (r260639)
@@ -597,6 +597,8 @@ getconfig(
#endif /* not SYS_WINNT */
}
+ proto_config(PROTO_MONITOR, 0, 0., NULL);
+
for (;;) {
if (tok == CONFIG_END)
break;
From owner-svn-src-stable-10@FreeBSD.ORG Tue Jan 14 23:15:55 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 75AB9420;
Tue, 14 Jan 2014 23:15:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 5551B147C;
Tue, 14 Jan 2014 23:15:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0ENFt7n015836;
Tue, 14 Jan 2014 23:15:55 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0ENFrWY015829;
Tue, 14 Jan 2014 23:15:53 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201401142315.s0ENFrWY015829@svn.freebsd.org>
From: Hiroki Sato
Date: Tue, 14 Jan 2014 23:15:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260656 - in stable/10/release/doc: de_DE.ISO8859-1
en_US.ISO8859-1/errata en_US.ISO8859-1/share/xml fr_FR.ISO8859-1 ja_JP.eucJP
ru_RU.KOI8-R share/mk share/xml zh_CN.GB2312
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 14 Jan 2014 23:15:55 -0000
Author: hrs
Date: Tue Jan 14 23:15:53 2014
New Revision: 260656
URL: http://svnweb.freebsd.org/changeset/base/260656
Log:
- MFC 260653,260655:
* Purge old translations.
* Add missing footer due to DSSSL->XSLT migration and use XML catalog to
resolve URI.
* Add missing arch= and revision= support.
- Update release.ent and fix release number in Errata.
Added:
stable/10/release/doc/en_US.ISO8859-1/share/xml/catalog.xml
- copied unchanged from r260653, head/release/doc/en_US.ISO8859-1/share/xml/catalog.xml
stable/10/release/doc/en_US.ISO8859-1/share/xml/release.xsl
- copied unchanged from r260653, head/release/doc/en_US.ISO8859-1/share/xml/release.xsl
stable/10/release/doc/share/xml/release.xsl
- copied, changed from r260653, head/release/doc/share/xml/release.xsl
Deleted:
stable/10/release/doc/de_DE.ISO8859-1/
stable/10/release/doc/en_US.ISO8859-1/share/xml/catalog
stable/10/release/doc/en_US.ISO8859-1/share/xml/release.dsl
stable/10/release/doc/fr_FR.ISO8859-1/
stable/10/release/doc/ja_JP.eucJP/
stable/10/release/doc/ru_RU.KOI8-R/
stable/10/release/doc/share/xml/catalog
stable/10/release/doc/share/xml/default.dsl
stable/10/release/doc/share/xml/release.dsl
stable/10/release/doc/zh_CN.GB2312/
Modified:
stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
stable/10/release/doc/share/mk/doc.relnotes.mk
stable/10/release/doc/share/xml/catalog.xml
stable/10/release/doc/share/xml/release.ent
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
==============================================================================
--- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jan 14 23:04:31 2014 (r260655)
+++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Tue Jan 14 23:15:53 2014 (r260656)
@@ -16,7 +16,7 @@
-->
- &os; &release; Errata
+ &os; &release.prev; Errata
@@ -26,20 +26,7 @@
$FreeBSD$
- 2000
- 2001
- 2002
- 2003
- 2004
- 2005
- 2006
- 2007
- 2008
- 2009
- 2010
- 2011
- 2012
- 2013
+ 2014
The &os; Documentation Project
Copied: stable/10/release/doc/en_US.ISO8859-1/share/xml/catalog.xml (from r260653, head/release/doc/en_US.ISO8859-1/share/xml/catalog.xml)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/release/doc/en_US.ISO8859-1/share/xml/catalog.xml Tue Jan 14 23:15:53 2014 (r260656, copy of r260653, head/release/doc/en_US.ISO8859-1/share/xml/catalog.xml)
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
Copied: stable/10/release/doc/en_US.ISO8859-1/share/xml/release.xsl (from r260653, head/release/doc/en_US.ISO8859-1/share/xml/release.xsl)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/release/doc/en_US.ISO8859-1/share/xml/release.xsl Tue Jan 14 23:15:53 2014 (r260656, copy of r260653, head/release/doc/en_US.ISO8859-1/share/xml/release.xsl)
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+ This file, and other release-related documents,
+ can be downloaded from .
+
+ For questions about FreeBSD, read the
+ documentation before
+ contacting <questions@FreeBSD.org >.
+
+ All users of FreeBSD should
+ subscribe to the <current@FreeBSD.org >
+ mailing list.
+
+ For questions about this documentation,
+ e-mail <doc@FreeBSD.org >.
+
+
Modified: stable/10/release/doc/share/mk/doc.relnotes.mk
==============================================================================
--- stable/10/release/doc/share/mk/doc.relnotes.mk Tue Jan 14 23:04:31 2014 (r260655)
+++ stable/10/release/doc/share/mk/doc.relnotes.mk Tue Jan 14 23:15:53 2014 (r260656)
@@ -4,6 +4,8 @@ DOC_PREFIX?= ${RELN_ROOT}/../../../doc
# XXX
RELEASETYPE!= grep -o 'release.type "[a-z]*"' ${RELN_ROOT}/share/xml/release.ent | sed 's|[a-z.]* "\([a-z]*\)"|\1|'
+RELEASEURL!= grep -o 'release.url \"[^\"]*\"' ${RELN_ROOT}/share/xml/release.ent | sed 's|[^ ]* "\([^"]*\)"|\1|'
+RELEASEBRANCH!= grep -o 'release.branch "\([^"]*\)"' ${RELN_ROOT}/share/xml/release.ent | sed 's|[^ ]* "\([^"]*\)"|\1|'
.if ${RELEASETYPE} == "current"
PROFILING+= --param profile.attribute "'releasetype'" --param profile.value "'current'"
.elif ${RELEASETYPE} == "snapshot"
@@ -11,13 +13,14 @@ PROFILING+= --param profile.attribute "'
.elif ${RELEASETYPE} == "release"
PROFILING+= --param profile.attribute "'releasetype'" --param profile.value "'release'"
.endif
+XSLTPROCFLAGS+= --param release.url "'${RELEASEURL}'"
+XSLTPROCFLAGS+= --param release.branch "'${RELEASEBRANCH}'"
# Find the RELNOTESng document catalogs
EXTRA_CATALOGS+= file://${RELN_ROOT}/${LANGCODE}/share/xml/catalog.xml \
- file://${RELN_ROOT}/share/xml/catalog.xml
+ file://${RELN_ROOT}/share/xml/catalog.xml
-# Use the appropriate architecture-dependent RELNOTESng stylesheet
-DSLPRINT?= ${RELN_ROOT}/share/xml/default.dsl
+XSLXHTML= http://www.FreeBSD.org/release/XML/share/xml/release.xsl
#
# Automatic device list generation:
Modified: stable/10/release/doc/share/xml/catalog.xml
==============================================================================
--- stable/10/release/doc/share/xml/catalog.xml Tue Jan 14 23:04:31 2014 (r260655)
+++ stable/10/release/doc/share/xml/catalog.xml Tue Jan 14 23:15:53 2014 (r260656)
@@ -1,6 +1,11 @@
+
+
+
Modified: stable/10/release/doc/share/xml/release.ent
==============================================================================
--- stable/10/release/doc/share/xml/release.ent Tue Jan 14 23:04:31 2014 (r260655)
+++ stable/10/release/doc/share/xml/release.ent Tue Jan 14 23:15:53 2014 (r260656)
@@ -6,17 +6,17 @@
-
+
-
+
-
+
@@ -52,7 +52,7 @@
-
+
@@ -70,6 +70,3 @@
-
-
-
Copied and modified: stable/10/release/doc/share/xml/release.xsl (from r260653, head/release/doc/share/xml/release.xsl)
==============================================================================
--- head/release/doc/share/xml/release.xsl Tue Jan 14 22:46:23 2014 (r260653, copy source)
+++ stable/10/release/doc/share/xml/release.xsl Tue Jan 14 23:15:53 2014 (r260656)
@@ -12,4 +12,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 00:11:10 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id B900945E;
Wed, 15 Jan 2014 00:11:10 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 8A3C718D0;
Wed, 15 Jan 2014 00:11:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F0BAiW038919;
Wed, 15 Jan 2014 00:11:10 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F0BAH9038917;
Wed, 15 Jan 2014 00:11:10 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201401150011.s0F0BAH9038917@svn.freebsd.org>
From: Hiroki Sato
Date: Wed, 15 Jan 2014 00:11:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260660 - in stable/10/release/doc/en_US.ISO8859-1:
errata share/xml
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 00:11:10 -0000
Author: hrs
Date: Wed Jan 15 00:11:09 2014
New Revision: 260660
URL: http://svnweb.freebsd.org/changeset/base/260660
Log:
Fix release numbers and branch names.
Modified:
stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
stable/10/release/doc/en_US.ISO8859-1/share/xml/release.xsl
Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
==============================================================================
--- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 00:10:20 2014 (r260659)
+++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 00:11:09 2014 (r260660)
@@ -38,7 +38,7 @@
- This document lists errata items for &os; &release;,
+ This document lists errata items for &os; &release.prev;,
containing significant information discovered after the release
or too late in the release cycle to be otherwise included in the
release documentation.
@@ -48,7 +48,7 @@
should always be consulted before installing this version of
&os;.
- This errata document for &os; &release;
+ This errata document for &os; &release.prev;
will be maintained until the release of &os; &release.next;.
@@ -57,7 +57,7 @@
Introduction
This errata document contains late-breaking news
- about &os; &release;
+ about &os; &release.prev;
Before installing this version, it is important to consult this
document to learn about any post-release discoveries or problems
that may already have been found and fixed.
Modified: stable/10/release/doc/en_US.ISO8859-1/share/xml/release.xsl
==============================================================================
--- stable/10/release/doc/en_US.ISO8859-1/share/xml/release.xsl Wed Jan 15 00:10:20 2014 (r260659)
+++ stable/10/release/doc/en_US.ISO8859-1/share/xml/release.xsl Wed Jan 15 00:11:09 2014 (r260660)
@@ -17,8 +17,8 @@
documentation before
contacting <questions@FreeBSD.org >.
- All users of FreeBSD should
- subscribe to the <current@FreeBSD.org >
+
All users of FreeBSD stable should
+ subscribe to the <stable@FreeBSD.org >
mailing list.
For questions about this documentation,
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 00:12:20 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 406FC6B6;
Wed, 15 Jan 2014 00:12:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 2BDEC18D9;
Wed, 15 Jan 2014 00:12:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F0CKIH039423;
Wed, 15 Jan 2014 00:12:20 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F0CKKE039422;
Wed, 15 Jan 2014 00:12:20 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201401150012.s0F0CKKE039422@svn.freebsd.org>
From: Hiroki Sato
Date: Wed, 15 Jan 2014 00:12:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260662 - stable/10/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 00:12:20 -0000
Author: hrs
Date: Wed Jan 15 00:12:19 2014
New Revision: 260662
URL: http://svnweb.freebsd.org/changeset/base/260662
Log:
Remove a non-applicable sentence.
Modified:
stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Jan 15 00:11:42 2014 (r260661)
+++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Jan 15 00:12:19 2014 (r260662)
@@ -94,10 +94,7 @@
This section describes
the most user-visible new or changed features in &os;
- since &release.prev;.
- In general, changes described here are unique to the &release.branch;
- branch unless specifically marked as &merged; features.
-
+ since &release.prev;.
Typical release note items
document recent security advisories issued after
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 04:16:46 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 5FCC2C54;
Wed, 15 Jan 2014 04:16:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 40AEA1275;
Wed, 15 Jan 2014 04:16:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F4GkCf034250;
Wed, 15 Jan 2014 04:16:46 GMT
(envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F4GjKQ034248;
Wed, 15 Jan 2014 04:16:45 GMT
(envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201401150416.s0F4GjKQ034248@svn.freebsd.org>
From: Justin Hibbits
Date: Wed, 15 Jan 2014 04:16:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260667 - stable/10/sys/powerpc/aim
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 04:16:46 -0000
Author: jhibbits
Date: Wed Jan 15 04:16:45 2014
New Revision: 260667
URL: http://svnweb.freebsd.org/changeset/base/260667
Log:
MFC r256542,r256581
Move the PMC handling to the first level interrupt handler where it belongs.
Also add the pmc_hook use, to handle callchain tracing.
Modified:
stable/10/sys/powerpc/aim/interrupt.c
stable/10/sys/powerpc/aim/trap.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/powerpc/aim/interrupt.c
==============================================================================
--- stable/10/sys/powerpc/aim/interrupt.c Wed Jan 15 03:57:41 2014 (r260666)
+++ stable/10/sys/powerpc/aim/interrupt.c Wed Jan 15 04:16:45 2014 (r260667)
@@ -31,6 +31,8 @@
* Interrupts are dispatched to here from locore asm
*/
+#include "opt_hwpmc_hooks.h"
+
#include /* RCS ID & Copyright macro defns */
#include
@@ -43,6 +45,9 @@
#include
#include
#include
+#ifdef HWPMC_HOOKS
+#include
+#endif
#include
#include
#include
@@ -96,6 +101,16 @@ powerpc_interrupt(struct trapframe *fram
atomic_subtract_int(&td->td_intr_nesting_level, 1);
critical_exit();
break;
+#ifdef HWPMC_HOOKS
+ case EXC_PERF:
+ critical_enter();
+ KASSERT(pmc_intr != NULL, ("Performance exception, but no handler!"));
+ (*pmc_intr)(PCPU_GET(cpuid), framep);
+ if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN))
+ pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, framep);
+ critical_exit();
+ break;
+#endif
default:
/* Re-enable interrupts if applicable. */
Modified: stable/10/sys/powerpc/aim/trap.c
==============================================================================
--- stable/10/sys/powerpc/aim/trap.c Wed Jan 15 03:57:41 2014 (r260666)
+++ stable/10/sys/powerpc/aim/trap.c Wed Jan 15 04:16:45 2014 (r260667)
@@ -34,7 +34,6 @@
#include
__FBSDID("$FreeBSD$");
-#include "opt_hwpmc_hooks.h"
#include "opt_kdtrace.h"
#include
@@ -52,9 +51,6 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
-#ifdef HWPMC_HOOKS
-#include
-#endif
#include
@@ -195,14 +191,6 @@ trap(struct trapframe *frame)
CTR3(KTR_TRAP, "trap: %s type=%s (%s)", td->td_name,
trapname(type), user ? "user" : "kernel");
-#ifdef HWPMC_HOOKS
- if (type == EXC_PERF && (pmc_intr != NULL)) {
- (*pmc_intr)(PCPU_GET(cpuid), frame);
- if (user)
- userret(td, frame);
- return;
- }
-#endif
#ifdef KDTRACE_HOOKS
/*
* A trap can occur while DTrace executes a probe. Before
@@ -292,7 +280,7 @@ trap(struct trapframe *frame)
case EXC_PGM:
/* Identify the trap reason */
if (frame->srr1 & EXC_PGM_TRAP)
- sig = SIGTRAP;
+ sig = SIGTRAP;
else if (ppc_instr_emulate(frame) == 0)
frame->srr0 += 4;
else
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 04:44:53 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id A5202ECF;
Wed, 15 Jan 2014 04:44:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 855FA14CC;
Wed, 15 Jan 2014 04:44:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F4irUx045630;
Wed, 15 Jan 2014 04:44:53 GMT
(envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F4irhv045628;
Wed, 15 Jan 2014 04:44:53 GMT
(envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201401150444.s0F4irhv045628@svn.freebsd.org>
From: Justin Hibbits
Date: Wed, 15 Jan 2014 04:44:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260669 - in stable/10/sys: dev/hwpmc powerpc/include
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 04:44:53 -0000
Author: jhibbits
Date: Wed Jan 15 04:44:52 2014
New Revision: 260669
URL: http://svnweb.freebsd.org/changeset/base/260669
Log:
MFC r259394,r259395,r259699
r259394:
Rebase the PMC indices at 1, since PMC_SOFT is at 0.
r259395,r259699:
Add userland PMC backtracing, and use the PMC trapframe macros for kernel
backtraces.
Modified:
stable/10/sys/dev/hwpmc/hwpmc_powerpc.c
stable/10/sys/powerpc/include/pmc_mdep.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/hwpmc/hwpmc_powerpc.c
==============================================================================
--- stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Wed Jan 15 04:25:54 2014 (r260668)
+++ stable/10/sys/dev/hwpmc/hwpmc_powerpc.c Wed Jan 15 04:44:52 2014 (r260669)
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
#define INKERNEL(x) (((vm_offset_t)(x)) <= VM_MAX_KERNEL_ADDRESS && \
((vm_offset_t)(x)) >= VM_MIN_KERNEL_ADDRESS)
+#define INUSER(x) (((vm_offset_t)(x)) <= VM_MAXUSER_ADDRESS && \
+ ((vm_offset_t)(x)) >= VM_MIN_ADDRESS)
struct powerpc_cpu **powerpc_pcpu;
@@ -55,13 +57,13 @@ pmc_save_kernel_callchain(uintptr_t *cc,
int frames = 0;
uintptr_t *sp;
- cc[frames++] = tf->srr0;
- sp = (uintptr_t *)tf->fixreg[1];
+ cc[frames++] = PMC_TRAPFRAME_TO_PC(tf);
+ sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf);
for (frames = 1; frames < maxsamples; frames++) {
if (!INKERNEL(sp))
break;
- cc[frames++] = *(sp + 1);
+ cc[frames++] = sp[1];
sp = (uintptr_t *)*sp;
}
return (frames);
@@ -172,8 +174,17 @@ int
pmc_save_user_callchain(uintptr_t *cc, int maxsamples,
struct trapframe *tf)
{
- (void) cc;
- (void) maxsamples;
- (void) tf;
- return (0);
+ uintptr_t *sp;
+ int frames = 0;
+
+ cc[frames++] = PMC_TRAPFRAME_TO_PC(tf);
+ sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf);
+
+ for (frames = 1; frames < maxsamples; frames++) {
+ if (!INUSER(sp))
+ break;
+ cc[frames++] = fuword(sp + 1);
+ sp = (uintptr_t *)fuword(sp);
+ }
+ return (frames);
}
Modified: stable/10/sys/powerpc/include/pmc_mdep.h
==============================================================================
--- stable/10/sys/powerpc/include/pmc_mdep.h Wed Jan 15 04:25:54 2014 (r260668)
+++ stable/10/sys/powerpc/include/pmc_mdep.h Wed Jan 15 04:44:52 2014 (r260669)
@@ -7,8 +7,8 @@
#ifndef _MACHINE_PMC_MDEP_H_
#define _MACHINE_PMC_MDEP_H_
-#define PMC_MDEP_CLASS_INDEX_PPC7450 0
-#define PMC_MDEP_CLASS_INDEX_PPC970 0
+#define PMC_MDEP_CLASS_INDEX_PPC7450 1
+#define PMC_MDEP_CLASS_INDEX_PPC970 1
union pmc_md_op_pmcallocate {
uint64_t __pad[4];
@@ -28,8 +28,8 @@ union pmc_md_pmc {
struct pmc_md_powerpc_pmc pm_powerpc;
};
-#define PMC_TRAPFRAME_TO_PC(TF) (0) /* Stubs */
-#define PMC_TRAPFRAME_TO_FP(TF) (0)
+#define PMC_TRAPFRAME_TO_PC(TF) ((TF)->srr0)
+#define PMC_TRAPFRAME_TO_FP(TF) ((TF)->fixreg[1])
#define PMC_TRAPFRAME_TO_SP(TF) (0)
#endif
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 05:19:39 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id B5B8FCC;
Wed, 15 Jan 2014 05:19:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 958B61773;
Wed, 15 Jan 2014 05:19:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F5Jdao058032;
Wed, 15 Jan 2014 05:19:39 GMT
(envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F5Jb2D058021;
Wed, 15 Jan 2014 05:19:37 GMT
(envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201401150519.s0F5Jb2D058021@svn.freebsd.org>
From: Justin Hibbits
Date: Wed, 15 Jan 2014 05:19:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260670 - in stable/10:
cddl/contrib/opensolaris/lib/libdtrace/common
cddl/contrib/opensolaris/lib/libdtrace/powerpc
sys/cddl/contrib/opensolaris/uts/powerpc/dtrace sys/cddl/contrib/ope...
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 05:19:39 -0000
Author: jhibbits
Date: Wed Jan 15 05:19:37 2014
New Revision: 260670
URL: http://svnweb.freebsd.org/changeset/base/260670
Log:
MFC r256543,r259245,r259421,r259668,r259674
r256543:
Add fasttrap for PowerPC. This is the last piece of the DTrace/ppc puzzle.
It's incomplete, it doesn't contain full instruction emulation, but it should be
sufficient for most cases.
r259245,r259421: (FBT)
FBT now does work fully on PowerPC.
Save r3 before using it for the trap check, else we end up saving the new r3,
containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return. This caused it to panic on my ppc32 machine.
r259668,r259674:
Fix a typo in the FBT code.
Modified:
stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
stable/10/cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c
stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h
stable/10/sys/cddl/dev/fbt/fbt_powerpc.c
stable/10/sys/modules/dtrace/Makefile
stable/10/sys/modules/dtrace/fasttrap/Makefile
stable/10/sys/powerpc/aim/trap.c
stable/10/sys/powerpc/aim/trap_subr32.S
stable/10/sys/powerpc/aim/trap_subr64.S
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Wed Jan 15 05:19:37 2014 (r260670)
@@ -242,8 +242,14 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_
/* XXX */
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
#elif defined(__powerpc__)
-/* XXX */
-printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
+ /*
+ * Add 4 bytes to hit the low half of this 64-bit
+ * big-endian address.
+ */
+ rel->r_offset = s->dofs_offset +
+ dofr[j].dofr_offset + 4;
+ rel->r_info = ELF32_R_INFO(count + dep->de_global,
+ R_PPC_REL32);
#elif defined(__sparc)
/*
* Add 4 bytes to hit the low half of this 64-bit
@@ -423,7 +429,10 @@ prepare_elf64(dtrace_hdl_t *dtp, const d
#elif defined(__mips__)
/* XXX */
#elif defined(__powerpc__)
-/* XXX */
+ rel->r_offset = s->dofs_offset +
+ dofr[j].dofr_offset;
+ rel->r_info = ELF64_R_INFO(count + dep->de_global,
+ R_PPC64_REL64);
#elif defined(__i386) || defined(__amd64)
rel->r_offset = s->dofs_offset +
dofr[j].dofr_offset;
@@ -824,12 +833,84 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_
return (0);
}
#elif defined(__powerpc__)
+/* The sentinel is 'xor r3,r3,r3'. */
+#define DT_OP_XOR_R3 0x7c631a78
+
+#define DT_OP_NOP 0x60000000
+#define DT_OP_BLR 0x4e800020
+
+/* This captures all forms of branching to address. */
+#define DT_IS_BRANCH(inst) ((inst & 0xfc000000) == 0x48000000)
+#define DT_IS_BL(inst) (DT_IS_BRANCH(inst) && (inst & 0x01))
+
/* XXX */
static int
dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
uint32_t *off)
{
-printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
+ uint32_t *ip;
+
+ if ((rela->r_offset & (sizeof (uint32_t) - 1)) != 0)
+ return (-1);
+
+ /*LINTED*/
+ ip = (uint32_t *)(p + rela->r_offset);
+
+ /*
+ * We only know about some specific relocation types.
+ */
+ if (GELF_R_TYPE(rela->r_info) != R_PPC_REL24 &&
+ GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24)
+ return (-1);
+
+ /*
+ * We may have already processed this object file in an earlier linker
+ * invocation. Check to see if the present instruction sequence matches
+ * the one we would install below.
+ */
+ if (isenabled) {
+ if (ip[0] == DT_OP_XOR_R3) {
+ (*off) += sizeof (ip[0]);
+ return (0);
+ }
+ } else {
+ if (ip[0] == DT_OP_NOP) {
+ (*off) += sizeof (ip[0]);
+ return (0);
+ }
+ }
+
+ /*
+ * We only expect branch to address instructions.
+ */
+ if (!DT_IS_BRANCH(ip[0])) {
+ dt_dprintf("found %x instead of a branch instruction at %llx\n",
+ ip[0], (u_longlong_t)rela->r_offset);
+ return (-1);
+ }
+
+ if (isenabled) {
+ /*
+ * It would necessarily indicate incorrect usage if an is-
+ * enabled probe were tail-called so flag that as an error.
+ * It's also potentially (very) tricky to handle gracefully,
+ * but could be done if this were a desired use scenario.
+ */
+ if (!DT_IS_BL(ip[0])) {
+ dt_dprintf("tail call to is-enabled probe at %llx\n",
+ (u_longlong_t)rela->r_offset);
+ return (-1);
+ }
+
+ ip[0] = DT_OP_XOR_R3;
+ (*off) += sizeof (ip[0]);
+ } else {
+ if (DT_IS_BL(ip[0]))
+ ip[0] = DT_OP_NOP;
+ else
+ ip[0] = DT_OP_BLR;
+ }
+
return (0);
}
Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/powerpc/dt_isadep.c Wed Jan 15 05:19:37 2014 (r260670)
@@ -35,14 +35,26 @@
#include
#include
+#include
+
/*ARGSUSED*/
int
dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp)
{
+ ftp->ftps_type = DTFTP_ENTRY;
+ ftp->ftps_pc = (uintptr_t)symp->st_value;
+ ftp->ftps_size = (size_t)symp->st_size;
+ ftp->ftps_noffs = 1;
+ ftp->ftps_offs[0] = 0;
+
+ if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
+ dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
+ strerror(errno));
+ return (dt_set_errno(dtp, errno));
+ }
- dt_dprintf("%s: unimplemented\n", __func__);
- return (DT_PROC_ERR);
+ return (1);
}
int
@@ -50,8 +62,74 @@ dt_pid_create_return_probe(struct ps_pro
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret)
{
- dt_dprintf("%s: unimplemented\n", __func__);
- return (DT_PROC_ERR);
+ uintptr_t temp;
+ uint32_t *text;
+ int i;
+ int srdepth = 0;
+
+ if ((text = malloc(symp->st_size + 4)) == NULL) {
+ dt_dprintf("mr sparkle: malloc() failed\n");
+ return (DT_PROC_ERR);
+ }
+
+ if (Pread(P, text, symp->st_size, symp->st_value) != symp->st_size) {
+ dt_dprintf("mr sparkle: Pread() failed\n");
+ free(text);
+ return (DT_PROC_ERR);
+ }
+
+ /*
+ * Leave a dummy instruction in the last slot to simplify edge
+ * conditions.
+ */
+ text[symp->st_size / 4] = 0;
+
+ ftp->ftps_type = DTFTP_RETURN;
+ ftp->ftps_pc = symp->st_value;
+ ftp->ftps_size = symp->st_size;
+ ftp->ftps_noffs = 0;
+
+ for (i = 0; i < symp->st_size / 4; i++) {
+
+ if ((text[i] & 0xfc000001) != 0x48000000 &&
+ text[i] != 0x4e800020)
+ continue;
+
+ /*
+ * Check for a jump within this function. If it's outside this
+ * function then it's a tail-call, so a return point.
+ */
+ if ((text[i] & 0xfc000000) == 0x48000000) {
+ temp = (text[i] & 0x03fffffc);
+ /* Bit 30 denotes an absolute address. */
+ if (!(text[i] & 0x02)) {
+ temp += symp->st_value + i * 4;
+ }
+ else {
+ /* Sign extend the absolute address. */
+ if (temp & 0x02000000) {
+ temp |= (UINTPTR_MAX - 0x03ffffff);
+ }
+ }
+ if (temp >= symp->st_value &&
+ temp <= (symp->st_value + symp->st_size))
+ continue;
+ }
+ dt_dprintf("return at offset %x\n", i * 4);
+ ftp->ftps_offs[ftp->ftps_noffs++] = i * 4;
+ }
+
+ free(text);
+ if (ftp->ftps_noffs > 0) {
+ if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
+ dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
+ strerror(errno));
+ return (dt_set_errno(dtp, errno));
+ }
+ }
+
+
+ return (ftp->ftps_noffs);
}
/*ARGSUSED*/
@@ -59,9 +137,22 @@ int
dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off)
{
+ if (off & 0x3)
+ return (DT_PROC_ALIGN);
- dt_dprintf("%s: unimplemented\n", __func__);
- return (DT_PROC_ERR);
+ ftp->ftps_type = DTFTP_OFFSETS;
+ ftp->ftps_pc = (uintptr_t)symp->st_value;
+ ftp->ftps_size = (size_t)symp->st_size;
+ ftp->ftps_noffs = 1;
+ ftp->ftps_offs[0] = off;
+
+ if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
+ dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
+ strerror(errno));
+ return (dt_set_errno(dtp, errno));
+ }
+
+ return (1);
}
/*ARGSUSED*/
@@ -69,7 +160,38 @@ int
dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp,
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern)
{
+ ulong_t i;
+
+ ftp->ftps_type = DTFTP_OFFSETS;
+ ftp->ftps_pc = (uintptr_t)symp->st_value;
+ ftp->ftps_size = (size_t)symp->st_size;
+ ftp->ftps_noffs = 0;
+
+ /*
+ * If we're matching against everything, just iterate through each
+ * instruction in the function, otherwise look for matching offset
+ * names by constructing the string and comparing it against the
+ * pattern.
+ */
+ if (strcmp("*", pattern) == 0) {
+ for (i = 0; i < symp->st_size; i += 4) {
+ ftp->ftps_offs[ftp->ftps_noffs++] = i;
+ }
+ } else {
+ char name[sizeof (i) * 2 + 1];
+
+ for (i = 0; i < symp->st_size; i += 4) {
+ (void) sprintf(name, "%lx", i);
+ if (gmatch(name, pattern))
+ ftp->ftps_offs[ftp->ftps_noffs++] = i;
+ }
+ }
+
+ if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
+ dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
+ strerror(errno));
+ return (dt_set_errno(dtp, errno));
+ }
- dt_dprintf("%s: unimplemented\n", __func__);
- return (DT_PROC_ERR);
+ return (ftp->ftps_noffs);
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Wed Jan 15 05:19:37 2014 (r260670)
@@ -18,13 +18,560 @@
*
* CDDL HEADER END
*/
-
+/* Portions Copyright 2013 Justin Hibbits */
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define OP(x) ((x) >> 26)
+#define OPX(x) (((x) >> 2) & 0x3FF)
+#define OP_BO(x) (((x) & 0x03E00000) >> 21)
+#define OP_BI(x) (((x) & 0x001F0000) >> 16)
+#define OP_RS(x) (((x) & 0x03E00000) >> 21)
+#define OP_RA(x) (((x) & 0x001F0000) >> 16)
+#define OP_RB(x) (((x) & 0x0000F100) >> 11)
+
+
+static int
+proc_ops(int op, proc_t *p, void *kaddr, off_t uaddr, size_t len)
+{
+ struct iovec iov;
+ struct uio uio;
+
+ iov.iov_base = kaddr;
+ iov.iov_len = len;
+ uio.uio_offset = uaddr;
+ uio.uio_iov = &iov;
+ uio.uio_resid = len;
+ uio.uio_iovcnt = 1;
+ uio.uio_segflg = UIO_SYSSPACE;
+ uio.uio_td = curthread;
+ uio.uio_rw = op;
+ PHOLD(p);
+ if (proc_rwmem(p, &uio) < 0) {
+ PRELE(p);
+ return (-1);
+ }
+ PRELE(p);
+
+ return (0);
+}
+
+static int
+uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
+{
+
+ return (proc_ops(UIO_READ, p, kaddr, uaddr, len));
+}
+
+static int
+uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr)
+{
+
+ return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len));
+}
+
+int
+fasttrap_tracepoint_install(proc_t *p, fasttrap_tracepoint_t *tp)
+{
+ fasttrap_instr_t instr = FASTTRAP_INSTR;
+
+ if (uwrite(p, &instr, 4, tp->ftt_pc) != 0)
+ return (-1);
+
+ return (0);
+}
+
+int
+fasttrap_tracepoint_remove(proc_t *p, fasttrap_tracepoint_t *tp)
+{
+ uint32_t instr;
+
+ /*
+ * Distinguish between read or write failures and a changed
+ * instruction.
+ */
+ if (uread(p, &instr, 4, tp->ftt_pc) != 0)
+ return (0);
+ if (instr != FASTTRAP_INSTR)
+ return (0);
+ if (uwrite(p, &tp->ftt_instr, 4, tp->ftt_pc) != 0)
+ return (-1);
+
+ return (0);
+}
+
+int
+fasttrap_tracepoint_init(proc_t *p, fasttrap_tracepoint_t *tp, uintptr_t pc,
+ fasttrap_probe_type_t type)
+{
+ uint32_t instr;
+ //int32_t disp;
+
+ /*
+ * Read the instruction at the given address out of the process's
+ * address space. We don't have to worry about a debugger
+ * changing this instruction before we overwrite it with our trap
+ * instruction since P_PR_LOCK is set.
+ */
+ if (uread(p, &instr, 4, pc) != 0)
+ return (-1);
+
+ /*
+ * Decode the instruction to fill in the probe flags. We can have
+ * the process execute most instructions on its own using a pc/npc
+ * trick, but pc-relative control transfer present a problem since
+ * we're relocating the instruction. We emulate these instructions
+ * in the kernel. We assume a default type and over-write that as
+ * needed.
+ *
+ * pc-relative instructions must be emulated for correctness;
+ * other instructions (which represent a large set of commonly traced
+ * instructions) are emulated or otherwise optimized for performance.
+ */
+ tp->ftt_type = FASTTRAP_T_COMMON;
+ tp->ftt_instr = instr;
+
+ switch (OP(instr)) {
+ /* The following are invalid for trapping (invalid opcodes, tw/twi). */
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ case 6:
+ case 30:
+ case 39:
+ case 58:
+ case 62:
+ case 3: /* twi */
+ return (-1);
+ case 31: /* tw */
+ if (OPX(instr) == 4)
+ return (-1);
+ else if (OPX(instr) == 444 && OP_RS(instr) == OP_RA(instr) &&
+ OP_RS(instr) == OP_RB(instr))
+ tp->ftt_type = FASTTRAP_T_NOP;
+ break;
+ case 16:
+ tp->ftt_type = FASTTRAP_T_BC;
+ tp->ftt_dest = instr & 0x0000FFFC; /* Extract target address */
+ if (instr & 0x00008000)
+ tp->ftt_dest |= 0xFFFF0000;
+ /* Use as offset if not absolute address. */
+ if (!(instr & 0x02))
+ tp->ftt_dest += pc;
+ tp->ftt_bo = OP_BO(instr);
+ tp->ftt_bi = OP_BI(instr);
+ break;
+ case 18:
+ tp->ftt_type = FASTTRAP_T_B;
+ tp->ftt_dest = instr & 0x03FFFFFC; /* Extract target address */
+ if (instr & 0x02000000)
+ tp->ftt_dest |= 0xFC000000;
+ /* Use as offset if not absolute address. */
+ if (!(instr & 0x02))
+ tp->ftt_dest += pc;
+ break;
+ case 19:
+ switch (OPX(instr)) {
+ case 528: /* bcctr */
+ tp->ftt_type = FASTTRAP_T_BCTR;
+ tp->ftt_bo = OP_BO(instr);
+ tp->ftt_bi = OP_BI(instr);
+ break;
+ case 16: /* bclr */
+ tp->ftt_type = FASTTRAP_T_BCTR;
+ tp->ftt_bo = OP_BO(instr);
+ tp->ftt_bi = OP_BI(instr);
+ break;
+ };
+ break;
+ case 24:
+ if (OP_RS(instr) == OP_RA(instr) &&
+ (instr & 0x0000FFFF) == 0)
+ tp->ftt_type = FASTTRAP_T_NOP;
+ break;
+ };
+
+ /*
+ * We don't know how this tracepoint is going to be used, but in case
+ * it's used as part of a function return probe, we need to indicate
+ * whether it's always a return site or only potentially a return
+ * site. If it's part of a return probe, it's always going to be a
+ * return from that function if it's a restore instruction or if
+ * the previous instruction was a return. If we could reliably
+ * distinguish jump tables from return sites, this wouldn't be
+ * necessary.
+ */
+#if 0
+ if (tp->ftt_type != FASTTRAP_T_RESTORE &&
+ (uread(p, &instr, 4, pc - sizeof (instr)) != 0 ||
+ !(OP(instr) == 2 && OP3(instr) == OP3_RETURN)))
+ tp->ftt_flags |= FASTTRAP_F_RETMAYBE;
+#endif
+
+ return (0);
+}
+
+static uint64_t
+fasttrap_anarg(struct reg *rp, int argno)
+{
+ uint64_t value;
+ proc_t *p = curproc;
+
+ /* The first 8 arguments are in registers. */
+ if (argno < 8)
+ return rp->fixreg[argno + 3];
+
+ /* Arguments on stack start after SP+LR (2 register slots). */
+ if (SV_PROC_FLAG(p, SV_ILP32)) {
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
+ value = dtrace_fuword32((void *)(rp->fixreg[1] + 8 +
+ ((argno - 8) * sizeof(uint32_t))));
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR);
+ } else {
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
+ value = dtrace_fuword64((void *)(rp->fixreg[1] + 16 +
+ ((argno - 8) * sizeof(uint32_t))));
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR);
+ }
+ return value;
+}
+
+uint64_t
+fasttrap_pid_getarg(void *arg, dtrace_id_t id, void *parg, int argno,
+ int aframes)
+{
+ struct reg r;
+
+ fill_regs(curthread, &r);
+
+ return (fasttrap_anarg(&r, argno));
+}
+
+uint64_t
+fasttrap_usdt_getarg(void *arg, dtrace_id_t id, void *parg, int argno,
+ int aframes)
+{
+ struct reg r;
+
+ fill_regs(curthread, &r);
+
+ return (fasttrap_anarg(&r, argno));
+}
+
+static void
+fasttrap_usdt_args(fasttrap_probe_t *probe, struct reg *rp, int argc,
+ uintptr_t *argv)
+{
+ int i, x, cap = MIN(argc, probe->ftp_nargs);
+
+ for (i = 0; i < cap; i++) {
+ x = probe->ftp_argmap[i];
+
+ if (x < 8)
+ argv[i] = rp->fixreg[x];
+ else
+ if (SV_PROC_FLAG(curproc, SV_ILP32))
+ argv[i] = fuword32((void *)(rp->fixreg[1] + 8 +
+ (x * sizeof(uint32_t))));
+ else
+ argv[i] = fuword32((void *)(rp->fixreg[1] + 16 +
+ (x * sizeof(uint64_t))));
+ }
+
+ for (; i < argc; i++) {
+ argv[i] = 0;
+ }
+}
+
+static void
+fasttrap_return_common(struct reg *rp, uintptr_t pc, pid_t pid,
+ uintptr_t new_pc)
+{
+ fasttrap_tracepoint_t *tp;
+ fasttrap_bucket_t *bucket;
+ fasttrap_id_t *id;
+
+ bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)];
+
+ for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) {
+ if (pid == tp->ftt_pid && pc == tp->ftt_pc &&
+ tp->ftt_proc->ftpc_acount != 0)
+ break;
+ }
+
+ /*
+ * Don't sweat it if we can't find the tracepoint again; unlike
+ * when we're in fasttrap_pid_probe(), finding the tracepoint here
+ * is not essential to the correct execution of the process.
+ */
+ if (tp == NULL) {
+ return;
+ }
+
+ for (id = tp->ftt_retids; id != NULL; id = id->fti_next) {
+ /*
+ * If there's a branch that could act as a return site, we
+ * need to trace it, and check here if the program counter is
+ * external to the function.
+ */
+ /* Skip function-local branches. */
+ if ((new_pc - id->fti_probe->ftp_faddr) < id->fti_probe->ftp_fsize)
+ continue;
+
+ dtrace_probe(id->fti_probe->ftp_id,
+ pc - id->fti_probe->ftp_faddr,
+ rp->fixreg[3], rp->fixreg[4], 0, 0);
+ }
+}
+
+
+static int
+fasttrap_branch_taken(int bo, int bi, struct reg *regs)
+{
+ int crzero = 0;
+
+ /* Branch always? */
+ if ((bo & 0x14) == 0x14)
+ return 1;
+
+ /* Handle decrementing ctr */
+ if (!(bo & 0x04)) {
+ --regs->ctr;
+ crzero = (regs->ctr == 0);
+ if (bo & 0x10) {
+ return (!(crzero ^ (bo >> 1)));
+ }
+ }
+
+ return (crzero | (((regs->cr >> (31 - bi)) ^ (bo >> 3)) ^ 1));
+}
+
+
+int
+fasttrap_pid_probe(struct reg *rp)
+{
+ proc_t *p = curproc;
+ uintptr_t pc = rp->pc;
+ uintptr_t new_pc = 0;
+ fasttrap_bucket_t *bucket;
+ fasttrap_tracepoint_t *tp, tp_local;
+ pid_t pid;
+ dtrace_icookie_t cookie;
+ uint_t is_enabled = 0;
+
+ /*
+ * It's possible that a user (in a veritable orgy of bad planning)
+ * could redirect this thread's flow of control before it reached the
+ * return probe fasttrap. In this case we need to kill the process
+ * since it's in a unrecoverable state.
+ */
+ if (curthread->t_dtrace_step) {
+ ASSERT(curthread->t_dtrace_on);
+ fasttrap_sigtrap(p, curthread, pc);
+ return (0);
+ }
+
+ /*
+ * Clear all user tracing flags.
+ */
+ curthread->t_dtrace_ft = 0;
+ curthread->t_dtrace_pc = 0;
+ curthread->t_dtrace_npc = 0;
+ curthread->t_dtrace_scrpc = 0;
+ curthread->t_dtrace_astpc = 0;
+
+
+ PROC_LOCK(p);
+ pid = p->p_pid;
+ bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)];
+
+ /*
+ * Lookup the tracepoint that the process just hit.
+ */
+ for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) {
+ if (pid == tp->ftt_pid && pc == tp->ftt_pc &&
+ tp->ftt_proc->ftpc_acount != 0)
+ break;
+ }
+
+ /*
+ * If we couldn't find a matching tracepoint, either a tracepoint has
+ * been inserted without using the pid ioctl interface (see
+ * fasttrap_ioctl), or somehow we have mislaid this tracepoint.
+ */
+ if (tp == NULL) {
+ PROC_UNLOCK(p);
+ return (-1);
+ }
+
+ if (tp->ftt_ids != NULL) {
+ fasttrap_id_t *id;
+
+ for (id = tp->ftt_ids; id != NULL; id = id->fti_next) {
+ fasttrap_probe_t *probe = id->fti_probe;
+
+ if (id->fti_ptype == DTFTP_ENTRY) {
+ /*
+ * We note that this was an entry
+ * probe to help ustack() find the
+ * first caller.
+ */
+ cookie = dtrace_interrupt_disable();
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_ENTRY);
+ dtrace_probe(probe->ftp_id, rp->fixreg[3],
+ rp->fixreg[4], rp->fixreg[5], rp->fixreg[6],
+ rp->fixreg[7]);
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_ENTRY);
+ dtrace_interrupt_enable(cookie);
+ } else if (id->fti_ptype == DTFTP_IS_ENABLED) {
+ /*
+ * Note that in this case, we don't
+ * call dtrace_probe() since it's only
+ * an artificial probe meant to change
+ * the flow of control so that it
+ * encounters the true probe.
+ */
+ is_enabled = 1;
+ } else if (probe->ftp_argmap == NULL) {
+ dtrace_probe(probe->ftp_id, rp->fixreg[3],
+ rp->fixreg[4], rp->fixreg[5], rp->fixreg[6],
+ rp->fixreg[7]);
+ } else {
+ uintptr_t t[5];
+
+ fasttrap_usdt_args(probe, rp,
+ sizeof (t) / sizeof (t[0]), t);
+
+ dtrace_probe(probe->ftp_id, t[0], t[1],
+ t[2], t[3], t[4]);
+ }
+ }
+ }
+
+ /*
+ * We're about to do a bunch of work so we cache a local copy of
+ * the tracepoint to emulate the instruction, and then find the
+ * tracepoint again later if we need to light up any return probes.
+ */
+ tp_local = *tp;
+ PROC_UNLOCK(p);
+ tp = &tp_local;
+
+ /*
+ * If there's an is-enabled probe connected to this tracepoint it
+ * means that there was a 'xor r3, r3, r3'
+ * instruction that was placed there by DTrace when the binary was
+ * linked. As this probe is, in fact, enabled, we need to stuff 1
+ * into R3. Accordingly, we can bypass all the instruction
+ * emulation logic since we know the inevitable result. It's possible
+ * that a user could construct a scenario where the 'is-enabled'
+ * probe was on some other instruction, but that would be a rather
+ * exotic way to shoot oneself in the foot.
+ */
+ if (is_enabled) {
+ rp->fixreg[3] = 1;
+ new_pc = rp->pc + 4;
+ goto done;
+ }
+
+
+ switch (tp->ftt_type) {
+ case FASTTRAP_T_NOP:
+ new_pc = rp->pc + 4;
+ break;
+ case FASTTRAP_T_BC:
+ if (!fasttrap_branch_taken(tp->ftt_bo, tp->ftt_bi, rp))
+ break;
+ /* FALLTHROUGH */
+ case FASTTRAP_T_B:
+ if (tp->ftt_instr & 0x01)
+ rp->lr = rp->pc + 4;
+ new_pc = tp->ftt_dest;
+ break;
+ case FASTTRAP_T_BLR:
+ case FASTTRAP_T_BCTR:
+ if (!fasttrap_branch_taken(tp->ftt_bo, tp->ftt_bi, rp))
+ break;
+ /* FALLTHROUGH */
+ if (tp->ftt_type == FASTTRAP_T_BCTR)
+ new_pc = rp->ctr;
+ else
+ new_pc = rp->lr;
+ if (tp->ftt_instr & 0x01)
+ rp->lr = rp->pc + 4;
+ break;
+ case FASTTRAP_T_COMMON:
+ break;
+ };
+done:
+ /*
+ * If there were no return probes when we first found the tracepoint,
+ * we should feel no obligation to honor any return probes that were
+ * subsequently enabled -- they'll just have to wait until the next
+ * time around.
+ */
+ if (tp->ftt_retids != NULL) {
+ /*
+ * We need to wait until the results of the instruction are
+ * apparent before invoking any return probes. If this
+ * instruction was emulated we can just call
+ * fasttrap_return_common(); if it needs to be executed, we
+ * need to wait until the user thread returns to the kernel.
+ */
+ if (tp->ftt_type != FASTTRAP_T_COMMON) {
+ fasttrap_return_common(rp, pc, pid, new_pc);
+ } else {
+ ASSERT(curthread->t_dtrace_ret != 0);
+ ASSERT(curthread->t_dtrace_pc == pc);
+ ASSERT(curthread->t_dtrace_scrpc != 0);
+ ASSERT(new_pc == curthread->t_dtrace_astpc);
+ }
+ }
+
+ rp->pc = new_pc;
+ set_regs(curthread, rp);
+
+ return (0);
+}
+
+int
+fasttrap_return_probe(struct reg *rp)
+{
+ proc_t *p = curproc;
+ uintptr_t pc = curthread->t_dtrace_pc;
+ uintptr_t npc = curthread->t_dtrace_npc;
+
+ curthread->t_dtrace_pc = 0;
+ curthread->t_dtrace_npc = 0;
+ curthread->t_dtrace_scrpc = 0;
+ curthread->t_dtrace_astpc = 0;
+
+ /*
+ * We set rp->pc to the address of the traced instruction so
+ * that it appears to dtrace_probe() that we're on the original
+ * instruction, and so that the user can't easily detect our
+ * complex web of lies. dtrace_return_probe() (our caller)
+ * will correctly set %pc after we return.
+ */
+ rp->pc = pc;
+
+ fasttrap_return_common(rp, pc, p->p_pid, npc);
+
+ return (0);
+}
-/*
- * XXX: Placeholder for PowerPC fasttrap code
- */
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/powerpc/sys/fasttrap_isa.h Wed Jan 15 05:19:37 2014 (r260670)
@@ -19,6 +19,7 @@
*
* CDDL HEADER END
*/
+/* Portions Copyright 2013 Justin Hibbits */
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
@@ -34,13 +35,39 @@
#ifdef __cplusplus
extern "C" {
#endif
-/*
- * XXXDTRACE: placehodler for PowerPC fasttrap stuff
- */
-typedef uint32_t fasttrap_instr_t;
#define FASTTRAP_SUNWDTRACE_SIZE 64
-#define FASTTRAP_INSTR 0x0FFFDDDD
+#define FASTTRAP_INSTR 0x0FFFDDDD
+
+typedef uint32_t fasttrap_instr_t;
+
+typedef struct fasttrap_machtp_t {
+ fasttrap_instr_t ftmt_instr; /* original instruction */
+ uintptr_t ftmt_dest; /* branch target */
+ uint8_t ftmt_type; /* emulation type */
+ uint8_t ftmt_flags; /* emulation flags */
+ uint8_t ftmt_bo; /* BO field */
+ uint8_t ftmt_bi; /* BI field (CR bit) */
+} fasttrap_machtp_t;
+
+#define ftt_instr ftt_mtp.ftmt_instr
+#define ftt_dest ftt_mtp.ftmt_dest
+#define ftt_type ftt_mtp.ftmt_type
+#define ftt_flags ftt_mtp.ftmt_flags
+#define ftt_bo ftt_mtp.ftmt_bo
+#define ftt_bi ftt_mtp.ftmt_bi
+
+#define FASTTRAP_T_COMMON 0x00
+#define FASTTRAP_T_B 0x01
+#define FASTTRAP_T_BC 0x02
+#define FASTTRAP_T_BLR 0x03
+#define FASTTRAP_T_BCTR 0x04
+#define FASTTRAP_T_NOP 0x05
+
+#define FASTTRAP_AFRAMES 3
+#define FASTTRAP_RETURN_AFRAMES 4
+#define FASTTRAP_ENTRY_AFRAMES 3
+#define FASTTRAP_OFFSET_AFRAMES 3
#ifdef __cplusplus
}
Modified: stable/10/sys/cddl/dev/fbt/fbt_powerpc.c
==============================================================================
--- stable/10/sys/cddl/dev/fbt/fbt_powerpc.c Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/sys/cddl/dev/fbt/fbt_powerpc.c Wed Jan 15 05:19:37 2014 (r260670)
@@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_
return (0);
instr = (u_int32_t *) symval->value;
- limit = (u_int32_t *) symval->value + symval->size;
+ limit = (u_int32_t *) (symval->value + symval->size);
for (; instr < limit; instr++)
if (*instr == FBT_MFLR_R0)
@@ -278,7 +278,7 @@ again:
instr++;
for (j = 0; j < 12 && instr < limit; j++, instr++) {
- if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) |
+ if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) ||
FBT_IS_JUMP(*instr))
break;
}
Modified: stable/10/sys/modules/dtrace/Makefile
==============================================================================
--- stable/10/sys/modules/dtrace/Makefile Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/sys/modules/dtrace/Makefile Wed Jan 15 05:19:37 2014 (r260670)
@@ -20,7 +20,7 @@ SUBDIR= dtmalloc \
SUBDIR+= fasttrap fbt systrace_linux32
.endif
.if ${MACHINE_CPUARCH} == "powerpc"
-SUBDIR+= fbt
+SUBDIR+= fbt fasttrap
.endif
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
SUBDIR+= systrace_freebsd32
Modified: stable/10/sys/modules/dtrace/fasttrap/Makefile
==============================================================================
--- stable/10/sys/modules/dtrace/fasttrap/Makefile Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/sys/modules/dtrace/fasttrap/Makefile Wed Jan 15 05:19:37 2014 (r260670)
@@ -13,6 +13,9 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel/dtrace
+.elif ${MACHINE_CPUARCH} == "powerpc"
+CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc/dtrace
.endif
CFLAGS+= -DSMP
Modified: stable/10/sys/powerpc/aim/trap.c
==============================================================================
--- stable/10/sys/powerpc/aim/trap.c Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/sys/powerpc/aim/trap.c Wed Jan 15 05:19:37 2014 (r260670)
@@ -175,6 +175,9 @@ trap(struct trapframe *frame)
{
struct thread *td;
struct proc *p;
+#ifdef KDTRACE_HOOKS
+ uint32_t inst;
+#endif
int sig, type, user;
u_int ucode;
ksiginfo_t ksi;
@@ -279,9 +282,18 @@ trap(struct trapframe *frame)
case EXC_PGM:
/* Identify the trap reason */
- if (frame->srr1 & EXC_PGM_TRAP)
+ if (frame->srr1 & EXC_PGM_TRAP) {
+#ifdef KDTRACE_HOOKS
+ inst = fuword32((const void *)frame->srr0);
+ if (inst == 0x0FFFDDDD && dtrace_pid_probe_ptr != NULL) {
+ struct reg regs;
+ fill_regs(td, ®s);
+ (*dtrace_pid_probe_ptr)(®s);
+ break;
+ }
+#endif
sig = SIGTRAP;
- else if (ppc_instr_emulate(frame) == 0)
+ } else if (ppc_instr_emulate(frame) == 0)
frame->srr0 += 4;
else
sig = SIGILL;
@@ -299,7 +311,7 @@ trap(struct trapframe *frame)
#ifdef KDTRACE_HOOKS
case EXC_PGM:
if (frame->srr1 & EXC_PGM_TRAP) {
- if (*(uintptr_t *)frame->srr0 == 0x7c810808) {
+ if (*(uint32_t *)frame->srr0 == 0x7c810808) {
if (dtrace_invop_jump_addr != NULL) {
dtrace_invop_jump_addr(frame);
return;
Modified: stable/10/sys/powerpc/aim/trap_subr32.S
==============================================================================
--- stable/10/sys/powerpc/aim/trap_subr32.S Wed Jan 15 04:44:52 2014 (r260669)
+++ stable/10/sys/powerpc/aim/trap_subr32.S Wed Jan 15 05:19:37 2014 (r260670)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 05:30:06 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id C40B2527;
Wed, 15 Jan 2014 05:30:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id AFE5A185F;
Wed, 15 Jan 2014 05:30:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F5U6ov062260;
Wed, 15 Jan 2014 05:30:06 GMT
(envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F5U6Xr062256;
Wed, 15 Jan 2014 05:30:06 GMT
(envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201401150530.s0F5U6Xr062256@svn.freebsd.org>
From: Justin Hibbits
Date: Wed, 15 Jan 2014 05:30:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260671 - in stable/10/cddl/contrib/opensolaris/cmd:
plockstat zfs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 05:30:06 -0000
Author: jhibbits
Date: Wed Jan 15 05:30:05 2014
New Revision: 260671
URL: http://svnweb.freebsd.org/changeset/base/260671
Log:
MFC r258362
Use 'int' to store the return value of getopt(), rather than char.
On some architectures (powerpc), char is unsigned by default, which means
comparisons against -1 always fail, so the programs get stuck in an
infinite loop.
Modified:
stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Jan 15 05:19:37 2014 (r260670)
+++ stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Jan 15 05:30:05 2014 (r260671)
@@ -778,7 +778,8 @@ main(int argc, char **argv)
#endif
int err;
int opt_C = 0, opt_H = 0, opt_p = 0, opt_v = 0;
- char c, *p, *end;
+ int c;
+ char *p, *end;
struct sigaction act;
int done = 0;
Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Jan 15 05:19:37 2014 (r260670)
+++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Jan 15 05:30:05 2014 (r260671)
@@ -2011,7 +2011,7 @@ zfs_do_upgrade(int argc, char **argv)
boolean_t showversions = B_FALSE;
int ret = 0;
upgrade_cbdata_t cb = { 0 };
- char c;
+ int c;
int flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
/* check options */
@@ -3560,7 +3560,7 @@ static int
zfs_do_snapshot(int argc, char **argv)
{
int ret = 0;
- char c;
+ int c;
nvlist_t *props;
snap_cbdata_t sd = { 0 };
boolean_t multiple_snaps = B_FALSE;
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 05:41:28 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id C732EA72;
Wed, 15 Jan 2014 05:41:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id B3875197A;
Wed, 15 Jan 2014 05:41:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F5fSqF068437;
Wed, 15 Jan 2014 05:41:28 GMT
(envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F5fSPq068436;
Wed, 15 Jan 2014 05:41:28 GMT
(envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201401150541.s0F5fSPq068436@svn.freebsd.org>
From: Justin Hibbits
Date: Wed, 15 Jan 2014 05:41:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260672 - stable/10/sys/powerpc/aim
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 05:41:29 -0000
Author: jhibbits
Date: Wed Jan 15 05:41:28 2014
New Revision: 260672
URL: http://svnweb.freebsd.org/changeset/base/260672
Log:
MFC r257941,r258119
Add the necessary bits for dumps on ppc64.
Modified:
stable/10/sys/powerpc/aim/mmu_oea64.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- stable/10/sys/powerpc/aim/mmu_oea64.c Wed Jan 15 05:30:05 2014 (r260671)
+++ stable/10/sys/powerpc/aim/mmu_oea64.c Wed Jan 15 05:41:28 2014 (r260672)
@@ -192,6 +192,11 @@ struct ofw_map {
cell_t om_mode;
};
+extern unsigned char _etext[];
+extern unsigned char _end[];
+
+extern int dumpsys_minidump;
+
/*
* Map of physical memory regions.
*/
@@ -329,6 +334,9 @@ void moea64_kenter_attr(mmu_t, vm_offset
void moea64_kenter(mmu_t, vm_offset_t, vm_paddr_t);
boolean_t moea64_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t);
+vm_offset_t moea64_dumpsys_map(mmu_t mmu, struct pmap_md *md, vm_size_t ofs,
+ vm_size_t *sz);
+struct pmap_md * moea64_scan_md(mmu_t mmu, struct pmap_md *prev);
static mmu_method_t moea64_methods[] = {
MMUMETHOD(mmu_change_wiring, moea64_change_wiring),
@@ -374,6 +382,8 @@ static mmu_method_t moea64_methods[] = {
MMUMETHOD(mmu_kenter, moea64_kenter),
MMUMETHOD(mmu_kenter_attr, moea64_kenter_attr),
MMUMETHOD(mmu_dev_direct_mapped,moea64_dev_direct_mapped),
+ MMUMETHOD(mmu_scan_md, moea64_scan_md),
+ MMUMETHOD(mmu_dumpsys_map, moea64_dumpsys_map),
{ 0, 0 }
};
@@ -2584,3 +2594,98 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm,
}
PMAP_UNLOCK(pm);
}
+
+vm_offset_t
+moea64_dumpsys_map(mmu_t mmu, struct pmap_md *md, vm_size_t ofs,
+ vm_size_t *sz)
+{
+ if (md->md_vaddr == ~0UL)
+ return (md->md_paddr + ofs);
+ else
+ return (md->md_vaddr + ofs);
+}
+
+struct pmap_md *
+moea64_scan_md(mmu_t mmu, struct pmap_md *prev)
+{
+ static struct pmap_md md;
+ struct pvo_entry *pvo;
+ vm_offset_t va;
+
+ if (dumpsys_minidump) {
+ md.md_paddr = ~0UL; /* Minidumps use virtual addresses. */
+ if (prev == NULL) {
+ /* 1st: kernel .data and .bss. */
+ md.md_index = 1;
+ md.md_vaddr = trunc_page((uintptr_t)_etext);
+ md.md_size = round_page((uintptr_t)_end) - md.md_vaddr;
+ return (&md);
+ }
+ switch (prev->md_index) {
+ case 1:
+ /* 2nd: msgbuf and tables (see pmap_bootstrap()). */
+ md.md_index = 2;
+ md.md_vaddr = (vm_offset_t)msgbufp->msg_ptr;
+ md.md_size = round_page(msgbufp->msg_size);
+ break;
+ case 2:
+ /* 3rd: kernel VM. */
+ va = prev->md_vaddr + prev->md_size;
+ /* Find start of next chunk (from va). */
+ while (va < virtual_end) {
+ /* Don't dump the buffer cache. */
+ if (va >= kmi.buffer_sva &&
+ va < kmi.buffer_eva) {
+ va = kmi.buffer_eva;
+ continue;
+ }
+ pvo = moea64_pvo_find_va(kernel_pmap,
+ va & ~ADDR_POFF);
+ if (pvo != NULL &&
+ (pvo->pvo_pte.lpte.pte_hi & LPTE_VALID))
+ break;
+ va += PAGE_SIZE;
+ }
+ if (va < virtual_end) {
+ md.md_vaddr = va;
+ va += PAGE_SIZE;
+ /* Find last page in chunk. */
+ while (va < virtual_end) {
+ /* Don't run into the buffer cache. */
+ if (va == kmi.buffer_sva)
+ break;
+ pvo = moea64_pvo_find_va(kernel_pmap,
+ va & ~ADDR_POFF);
+ if (pvo == NULL ||
+ !(pvo->pvo_pte.lpte.pte_hi & LPTE_VALID))
+ break;
+ va += PAGE_SIZE;
+ }
+ md.md_size = va - md.md_vaddr;
+ break;
+ }
+ md.md_index = 3;
+ /* FALLTHROUGH */
+ default:
+ return (NULL);
+ }
+ } else { /* minidumps */
+ if (prev == NULL) {
+ /* first physical chunk. */
+ md.md_paddr = pregions[0].mr_start;
+ md.md_size = pregions[0].mr_size;
+ md.md_vaddr = ~0UL;
+ md.md_index = 1;
+ } else if (md.md_index < pregions_sz) {
+ md.md_paddr = pregions[md.md_index].mr_start;
+ md.md_size = pregions[md.md_index].mr_size;
+ md.md_vaddr = ~0UL;
+ md.md_index++;
+ } else {
+ /* There's no next physical chunk. */
+ return (NULL);
+ }
+ }
+
+ return (&md);
+}
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 05:52:07 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 345CBEE2;
Wed, 15 Jan 2014 05:52:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 1FF2F1A30;
Wed, 15 Jan 2014 05:52:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F5q66n072549;
Wed, 15 Jan 2014 05:52:06 GMT
(envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F5q64j072546;
Wed, 15 Jan 2014 05:52:06 GMT
(envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201401150552.s0F5q64j072546@svn.freebsd.org>
From: Justin Hibbits
Date: Wed, 15 Jan 2014 05:52:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260673 - in stable/10/sys: dev/iicbus powerpc/powermac
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 05:52:07 -0000
Author: jhibbits
Date: Wed Jan 15 05:52:06 2014
New Revision: 260673
URL: http://svnweb.freebsd.org/changeset/base/260673
Log:
MFC r259082
Make some unsigned ints signed.
Found by: clang (powerpc64)
Modified:
stable/10/sys/dev/iicbus/ds1631.c
stable/10/sys/dev/iicbus/ds1775.c
stable/10/sys/powerpc/powermac/platform_powermac.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/iicbus/ds1631.c
==============================================================================
--- stable/10/sys/dev/iicbus/ds1631.c Wed Jan 15 05:41:28 2014 (r260672)
+++ stable/10/sys/dev/iicbus/ds1631.c Wed Jan 15 05:52:06 2014 (r260673)
@@ -398,7 +398,7 @@ ds1631_sensor_sysctl(SYSCTL_HANDLER_ARGS
device_t dev;
struct ds1631_softc *sc;
int error;
- unsigned int temp;
+ int temp;
dev = arg1;
sc = device_get_softc(dev);
Modified: stable/10/sys/dev/iicbus/ds1775.c
==============================================================================
--- stable/10/sys/dev/iicbus/ds1775.c Wed Jan 15 05:41:28 2014 (r260672)
+++ stable/10/sys/dev/iicbus/ds1775.c Wed Jan 15 05:52:06 2014 (r260673)
@@ -257,7 +257,7 @@ ds1775_sensor_sysctl(SYSCTL_HANDLER_ARGS
device_t dev;
struct ds1775_softc *sc;
int error;
- unsigned int temp;
+ int temp;
dev = arg1;
sc = device_get_softc(dev);
Modified: stable/10/sys/powerpc/powermac/platform_powermac.c
==============================================================================
--- stable/10/sys/powerpc/powermac/platform_powermac.c Wed Jan 15 05:41:28 2014 (r260672)
+++ stable/10/sys/powerpc/powermac/platform_powermac.c Wed Jan 15 05:52:06 2014 (r260673)
@@ -169,7 +169,8 @@ powermac_timebase_freq(platform_t plat,
static int
powermac_smp_fill_cpuref(struct cpuref *cpuref, phandle_t cpu)
{
- cell_t cpuid, res;
+ cell_t cpuid;
+ int res;
cpuref->cr_hwref = cpu;
res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid));
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 06:17:18 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id B286D806;
Wed, 15 Jan 2014 06:17:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 9C5641D17;
Wed, 15 Jan 2014 06:17:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F6HIjW081141;
Wed, 15 Jan 2014 06:17:18 GMT
(envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F6HFsI081122;
Wed, 15 Jan 2014 06:17:15 GMT
(envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201401150617.s0F6HFsI081122@svn.freebsd.org>
From: Justin Hibbits
Date: Wed, 15 Jan 2014 06:17:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260674 - in stable/10/sys: conf powerpc/aim
powerpc/cpufreq powerpc/include powerpc/powermac powerpc/powerpc
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 06:17:18 -0000
Author: jhibbits
Date: Wed Jan 15 06:17:15 2014
New Revision: 260674
URL: http://svnweb.freebsd.org/changeset/base/260674
Log:
MFC r259284,r259287
Add PMU-based CPU frequency scalling. This is used on most Titanium
PowerBooks.
Added:
stable/10/sys/powerpc/cpufreq/pmufreq.c
- copied, changed from r259284, head/sys/powerpc/cpufreq/pmufreq.c
Modified:
stable/10/sys/conf/files.powerpc
stable/10/sys/powerpc/aim/mp_cpudep.c
stable/10/sys/powerpc/include/cpu.h
stable/10/sys/powerpc/include/dbdma.h
stable/10/sys/powerpc/include/pcpu.h
stable/10/sys/powerpc/include/spr.h
stable/10/sys/powerpc/powermac/platform_powermac.c
stable/10/sys/powerpc/powermac/pmu.c
stable/10/sys/powerpc/powermac/pmuvar.h
stable/10/sys/powerpc/powermac/uninorth.c
stable/10/sys/powerpc/powermac/uninorthvar.h
stable/10/sys/powerpc/powermac/viareg.h
stable/10/sys/powerpc/powerpc/mp_machdep.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/conf/files.powerpc
==============================================================================
--- stable/10/sys/conf/files.powerpc Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/conf/files.powerpc Wed Jan 15 06:17:15 2014 (r260674)
@@ -116,6 +116,7 @@ powerpc/booke/trap.c optional booke
powerpc/booke/vm_machdep.c optional booke
powerpc/cpufreq/dfs.c optional cpufreq
powerpc/cpufreq/pcr.c optional cpufreq aim
+powerpc/cpufreq/pmufreq.c optional cpufreq aim pmu
powerpc/fpu/fpu_add.c optional fpu_emu powerpc
powerpc/fpu/fpu_compare.c optional fpu_emu powerpc
powerpc/fpu/fpu_div.c optional fpu_emu powerpc
Modified: stable/10/sys/powerpc/aim/mp_cpudep.c
==============================================================================
--- stable/10/sys/powerpc/aim/mp_cpudep.c Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/aim/mp_cpudep.c Wed Jan 15 06:17:15 2014 (r260674)
@@ -322,17 +322,13 @@ cpudep_ap_setup()
mtspr(SPR_CELL_TSRL, bsp_state[5]);
break;
- case MPC7450:
- case MPC7455:
- case MPC7457:
- /* Only MPC745x CPUs have an L3 cache. */
- reg = mpc745x_l3_enable(bsp_state[3]);
-
- /* Fallthrough */
case MPC7400:
case MPC7410:
case MPC7447A:
case MPC7448:
+ case MPC7450:
+ case MPC7455:
+ case MPC7457:
/* XXX: Program the CPU ID into PIR */
__asm __volatile("mtspr 1023,%0" :: "r"(PCPU_GET(cpuid)));
@@ -342,6 +338,17 @@ cpudep_ap_setup()
mtspr(SPR_HID0, bsp_state[0]); isync();
mtspr(SPR_HID1, bsp_state[1]); isync();
+ /* Now enable the L3 cache. */
+ switch (vers) {
+ case MPC7450:
+ case MPC7455:
+ case MPC7457:
+ /* Only MPC745x CPUs have an L3 cache. */
+ reg = mpc745x_l3_enable(bsp_state[3]);
+ default:
+ break;
+ }
+
reg = mpc74xx_l2_enable(bsp_state[2]);
reg = mpc74xx_l1d_enable();
reg = mpc74xx_l1i_enable();
Copied and modified: stable/10/sys/powerpc/cpufreq/pmufreq.c (from r259284, head/sys/powerpc/cpufreq/pmufreq.c)
==============================================================================
--- head/sys/powerpc/cpufreq/pmufreq.c Fri Dec 13 02:37:35 2013 (r259284, copy source)
+++ stable/10/sys/powerpc/cpufreq/pmufreq.c Wed Jan 15 06:17:15 2014 (r260674)
@@ -106,9 +106,9 @@ pmufreq_identify(driver_t *driver, devic
static int
pmufreq_probe(device_t dev)
{
- uint32_t min_freq;
struct pmufreq_softc *sc;
phandle_t node;
+ uint32_t min_freq;
if (resource_disabled("pmufreq", 0))
return (ENXIO);
@@ -174,8 +174,7 @@ static int
pmufreq_set(device_t dev, const struct cf_setting *set)
{
struct pmufreq_softc *sc;
- int speed_sel;
- int error;
+ int error, speed_sel;
if (set == NULL)
return (EINVAL);
@@ -191,7 +190,7 @@ pmufreq_set(device_t dev, const struct c
if (error == 0)
sc->curfreq = set->freq;
- return error;
+ return (error);
}
static int
Modified: stable/10/sys/powerpc/include/cpu.h
==============================================================================
--- stable/10/sys/powerpc/include/cpu.h Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/include/cpu.h Wed Jan 15 06:17:15 2014 (r260674)
@@ -98,4 +98,6 @@ void cpu_reset(void);
void fork_trampoline(void);
void swi_vm(void *);
+void flush_disable_caches(void);
+
#endif /* _MACHINE_CPU_H_ */
Modified: stable/10/sys/powerpc/include/dbdma.h
==============================================================================
--- stable/10/sys/powerpc/include/dbdma.h Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/include/dbdma.h Wed Jan 15 06:17:15 2014 (r260674)
@@ -147,4 +147,7 @@ void dbdma_insert_branch(dbdma_channel_t
void dbdma_sync_commands(dbdma_channel_t *chan, bus_dmasync_op_t op);
+void dbdma_save_state(dbdma_channel_t *chan);
+void dbdma_restore_state(dbdma_channel_t *chan);
+
#endif /* _MACHINE_DBDMA_H_ */
Modified: stable/10/sys/powerpc/include/pcpu.h
==============================================================================
--- stable/10/sys/powerpc/include/pcpu.h Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/include/pcpu.h Wed Jan 15 06:17:15 2014 (r260674)
@@ -49,7 +49,8 @@ struct pmap;
uint32_t pc_ipimask; \
register_t pc_tempsave[CPUSAVE_LEN]; \
register_t pc_disisave[CPUSAVE_LEN]; \
- register_t pc_dbsave[CPUSAVE_LEN];
+ register_t pc_dbsave[CPUSAVE_LEN]; \
+ void *pc_restore;
#define PCPU_MD_AIM32_FIELDS \
/* char __pad[0] */
Modified: stable/10/sys/powerpc/include/spr.h
==============================================================================
--- stable/10/sys/powerpc/include/spr.h Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/include/spr.h Wed Jan 15 06:17:15 2014 (r260674)
@@ -519,6 +519,8 @@
#define MSSCR0_EMODE 0x00200000 /* 10: MPX bus mode (read-only) */
#define MSSCR0_ABD 0x00100000 /* 11: address bus driven (read-only) */
#define MSSCR0_MBZ 0x000fffff /* 12-31: must be zero */
+#define MSSCR0_L2PFE 0x00000003 /* 30-31: L2 prefetch enable */
+#define SPR_LDSTCR 0x3f8 /* .6. Load/Store Control Register */
#define SPR_L2PM 0x3f8 /* .6. L2 Private Memory Control Register */
#define SPR_L2CR 0x3f9 /* .6. L2 Control Register */
#define L2CR_L2E 0x80000000 /* 0: L2 enable */
@@ -543,12 +545,14 @@
Setting this bit disables instruction
caching. */
#define L2CR_L2I 0x00200000 /* 10: L2 global invalidate. */
+#define L2CR_L2IO_7450 0x00010000 /* 11: L2 instruction-only (MPC745x). */
#define L2CR_L2CTL 0x00100000 /* 11: L2 RAM control (ZZ enable).
Enables automatic operation of the
L2ZZ (low-power mode) signal. */
#define L2CR_L2WT 0x00080000 /* 12: L2 write-through. */
#define L2CR_L2TS 0x00040000 /* 13: L2 test support. */
#define L2CR_L2OH 0x00030000 /* 14-15: L2 output hold. */
+#define L2CR_L2DO_7450 0x00010000 /* 15: L2 data-only (MPC745x). */
#define L2CR_L2SL 0x00008000 /* 16: L2 DLL slow. */
#define L2CR_L2DF 0x00004000 /* 17: L2 differential clock. */
#define L2CR_L2BYP 0x00002000 /* 18: L2 DLL bypass. */
Modified: stable/10/sys/powerpc/powermac/platform_powermac.c
==============================================================================
--- stable/10/sys/powerpc/powermac/platform_powermac.c Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/powermac/platform_powermac.c Wed Jan 15 06:17:15 2014 (r260674)
@@ -326,6 +326,110 @@ powermac_smp_start_cpu(platform_t plat,
#endif
}
+/* From p3-53 of the MPC7450 RISC Microprocessor Family Reference Manual */
+void
+flush_disable_caches(void)
+{
+ register_t msr;
+ register_t msscr0;
+ register_t cache_reg;
+ volatile uint32_t *memp;
+ uint32_t temp;
+ int i;
+ int x;
+
+ msr = mfmsr();
+ powerpc_sync();
+ mtmsr(msr & ~(PSL_EE | PSL_DR));
+ msscr0 = mfspr(SPR_MSSCR0);
+ msscr0 &= ~MSSCR0_L2PFE;
+ mtspr(SPR_MSSCR0, msscr0);
+ powerpc_sync();
+ isync();
+ __asm__ __volatile__("dssall; sync");
+ powerpc_sync();
+ isync();
+ __asm__ __volatile__("dcbf 0,%0" :: "r"(0));
+ __asm__ __volatile__("dcbf 0,%0" :: "r"(0));
+ __asm__ __volatile__("dcbf 0,%0" :: "r"(0));
+
+ /* Lock the L1 Data cache. */
+ mtspr(SPR_LDSTCR, mfspr(SPR_LDSTCR) | 0xFF);
+ powerpc_sync();
+ isync();
+
+ mtspr(SPR_LDSTCR, 0);
+
+ /*
+ * Perform this in two stages: Flush the cache starting in RAM, then do it
+ * from ROM.
+ */
+ memp = (volatile uint32_t *)0x00000000;
+ for (i = 0; i < 128 * 1024; i++) {
+ temp = *memp;
+ __asm__ __volatile__("dcbf 0,%0" :: "r"(memp));
+ memp += 32/sizeof(*memp);
+ }
+
+ memp = (volatile uint32_t *)0xfff00000;
+ x = 0xfe;
+
+ for (; x != 0xff;) {
+ mtspr(SPR_LDSTCR, x);
+ for (i = 0; i < 128; i++) {
+ temp = *memp;
+ __asm__ __volatile__("dcbf 0,%0" :: "r"(memp));
+ memp += 32/sizeof(*memp);
+ }
+ x = ((x << 1) | 1) & 0xff;
+ }
+ mtspr(SPR_LDSTCR, 0);
+
+ cache_reg = mfspr(SPR_L2CR);
+ if (cache_reg & L2CR_L2E) {
+ cache_reg &= ~(L2CR_L2IO_7450 | L2CR_L2DO_7450);
+ mtspr(SPR_L2CR, cache_reg);
+ powerpc_sync();
+ mtspr(SPR_L2CR, cache_reg | L2CR_L2HWF);
+ while (mfspr(SPR_L2CR) & L2CR_L2HWF)
+ ; /* Busy wait for cache to flush */
+ powerpc_sync();
+ cache_reg &= ~L2CR_L2E;
+ mtspr(SPR_L2CR, cache_reg);
+ powerpc_sync();
+ mtspr(SPR_L2CR, cache_reg | L2CR_L2I);
+ powerpc_sync();
+ while (mfspr(SPR_L2CR) & L2CR_L2I)
+ ; /* Busy wait for L2 cache invalidate */
+ powerpc_sync();
+ }
+
+ cache_reg = mfspr(SPR_L3CR);
+ if (cache_reg & L3CR_L3E) {
+ cache_reg &= ~(L3CR_L3IO | L3CR_L3DO);
+ mtspr(SPR_L3CR, cache_reg);
+ powerpc_sync();
+ mtspr(SPR_L3CR, cache_reg | L3CR_L3HWF);
+ while (mfspr(SPR_L3CR) & L3CR_L3HWF)
+ ; /* Busy wait for cache to flush */
+ powerpc_sync();
+ cache_reg &= ~L3CR_L3E;
+ mtspr(SPR_L3CR, cache_reg);
+ powerpc_sync();
+ mtspr(SPR_L3CR, cache_reg | L3CR_L3I);
+ powerpc_sync();
+ while (mfspr(SPR_L3CR) & L3CR_L3I)
+ ; /* Busy wait for L3 cache invalidate */
+ powerpc_sync();
+ }
+
+ mtspr(SPR_HID0, mfspr(SPR_HID0) & ~HID0_DCE);
+ powerpc_sync();
+ isync();
+
+ mtmsr(msr);
+}
+
static void
powermac_reset(platform_t platform)
{
Modified: stable/10/sys/powerpc/powermac/pmu.c
==============================================================================
--- stable/10/sys/powerpc/powermac/pmu.c Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/powermac/pmu.c Wed Jan 15 06:17:15 2014 (r260674)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
@@ -43,11 +44,18 @@ __FBSDID("$FreeBSD$");
#include
#include
+#include
+#include /* For save_vec() */
#include
+#include
+#include /* For save_fpu() */
+#include
#include
#include
+#include
#include
#include
+#include
#include
#include
@@ -59,6 +67,11 @@ __FBSDID("$FreeBSD$");
#include "clock_if.h"
#include "pmuvar.h"
#include "viareg.h"
+#include "uninorthvar.h" /* For unin_chip_sleep()/unin_chip_wake() */
+
+#define PMU_DEFAULTS PMU_INT_TICK | PMU_INT_ADB | \
+ PMU_INT_PCEJECT | PMU_INT_SNDBRT | \
+ PMU_INT_BATTERY | PMU_INT_ENVIRONMENT
/*
* Bus interface
@@ -93,6 +106,7 @@ static int pmu_acline_state(SYSCTL_HANDL
static int pmu_query_battery(struct pmu_softc *sc, int batt,
struct pmu_battstate *info);
static int pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS);
+static void pmu_sleep_int(void);
/*
* List of battery-related sysctls we might ask for
@@ -115,8 +129,6 @@ static device_method_t pmu_methods[] =
DEVMETHOD(device_attach, pmu_attach),
DEVMETHOD(device_detach, pmu_detach),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
- DEVMETHOD(device_suspend, bus_generic_suspend),
- DEVMETHOD(device_resume, bus_generic_resume),
/* ADB bus interface */
DEVMETHOD(adb_hb_send_raw_packet, pmu_adb_send),
@@ -193,7 +205,7 @@ static signed char pm_send_cmd_type[] =
0x02, -1, -1, -1, -1, -1, -1, -1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -1, -1,
0x01, 0x01, 0x01, -1, -1, -1, -1, -1,
- 0x00, 0x00, -1, -1, -1, -1, 0x04, 0x04,
+ 0x00, 0x00, -1, -1, -1, 0x05, 0x04, 0x04,
0x04, -1, 0x00, -1, -1, -1, -1, -1,
0x00, -1, -1, -1, -1, -1, -1, -1,
0x01, 0x02, -1, -1, -1, -1, -1, -1,
@@ -229,7 +241,7 @@ static signed char pm_receive_cmd_type[]
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x04, 0x03, 0x09, -1, -1, -1, -1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- -1, -1, -1, -1, -1, -1, 0x01, 0x01,
+ -1, -1, -1, -1, -1, 0x01, 0x01, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, -1, -1, -1, -1, -1, -1, -1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -357,12 +369,13 @@ pmu_attach(device_t dev)
/* Init PMU */
- reg = PMU_INT_TICK | PMU_INT_ADB | PMU_INT_PCEJECT | PMU_INT_SNDBRT;
- reg |= PMU_INT_BATTERY;
- reg |= PMU_INT_ENVIRONMENT;
+ pmu_write_reg(sc, vBufB, pmu_read_reg(sc, vBufB) | vPB4);
+ pmu_write_reg(sc, vDirB, (pmu_read_reg(sc, vDirB) | vPB4) & ~vPB3);
+
+ reg = PMU_DEFAULTS;
pmu_send(sc, PMU_SET_IMASK, 1, ®, 16, resp);
- pmu_write_reg(sc, vIER, 0x90); /* make sure VIA interrupts are on */
+ pmu_write_reg(sc, vIER, 0x94); /* make sure VIA interrupts are on */
pmu_send(sc, PMU_SYSTEM_READY, 1, cmd, 16, resp);
pmu_send(sc, PMU_GET_VERSION, 1, cmd, 16, resp);
@@ -1018,3 +1031,95 @@ pmu_settime(device_t dev, struct timespe
return (0);
}
+static register_t sprgs[4];
+static register_t srrs[2];
+extern void *ap_pcpu;
+
+void pmu_sleep_int(void)
+{
+ static u_quad_t timebase = 0;
+ jmp_buf resetjb;
+ struct thread *fputd;
+ struct thread *vectd;
+ register_t hid0;
+ register_t msr;
+ register_t saved_msr;
+
+ ap_pcpu = pcpup;
+
+ PCPU_SET(restore, &resetjb);
+
+ *(unsigned long *)0x80 = 0x100;
+ saved_msr = mfmsr();
+ fputd = PCPU_GET(fputhread);
+ vectd = PCPU_GET(vecthread);
+ if (fputd != NULL)
+ save_fpu(fputd);
+ if (vectd != NULL)
+ save_vec(vectd);
+ if (setjmp(resetjb) == 0) {
+ sprgs[0] = mfspr(SPR_SPRG0);
+ sprgs[1] = mfspr(SPR_SPRG1);
+ sprgs[2] = mfspr(SPR_SPRG2);
+ sprgs[3] = mfspr(SPR_SPRG3);
+ srrs[0] = mfspr(SPR_SRR0);
+ srrs[1] = mfspr(SPR_SRR1);
+ timebase = mftb();
+ powerpc_sync();
+ flush_disable_caches();
+ hid0 = mfspr(SPR_HID0);
+ hid0 = (hid0 & ~(HID0_DOZE | HID0_NAP)) | HID0_SLEEP;
+ powerpc_sync();
+ isync();
+ msr = mfmsr() | PSL_POW;
+ mtspr(SPR_HID0, hid0);
+ powerpc_sync();
+
+ while (1)
+ mtmsr(msr);
+ }
+ mttb(timebase);
+ PCPU_SET(curthread, curthread);
+ PCPU_SET(curpcb, curthread->td_pcb);
+ pmap_activate(curthread);
+ powerpc_sync();
+ mtspr(SPR_SPRG0, sprgs[0]);
+ mtspr(SPR_SPRG1, sprgs[1]);
+ mtspr(SPR_SPRG2, sprgs[2]);
+ mtspr(SPR_SPRG3, sprgs[3]);
+ mtspr(SPR_SRR0, srrs[0]);
+ mtspr(SPR_SRR1, srrs[1]);
+ mtmsr(saved_msr);
+ if (fputd == curthread)
+ enable_fpu(curthread);
+ if (vectd == curthread)
+ enable_vec(curthread);
+ powerpc_sync();
+}
+
+int
+pmu_set_speed(int low_speed)
+{
+ struct pmu_softc *sc;
+ uint8_t sleepcmd[] = {'W', 'O', 'O', 'F', 0};
+ uint8_t resp[16];
+
+ sc = device_get_softc(pmu);
+ pmu_write_reg(sc, vIER, 0x10);
+ spinlock_enter();
+ mtdec(0x7fffffff);
+ mb();
+ mtdec(0x7fffffff);
+
+ sleepcmd[4] = low_speed;
+ pmu_send(sc, PMU_CPU_SPEED, 5, sleepcmd, 16, resp);
+ unin_chip_sleep(NULL, 1);
+ pmu_sleep_int();
+ unin_chip_wake(NULL);
+
+ mtdec(1); /* Force a decrementer exception */
+ spinlock_exit();
+ pmu_write_reg(sc, vIER, 0x90);
+
+ return (0);
+}
Modified: stable/10/sys/powerpc/powermac/pmuvar.h
==============================================================================
--- stable/10/sys/powerpc/powermac/pmuvar.h Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/powermac/pmuvar.h Wed Jan 15 06:17:15 2014 (r260674)
@@ -160,7 +160,8 @@ struct pmu_softc {
volatile int sc_autopoll;
int sc_batteries;
struct cdev *sc_leddev;
- int lid_closed;
+ int lid_closed;
+ uint8_t saved_regs[9];
};
struct pmu_battstate {
@@ -172,4 +173,6 @@ struct pmu_battstate {
int voltage;
};
+int pmu_set_speed(int low_speed);
+
#endif /* PMUVAR_H */
Modified: stable/10/sys/powerpc/powermac/uninorth.c
==============================================================================
--- stable/10/sys/powerpc/powermac/uninorth.c Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/powermac/uninorth.c Wed Jan 15 06:17:15 2014 (r260674)
@@ -136,6 +136,13 @@ static driver_t unin_chip_driver = {
static devclass_t unin_chip_devclass;
+/*
+ * Assume there is only one unin chip in a PowerMac, so that pmu.c functions can
+ * suspend the chip after the whole rest of the device tree is suspended, not
+ * earlier.
+ */
+static device_t unin_chip;
+
DRIVER_MODULE(unin, nexus, unin_chip_driver, unin_chip_devclass, 0, 0);
/*
@@ -210,31 +217,30 @@ unin_chip_add_reg(phandle_t devnode, str
}
static void
-unin_enable_gmac(device_t dev)
+unin_update_reg(device_t dev, uint32_t regoff, uint32_t set, uint32_t clr)
{
- volatile u_int *clkreg;
+ volatile u_int *reg;
struct unin_chip_softc *sc;
u_int32_t tmpl;
sc = device_get_softc(dev);
- clkreg = (void *)(sc->sc_addr + UNIN_CLOCKCNTL);
- tmpl = inl(clkreg);
- tmpl |= UNIN_CLOCKCNTL_GMAC;
- outl(clkreg, tmpl);
+ reg = (void *)(sc->sc_addr + regoff);
+ tmpl = inl(reg);
+ tmpl &= ~clr;
+ tmpl |= set;
+ outl(reg, tmpl);
}
static void
-unin_enable_mpic(device_t dev)
+unin_enable_gmac(device_t dev)
{
- volatile u_int *toggle;
- struct unin_chip_softc *sc;
- u_int32_t tmpl;
+ unin_update_reg(dev, UNIN_CLOCKCNTL, UNIN_CLOCKCNTL_GMAC, 0);
+}
- sc = device_get_softc(dev);
- toggle = (void *)(sc->sc_addr + UNIN_TOGGLE_REG);
- tmpl = inl(toggle);
- tmpl |= UNIN_MPIC_RESET | UNIN_MPIC_OUTPUT_ENABLE;
- outl(toggle, tmpl);
+static void
+unin_enable_mpic(device_t dev)
+{
+ unin_update_reg(dev, UNIN_TOGGLE_REG, UNIN_MPIC_RESET | UNIN_MPIC_OUTPUT_ENABLE, 0);
}
static int
@@ -301,6 +307,9 @@ unin_chip_attach(device_t dev)
return (error);
}
+ if (unin_chip == NULL)
+ unin_chip = dev;
+
/*
* Iterate through the sub-devices
*/
@@ -621,3 +630,33 @@ unin_chip_get_devinfo(device_t dev, devi
return (&dinfo->udi_obdinfo);
}
+int
+unin_chip_wake(device_t dev)
+{
+
+ if (dev == NULL)
+ dev = unin_chip;
+ unin_update_reg(dev, UNIN_PWR_MGMT, UNIN_PWR_NORMAL, UNIN_PWR_MASK);
+ DELAY(10);
+ unin_update_reg(dev, UNIN_HWINIT_STATE, UNIN_RUNNING, 0);
+ DELAY(100);
+
+ return (0);
+}
+
+int
+unin_chip_sleep(device_t dev, int idle)
+{
+ if (dev == NULL)
+ dev = unin_chip;
+
+ unin_update_reg(dev, UNIN_HWINIT_STATE, UNIN_SLEEPING, 0);
+ DELAY(10);
+ if (idle)
+ unin_update_reg(dev, UNIN_PWR_MGMT, UNIN_PWR_IDLE2, UNIN_PWR_MASK);
+ else
+ unin_update_reg(dev, UNIN_PWR_MGMT, UNIN_PWR_SLEEP, UNIN_PWR_MASK);
+ DELAY(10);
+
+ return (0);
+}
Modified: stable/10/sys/powerpc/powermac/uninorthvar.h
==============================================================================
--- stable/10/sys/powerpc/powermac/uninorthvar.h Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/powermac/uninorthvar.h Wed Jan 15 06:17:15 2014 (r260674)
@@ -28,6 +28,8 @@
#ifndef _POWERPC_POWERMAC_UNINORTHVAR_H_
#define _POWERPC_POWERMAC_UNINORTHVAR_H_
+#include
+#include
#include
struct uninorth_softc {
@@ -76,10 +78,30 @@ struct unin_chip_devinfo {
#define UNIN_CLOCKCNTL_GMAC 0x2
/*
+ * Power management register
+ */
+#define UNIN_PWR_MGMT 0x30
+#define UNIN_PWR_NORMAL 0x00
+#define UNIN_PWR_IDLE2 0x01
+#define UNIN_PWR_SLEEP 0x02
+#define UNIN_PWR_SAVE 0x03
+#define UNIN_PWR_MASK 0x03
+
+/*
+ * Hardware initialization state register
+ */
+#define UNIN_HWINIT_STATE 0x70
+#define UNIN_SLEEPING 0x01
+#define UNIN_RUNNING 0x02
+
+
+/*
* Toggle registers
*/
#define UNIN_TOGGLE_REG 0xe0
#define UNIN_MPIC_RESET 0x2
#define UNIN_MPIC_OUTPUT_ENABLE 0x4
+extern int unin_chip_sleep(device_t dev, int idle);
+extern int unin_chip_wake(device_t dev);
#endif /* _POWERPC_POWERMAC_UNINORTHVAR_H_ */
Modified: stable/10/sys/powerpc/powermac/viareg.h
==============================================================================
--- stable/10/sys/powerpc/powermac/viareg.h Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/powermac/viareg.h Wed Jan 15 06:17:15 2014 (r260674)
@@ -30,14 +30,16 @@
/* VIA interface registers */
#define vBufB 0x0000 /* register B */
-#define vBufA 0x0200 /* register A */
#define vDirB 0x0400 /* data direction register */
#define vDirA 0x0600 /* data direction register */
+#define vT1C 0x0800 /* Timer 1 counter Lo */
+#define vT1CH 0x0a00 /* Timer 1 counter Hi */
#define vSR 0x1400 /* shift register */
#define vACR 0x1600 /* aux control register */
#define vPCR 0x1800 /* peripheral control register */
#define vIFR 0x1a00 /* interrupt flag register */
#define vIER 0x1c00 /* interrupt enable register */
+#define vBufA 0x1e00 /* register A */
#define vPB 0x0000
#define vPB3 0x08
Modified: stable/10/sys/powerpc/powerpc/mp_machdep.c
==============================================================================
--- stable/10/sys/powerpc/powerpc/mp_machdep.c Wed Jan 15 05:52:06 2014 (r260673)
+++ stable/10/sys/powerpc/powerpc/mp_machdep.c Wed Jan 15 06:17:15 2014 (r260674)
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include "pic_if.h"
@@ -66,10 +67,21 @@ volatile static u_quad_t ap_timebase;
static u_int ipi_msg_cnt[32];
static struct mtx ap_boot_mtx;
struct pcb stoppcbs[MAXCPU];
+int longfault(faultbuf, int);
void
machdep_ap_bootstrap(void)
{
+ jmp_buf *restore;
+
+ /* The following is needed for restoring from sleep. */
+#ifdef __powerpc64__
+ /* Writing to the time base register is hypervisor-privileged */
+ if (mfmsr() & PSL_HV)
+ mttb(0);
+#else
+ mttb(0);
+#endif
/* Set up important bits on the CPU (HID registers, etc.) */
cpudep_ap_setup();
@@ -78,6 +90,11 @@ machdep_ap_bootstrap(void)
PCPU_SET(awake, 1);
__asm __volatile("msync; isync");
+ restore = PCPU_GET(restore);
+ if (restore != NULL) {
+ longjmp(*restore, 1);
+ }
+
while (ap_letgo == 0)
;
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 07:36:37 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id B500C4B1;
Wed, 15 Jan 2014 07:36:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 95A521373;
Wed, 15 Jan 2014 07:36:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F7abVX012813;
Wed, 15 Jan 2014 07:36:37 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F7aYj6012794;
Wed, 15 Jan 2014 07:36:34 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150736.s0F7aYj6012794@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 07:36:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260675 - in stable/10/usr.sbin/bsdconfig: . console
console/include dot include includes mouse/include networking/include
networking/share share share/media startup/include usermgmt/in...
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 07:36:37 -0000
Author: dteske
Date: Wed Jan 15 07:36:34 2014
New Revision: 260675
URL: http://svnweb.freebsd.org/changeset/base/260675
Log:
MFC r258355,258360,258400-258401,258406-258407,258418,258430,258439,258589-
258590,258592,258727-258728,258785, with the following descriptions:
Revisions 258400-258401,258406-258407,258590,258727-258728,258785:
+ Add a new `includes' module (see: bsdconfig includes -h) for exploring
the bsdconfig(8) API
Remaining revisions:
258592: Sort all the messages.subr files
258355: Fix typo in a comment in networking/device.subr
258360: Whitespace, style, and other changes in networking/device.subr
258418: Quote interface names for good measure in networking/device.subr
258430: Remove an unused line in networking/device.subr
258439: Minor bugfix to f_die() function in common.subr
258589: Minor bugfix to syscons_ttys module
Added:
stable/10/usr.sbin/bsdconfig/includes/
- copied from r258400, head/usr.sbin/bsdconfig/includes/
Modified:
stable/10/usr.sbin/bsdconfig/Makefile
stable/10/usr.sbin/bsdconfig/console/include/messages.subr
stable/10/usr.sbin/bsdconfig/console/ttys
stable/10/usr.sbin/bsdconfig/dot/dot
stable/10/usr.sbin/bsdconfig/include/messages.subr
stable/10/usr.sbin/bsdconfig/includes/USAGE
stable/10/usr.sbin/bsdconfig/includes/includes
stable/10/usr.sbin/bsdconfig/mouse/include/messages.subr
stable/10/usr.sbin/bsdconfig/networking/include/messages.subr
stable/10/usr.sbin/bsdconfig/networking/share/device.subr
stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr
stable/10/usr.sbin/bsdconfig/share/variable.subr
stable/10/usr.sbin/bsdconfig/startup/include/messages.subr
stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/bsdconfig/Makefile
==============================================================================
--- stable/10/usr.sbin/bsdconfig/Makefile Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/Makefile Wed Jan 15 07:36:34 2014 (r260675)
@@ -6,6 +6,7 @@ SUBDIR= console \
dot \
examples \
include \
+ includes \
mouse \
networking \
packages \
Modified: stable/10/usr.sbin/bsdconfig/console/include/messages.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/include/messages.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/console/include/messages.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -51,8 +51,8 @@ msg_cancel="Cancel"
msg_central_european_iso="Central European ISO"
msg_central_european_iso_desc="Central European ISO keymap"
msg_choose_alternate_keyboard_map="Choose an alternate keyboard map"
-msg_choose_alternate_screenmap="Choose an alternate screenmap"
msg_choose_alternate_screen_font="Choose an alternate screen font"
+msg_choose_alternate_screenmap="Choose an alternate screenmap"
msg_choose_console_terminal_type="Choose console terminal type"
msg_configure_screen_saver="Configure the screen saver"
msg_console_menu_text="The system console driver for FreeBSD has a number of configuration\noptions which may be set according to your preference.\n\nWhen you are done setting configuration options, select Cancel."
@@ -74,9 +74,9 @@ msg_enter_timeout_period="Enter time-out
msg_estonian_cp850="Estonian CP850"
msg_estonian_cp850_desc="Estonian Code Page 850 keymap"
msg_estonian_iso="Estonian ISO"
-msg_estonian_iso_desc="Estonian ISO keymap"
msg_estonian_iso_15="Estonian ISO 15"
msg_estonian_iso_15_desc="Estonian ISO 8859-15 keymap"
+msg_estonian_iso_desc="Estonian ISO keymap"
msg_exit="Exit"
msg_exit_this_menu="Exit this menu"
msg_fade="Fade"
@@ -97,8 +97,6 @@ msg_french_iso_accent_desc="French ISO k
msg_french_iso_desc="French ISO keymap"
msg_french_iso_macbook="French ISO/Macbook"
msg_french_iso_macbook_desc="French ISO keymap on macbook"
-msg_green="Green"
-msg_green_desc="\"Green\" power saving mode (if supported by monitor)"
msg_german_cp850="German CP850"
msg_german_cp850_desc="German Code Page 850 keymap"
msg_german_iso="German ISO"
@@ -109,10 +107,14 @@ msg_greek_104="Greek 104"
msg_greek_104_desc="Greek ISO keymap (104 keys)"
msg_greek_elot="Greek ELOT"
msg_greek_elot_desc="Greek ISO keymap (ELOT 1000)"
+msg_green="Green"
+msg_green_desc="\"Green\" power saving mode (if supported by monitor)"
msg_hungarian_101="Hungarian 101"
msg_hungarian_101_desc="Hungarian ISO keymap (101 key)"
msg_hungarian_102="Hungarian 102"
msg_hungarian_102_desc="Hungarian ISO keymap (102 key)"
+msg_ibm_1251="IBM 1251"
+msg_ibm_1251_desc="Cyrillic, MS Windows encoding"
msg_ibm_437="IBM 437"
msg_ibm_437_desc="English and others, VGA default"
msg_ibm_437_vga_default="IBM437 (VGA default)"
@@ -124,12 +126,12 @@ msg_ibm_866="IBM 866"
msg_ibm_866_desc="Russian, IBM encoding (use with KOI8-R screenmap)"
msg_ibm_866u="IBM 866u"
msg_ibm_866u_desc="Ukrainian, IBM encoding (use with KOI8-U screenmap)"
-msg_ibm_1251="IBM 1251"
-msg_ibm_1251_desc="Cyrillic, MS Windows encoding"
msg_icelandic="Icelandic"
msg_icelandic_accent="Icelandic (accent)"
msg_icelandic_accent_desc="Icelandic ISO keymap (accent keys)"
msg_icelandic_desc="Icelandic ISO keymap"
+msg_iso_8859_15="ISO 8859-15"
+msg_iso_8859_15_desc="Europe, ISO encoding"
msg_iso_8859_1="ISO 8859-1"
msg_iso_8859_1_desc="Western Europe, ISO encoding"
msg_iso_8859_1_to_ibm437="ISO 8859-1 to IBM437"
@@ -144,8 +146,6 @@ msg_iso_8859_7_to_ibm437="ISO 8859-7 to
msg_iso_8859_7_to_ibm437_desc="Greek ISO 8859-1 to IBM 437 screenmap"
msg_iso_8859_8="ISO 8859-8"
msg_iso_8859_8_desc="Hebrew, ISO encoding"
-msg_iso_8859_15="ISO 8859-15"
-msg_iso_8859_15_desc="Europe, ISO encoding"
msg_italian="Italian"
msg_italian_desc="Italian ISO keymap"
msg_japanese_106="Japanese 106"
@@ -153,9 +153,9 @@ msg_japanese_106_desc="Japanese 106 keym
msg_keymap="Keymap"
msg_keymap_menu_text="The system console driver for FreeBSD defaults to a standard\n\"US\" keyboard map. Users may wish to choose one of the\nother keymaps below."
msg_koi8_r="KOI8-R"
-msg_koi8_u="KOI8-U"
msg_koi8_r_to_ibm866="KOI8-R to IBM866"
msg_koi8_r_to_ibm866_desc="Russian KOI8-R to IBM 866 screenmap"
+msg_koi8_u="KOI8-U"
msg_koi8_u_to_ibm866u="KOI8-U to IBM866u"
msg_koi8_u_to_ibm866u_desc="Ukrainian KOI8-U to IBM 866u screenmap"
msg_latin_american="Latin American"
@@ -224,8 +224,8 @@ msg_swiss_german_iso_accent_desc="Swiss
msg_swiss_german_iso_desc="Swiss German ISO keymap"
msg_system_console_configuration="System Console Configuration"
msg_system_console_font="System Console Font"
-msg_system_console_keymap="System Console Keymap"
msg_system_console_keyboard_repeat_rate="System Console Keyboard Repeat Rate"
+msg_system_console_keymap="System Console Keymap"
msg_system_console_screen_saver="System Console Screen Saver"
msg_system_console_screenmap="System Console Screenmap"
msg_system_console_terminal_type="System Console Terminal Type"
Modified: stable/10/usr.sbin/bsdconfig/console/ttys
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/ttys Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/console/ttys Wed Jan 15 07:36:34 2014 (r260675)
@@ -113,7 +113,7 @@ ttys_set_type()
#
# Create new temporary file to write our ttys(5) update with new types.
#
- local tmpfile="$( mktemp -t "pgm" )"
+ local tmpfile="$( mktemp -t "$pgm" )"
[ "$tmpfile" ] || return $FAILURE
#
Modified: stable/10/usr.sbin/bsdconfig/dot/dot
==============================================================================
--- stable/10/usr.sbin/bsdconfig/dot/dot Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/dot/dot Wed Jan 15 07:36:34 2014 (r260675)
@@ -163,7 +163,7 @@ while getopts cdhi flag; do
done
shift $(( $OPTIND - 1 ))
-cd $BSDCFG_LIBE || f_die 1 "$msg_directory_not_found" "$BSDCFG_LIB"
+cd $BSDCFG_LIBE || f_die # Pedantic
#
# Get a list of menu programs
Modified: stable/10/usr.sbin/bsdconfig/include/messages.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/include/messages.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/include/messages.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -170,8 +170,8 @@ msg_install_from_an_http_server="Install
msg_install_from_the_existing_filesystem="Install from the existing filesystem"
msg_install_over_nfs="Install over NFS"
msg_installed="Installed"
-msg_installed_lc="installed"
msg_installed_desc="Leave package as-is, installed"
+msg_installed_lc="installed"
msg_invalid_gateway_ipv4_address_specified="Invalid gateway IPv4 address specified"
msg_invalid_hostname_value="Invalid hostname value"
msg_invalid_ipv4_address="Invalid IPv4 address"
@@ -261,7 +261,6 @@ msg_ok="OK"
msg_options="Options"
msg_options_editor="Options Editor"
msg_other="other"
-msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details."
msg_package_is_needed_by_other_installed_packages="Warning: Package %s is needed by\n %d other installed package%s."
msg_package_not_installed_cannot_delete="Warning: package %s not installed\n No package can be deleted."
msg_package_temp="Package Temp"
@@ -273,6 +272,7 @@ msg_parallel_desc="Applications dealing
msg_pear_desc="Software related to the Pear PHP framework."
msg_perl5_desc="Utilities/modules for the PERL5 language."
msg_permission_denied="%s: %s: Permission denied"
+msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details."
msg_pkg_install_apparently_did_not_like_the_package="pkg-install(8) apparently did not like the %s package."
msg_plan9_desc="Software from the Plan9 operating system."
msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n"
@@ -375,9 +375,9 @@ msg_unable_to_get_file_from_selected_med
msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path. FTP media not initialized."
msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract."
msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!"
-msg_unable_to_pkg_rquery_package_dependencies="Unable to pkg-rquery(8) package dependencies!"
-msg_unable_to_pkg_rquery_package_categories="Unable to pkg-rquery(8) package categories!"
msg_unable_to_open="Unable to open %s"
+msg_unable_to_pkg_rquery_package_categories="Unable to pkg-rquery(8) package categories!"
+msg_unable_to_pkg_rquery_package_dependencies="Unable to pkg-rquery(8) package dependencies!"
msg_unable_to_update_pkg_from_selected_media="Unable to update pkg(8) from selected media."
msg_uninstall="Uninstall"
msg_uninstall_desc="Mark this package for deletion"
Modified: stable/10/usr.sbin/bsdconfig/includes/USAGE
==============================================================================
--- head/usr.sbin/bsdconfig/includes/USAGE Wed Nov 20 20:37:21 2013 (r258400)
+++ stable/10/usr.sbin/bsdconfig/includes/USAGE Wed Jan 15 07:36:34 2014 (r260675)
@@ -28,6 +28,7 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS
OPTIONS:
-a Always use color even when output is not to a terminal.
+ -d Print description for each function selected. Implies `-f'.
-f Show functions for selected includes.
-F pattern
If `-f', only print functions matching pattern. Without `-f'
@@ -64,3 +65,7 @@ EXAMPLES:
bsdconfig @PROGRAM_NAME@ -F show common
NB: The `.subr' suffix on the end of the include is optional.
+
+ Show descriptions of each of the `show' functions:
+
+ bsdconfig @PROGRAM_NAME@ -dF show
Modified: stable/10/usr.sbin/bsdconfig/includes/includes
==============================================================================
--- head/usr.sbin/bsdconfig/includes/includes Wed Nov 20 20:37:21 2013 (r258400)
+++ stable/10/usr.sbin/bsdconfig/includes/includes Wed Jan 15 07:36:34 2014 (r260675)
@@ -29,7 +29,7 @@
############################################################ INCLUDES
# Prevent common.subr from auto initializing debugging (this is not an inter-
-# active utility that requires debugging).
+# active utility that requires debugging; also `-d' has been repurposed).
#
DEBUG_SELF_INITIALIZE=NO
@@ -50,6 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_
# Options
#
USE_COLOR=1
+SHOW_DESC=
SHOW_FUNCS=
FUNC_PATTERN=
@@ -64,24 +65,62 @@ show_include()
local file="${1#./}"
local pattern="${FUNC_PATTERN:-.*}"
- output=$( awk -v use_color=${USE_COLOR:-0} -v re="$pattern" '
+ output=$( awk \
+ -v use_color=${USE_COLOR:-0} \
+ -v re="$pattern" \
+ -v show_desc=${SHOW_DESC:-0} '
+ function asorti(src, dest)
+ {
+ # Copy src indices to dest and calculate array length
+ nitems = 0; for (i in src) dest[++nitems] = i
+
+ # Sort the array of indices (dest) using insertion sort method
+ for (i = 1; i <= nitems; k = i++)
+ {
+ idx = dest[i]
+ while ((k > 0) && (dest[k] > idx))
+ {
+ dest[k+1] = dest[k]
+ k--
+ }
+ dest[k+1] = idx
+ }
+
+ return nitems
+ }
/^$/,/^#/ {
if ($0 ~ /^# f_/) {
if (!match($2, re)) next
+ fn = $2
if (use_color)
- printf " %s[1;31m%s[0m%s\n",
+ syntax[fn] = sprintf("+%s[1;31m%s[0m%s\n",
substr($0, 2, RSTART),
substr($0, 2 + RSTART, RLENGTH),
- substr($0, 2 + RSTART + RLENGTH)
+ substr($0, 2 + RSTART + RLENGTH))
else
- print substr($0, 2)
- print_more = substr($0, length($0)) == "\\"
+ syntax[fn] = "+" substr($0, 2) "\n"
+ if (show_desc)
+ print_more = 1
+ else
+ print_more = substr($0, length($0)) == "\\"
}
- while (print_more) {
+ if (show_desc && print_more) {
+ getline
+ while ($0 ~ /^#/) {
+ syntax[fn] = syntax[fn] " " substr($0, 2) "\n"
+ getline
+ }
+ print_more = 0
+ } else while (print_more) {
getline
- print substr($0, 2)
+ syntax[fn] = syntax[fn] " " substr($0, 2) "\n"
print_more = substr($0, length($0)) == "\\"
}
+ }
+ END {
+ n = asorti(syntax, sorted_indices)
+ for (i = 1; i <= n; i++)
+ printf "%s", syntax[sorted_indices[i]]
}' "$file" )
if [ "$output" ]; then
if [ ! "$SHOW_FUNCS" ]; then
@@ -89,10 +128,10 @@ show_include()
return $SUCCESS
fi
if [ "$FUNC_PATTERN" ]; then
- printf "$msg_functions_in_matching\n" \
+ printf ">>> $msg_functions_in_matching\n" \
"$file" "$FUNC_PATTERN"
else
- printf "$msg_functions_in\n" "$file"
+ printf ">>> $msg_functions_in\n" "$file"
fi
echo "$output"
echo # blank line to simplify awk(1)-based reparse
@@ -110,9 +149,10 @@ show_include()
#
# Process command-line arguments
#
-while getopts afF:hn flag; do
+while getopts adfF:hn flag; do
case "$flag" in
a) USE_COLOR=1 ;;
+ d) SHOW_DESC=1 SHOW_FUNCS=1 ;;
f) SHOW_FUNCS=1 ;;
F) FUNC_PATTERN="$OPTARG" ;;
n) USE_COLOR= ;;
@@ -122,7 +162,7 @@ done
shift $(( $OPTIND - 1 ))
# cd(1) to `share' dir so relative paths work for find and positional args
-cd $BSDCFG_SHARE || f_die 1 "$msg_directory_not_found" "$BSDCFG_SHARE"
+cd $BSDCFG_SHARE || f_die # Pedantic
#
# If given an argument, operate on it specifically (implied `-f') and exit
@@ -132,9 +172,11 @@ for include in "$@"; do
# See if they've just omitted the `*.subr' suffix
[ -f "$include.subr" -a ! -f "$include" ] && include="$include.subr"
if [ ! -f "$include" ]; then
- f_die 1 "$msg_no_such_file_or_directory" "$0" "$include"
+ printf "$msg_no_such_file_or_directory\n" "$0" "$include"
+ exit $FAILURE
elif [ ! -r "$include" ]; then
- f_die 1 "$msg_permission_denied" "$0" "$include"
+ printf "$msg_permission_denied\n" "$0" "$include"
+ exit $FAILURE
fi
show_include "$include" || f_die
done
Modified: stable/10/usr.sbin/bsdconfig/mouse/include/messages.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/mouse/include/messages.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/mouse/include/messages.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -58,14 +58,14 @@ msg_microsoft="Microsoft"
msg_microsoft_desc="Microsoft protocol (serial)"
msg_mm_series="MM Series"
msg_mm_series_desc="MM Series protocol (serial)"
-msg_mouseman="MouseMan"
-msg_mouseman_desc="Logitech MouseMan/TrackMan models (serial)"
-msg_mousesystems="MouseSystems"
-msg_mousesystems_desc="MouseSystems protocol (serial)"
msg_mouse_daemon_is_disabled="The mouse daemon is disabled."
msg_mouse_disable="Mouse Disable"
msg_mouse_enable="Mouse Enable"
msg_mouse_flags="Mouse Flags"
+msg_mouseman="MouseMan"
+msg_mouseman_desc="Logitech MouseMan/TrackMan models (serial)"
+msg_mousesystems="MouseSystems"
+msg_mousesystems_desc="MouseSystems protocol (serial)"
msg_now_move_the_mouse="Now move the mouse and see if it works.\n(Note that buttons don't have any effect for now.)\n\n Is the mouse cursor moving?\n"
msg_ok="OK"
msg_please_configure_your_mouse="Please configure your mouse"
Modified: stable/10/usr.sbin/bsdconfig/networking/include/messages.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/include/messages.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/networking/include/messages.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -59,15 +59,15 @@ msg_ipv4_addr_octet_contains_invalid_cha
msg_ipv4_addr_octet_exceeds_max_value="ERROR! One or more individual octets within the IPv4 address\n(separated by dots) exceeds the maximum of 255.\n\nInvalid IP Address: %s"
msg_ipv4_addr_octet_is_null="ERROR! One or more individual octets within the IPv4 address\n(separated by dots) are null and/or missing.\n\nInvalid IP Address: %s"
msg_ipv4_addr_octet_missing_or_extra="ERROR! The IPv4 address entered has either too few (less than\nfour) or too many (more than four) octets, separated by dots.\n\nInvalid IP Address: %s"
-msg_ipv6_addr_segment_contains_invalid_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) contains one or more invalid characters.\nSegments must contain only combinations of the characters 0-9,\nA-F, or a-f.\n\nInvalid IPv6 Address: %s"
-msg_ipv6_addr_segment_contains_too_many_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) exceeds the length of 4 hex-digits.\n\nInvalid IPv6 Address: %s"
-msg_ipv6_addr_too_few_or_extra_segments="ERROR! The IP address entered has either too few (less than 3), too\nmany (more than 8), or not enough segments, separated by colons.\n\nInvalid IPv6 Address: %s"
-msg_ipv6_addr_too_many_null_segments="ERROR! Too many/incorrect null segments. A single null\nsegment is allowed within the IP address (separated by\ncolons) but not allowed at the beginning or end (unless\na double-null segment; i.e., \"::*\" or \"*::\").\n\nInvalid IPv6 Address: %s"
msg_ipv4_mask_field_contains_invalid_chars="ERROR! One or more individual fields within the subnet mask\n(separated by dots) contains one or more invalid characters.\n\nInvalid Subnet Mask: %s"
msg_ipv4_mask_field_exceeds_max_value="ERROR! One or more individual fields within the subnet mask\n(separated by dots) exceeds the maximum of 255.\n\nInvalid Subnet Mask: %s"
msg_ipv4_mask_field_invalid_value="ERROR! One or more individual fields within the subnet mask\n(separated by dots) contains one or more invalid integers.\nFields must be one of 0/128/192/224/240/248/252/254/255.\n\nInvalid Subnet Mask: %s"
msg_ipv4_mask_field_is_null="ERROR! One or more individual fields within the subnet mask\n(separated by dots) are null and/or missing.\n\nInvalid Subnet Mask: %s"
msg_ipv4_mask_field_missing_or_extra="ERROR! The subnet mask entered has either too few or too many\nfields.\n\nInvalid Subnet Mask: %s"
+msg_ipv6_addr_segment_contains_invalid_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) contains one or more invalid characters.\nSegments must contain only combinations of the characters 0-9,\nA-F, or a-f.\n\nInvalid IPv6 Address: %s"
+msg_ipv6_addr_segment_contains_too_many_chars="ERROR! One or more individual segments within the IP address\n(separated by colons) exceeds the length of 4 hex-digits.\n\nInvalid IPv6 Address: %s"
+msg_ipv6_addr_too_few_or_extra_segments="ERROR! The IP address entered has either too few (less than 3), too\nmany (more than 8), or not enough segments, separated by colons.\n\nInvalid IPv6 Address: %s"
+msg_ipv6_addr_too_many_null_segments="ERROR! Too many/incorrect null segments. A single null\nsegment is allowed within the IP address (separated by\ncolons) but not allowed at the beginning or end (unless\na double-null segment; i.e., \"::*\" or \"*::\").\n\nInvalid IPv6 Address: %s"
msg_netmask="netmask"
msg_network_configuration="%s Network Configuration:\nChoose Save/Exit when finished or Cancel."
msg_network_interfaces="Network Interfaces"
Modified: stable/10/usr.sbin/bsdconfig/networking/share/device.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/device.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/networking/share/device.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -62,7 +62,8 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc
#
f_dialog_menu_netdev()
{
- local defaultitem="${1%\*}" # Tim trailing asterisk if present
+ local menu_list # Calculated below
+ local defaultitem="${1%\*}" # Trim trailing asterisk if present
#
# Display a message to let the user know we're working...
@@ -73,20 +74,15 @@ f_dialog_menu_netdev()
#
# Get list of usable network interfaces
#
- local d='[[:digit:]]+:'
- local iflist="`echo "$(ifconfig -l):" | sed -E -e "
- # Convert all spaces to colons
- y/ /:/
-
- # Prune unsavory interfaces
- s/lo$d//g
- s/ppp$d//g
- s/sl$d//g
- s/faith$d//g
-
- # Convert all colons back into spaces
- y/:/ /
- "`"
+ local if iflist= # Calculated below
+ for if in $( ifconfig -l ); do
+ # Skip unsavory interfaces
+ case "$if" in
+ lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;;
+ esac
+ iflist="$iflist $if"
+ done
+ iflist="${iflist# }"
#
# Optionally kick interfaces in the head to get them to accurately
@@ -110,20 +106,17 @@ f_dialog_menu_netdev()
# Mark any "active" interfaces with an asterisk (*)
# to the right of the device name.
#
- interfaces=$(
+ menu_list=$(
for ifn in $iflist; do
- active=$( ifconfig $ifn | awk \
- '
- ( $1 == "status:" ) \
- {
- if ( $2 == "active" ) { print 1; exit }
- }
- ' )
+ active=$( ifconfig $ifn 2> /dev/null | awk '
+ ($1 == "status:") {
+ if ($2 == "active") { print 1; exit }
+ }' )
printf "'%s%s' '%s'\n" \
$ifn "${active:+*}" "$( f_device_desc $ifn )"
done
)
- if [ ! "$interfaces" ]; then
+ if [ ! "$menu_list" ]; then
f_show_msg "$msg_no_network_interfaces"
return $DIALOG_CANCEL
fi
@@ -132,8 +125,8 @@ f_dialog_menu_netdev()
# Maybe the default item was marked as active
#
if [ "$defaultitem" ]; then
- ifconfig "$defaultitem" 2> /dev/null | awk \
- '( $1 == "status:" && $2 != "active" ) { exit 0 }' ||
+ ifconfig "$defaultitem" 2> /dev/null |
+ awk '($1 == "status:" && $2 == "active"){exit 1}' ||
defaultitem="$defaultitem*"
fi
@@ -149,7 +142,7 @@ f_dialog_menu_netdev()
\"\$DIALOG_BACKTITLE\" \
\"\$prompt\" \
\"\$hline\" \
- $interfaces
+ $menu_list
local menu_choice
menu_choice=$( eval $DIALOG \
--title \"\$DIALOG_TITLE\" \
@@ -160,7 +153,7 @@ f_dialog_menu_netdev()
--default-item \"\$defaultitem\" \
--menu \"\$prompt\" \
$height $width $rows \
- $interfaces \
+ $menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
)
local retval=$?
@@ -284,22 +277,23 @@ f_dialog_menu_netdev_edit()
msg=$( printf "$msg_scanning_for_dhcp" "$interface" )
if [ "$USE_XDIALOG" ]; then
(
- f_quietly ifconfig $interface delete
- f_quietly dhclient $interface
+ f_quietly ifconfig "$interface" delete
+ f_quietly dhclient "$interface"
) |
f_xdialog_info "$msg"
else
f_dialog_info "$msg"
- f_quietly ifconfig $interface delete
- f_quietly dhclient $interface
+ f_quietly ifconfig "$interface" delete
+ f_quietly dhclient "$interface"
fi
)
retval=$?
trap 'interrupt' SIGINT
if [ $retval -eq $DIALOG_OK ]; then
dhcp=1
- ipaddr=$( f_ifconfig_inet $interface )
- netmask=$( f_ifconfig_netmask $interface )
+ f_ifconfig_inet "$interface" ipaddr
+ f_ifconfig_inet6 "$interface" ipaddr6
+ f_ifconfig_netmask "$interface" netmask
options=
# Fixup search/domain in resolv.conf(5)
Modified: stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -110,10 +110,11 @@ f_struct_define DHCP_LEASE \
# begin or end with a hyphen).
# 3 One or more individual labels within the hostname are null.
#
-# f_dialog_validate_hostname $hostname
+# To call this function and display an appropriate error message to the user
+# based on the above error codes, use the following function defined in
+# dialog.subr:
#
-# If the hostname is determined to be invalid, the appropriate error will be
-# displayed using the f_show_msg function.
+# f_dialog_validate_hostname $hostname
#
f_validate_hostname()
{
Modified: stable/10/usr.sbin/bsdconfig/share/variable.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/share/variable.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/share/variable.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -179,7 +179,7 @@ f_debugging()
f_getvar $VAR_DEBUG value && [ "$value" ]
}
-# f_interactive()
+# f_interactive
#
# Are we running interactively? Return error if $nonInteractive is set and non-
# NULL, otherwise return success.
@@ -190,7 +190,7 @@ f_interactive()
! f_getvar $VAR_NONINTERACTIVE value || [ ! "$value" ]
}
-# f_netinteractive()
+# f_netinteractive
#
# Has the user specifically requested the network-portion of configuration and
# setup to be performed interactively? Returns success if the user has asked
@@ -205,7 +205,7 @@ f_netinteractive()
f_getvar $VAR_NETINTERACTIVE value && [ "$value" ]
}
-# f_zfsinteractive()
+# f_zfsinteractive
#
# Has the user specifically requested the ZFS-portion of configuration and
# setup to be performed interactively? Returns success if the user has asked
Modified: stable/10/usr.sbin/bsdconfig/startup/include/messages.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/startup/include/messages.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/startup/include/messages.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -39,8 +39,8 @@ msg_all_desc="Select all directives"
msg_all_help="Select all displayed rc.conf(5) configuration directives"
msg_apm="APM"
msg_apm_desc="Auto-power management services (typically laptops)"
-msg_are_you_sure_you_want_to_delete="Are you sure you want to delete the \`%s' directive\nfrom the rc.conf(5) collection of system configuration files?"
msg_are_you_sure_you_want_delete_the_following="Are you sure you want to delete the following directives\nfrom the rc.conf(5) collection of system configuration files?"
+msg_are_you_sure_you_want_to_delete="Are you sure you want to delete the \`%s' directive\nfrom the rc.conf(5) collection of system configuration files?"
msg_cancel="Cancel"
msg_choose_view_details="Choose View Details"
msg_creating_menu_list="Creating menu list...\nThis may take a while."
@@ -67,8 +67,8 @@ msg_exit_this_menu="Exit this menu"
msg_info="Info"
msg_lpd="lpd"
msg_lpd_desc="This host has a printer and wants to run lpd."
-msg_miscellaneous_startup_services="Miscellaneous Startup Services"
msg_miscellaneous_menu_text="This menu allows you to configure various aspects of your system's\nstartup configuration. Use [SPACE] or [ENTER] to select items, and\n[TAB] to move to the buttons. Select Exit to leave this menu."
+msg_miscellaneous_startup_services="Miscellaneous Startup Services"
msg_named="named"
msg_named_desc="Run a local name server on this host"
msg_named_flags="named flags"
Modified: stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr Wed Jan 15 06:17:15 2014 (r260674)
+++ stable/10/usr.sbin/bsdconfig/usermgmt/include/messages.subr Wed Jan 15 07:36:34 2014 (r260675)
@@ -32,9 +32,9 @@ hline_arrows_space_tab_enter="Use arrows
hline_arrows_tab_enter="Press arrows, TAB or ENTER"
hline_num_arrows_tab_enter="Use numbers, arrows, TAB or ENTER"
hline_num_tab_enter="Use numbers, TAB or ENTER"
+msg_account_does_not_expire="Account does not expire"
msg_account_expires_in_how_many_days="Account expires in how many days?"
msg_account_expires_on="Account Expires on"
-msg_account_does_not_expire="Account does not expire"
msg_add="Add"
msg_add_group="Add Group"
msg_add_login="Add Login"
@@ -65,9 +65,9 @@ msg_group="Group"
msg_group_added="Group Added"
msg_group_already_used="%s: Group is already used."
msg_group_deleted="Group Deleted"
-msg_group_is_empty="Group is empty."
msg_group_id="Group ID"
msg_group_id_leave_empty_for_default="Group ID (Leave empty for default)"
+msg_group_is_empty="Group is empty."
msg_group_members="Group Members"
msg_group_must_start_with_letter="Group must start with a letter."
msg_group_not_found="%s: Group not found."
@@ -89,21 +89,21 @@ msg_login_not_found="Login not found."
msg_login_updated="Login Updated"
msg_member_of_groups="Member of Groups"
msg_n_a="N/A"
-msg_number_of_seconds_since_epoch="Number of seconds since the Epoch\n(1 = %s)\nNULL or zero to disable:"
msg_no="No"
+msg_number_of_seconds_since_epoch="Number of seconds since the Epoch\n(1 = %s)\nNULL or zero to disable:"
msg_ok="OK"
msg_password="Password"
+msg_password_does_not_expire="Password does not expire"
msg_password_expires_in_how_many_days="Password expires in how many days?"
msg_password_expires_on="Password Expires on"
msg_passwords_do_not_match="Passwords do not match."
-msg_password_does_not_expire="Password does not expire"
msg_reenter_group_password="Re-enter Group Password"
msg_reenter_password="Re-enter Password"
msg_save="Save"
msg_save_exit_or_cancel="Choose Save/Exit when finished or Cancel."
-msg_separated_by_commas="Separated by commas"
msg_select_group_members_from_list="Select Group Members from a list"
msg_select_login_shell="Select Login Shell"
+msg_separated_by_commas="Separated by commas"
msg_shell="Shell"
msg_unknown_user_management_menu_selection="Unknown user management menu selection"
msg_use_default_values_for_all_account_details="Use default values for all account details?"
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 07:42:32 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id CAC2A75D;
Wed, 15 Jan 2014 07:42:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id B4BF51445;
Wed, 15 Jan 2014 07:42:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F7gWQG016432;
Wed, 15 Jan 2014 07:42:32 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F7gWpR016429;
Wed, 15 Jan 2014 07:42:32 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150742.s0F7gWpR016429@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 07:42:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260676 - in stable/10/usr.sbin/bsdconfig: networking
networking/share share
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 07:42:32 -0000
Author: dteske
Date: Wed Jan 15 07:42:31 2014
New Revision: 260676
URL: http://svnweb.freebsd.org/changeset/base/260676
Log:
MFC r258458:
Improve network device scanning in the netdev module. First, make it use the
`device.subr' framework (improving performane and reducing sub-shells). Next
improve the `device.subr' framework itself. Make use of the `flags' device
struct member for network interfaces to indicate if an interface is Active,
Wired Ethernet, or 802.11 Wireless. Functions have been added to make checks
against the `flags' bit-field quick and efficient. Last, add function for
rescanning the network to update the device registers. Remove an unnecessary
local (ifn) while we're here (use already provided local `if').
Modified:
stable/10/usr.sbin/bsdconfig/networking/devices
stable/10/usr.sbin/bsdconfig/networking/share/device.subr
stable/10/usr.sbin/bsdconfig/share/device.subr
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/bsdconfig/networking/devices
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/devices Wed Jan 15 07:36:34 2014 (r260675)
+++ stable/10/usr.sbin/bsdconfig/networking/devices Wed Jan 15 07:42:31 2014 (r260676)
@@ -28,6 +28,12 @@
#
############################################################ INCLUDES
+# Prevent device.subr (included indirectly) from auto scanning; this will be
+# performed indirectly later via f_dialog_menu_netdev() -- but only after we've
+# successfully completed f_mustberoot_init().
+#
+DEVICE_SELF_SCAN_ALL=NO
+
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_dprintf "%s: loading includes..." "$0"
Modified: stable/10/usr.sbin/bsdconfig/networking/share/device.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/device.subr Wed Jan 15 07:36:34 2014 (r260675)
+++ stable/10/usr.sbin/bsdconfig/networking/share/device.subr Wed Jan 15 07:42:31 2014 (r260676)
@@ -74,8 +74,10 @@ f_dialog_menu_netdev()
#
# Get list of usable network interfaces
#
- local if iflist= # Calculated below
- for if in $( ifconfig -l ); do
+ local devs if iflist= # Calculated below
+ f_device_rescan_network
+ f_device_find "" $DEVICE_TYPE_NETWORK devs
+ for if in $devs; do
# Skip unsavory interfaces
case "$if" in
lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;;
@@ -91,9 +93,8 @@ f_dialog_menu_netdev()
if [ "$DIALOG_MENU_NETDEV_KICK_INTERFACES" ]; then
DIALOG_MENU_NETDEV_KICK_INTERFACES=
- local ifn
- for ifn in $iflist; do
- f_quietly ifconfig $ifn up
+ for if in $iflist; do
+ f_quietly ifconfig $if up
done
if [ "$DIALOG_MENU_NETDEV_SLEEP_AFTER_KICK" ]; then
@@ -107,13 +108,14 @@ f_dialog_menu_netdev()
# to the right of the device name.
#
menu_list=$(
- for ifn in $iflist; do
- active=$( ifconfig $ifn 2> /dev/null | awk '
- ($1 == "status:") {
- if ($2 == "active") { print 1; exit }
- }' )
- printf "'%s%s' '%s'\n" \
- $ifn "${active:+*}" "$( f_device_desc $ifn )"
+ for if in $iflist; do
+ f_device_desc $if $DEVICE_TYPE_NETWORK desc
+ f_shell_escape "$desc" desc
+ if f_device_is_active $if; then
+ printf "'%s\*' '%s'\n" $if "$desc"
+ else
+ printf "'%s' '%s'\n" $if "$desc"
+ fi
done
)
if [ ! "$menu_list" ]; then
@@ -121,21 +123,14 @@ f_dialog_menu_netdev()
return $DIALOG_CANCEL
fi
- #
# Maybe the default item was marked as active
- #
- if [ "$defaultitem" ]; then
- ifconfig "$defaultitem" 2> /dev/null |
- awk '($1 == "status:" && $2 == "active"){exit 1}' ||
- defaultitem="$defaultitem*"
- fi
-
- local hline="$hline_arrows_tab_enter"
+ f_device_is_active "$defaultitem" && defaultitem="$defaultitem*"
#
# Ask user to select an interface
#
local prompt="$msg_select_network_interface"
+ local hline="$hline_arrows_tab_enter"
local height width rows
eval f_dialog_menu_size height width rows \
\"\$DIALOG_TITLE\" \
Modified: stable/10/usr.sbin/bsdconfig/share/device.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/share/device.subr Wed Jan 15 07:36:34 2014 (r260675)
+++ stable/10/usr.sbin/bsdconfig/share/device.subr Wed Jan 15 07:42:31 2014 (r260676)
@@ -76,6 +76,11 @@ setvar DEVICE_TYPE_ANY 11
setvar DEVICE_TYPE_HTTP_PROXY 12
setvar DEVICE_TYPE_HTTP 13
+# Network devices have the following flags available
+setvar IF_ETHERNET 1
+setvar IF_WIRELESS 2
+setvar IF_ACTIVE 4
+
#
# Default behavior is to call f_device_get_all() automatically when loaded.
#
@@ -175,6 +180,33 @@ f_device_reset()
DEVICES=
}
+# f_device_reset_network
+#
+# Reset the registered network device chain.
+#
+f_device_reset_network()
+{
+ local dev type private pruned_list=
+ for dev in $DEVICES; do
+ device_$dev get type type
+ if [ "$type" != "$DEVICE_TYPE_NETWORK" ]; then
+ pruned_list="$pruned_list $dev"
+ continue
+ fi
+
+ #
+ # Leave the device up (don't call shutdown routine)
+ #
+
+ # Network devices may have DEVICE_INFO private member
+ device_$dev get private private
+ [ "$private" ] && f_struct_free "$private"
+
+ f_struct_free device_$dev
+ done
+ DEVICES="${pruned_list# }"
+}
+
# f_device_get_all
#
# Get all device information for devices we have attached.
@@ -187,20 +219,7 @@ f_device_get_all()
f_dialog_info "$msg_probing_devices_please_wait_this_can_take_a_while"
# First go for the network interfaces
- for devname in $( ifconfig -l ); do
- # Eliminate network devices that don't make sense
- case "$devname" in
- lo*) continue ;;
- esac
-
- # Try and find its description
- f_device_desc "$devname" $DEVICE_TYPE_NETWORK desc
-
- f_dprintf "Found a network device named %s" "$devname"
- f_device_register $devname \
- "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \
- f_media_init_network "" f_media_shutdown_network "" -1
- done
+ f_device_get_all_network
# Next, try to find all the types of devices one might use
# as a media source for content
@@ -378,6 +397,48 @@ f_device_get_all()
done # disks
}
+# f_device_get_all_network
+#
+# Get all network device information for attached network devices.
+#
+f_device_get_all_network()
+{
+ local devname desc flags
+ for devname in $( ifconfig -l ); do
+ # Eliminate network devices that don't make sense
+ case "$devname" in
+ lo*) continue ;;
+ esac
+
+ # Try and find its description
+ f_device_desc "$devname" $DEVICE_TYPE_NETWORK desc
+
+ f_dprintf "Found a network device named %s" "$devname"
+ f_device_register $devname \
+ "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \
+ f_media_init_network "" f_media_shutdown_network "" -1
+
+ # Set flags based on media and status
+ flags=0
+ eval "$( ifconfig $devname 2> /dev/null | awk -v var=flags '
+ function _or(var, mask) {
+ printf "%s=$(( $%s | $%s ))\n", var, var, mask
+ }
+ BEGIN { S = "[[:space:]]+" }
+ {
+ if (!match($0, "^" S "(media|status):" S)) next
+ value = substr($0, RLENGTH + 1)
+ if ($1 == "media:") {
+ if (value ~ /Ethernet/) _or(var, "IF_ETHERNET")
+ if (value ~ /802\.11/) _or(var, "IF_WIRELESS")
+ } else if ($1 == "status:") {
+ if (value ~ /^active/) _or(var, "IF_ACTIVE")
+ }
+ }' )"
+ device_$devname set flags $flags
+ done
+}
+
# f_device_name_get $type $name type|desc|max [$var_to_set]
#
# Fetch the device type (type), description (desc), or maximum number of
@@ -571,6 +632,72 @@ f_device_desc()
return $FAILURE
}
+# f_device_is_ethernet $device
+#
+# Returns true if $device is a wired Ethernet network interface. Otherwise
+# returns false. Example wired interfaces include: fxp0 em0 bge0 rl0 etc.
+#
+f_device_is_ethernet()
+{
+ local dev="$1" type flags
+
+ # Make sure we have an actual device by that name
+ f_struct "device_$dev" || return $FAILURE
+
+ # Make sure that the device is a network device
+ device_$dev get type type
+ [ "$type" = "$DEVICE_TYPE_NETWORK" ] || return $FAILURE
+
+ # Make sure that the media flags indicate that it is Ethernet
+ device_$dev get flags flags
+ [ $(( ${flags:-0} & $IF_ETHERNET )) -eq $IF_ETHERNET ]
+}
+
+# f_device_is_wireless $device
+#
+# Returns true if $device is a Wireless network interface. Otherwise returns
+# false. Examples of wireless interfaces include: iwn0
+#
+f_device_is_wireless()
+{
+ local dev="$1" type flags
+
+ # Make sure we have an actual device by that name
+ f_struct "device_$dev" || return $FAILURE
+
+ # Make sure that the device is a network device
+ device_$dev get type type
+ [ "$type" = "$DEVICE_TYPE_NETWORK" ] || return $FAILURE
+
+ # Make sure that the media flags indicate that it is Ethernet
+ device_$dev get flags flags
+ [ $(( ${flags:-0} & $IF_WIRELESS )) -eq $IF_WIRELESS ]
+}
+
+# f_device_is_active $device
+#
+# Returns true if $device is active. Otherwise returns false. Currently this
+# only works for network interfaces.
+#
+f_device_is_active()
+{
+ local dev="$1" type flags=0
+
+ # Make sure we have an actual device by that name
+ f_struct "device_$dev" || return $FAILURE
+
+ device_$dev get type type
+ case "$type" in
+ $DEVICE_TYPE_NETWORK)
+ # Make sure that the media flags indicate that it is active
+ device_$dev get flags flags
+ [ $(( ${flags:-0} & $IF_ACTIVE )) -eq $IF_ACTIVE ]
+ ;;
+ *)
+ return $FAILURE
+ esac
+}
+
# f_device_rescan
#
# Rescan all devices, after closing previous set - convenience function.
@@ -581,6 +708,16 @@ f_device_rescan()
f_device_get_all
}
+# f_device_rescan_network
+#
+# Rescan all network devices, after closing previous set - for convenience.
+#
+f_device_rescan_network()
+{
+ f_device_reset_network
+ f_device_get_all_network
+}
+
# f_device_find $name [$type [$var_to_set]]
#
# Find one or more registered devices by name, type, or both. Returns a space-
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 07:47:14 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 45DE4988;
Wed, 15 Jan 2014 07:47:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 1777B14A5;
Wed, 15 Jan 2014 07:47:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F7lDvN017110;
Wed, 15 Jan 2014 07:47:13 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F7lD3f017109;
Wed, 15 Jan 2014 07:47:13 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150747.s0F7lD3f017109@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 07:47:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260677 - stable/10
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 07:47:14 -0000
Author: dteske
Date: Wed Jan 15 07:47:13 2014
New Revision: 260677
URL: http://svnweb.freebsd.org/changeset/base/260677
Log:
MFC missing mergeinfo for r258854.
Modified:
Directory Properties:
stable/10/ (props changed)
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 07:49:24 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 54450AD4;
Wed, 15 Jan 2014 07:49:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 3C55114B8;
Wed, 15 Jan 2014 07:49:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F7nOjM017418;
Wed, 15 Jan 2014 07:49:24 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F7nHVW017377;
Wed, 15 Jan 2014 07:49:17 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150749.s0F7nHVW017377@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 07:49:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260678 - in stable/10/usr.sbin/bsdconfig: console
diskmgmt docsinstall dot includes mouse networking networking/share packages
password security share share/media share/packages startu...
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 07:49:24 -0000
Author: dteske
Date: Wed Jan 15 07:49:17 2014
New Revision: 260678
URL: http://svnweb.freebsd.org/changeset/base/260678
Log:
MFC r259054:
Performance and debugging enhancements:
+ Remove UNAME_P=$(...) from startup/misc -- already supplied by common.subr
+ Use f_getvar instead of $(eval echo \$$var) -- f_getvar is sub-shell free
+ Add `-e' and `-k var' options to f_eval_catch -- increasing use-cases
+ Use f_eval_catch to display errors on failure -- reducing duplicated code
+ Use f_eval_catch when we need output from a command -- improving debugging
+ Optimize f_isinter of strings.subr for performance -- now sub-shell free
+ Improve error checking on pidfiles -- using f_eval_catch and f_isinteger
+ Use $var_to_set arg of f_ifconfig_{inet,netmask} -- eliminate sub-shells
+ Use f_sprintf instead of $(printf ...) -- consolidate sub-shells
+ Use $var_to_set arg of f_route_get_default -- eliminate sub-shells
+ Add f_count to replace $(set -- ...;echo $#) -- eliminate sub-shells
+ Add f_count_ifs to replace $(IFS=x;set -- ...;echo $#) -- no sub-shells
+ Replace var="$var${var:+ }..." in loops with var="$var ..." with a follow-
up var="${var# }" to trim leading whitespace -- optimize loops
+ Use $var_to_set arg of f_resolv_conf_nameservers -- eliminate sub-shells
+ Comments for the f_eval_catch function
+ Remove a duplicate `local ... desc ...' in f_device_get_all of device.subr
+ Use $var_to_set arg of f_device_capacity -- eliminate sub-shells
+ Whitespace fixes in f_dialog_init of dialog.subr
+ Optimize f_inet_atoi of media/tcpip.subr for performance -- sub-shell free
+ In several cases, send stderr to /dev/null -- clean up runtime execution
+ Change f_err of common.subr to go to program stderr not terminal stderr,
allowing redirection of output from functions that use f_err
+ Disable debugging when using f_getvar to get variable argument to
f_startup_rcconf_map_expand of startup/rcconf.subr
+ Use f_replace_all instead of $(echo ... | tr | sed) -- performance
+ Add a $var_to_set option to f_index_{file,menusel_{command,keyword}} of
common.subr -- centralize sub-shells
Modified:
stable/10/usr.sbin/bsdconfig/console/console
stable/10/usr.sbin/bsdconfig/console/font
stable/10/usr.sbin/bsdconfig/console/keymap
stable/10/usr.sbin/bsdconfig/console/repeat
stable/10/usr.sbin/bsdconfig/console/saver
stable/10/usr.sbin/bsdconfig/console/screenmap
stable/10/usr.sbin/bsdconfig/console/ttys
stable/10/usr.sbin/bsdconfig/diskmgmt/diskmgmt
stable/10/usr.sbin/bsdconfig/docsinstall/docsinstall
stable/10/usr.sbin/bsdconfig/dot/dot
stable/10/usr.sbin/bsdconfig/includes/includes
stable/10/usr.sbin/bsdconfig/mouse/disable
stable/10/usr.sbin/bsdconfig/mouse/enable
stable/10/usr.sbin/bsdconfig/mouse/flags
stable/10/usr.sbin/bsdconfig/mouse/mouse
stable/10/usr.sbin/bsdconfig/mouse/port
stable/10/usr.sbin/bsdconfig/mouse/type
stable/10/usr.sbin/bsdconfig/networking/defaultrouter
stable/10/usr.sbin/bsdconfig/networking/devices
stable/10/usr.sbin/bsdconfig/networking/hostname
stable/10/usr.sbin/bsdconfig/networking/nameservers
stable/10/usr.sbin/bsdconfig/networking/networking
stable/10/usr.sbin/bsdconfig/networking/share/device.subr
stable/10/usr.sbin/bsdconfig/networking/share/hostname.subr
stable/10/usr.sbin/bsdconfig/networking/share/ipaddr.subr
stable/10/usr.sbin/bsdconfig/networking/share/media.subr
stable/10/usr.sbin/bsdconfig/networking/share/netmask.subr
stable/10/usr.sbin/bsdconfig/networking/share/resolv.subr
stable/10/usr.sbin/bsdconfig/networking/share/routing.subr
stable/10/usr.sbin/bsdconfig/networking/share/services.subr
stable/10/usr.sbin/bsdconfig/packages/packages
stable/10/usr.sbin/bsdconfig/password/password
stable/10/usr.sbin/bsdconfig/security/kern_securelevel
stable/10/usr.sbin/bsdconfig/security/security
stable/10/usr.sbin/bsdconfig/share/common.subr
stable/10/usr.sbin/bsdconfig/share/device.subr
stable/10/usr.sbin/bsdconfig/share/dialog.subr
stable/10/usr.sbin/bsdconfig/share/keymap.subr
stable/10/usr.sbin/bsdconfig/share/media/cdrom.subr
stable/10/usr.sbin/bsdconfig/share/media/common.subr
stable/10/usr.sbin/bsdconfig/share/media/dos.subr
stable/10/usr.sbin/bsdconfig/share/media/floppy.subr
stable/10/usr.sbin/bsdconfig/share/media/ftp.subr
stable/10/usr.sbin/bsdconfig/share/media/nfs.subr
stable/10/usr.sbin/bsdconfig/share/media/tcpip.subr
stable/10/usr.sbin/bsdconfig/share/media/ufs.subr
stable/10/usr.sbin/bsdconfig/share/media/usb.subr
stable/10/usr.sbin/bsdconfig/share/mustberoot.subr
stable/10/usr.sbin/bsdconfig/share/packages/categories.subr
stable/10/usr.sbin/bsdconfig/share/packages/index.subr
stable/10/usr.sbin/bsdconfig/share/packages/packages.subr
stable/10/usr.sbin/bsdconfig/share/strings.subr
stable/10/usr.sbin/bsdconfig/share/sysrc.subr
stable/10/usr.sbin/bsdconfig/startup/misc
stable/10/usr.sbin/bsdconfig/startup/rcadd
stable/10/usr.sbin/bsdconfig/startup/rcconf
stable/10/usr.sbin/bsdconfig/startup/rcdelete
stable/10/usr.sbin/bsdconfig/startup/rcedit
stable/10/usr.sbin/bsdconfig/startup/rcvar
stable/10/usr.sbin/bsdconfig/startup/share/rcconf.subr
stable/10/usr.sbin/bsdconfig/startup/share/rcedit.subr
stable/10/usr.sbin/bsdconfig/startup/share/rcvar.subr
stable/10/usr.sbin/bsdconfig/startup/startup
stable/10/usr.sbin/bsdconfig/timezone/share/zones.subr
stable/10/usr.sbin/bsdconfig/timezone/timezone
stable/10/usr.sbin/bsdconfig/ttys/ttys
stable/10/usr.sbin/bsdconfig/usermgmt/groupadd
stable/10/usr.sbin/bsdconfig/usermgmt/groupdel
stable/10/usr.sbin/bsdconfig/usermgmt/groupedit
stable/10/usr.sbin/bsdconfig/usermgmt/groupinput
stable/10/usr.sbin/bsdconfig/usermgmt/share/group_input.subr
stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr
stable/10/usr.sbin/bsdconfig/usermgmt/useradd
stable/10/usr.sbin/bsdconfig/usermgmt/userdel
stable/10/usr.sbin/bsdconfig/usermgmt/useredit
stable/10/usr.sbin/bsdconfig/usermgmt/userinput
stable/10/usr.sbin/bsdconfig/usermgmt/usermgmt
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/bsdconfig/console/console
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/console Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/console/console Wed Jan 15 07:49:17 2014 (r260678)
@@ -37,8 +37,8 @@ f_include $BSDCFG_SHARE/mustberoot.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
Modified: stable/10/usr.sbin/bsdconfig/console/font
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/font Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/console/font Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
@@ -174,14 +174,16 @@ esac
[ "$f8" -a "$f14" -a "$f16" ] || f_die 1 "$msg_unknown_font_selection"
-f_sysrc_set font8x8 "$f8" || f_die
-f_sysrc_set font8x14 "$f14" || f_die
-f_sysrc_set font8x16 "$f16" || f_die
+f_eval_catch "$0" f_sysrc_set 'f_sysrc_set font8x8 "%s"' "$f8" || f_die
+f_eval_catch "$0" f_sysrc_set 'f_sysrc_set font8x14 "%s"' "$f14" || f_die
+f_eval_catch "$0" f_sysrc_set 'f_sysrc_set font8x16 "%s"' "$f16" || f_die
if [ "$mc_start" ]; then
- f_sysrc_set mousechar_start "$mc_start" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set mousechar_start "%s"' "$mc_start" || f_die
else
- f_sysrc_delete mousechar_start || f_die
+ f_eval_catch "$0" f_sysrc_delete \
+ 'f_sysrc_delete mousechar_start' || f_die
fi
exit $SUCCESS
Modified: stable/10/usr.sbin/bsdconfig/console/keymap
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/keymap Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/console/keymap Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
@@ -246,10 +246,8 @@ while :; do
keymap_name=
mtag="${mtag# }" # remove single leading-space if-present
for name in $KEYMAP_NAMES; do
- if [ "$( eval echo \"\$msg_$name\" )" = "$mtag" ]; then
- keymap_name="$name"
- break
- fi
+ debug= f_getvar msg_$name msg
+ [ "$msg" = "$mtag" ] && keymap_name="$name" break
done
[ "$keymap_name" ] || continue
@@ -319,7 +317,8 @@ while :; do
esac
if [ "$keymap_to_set" ]; then
- f_sysrc_set keymap "$keymap_to_set" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set keymap "%s"' "$keymap_to_set" || f_die
break
else
f_die 1 "$msg_unknown_keymap"
Modified: stable/10/usr.sbin/bsdconfig/console/repeat
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/repeat Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/console/repeat Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
@@ -129,7 +129,8 @@ case "$mtag" in
esac
if [ "$repeat_rate_to_set" ]; then
- f_sysrc_set keyrate "$repeat_rate_to_set" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set keyrate "%s"' "$repeat_rate_to_set" || f_die
break
else
f_die 1 "$msg_unknown_repeat_rate"
Modified: stable/10/usr.sbin/bsdconfig/console/saver
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/saver Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/console/saver Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
@@ -144,7 +144,8 @@ case "$mtag" in
f_dialog_title "$msg_value_required"
f_dialog_input blanktime "$msg_enter_timeout_period" \
"$( f_sysrc_get blanktime )" &&
- f_sysrc_set blanktime "$blanktime" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set blanktime "%s"' "$blanktime" || f_die
f_dialog_title_restore
exit $SUCCESS
esac
@@ -180,7 +181,8 @@ case "$mtag" in
esac
if [ "$saver_to_set" ]; then
- f_sysrc_set saver "$saver_to_set" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set saver "%s"' "$saver_to_set" || f_die
break
else
f_die 1 "$msg_unknown_saver"
Modified: stable/10/usr.sbin/bsdconfig/console/screenmap
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/screenmap Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/console/screenmap Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
@@ -141,7 +141,8 @@ case "$mtag" in
esac
if [ "$scrnmap_to_set" ]; then
- f_sysrc_set scrnmap "$scrnmap_to_set" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set scrnmap "%s"' "$scrnmap_to_set" || f_die
break
else
f_die 1 "$msg_unknown_screenmap_selection"
Modified: stable/10/usr.sbin/bsdconfig/console/ttys
==============================================================================
--- stable/10/usr.sbin/bsdconfig/console/ttys Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/console/ttys Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
@@ -108,23 +108,28 @@ dialog_menu_main()
#
ttys_set_type()
{
+ local funcname=ttys_set_type
local consterm="$1" err
#
# Create new temporary file to write our ttys(5) update with new types.
#
- local tmpfile="$( mktemp -t "$pgm" )"
- [ "$tmpfile" ] || return $FAILURE
+ local tmpfile
+ f_eval_catch -k tmpfile $funcname mktemp 'mktemp -t "%s"' "$pgm" ||
+ return $FAILURE
#
# Fixup permissions and ownership (mktemp(1) creates the temporary file
# with 0600 permissions -- change the permissions and ownership to
# match ttys(5) before we write it out and mv(1) it into place).
#
- local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2> /dev/null )"
- local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2> /dev/null )"
- f_quietly chmod "${mode:-0644}" "$tmpfile"
- f_quietly chown "${owner:-root:wheel}" "$tmpfile"
+ local mode owner
+ f_eval_catch -dk mode $funcname stat \
+ 'stat -f "%%#Lp" "%s"' "$ETC_TTYS" || mode=0644
+ f_eval_catch -dk owner $funcname stat \
+ 'stat -f "%%u:%%g" "%s"' "$ETC_TTYS" || owner="root:wheel"
+ f_eval_catch -d $funcname chmod 'chmod "%s" "%s"' "$mode" "$tmpfile"
+ f_eval_catch -d $funcname chown 'chown "%s" "%s"' "$owner" "$tmpfile"
#
# Operate on ttys(5), replacing only the types of `ttyv*' and
@@ -156,10 +161,8 @@ ttys_set_type()
f_dialog_msgbox "$err"
return $FAILURE
fi
- if ! err=$( mv -f "$tmpfile" "$ETC_TTYS" 2>&1 ); then
- f_dialog_msgbox "$err"
+ f_eval_catch $funcname mv 'mv -f "%s" "%s"' "$tmpfile" "$ETC_TTYS" ||
return $FAILURE
- fi
return $SUCCESS
}
Modified: stable/10/usr.sbin/bsdconfig/diskmgmt/diskmgmt
==============================================================================
--- stable/10/usr.sbin/bsdconfig/diskmgmt/diskmgmt Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/diskmgmt/diskmgmt Wed Jan 15 07:49:17 2014 (r260678)
@@ -37,8 +37,8 @@ f_include $BSDCFG_SHARE/mustberoot.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="050.diskmgmt"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
Modified: stable/10/usr.sbin/bsdconfig/docsinstall/docsinstall
==============================================================================
--- stable/10/usr.sbin/bsdconfig/docsinstall/docsinstall Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/docsinstall/docsinstall Wed Jan 15 07:49:17 2014 (r260678)
@@ -37,8 +37,8 @@ f_include $BSDCFG_SHARE/mustberoot.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="020.docsinstall"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
Modified: stable/10/usr.sbin/bsdconfig/dot/dot
==============================================================================
--- stable/10/usr.sbin/bsdconfig/dot/dot Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/dot/dot Wed Jan 15 07:49:17 2014 (r260678)
@@ -41,8 +41,8 @@ BSDCFG_LIBE="/usr/libexec/bsdconfig" APP
f_include_lang $BSDCFG_LIBE/include/messages.subr
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
Modified: stable/10/usr.sbin/bsdconfig/includes/includes
==============================================================================
--- stable/10/usr.sbin/bsdconfig/includes/includes Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/includes/includes Wed Jan 15 07:49:17 2014 (r260678)
@@ -41,8 +41,8 @@ BSDCFG_LIBE="/usr/libexec/bsdconfig" APP
f_include_lang $BSDCFG_LIBE/include/messages.subr
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ GLOBALS
Modified: stable/10/usr.sbin/bsdconfig/mouse/disable
==============================================================================
--- stable/10/usr.sbin/bsdconfig/mouse/disable Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/mouse/disable Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
@@ -73,12 +73,16 @@ f_mustberoot_init
#
# Stop the mouse daemon
#
-[ -r "$MOUSED_PIDFILE" ] &&
- f_quietly kill "$( cat "$MOUSED_PIDFILE" )"
-f_sysrc_set moused_enable "NO" || f_die
-f_sysrc_set moused_type "NO" || f_die
-f_sysrc_delete moused_port || f_die
-f_sysrc_delete moused_flags || f_die
+if [ -r "$MOUSED_PIDFILE" ]; then
+ f_eval_catch -dk pid "$0" cat 'cat "%s"' "$MOUSED_PIDFILE" &&
+ f_isinteger "$pid" &&
+ [ $pid -gt 0 ] &&
+ f_eval_catch -d "$0" kill 'kill %s' $pid
+fi
+f_eval_catch "$0" f_sysrc_set 'f_sysrc_set moused_enable NO' || f_die
+f_eval_catch "$0" f_sysrc_set 'f_sysrc_set moused_type NO' || f_die
+f_eval_catch "$0" f_sysrc_delete 'f_sysrc_delete moused_port' || f_die
+f_eval_catch "$0" f_sysrc_delete 'f_sysrc_delete moused_flags' || f_die
#
# Message box
Modified: stable/10/usr.sbin/bsdconfig/mouse/enable
==============================================================================
--- stable/10/usr.sbin/bsdconfig/mouse/enable Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/mouse/enable Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
@@ -85,10 +85,15 @@ flags=$( f_sysrc_get moused_flags )
# Start the mouse daemon
#
f_dialog_info "$msg_trying_to_start_the_mouse_daemon"
-[ -r "$MOUSED_PIDFILE" ] &&
- f_quietly kill "$( cat "$MOUSED_PIDFILE" 2> /dev/null )"
-f_quietly vidcontrol -m on
-f_quietly moused -t "$type" -p "$port" $flags
+if [ -r "$MOUSED_PIDFILE" ]; then
+ f_eval_catch -dk pid "$0" cat 'cat "%s"' "$MOUSED_PIDFILE" &&
+ f_isinteger "$pid" &&
+ [ $pid -gt 0 ] &&
+ f_eval_catch -d "$0" kill 'kill %s' $pid
+fi
+f_eval_catch -d "$0" vidcontrol 'vidcontrol -m on'
+f_eval_catch -d "$0" moused \
+ 'moused -t "%s" -p "%s" %s' "$type" "$port" "$flags"
#
# Confirm with the user that the mouse is working
@@ -101,14 +106,19 @@ f_dialog_title_restore
#
# Stop the mouse daemon
#
-f_quietly vidcontrol -m off
+f_eval_catch -d "$0" vidcontrol 'vidcontrol -m off'
if [ $retval -eq $DIALOG_OK ]; then
- f_sysrc_set moused_enable "YES" || f_die
- ln -fs /dev/sysmouse /dev/mouse || f_die # backwards compat
+ f_eval_catch "$0" f_sysrc_set 'f_sysrc_set moused_enable YES' || f_die
+ f_eval_catch "$0" ln \
+ 'ln -fs /dev/sysmouse /dev/mouse' || f_die # backwards compat
else
- [ -r "$MOUSED_PIDFILE" ] &&
- f_quietly kill "$( cat "$MOUSED_PIDFILE" )"
- f_sysrc_set moused_enable "NO" || f_die
+ if [ -r "$MOUSED_PIDFILE" ]; then
+ f_eval_catch -dk pid "$0" cat 'cat "%s"' "$MOUSED_PIDFILE" &&
+ f_isinteger "$pid" &&
+ [ $pid -gt 0 ] &&
+ f_eval_catch -d "$0" kill 'kill %s' $pid
+ fi
+ f_eval_catch "$0" f_sysrc_set 'f_sysrc_set moused_enable NO' || f_die
fi
exit $SUCCESS
Modified: stable/10/usr.sbin/bsdconfig/mouse/flags
==============================================================================
--- stable/10/usr.sbin/bsdconfig/mouse/flags Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/mouse/flags Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ CONFIGURATION
@@ -86,7 +86,7 @@ f_dialog_title_restore
#
# Save the new value
#
-f_sysrc_set moused_flags "$flags" || f_die
+f_eval_catch "$0" f_sysrc_set 'f_sysrc_set moused_flags "%s"' "$flags" || f_die
exit $SUCCESS
Modified: stable/10/usr.sbin/bsdconfig/mouse/mouse
==============================================================================
--- stable/10/usr.sbin/bsdconfig/mouse/mouse Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/mouse/mouse Wed Jan 15 07:49:17 2014 (r260678)
@@ -37,8 +37,8 @@ f_include $BSDCFG_SHARE/mustberoot.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
Modified: stable/10/usr.sbin/bsdconfig/mouse/port
==============================================================================
--- stable/10/usr.sbin/bsdconfig/mouse/port Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/mouse/port Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
@@ -141,7 +141,8 @@ case "$mtag" in
esac
if [ "$moused_port_to_set" ]; then
- f_sysrc_set moused_port "$moused_port_to_set" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set moused_port "%s"' "$moused_port_to_set" || f_die
else
f_die 1 "$msg_unknown_mouse_port_selection"
fi
Modified: stable/10/usr.sbin/bsdconfig/mouse/type
==============================================================================
--- stable/10/usr.sbin/bsdconfig/mouse/type Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/mouse/type Wed Jan 15 07:49:17 2014 (r260678)
@@ -38,8 +38,8 @@ f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
@@ -157,7 +157,8 @@ case "$mtag" in
esac
if [ "$moused_type_to_set" ]; then
- f_sysrc_set moused_type "$moused_type_to_set" || f_die
+ f_eval_catch "$0" f_sysrc_set \
+ 'f_sysrc_set moused_type "%s"' "$moused_type_to_set" || f_die
else
f_die 1 "$msg_unknown_mouse_protocol_selection"
fi
Modified: stable/10/usr.sbin/bsdconfig/networking/defaultrouter
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/defaultrouter Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/defaultrouter Wed Jan 15 07:49:17 2014 (r260678)
@@ -28,6 +28,9 @@
#
############################################################ INCLUDES
+# Prevent device.subr (included indirectly) from auto scanning on load
+DEVICE_SELF_SCAN_ALL=NO
+
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_dprintf "%s: loading includes..." "$0"
@@ -38,8 +41,8 @@ f_include $BSDCFG_SHARE/networking/routi
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ MAIN
Modified: stable/10/usr.sbin/bsdconfig/networking/devices
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/devices Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/devices Wed Jan 15 07:49:17 2014 (r260678)
@@ -49,8 +49,8 @@ f_include $BSDCFG_SHARE/networking/netma
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ MAIN
@@ -143,8 +143,8 @@ while :; do
# Fill in IP address/netmask from active settings if no
# configuration could be extrapolated from rc.conf(5)
#
- [ "$_ipaddr" ] || _ipaddr=$( f_ifconfig_inet $interface )
- [ "$_netmask" ] || _netmask=$( f_ifconfig_netmask $interface )
+ [ "$_ipaddr" ] || f_ifconfig_inet $interface _ipaddr
+ [ "$_netmask" ] || f_ifconfig_netmask $interface _netmask
# Get the extra options (this always comes from rc.conf(5))
_options=$( f_ifconfig_options $interface )
Modified: stable/10/usr.sbin/bsdconfig/networking/hostname
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/hostname Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/hostname Wed Jan 15 07:49:17 2014 (r260678)
@@ -41,8 +41,8 @@ f_include $BSDCFG_SHARE/networking/hostn
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ MAIN
Modified: stable/10/usr.sbin/bsdconfig/networking/nameservers
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/nameservers Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/nameservers Wed Jan 15 07:49:17 2014 (r260678)
@@ -41,8 +41,8 @@ f_include $BSDCFG_SHARE/networking/resol
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ MAIN
Modified: stable/10/usr.sbin/bsdconfig/networking/networking
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/networking Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/networking Wed Jan 15 07:49:17 2014 (r260678)
@@ -37,8 +37,8 @@ f_include $BSDCFG_SHARE/mustberoot.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ FUNCTIONS
Modified: stable/10/usr.sbin/bsdconfig/networking/share/device.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/device.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/device.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -40,6 +40,7 @@ f_include $BSDCFG_SHARE/networking/media
f_include $BSDCFG_SHARE/networking/netmask.subr
f_include $BSDCFG_SHARE/networking/resolv.subr
f_include $BSDCFG_SHARE/networking/routing.subr
+f_include $BSDCFG_SHARE/strings.subr
f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
@@ -163,6 +164,7 @@ f_dialog_menu_netdev()
#
f_dialog_menu_netdev_edit()
{
+ local funcname=f_dialog_menu_netdev_edit
local interface="$1" ipaddr="$2" netmask="$3" options="$4" dhcp="$5"
local prompt menu_list height width rows
@@ -175,7 +177,7 @@ f_dialog_menu_netdev_edit()
dhcp_orig="$5"
local hline="$hline_arrows_tab_enter"
- prompt=$( printf "$msg_network_configuration" "$interface" )
+ f_sprintf prompt "$msg_network_configuration" "$interface"
#
# Loop forever until the user has finished configuring the different
@@ -254,8 +256,9 @@ f_dialog_menu_netdev_edit()
# are made is changed parts of the system may hang.
#
if f_nfs_mounted && ! f_jailed; then
- local setting="$( printf "$msg_current_dhcp_status" \
- "$interface" "$dhcp_status" )"
+ local setting
+ f_sprintf setting "$msg_current_dhcp_status" \
+ "$interface" "$dhcp_status"
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
continue
fi
@@ -269,7 +272,7 @@ f_dialog_menu_netdev_edit()
trap - SIGINT
( # Execute within sub-shell to allow/catch Ctrl-C
trap 'exit $FAILURE' SIGINT
- msg=$( printf "$msg_scanning_for_dhcp" "$interface" )
+ f_sprintf msg "$msg_scanning_for_dhcp" "$interface"
if [ "$USE_XDIALOG" ]; then
(
f_quietly ifconfig "$interface" delete
@@ -319,14 +322,16 @@ f_dialog_menu_netdev_edit()
local value=
if [ "$dhcp" ]; then
- f_sysrc_delete defaultrouter
+ f_eval_catch $funcname f_sysrc_delete \
+ 'f_sysrc_delete defaultrouter'
value=DHCP
else
value="inet $ipaddr netmask $netmask"
value="$value${options:+ }$options"
fi
- f_sysrc_set ifconfig_$interface "$value"
+ f_eval_catch $funcname f_sysrc_set \
+ 'f_sysrc_set "ifconfig_%s" "%s"' "$interface" "$value"
fi
#
@@ -337,10 +342,12 @@ f_dialog_menu_netdev_edit()
then
f_show_info "$msg_bring_interface_up" "$interface"
- local dr="$( f_sysrc_get defaultrouter )" err
+ local dr="$( f_sysrc_get defaultrouter )"
if [ "$dr" = "NO" -o ! "$dr" ]; then
- dr=$( f_route_get_default )
- [ "$dr" ] && f_sysrc_set defaultrouter "$dr"
+ f_route_get_default dr
+ [ "$dr" ] && f_eval_catch \
+ $funcname f_sysrc_set \
+ 'f_sysrc_set defaultrouter "%s"' "$dr"
fi
#
# Make a backup of resolv.conf(5) before using
@@ -351,16 +358,13 @@ f_dialog_menu_netdev_edit()
# resolv.conf(5) by-default upon termination).
#
f_quietly cp -fp "$RESOLV_CONF" "$RESOLV_CONF.$$"
- err=$( ifconfig $interface inet $ipaddr \
- netmask $netmask $options 2>&1 )
- if [ $? -eq $SUCCESS ]; then
- if [ "$dr" -a "$dr" != "NO" ]; then
- err=$( route add default "$dr" 2>&1 )
- [ $? -eq $SUCCESS ] || \
- dialog_msgbox "$err"
- fi
- else
- dialog_msgbox "$err"
+ if f_eval_catch $funcname ifconfig \
+ 'ifconfig "%s" inet "%s" netmask "%s" %s' \
+ "$interface" "$ipaddr" "$netmask" "$options"
+ then
+ [ "$dr" -a "$dr" != "NO" ] &&
+ f_eval_catch $funcname route \
+ 'route add default "%s"' "$dr"
fi
if cmp -s "$RESOLV_CONF" "$RESOLV_CONF.$$"; then
f_quietly rm -f "$RESOLV_CONF.$$"
Modified: stable/10/usr.sbin/bsdconfig/networking/share/hostname.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/hostname.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/hostname.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -95,6 +95,7 @@ f_dialog_validate_hostname()
#
f_dialog_input_hostname()
{
+ local funcname=f_dialog_input_hostname
local hostname="$( f_sysrc_get 'hostname:-$(hostname)' )"
local hostname_orig="$hostname" # for change-tracking
@@ -120,7 +121,8 @@ f_dialog_input_hostname()
#
if [ "$hostname" != "$hostname_orig" ]; then
f_dialog_info "$msg_saving_hostname"
- f_sysrc_set hostname "$hostname"
+ f_eval_catch $funcname f_sysrc_set \
+ 'f_sysrc_set hostname "%s"' "$hostname"
fi
#
Modified: stable/10/usr.sbin/bsdconfig/networking/share/ipaddr.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/ipaddr.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/ipaddr.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -144,13 +144,14 @@ f_dialog_input_ipaddr()
# system may hang (if any NFS mounts are using that interface).
#
if f_nfs_mounted && ! f_jailed; then
- local setting="$( printf "$msg_current_ipaddr" \
- "$interface" "$_ipaddr" )"
+ local setting
+ f_sprintf setting "$msg_current_ipaddr" "$interface" "$_ipaddr"
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $DIALOG_CANCEL
fi
- local msg="$( printf "$msg_please_enter_new_ip_addr" "$interface" )"
+ local msg
+ f_sprintf msg "$msg_please_enter_new_ip_addr" "$interface"
#
# Loop until the user provides taint-free input.
Modified: stable/10/usr.sbin/bsdconfig/networking/share/media.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/media.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/media.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -115,13 +115,15 @@ f_dialog_input_options()
# the system may hang (if any NFS mounts are using that interface).
#
if f_nfs_mounted && ! f_jailed; then
- local setting="$( printf "$msg_current_options" \
- "$interface" "$options" )"
+ local setting
+ f_sprintf setting "$msg_current_options" \
+ "$interface" "$options"
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $DIALOG_CANCEL
fi
- local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )"
+ local msg
+ f_sprintf msg "$msg_please_enter_mediaopts" "$interface"
local hline="$hline_alnum_punc_tab_enter"
local _options
@@ -162,8 +164,9 @@ f_dialog_menu_media_options()
# the system may hang (if any NFS mounts are using that interface).
#
if f_nfs_mounted && ! f_jailed; then
- local setting="$( printf "$msg_current_options" \
- "$interface" "$_options" )"
+ local setting
+ f_sprintf setting "$msg_current_options" \
+ "$interface" "$_options"
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $DIALOG_CANCEL
fi
@@ -196,11 +199,11 @@ f_dialog_menu_media_options()
local msg
if [ "$USE_XDIALOG" ]; then
- msg=$( printf "$xmsg_supported_media_options" \
- "$interface" "$interface" )
+ f_sprintf msg "$xmsg_supported_media_options" \
+ "$interface" "$interface"
else
- msg=$( printf "$msg_supported_media_options" \
- "$interface" "$interface" )
+ f_sprintf msg "$msg_supported_media_options" \
+ "$interface" "$interface"
fi
local hline="$hline_arrows_tab_enter"
Modified: stable/10/usr.sbin/bsdconfig/networking/share/netmask.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/netmask.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/netmask.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -94,8 +94,9 @@ f_dialog_input_netmask()
# the system may hang (if any NFS mounts are using that interface).
#
if f_nfs_mounted && ! f_jailed; then
- local setting="$( printf "$msg_current_subnet" \
- "$interface" "$_netmask" )"
+ local setting
+ f_sprintf setting "$msg_current_subnet" \
+ "$interface" "$_netmask"
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $DIALOG_CANCEL
fi
@@ -103,7 +104,8 @@ f_dialog_input_netmask()
#
# Loop until the user provides taint-free input.
#
- local msg="$( printf "$msg_please_enter_subnet_mask" "$interface" )"
+ local msg
+ f_sprintf msg "$msg_please_enter_subnet_mask" "$interface"
while :; do
#
# Return error status if:
Modified: stable/10/usr.sbin/bsdconfig/networking/share/resolv.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/resolv.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/resolv.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -162,20 +162,23 @@ END {
'
f_dialog_resolv_conf_update()
{
+ local funcname=f_dialog_resolv_conf_update
local hostname="$1"
#
# Extrapolate the desired domain search parameter for resolv.conf(5)
#
- local search ndots domain="${hostname#*.}"
+ local search nfields ndots domain="${hostname#*.}"
if [ "$RESOLVER_SEARCH_DOMAINS_ALL" = "1" ]; then
- search=""
- ndots=$( IFS=.; set -- $domain; echo $(( $# - 1 )) )
+ search=
+ IFS=. f_count_ifs nfields "$domain"
+ ndots=$(( $nfields - 1 ))
while [ $ndots -ge ${RESOLVER_SEARCH_NDOTS:-1} ]; do
- search="$search${search:+ }$domain"
+ search="$search $domain"
domain="${domain#*.}"
ndots=$(( $ndots - 1 ))
done
+ search="${search# }"
domain="${hostname#*.}"
else
search="$domain"
@@ -194,8 +197,9 @@ f_dialog_resolv_conf_update()
# Create a new temporary file to write our resolv.conf(5)
# update with our new `domain' and `search' directives.
#
- local tmpfile="$( mktemp -t "$pgm" )"
- [ "$tmpfile" ] || return $DIALOG_CANCEL
+ local tmpfile
+ f_eval_catch -dk tmpfile $funcname mktemp \
+ 'mktemp -t "%s"' "$tmpfile" || return $DIALOG_CANCEL
#
# Fixup permissions and ownership (mktemp(1) creates the
@@ -203,10 +207,16 @@ f_dialog_resolv_conf_update()
# permissions and ownership to match resolv.conf(5) before
# we write it out and mv(1) it into place).
#
- local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )"
- local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )"
- f_quietly chmod "${mode:-0644}" "$tmpfile"
- f_quietly chown "${owner:-root:wheel}" "$tmpfile"
+ local mode owner
+ f_eval_catch -dk mode $funcname stat \
+ 'stat -f "%%#Lp" "%s"' "$RESOLV_CONF" || mode=0644
+ f_eval_catch -dk owner $funcname stat \
+ 'stat -f "%%u:%%g" "%s"' "$RESOLV_CONF" ||
+ owner="root:wheel"
+ f_eval_catch -d $funcname chmod \
+ 'chmod "%s" "%s"' "$mode" "$tmpfile"
+ f_eval_catch -d $funcname chown \
+ 'chown "%s" "%s"' "$owner" "$tmpfile"
#
# Operate on resolv.conf(5), replacing only the last
@@ -237,7 +247,8 @@ f_dialog_resolv_conf_update()
#
echo "$new_contents" | tail -r > "$tmpfile" ||
return $DIALOG_CANCEL
- f_quietly mv "$tmpfile" "$RESOLV_CONF"
+ f_eval_catch -d $funcname mv \
+ 'mv "%s" "%s"' "$tmpfile" "$RESOLV_CONF"
fi
}
@@ -288,6 +299,7 @@ END { if ( ! found ) exit 3 }
'
f_dialog_input_nameserver()
{
+ local funcname=f_dialog_input_nameserver
local index="${1:-0}" old_ns="$2" new_ns
local ns="$old_ns"
@@ -344,17 +356,23 @@ f_dialog_input_nameserver()
#
# Create a new temporary file to write our new resolv.conf(5)
#
- local tmpfile="$( mktemp -t "$pgm" )"
- [ "$tmpfile" ] || return $DIALOG_CANCEL
+ local tmpfile
+ f_eval_catch -dk tmpfile $funcname mktemp \
+ 'mktemp -t "%s"' "$pgm" || return $DIALOG_CANCEL
#
# Quietly fixup permissions and ownership
#
local mode owner
- mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )
- owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )
- f_quietly chmod "${mode:-0644}" "$tmpfile"
- f_quietly chown "${owner:-root:wheel}" "$tmpfile"
+ f_eval_catch -dk mode $funcname stat \
+ 'stat -f "%%#Lp" "%s"' "$RESOLV_CONF" || mode=0644
+ f_eval_catch -dk owner $funcname stat \
+ 'stat -f "%%u:%%g" "%s"' "$RESOLV_CONF" ||
+ owner="root:wheel"
+ f_eval_catch -d $funcname chmod \
+ 'chmod "%s" "%s"' "$mode" "$tmpfile"
+ f_eval_catch -d $funcname chown \
+ 'chown "%s" "%s"' "$owner" "$tmpfile"
#
# Operate on resolv.conf(5)
@@ -383,7 +401,8 @@ f_dialog_input_nameserver()
# file into place.
#
echo "$new_contents" > "$tmpfile" || return $DIALOG_CANCEL
- f_quietly mv "$tmpfile" "$RESOLV_CONF"
+ f_eval_catch -d $funcname mv \
+ 'mv "%s" "%s"' "$tmpfile" "$RESOLV_CONF"
fi
}
@@ -409,7 +428,8 @@ f_dialog_menu_nameservers()
#
# Re/Build list of nameservers
#
- local nameservers="$( f_resolv_conf_nameservers )"
+ local nameservers
+ f_resolv_conf_nameservers nameservers
menu_list=$(
index=1
Modified: stable/10/usr.sbin/bsdconfig/networking/share/routing.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/routing.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/routing.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -35,6 +35,7 @@ f_include $BSDCFG_SHARE/dialog.subr
f_include $BSDCFG_SHARE/media/tcpip.subr
f_include $BSDCFG_SHARE/networking/common.subr
f_include $BSDCFG_SHARE/networking/ipaddr.subr
+f_include $BSDCFG_SHARE/strings.subr
f_include $BSDCFG_SHARE/sysrc.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking"
@@ -48,6 +49,8 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc
#
f_dialog_input_defaultrouter()
{
+ local funcname=f_dialog_input_defaultrouter
+
#
# Get the defaultrouter. When this is not configured, the default is
# "NO", however we don't ever want to present this default to the user
@@ -61,9 +64,7 @@ f_dialog_input_defaultrouter()
local defaultrouter="$( f_sysrc_get 'defaultrouter:-NO' )"
local defaultrouter_orig="$defaultrouter" # for change-tracking
case "$defaultrouter" in
- [Nn][Oo])
- defaultrouter=$( f_route_get_default )
- ;;
+ [Nn][Oo]) f_route_get_default defaultrouter ;;
esac
#
@@ -72,8 +73,9 @@ f_dialog_input_defaultrouter()
# mounted, the system will hang.
#
if f_nfs_mounted && ! f_jailed; then
- local setting="$( printf "$msg_current_default_router" \
- "$defaultrouter" )"
+ local setting
+ f_sprintf setting "$msg_current_default_router" \
+ "$defaultrouter"
f_noyes "$msg_nfs_mounts_may_cause_hang" "$setting" ||
return $DIALOG_CANCEL
fi
@@ -101,27 +103,25 @@ f_dialog_input_defaultrouter()
f_dialog_info "$msg_saving_default_router"
# Save the default router/gateway
- f_sysrc_set defaultrouter "$defaultrouter"
+ f_eval_catch $funcname f_sysrc_set \
+ 'f_sysrc_set defaultrouter "%s"' "$defaultrouter"
fi
#
# Only ask to apply setting if the current defaultrouter is different
# than the stored configuration (in rc.conf(5)).
#
- if [ "$( f_route_get_default )" != "$defaultrouter" ]; then
+ local dr
+ f_route_get_default dr
+ if [ "$dr" != "$defaultrouter" ]; then
f_dialog_clear
- f_yesno "$msg_activate_default_router" \
- "$( f_route_get_default )" "$defaultrouter"
+ f_yesno "$msg_activate_default_router" "$dr" "$defaultrouter"
if [ $? -eq $DIALOG_OK ]; then
- local err
-
# Apply the default router/gateway
- f_quietly route delete default
- err=$( route add default "$defaultrouter" 2>&1 )
- if [ $? -ne $SUCCESS ]; then
- f_dialog_msgbox "$err"
+ f_eval_catch -d $funcname route 'route delete default'
+ f_eval_catch $funcname route \
+ 'route add default "%s"' "$defaultrouter" ||
return $DIALOG_CANCEL
- fi
fi
fi
}
Modified: stable/10/usr.sbin/bsdconfig/networking/share/services.subr
==============================================================================
--- stable/10/usr.sbin/bsdconfig/networking/share/services.subr Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/networking/share/services.subr Wed Jan 15 07:49:17 2014 (r260678)
@@ -42,8 +42,9 @@ f_include $BSDCFG_SHARE/sysrc.subr
#
f_config_pcnfsd()
{
+ local funcname=f_config_pcnfsd
f_package_add "pcnfsd" || return $?
- f_sysrc_set mountd_flags "-n"
+ f_eval_catch $funcname f_sysrc_set 'f_sysrc_set mountd_flags -n'
return $SUCCESS
}
Modified: stable/10/usr.sbin/bsdconfig/packages/packages
==============================================================================
--- stable/10/usr.sbin/bsdconfig/packages/packages Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/packages/packages Wed Jan 15 07:49:17 2014 (r260678)
@@ -45,8 +45,8 @@ f_include $BSDCFG_SHARE/packages/package
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="030.packages"
f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
-[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm"
+f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm &&
+ pgm="${ipgm:-$pgm}"
############################################################ MAIN
Modified: stable/10/usr.sbin/bsdconfig/password/password
==============================================================================
--- stable/10/usr.sbin/bsdconfig/password/password Wed Jan 15 07:47:13 2014 (r260677)
+++ stable/10/usr.sbin/bsdconfig/password/password Wed Jan 15 07:49:17 2014 (r260678)
@@ -37,8 +37,8 @@ f_include $BSDCFG_SHARE/password/passwor
BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="040.password"
-ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 08:03:02 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 573CED8B;
Wed, 15 Jan 2014 08:03:02 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 4282815FB;
Wed, 15 Jan 2014 08:03:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F832Mt024433;
Wed, 15 Jan 2014 08:03:02 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F831i2024430;
Wed, 15 Jan 2014 08:03:01 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150803.s0F831i2024430@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 08:03:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260679 - stable/10/usr.sbin/sysrc
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 08:03:02 -0000
Author: dteske
Date: Wed Jan 15 08:03:01 2014
New Revision: 260679
URL: http://svnweb.freebsd.org/changeset/base/260679
Log:
MFC r257824,257826-257830,258411: Updates to sysrc(8)
257824: Fix a bug with `-d' form working as documented
257826: Add `--version' long option
257827: Add a `-c' option for `check only'
257828: Comments and whitespace
257829: Fix a bug with `-e' introduced by above 257828
257830: Document SYSRC_VERBOSE enviroment variable in the manual
258411: Revert the above 257830 (both merged to get .Dd bump in man-page)
Modified:
stable/10/usr.sbin/sysrc/sysrc
stable/10/usr.sbin/sysrc/sysrc.8
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/sysrc/sysrc
==============================================================================
--- stable/10/usr.sbin/sysrc/sysrc Wed Jan 15 07:49:17 2014 (r260678)
+++ stable/10/usr.sbin/sysrc/sysrc Wed Jan 15 08:03:01 2014 (r260679)
@@ -28,6 +28,9 @@
#
############################################################ INCLUDES
+# Prevent `-d' from being interpreted as a debug flag by common.subr
+DEBUG_SELF_INITIALIZE=
+
BSDCFG_SHARE="/usr/share/bsdconfig"
[ "$_COMMON_SUBR" ] || . $BSDCFG_SHARE/common.subr || exit 1
[ "$_SYSRC_SUBR" ] || f_include $BSDCFG_SHARE/sysrc.subr
@@ -35,8 +38,14 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
############################################################ GLOBALS
#
+# Version information
+#
+SYSRC_VERSION="6.0 Nov-07,2013"
+
+#
# Options
#
+CHECK_ONLY=
DELETE=
DESCRIBE=
IGNORE_UNKNOWNS=
@@ -92,6 +101,8 @@ help()
"Dump a list of all non-default configuration variables."
f_err "$optfmt" "-A" \
"Dump a list of all configuration variables (incl. defaults)."
+ f_err "$optfmt" "-c" \
+ "Check. Return success if no changes needed, else error."
f_err "$optfmt" "-d" \
"Print a description of the given variable."
f_err "$optfmt" "-D" \
@@ -130,6 +141,8 @@ help()
"Verbose. Print the pathname of the specific rc.conf(5)"
f_err "$optfmt" "" \
"file where the directive was found."
+ f_err "$optfmt" "--version" \
+ "Print version information to stdout and exit."
f_err "$optfmt" "-x" \
"Remove variable(s) from specified file(s)."
f_err "\n"
@@ -179,6 +192,7 @@ jail_depend()
#
# Print include dependencies
#
+ echo DEBUG_SELF_INITIALIZE=
cat $BSDCFG_SHARE/common.subr
cat $BSDCFG_SHARE/sysrc.subr
}
@@ -191,27 +205,31 @@ jail_depend()
[ $# -gt 0 ] || usage
#
-# Check for `--help' command-line option
+# Check for `--help' and `--version' command-line option
#
( # Operate in sub-shell to protect $@ in parent
while [ $# -gt 0 ]; do
case "$1" in
- --help) exit 1;;
+ --help) help ;;
+ --version) # see GLOBALS
+ echo "$SYSRC_VERSION"
+ exit 1 ;;
-[fRj]) # These flags take an argument
- shift 1;;
+ shift 1 ;;
esac
shift 1
done
exit 0
-) || help
+) || die
#
# Process command-line flags
#
-while getopts aAdDef:Fhij:nNqR:vxX flag; do
+while getopts aAcdDef:Fhij:nNqR:vxX flag; do
case "$flag" in
a) SHOW_ALL=${SHOW_ALL:-1};;
A) SHOW_ALL=2;;
+ c) CHECK_ONLY=1;;
d) DESCRIBE=1;;
D) RC_CONFS=;;
e) SHOW_EQUALS=1;;
@@ -273,16 +291,23 @@ if [ "$DELETE" -a "$SHOW_ALL" ]; then
fi
#
+# Pre-flight for `-c' command-line option
+#
+[ "$CHECK_ONLY" -a "$SHOW_ALL" ] &&
+ die "$pgm: \`-c' option incompatible with \`-a'/\`-A' options"
+
+#
# Process `-e', `-n', and `-N' command-line options
#
SEP=': '
-[ "$SHOW_EQUALS" ] && SEP='="'
+[ "$SHOW_FILE" ] && SHOW_EQUALS=
[ "$SHOW_NAME" ] || SHOW_EQUALS=
[ "$SYSRC_VERBOSE" = "0" ] && SYSRC_VERBOSE=
if [ ! "$SHOW_VALUE" ]; then
SHOW_NAME=1
SHOW_EQUALS=
fi
+[ "$SHOW_EQUALS" ] && SEP='="'
#
# Process `-j jail' and `-R dir' command-line options
@@ -298,6 +323,7 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then
$( [ "$DELETE" = "2" ] && echo \ -X )
$( [ "$SHOW_ALL" = "1" ] && echo \ -a )
$( [ "$SHOW_ALL" = "2" ] && echo \ -A )
+ ${CHECK_ONLY:+-c}
${DESCRIBE:+-d}
${SHOW_EQUALS:+-e}
${IGNORE_UNKNOWNS:+-i}
@@ -408,7 +434,7 @@ if [ "$SHOW_ALL" ]; then
EXCEPT="IFS|EXCEPT|PATH|RC_DEFAULTS|OPTIND|DESCRIBE|SEP"
EXCEPT="$EXCEPT|DELETE|SHOW_ALL|SHOW_EQUALS|SHOW_NAME"
EXCEPT="$EXCEPT|SHOW_VALUE|SHOW_FILE|SYSRC_VERBOSE|RC_CONFS"
- EXCEPT="$EXCEPT|pgm|SUCCESS|FAILURE"
+ EXCEPT="$EXCEPT|pgm|SUCCESS|FAILURE|CHECK_ONLY"
EXCEPT="$EXCEPT|f_sysrc_desc_awk|f_sysrc_delete_awk"
#
@@ -501,6 +527,7 @@ fi
#
# Process command-line arguments
#
+costatus=$SUCCESS
while [ $# -gt 0 ]; do
NAME="${1%%=*}"
@@ -511,14 +538,19 @@ while [ $# -gt 0 ]; do
*=*)
#
# Like sysctl(8), if both `-d' AND "name=value" is passed,
- # first describe, then attempt to set
+ # first describe (done above), then attempt to set
#
- if [ "$SYSRC_VERBOSE" ]; then
+ # If verbose, prefix line with where the directive lives
+ if [ "$SYSRC_VERBOSE" -a ! "$CHECK_ONLY" ]; then
file=$( f_sysrc_find "$NAME" )
[ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && \
file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' )
- echo -n "$file: "
+ if [ "$SHOW_EQUALS" ]; then
+ echo -n ": $file; "
+ else
+ echo -n "$file: "
+ fi
fi
#
@@ -532,6 +564,20 @@ while [ $# -gt 0 ]; do
fi
#
+ # If `-c' is passed, simply compare and move on
+ #
+ if [ "$CHECK_ONLY" ]; then
+ if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
+ costatus=$FAILURE
+ else
+ value=$( f_sysrc_get "$NAME" )
+ [ "$value" = "${1#*=}" ] || costatus=$FAILURE
+ fi
+ shift 1
+ continue
+ fi
+
+ #
# If `-N' is passed, simplify the output
#
if [ ! "$SHOW_VALUE" ]; then
@@ -546,28 +592,34 @@ while [ $# -gt 0 ]; do
if f_sysrc_set "$NAME" "${1#*=}"; then
if [ "$SHOW_FILE" ]; then
after=$( f_sysrc_find "$NAME" )
- echo -n "${SHOW_NAME:+$NAME$SEP}"
- echo -n "$before${SHOW_EQUALS:+\"}"
- echo " -> $after"
else
after=$( f_sysrc_get "$NAME" )
- echo -n "${SHOW_NAME:+$NAME$SEP}"
- echo "$before -> $after"
fi
+ echo -n "${SHOW_NAME:+$NAME$SEP}"
+ echo -n "$before${SHOW_EQUALS:+\" #}"
+ echo -n " -> ${SHOW_EQUALS:+\"}$after"
+ echo "${SHOW_EQUALS:+\"}"
fi
fi
;;
*)
- if ! IGNORED="$( f_sysrc_get "$NAME?" )"; then
- [ "$IGNORE_UNKNOWNS" ] \
- || echo "$pgm: unknown variable '$NAME'"
+ if ! IGNORED=$( f_sysrc_get "$NAME?" ); then
+ [ "$IGNORE_UNKNOWNS" ] ||
+ echo "$pgm: unknown variable '$NAME'"
+ shift 1
+ costatus=$FAILURE
+ continue
+ fi
+
+ # The above check told us what we needed for `-c'
+ if [ "$CHECK_ONLY" ]; then
shift 1
continue
fi
#
- # Like sysctl(8), when `-d' is passed,
- # desribe it rather than expanding it
+ # Like sysctl(8), when `-d' is passed, desribe it
+ # (already done above) rather than expanding it
#
if [ "$DESCRIBE" ]; then
@@ -594,8 +646,13 @@ while [ $# -gt 0 ]; do
continue
fi
- [ "$SYSRC_VERBOSE" ] && \
- echo -n "$( f_sysrc_find "$NAME" ): "
+ if [ "$SYSRC_VERBOSE" ]; then
+ if [ "$SHOW_EQUALS" ]; then
+ echo -n ": $( f_sysrc_find "$NAME" ); "
+ else
+ echo -n "$( f_sysrc_find "$NAME" ): "
+ fi
+ fi
#
# If `-N' is passed, simplify the output
@@ -609,3 +666,9 @@ while [ $# -gt 0 ]; do
esac
shift 1
done
+
+[ ! "$CHECK_ONLY" ] || exit $costatus
+
+################################################################################
+# END
+################################################################################
Modified: stable/10/usr.sbin/sysrc/sysrc.8
==============================================================================
--- stable/10/usr.sbin/sysrc/sysrc.8 Wed Jan 15 07:49:17 2014 (r260678)
+++ stable/10/usr.sbin/sysrc/sysrc.8 Wed Jan 15 08:03:01 2014 (r260679)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Jul 5, 2013
+.Dd Nov 20, 2013
.Dt SYSRC 8
.Os
.Sh NAME
@@ -32,13 +32,13 @@
.Nd safely edit system rc files
.Sh SYNOPSIS
.Nm
-.Op Fl dDeFhinNqvx
+.Op Fl cdDeFhinNqvx
.Op Fl f Ar file
.Op Fl j Ar jail | Fl R Ar dir
.Ar name Ns Op = Ns Ar value
.Ar ...
.Nm
-.Op Fl dDeFhinNqvx
+.Op Fl cdDeFhinNqvx
.Op Fl f Ar file
.Op Fl j Ar jail | Fl R Ar dir
.Fl a | A
@@ -57,6 +57,12 @@ Dump a list of all non-default configura
.It Fl A
Dump a list of all configuration variables
.Pq incl. defaults .
+.It Fl c
+Check if the value will change when assigning a new value.
+If verbose
+.Pq see Dq Fl v
+prints a message stating whether a change would occur.
+Exits with success if no change is necessary, else returns error status.
.It Fl d
Print a description of the given variable.
.It Fl D
@@ -64,10 +70,13 @@ Show default value(s) only (this is the
passing `-f' with a NULL file-argument).
.It Fl e
Print query results as
-.Ql var=value
-.Pq useful for producing output to be fed back in .
-Ignored if
-.Fl n
+.Xr sh 1
+compatible syntax
+.Pq for example, Ql var=value .
+Ignored if either
+.Ql Fl n
+or
+.Ql Fl F
is specified.
.It Fl f Ar file
Operate on the specified file(s) instead of the files obtained by reading the
@@ -112,6 +121,8 @@ Verbose.
Print the pathname of the specific
.Xr rc.conf 5
file where the directive was found.
+.It Fl -version
+Print version information to stdout and exit.
.It Fl x
Remove variable(s) from specified file(s).
.El
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 08:10:42 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 1F27F16D;
Wed, 15 Jan 2014 08:10:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 0AE50169F;
Wed, 15 Jan 2014 08:10:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F8Afw3025795;
Wed, 15 Jan 2014 08:10:41 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F8AfdO025792;
Wed, 15 Jan 2014 08:10:41 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150810.s0F8AfdO025792@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 08:10:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260680 - in stable/10: release
usr.sbin/bsdinstall/scripts
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 08:10:42 -0000
Author: dteske
Date: Wed Jan 15 08:10:41 2014
New Revision: 260680
URL: http://svnweb.freebsd.org/changeset/base/260680
Log:
MFC r259686:
Move the installer's keymap solution introduced by SVN r259468. The new
location of /etc/rc.local on the install media is more appropriate as it
knows serial vs. non-serial and can also do the change earlier (so that
even the initial Install dialog can benefit from the change).
Discussed with: nwhitehorn
Modified:
stable/10/release/rc.local
stable/10/usr.sbin/bsdinstall/scripts/auto
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/release/rc.local
==============================================================================
--- stable/10/release/rc.local Wed Jan 15 08:03:01 2014 (r260679)
+++ stable/10/release/rc.local Wed Jan 15 08:10:41 2014 (r260680)
@@ -19,6 +19,10 @@ if [ $? -eq 0 ]; then
TERM=xterm
fi
+ # Don't send ESC on function-key 62/63 (left/right command key)
+ kbdcontrol -f 62 '' > /dev/null 2>&1
+ kbdcontrol -f 63 '' > /dev/null 2>&1
+
if [ -z "$EXTERNAL_VTY_STARTED" ]; then
# Init will clean these processes up if/when the system
# goes multiuser
Modified: stable/10/usr.sbin/bsdinstall/scripts/auto
==============================================================================
--- stable/10/usr.sbin/bsdinstall/scripts/auto Wed Jan 15 08:03:01 2014 (r260679)
+++ stable/10/usr.sbin/bsdinstall/scripts/auto Wed Jan 15 08:10:41 2014 (r260680)
@@ -49,10 +49,6 @@ error() {
############################################################ MAIN
-# Don't send ESC on function-key 62/63 (left/right command key)
-f_quietly kbdcontrol -f 62 ''
-f_quietly kbdcontrol -f 63 ''
-
f_dprintf "Began Installation at %s" "$( date )"
rm -rf $BSDINSTALL_TMPETC
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 08:12:19 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 9726C2C3;
Wed, 15 Jan 2014 08:12:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 82D5916AC;
Wed, 15 Jan 2014 08:12:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F8CJ0Y028665;
Wed, 15 Jan 2014 08:12:19 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F8CJwN028664;
Wed, 15 Jan 2014 08:12:19 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150812.s0F8CJwN028664@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 08:12:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260681 - stable/10/usr.sbin/bsdinstall/scripts
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 08:12:19 -0000
Author: dteske
Date: Wed Jan 15 08:12:19 2014
New Revision: 260681
URL: http://svnweb.freebsd.org/changeset/base/260681
Log:
MFC r260260 (gavin): Remove what appears to be a stray debugging printf.
Modified:
stable/10/usr.sbin/bsdinstall/scripts/wlanconfig
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- stable/10/usr.sbin/bsdinstall/scripts/wlanconfig Wed Jan 15 08:10:41 2014 (r260680)
+++ stable/10/usr.sbin/bsdinstall/scripts/wlanconfig Wed Jan 15 08:12:19 2014 (r260681)
@@ -111,7 +111,6 @@ echo "network={
priority=5
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
elif echo $ENCRYPTION | grep -q WEP; then
- echo FOO
exec 3>&1
WEPKEY=`dialog --insecure --backtitle "FreeBSD Installer" \
--title "WEP Setup" --mixedform "" 0 0 0 \
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 08:17:32 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 4EB8A47D;
Wed, 15 Jan 2014 08:17:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 201CD16DB;
Wed, 15 Jan 2014 08:17:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0F8HVAB029470;
Wed, 15 Jan 2014 08:17:31 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0F8HVT8029469;
Wed, 15 Jan 2014 08:17:31 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201401150817.s0F8HVT8029469@svn.freebsd.org>
From: Devin Teske
Date: Wed, 15 Jan 2014 08:17:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260682 - stable/10/usr.sbin/bsdinstall/scripts
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 08:17:32 -0000
Author: dteske
Date: Wed Jan 15 08:17:31 2014
New Revision: 260682
URL: http://svnweb.freebsd.org/changeset/base/260682
Log:
MFC r260261 (gavin):
Lower the priority of the "connect to any open wireless network" network
description, so guaranteeing that any other defined network will be tried
first.
MFC r260262 (gavin):
Allow bsdinstall to use WPA-Enterprise networks when installing. This
only allows basic username/password config, and does not provide the
ability to set any of the other WPA options. Regardless, this is
generally sufficient to associate.
Perhaps in the future this could allow full configuring (e.g. being able
to set "anonymous identity", and perhaps some of the more obscure WPA
options), though perhaps that will better belong in bsdconfig when that
grows wlan config ability.
Modified:
stable/10/usr.sbin/bsdinstall/scripts/wlanconfig
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- stable/10/usr.sbin/bsdinstall/scripts/wlanconfig Wed Jan 15 08:12:19 2014 (r260681)
+++ stable/10/usr.sbin/bsdinstall/scripts/wlanconfig Wed Jan 15 08:17:31 2014 (r260682)
@@ -110,6 +110,29 @@ echo "network={
psk=\"$PASS\"
priority=5
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+elif echo $ENCRYPTION | grep -q EAP; then
+ exec 3>&1
+ USERPASS=`dialog --insecure --backtitle "FreeBSD Installer" \
+ --title "WPA-Enterprise Setup" --mixedform "" 0 0 0 \
+ "SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
+ "Username" 2 0 "" 2 12 25 63 0 \
+ "Password" 3 0 "" 3 12 25 63 1 \
+ 2>&1 1>&3` \
+ || exec $0 $@
+ exec 3>&-
+echo "network={
+ ssid=\"$NETWORK\"
+ key_mgmt=WPA-EAP" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+echo "$USERPASS" | awk '
+{
+ if (NR == 1) {
+ printf " identity=\"%s\"\n", $1;
+ } else if (NR == 2) {
+ printf " password=\"%s\"\n", $1;
+ }
+}' >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
+echo " priority=5
+}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
elif echo $ENCRYPTION | grep -q WEP; then
exec 3>&1
WEPKEY=`dialog --insecure --backtitle "FreeBSD Installer" \
@@ -135,7 +158,7 @@ fi
# Connect to any open networks policy
echo "network={
- priority=5
+ priority=0
key_mgmt=NONE
}" >> $BSDINSTALL_TMPETC/wpa_supplicant.conf
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 17:51:50 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 110D41B6;
Wed, 15 Jan 2014 17:51:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id E5AC11144;
Wed, 15 Jan 2014 17:51:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0FHpnAV049940;
Wed, 15 Jan 2014 17:51:49 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0FHpnpJ049939;
Wed, 15 Jan 2014 17:51:49 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201401151751.s0FHpnpJ049939@svn.freebsd.org>
From: Hiroki Sato
Date: Wed, 15 Jan 2014 17:51:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260692 - stable/10/release/doc/en_US.ISO8859-1/errata
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 17:51:50 -0000
Author: hrs
Date: Wed Jan 15 17:51:49 2014
New Revision: 260692
URL: http://svnweb.freebsd.org/changeset/base/260692
Log:
MFC of r260691:
- Fix indent.
- Minor clean up after DB5 migration.
Modified:
stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
==============================================================================
--- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 17:34:21 2014 (r260691)
+++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 17:51:49 2014 (r260692)
@@ -1,32 +1,24 @@
+ "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [
+
%release;
]>
-
-
- &os; &release.prev; Errata
-
-
-
- The &os; Project
-
+
+
+
+ &os; &release.prev; Errata
+
+ The &os; Project
$FreeBSD$
2014
+
The &os; Documentation Project
@@ -37,20 +29,20 @@
&tm-attrib.general;
-
- This document lists errata items for &os; &release.prev;,
- containing significant information discovered after the release
- or too late in the release cycle to be otherwise included in the
- release documentation.
- This information includes security advisories, as well as news
- relating to the software or documentation that could affect its
- operation or usability. An up-to-date version of this document
- should always be consulted before installing this version of
- &os;.
-
- This errata document for &os; &release.prev;
- will be maintained until the release of &os; &release.next;.
-
+
+ This document lists errata items for &os; &release.prev;,
+ containing significant information discovered after the release
+ or too late in the release cycle to be otherwise included in the
+ release documentation.
+ This information includes security advisories, as well as news
+ relating to the software or documentation that could affect its
+ operation or usability. An up-to-date version of this document
+ should always be consulted before installing this version of
+ &os;.
+
+ This errata document for &os; &release.prev;
+ will be maintained until the release of &os; &release.next;.
+
@@ -67,44 +59,96 @@
out of date by definition, but other copies are kept updated on
the Internet and should be consulted as the current
errata
for this release. These other copies of the
- errata are located at http://www.FreeBSD.org/releases/ , plus any sites
+ errata are located at
+ ,
+ plus any sites
which keep up-to-date mirrors of this location.
Source and binary snapshots of &os; &release.branch; also
contain up-to-date copies of this document (as of the time of
the snapshot).
- For a list of all &os; CERT security advisories, see http://www.FreeBSD.org/security/ or ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/ .
-
+ For a list of all &os; CERT security advisories, see
+
+ or .
Security Advisories
- No advisories.
-
- No advisories.
-
- No advisories.
+
+
+
+
+
+
+
+ Advisory
+ Date
+ Topic
+
+
+
+
+
+ SA-13:14.openssh
+
+ 19 November 2013
+
+ OpenSSH AES-GCM memory corruption
+ vulnerability
+
+
+
+ SA-14:01.bsnmpd
+
+ 14 January 2014
+
+ bsnmpd remote denial of service vulnerability
+
+
+
+ SA-14:02.ntpd
+
+ 14 January 2014
+
+ ntpd distributed reflection Denial of Service vulnerability
+
+
+
+ SA-14:03.openssl
+
+ 14 January 2014
+
+ OpenSSL multiple vulnerabilities
+
+
+
+ SA-14:04.bind
+
+ 14 January 2014
+
+ BIND remote denial of service vulnerability
+
+
+
+
Open Issues
- No open issues.
-
- No open issues.
-
- No open issues.
+ No open issues.
Late-Breaking News
- No news.
-
- No news.
-
- No news.
+ No news.
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 18:48:35 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 2FB0EA20;
Wed, 15 Jan 2014 18:48:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 1B9261905;
Wed, 15 Jan 2014 18:48:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0FImYlj070260;
Wed, 15 Jan 2014 18:48:34 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0FImY1O070259;
Wed, 15 Jan 2014 18:48:34 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201401151848.s0FImY1O070259@svn.freebsd.org>
From: Hiroki Sato
Date: Wed, 15 Jan 2014 18:48:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260693 - stable/10/release/doc/en_US.ISO8859-1/errata
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 18:48:35 -0000
Author: hrs
Date: Wed Jan 15 18:48:34 2014
New Revision: 260693
URL: http://svnweb.freebsd.org/changeset/base/260693
Log:
Document an issue of FreeBSD/i386 on VirtualBox.
Discussed with: glebius and delphij
Modified:
stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
==============================================================================
--- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 17:51:49 2014 (r260692)
+++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 18:48:34 2014 (r260693)
@@ -143,7 +143,32 @@
Open Issues
- No open issues.
+
+
+ &os;/&arch.i386; &release.prev; running as a guest
+ operating system on VirtualBox
+ can have a problem with disk I/O access. It depends on some
+ specific hardware configuration and does not depend on a
+ specific version of VitrualBox or
+ host operating system.
+
+ It causes various errors and makes &os; quite unstable.
+ Although the cause is still unclear, disabling unmapped I/O
+ works as a workaround. To disable it, choose Escape to
+ loader prompt in the boot menu and enter the following
+ lines from &man.loader.8; prompt, after
+ an OK :
+
+ set vfs.unmapped_buf_allowed=0
+boot
+
+ Note that the following line has to be added to
+ /boot/loader.conf after a boot.
+ It disables unmapped I/O at every boot:
+
+ vfs.unmapped_buf_allowed=0
+
+
From owner-svn-src-stable-10@FreeBSD.ORG Wed Jan 15 19:09:11 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id D3E5E6F9;
Wed, 15 Jan 2014 19:09:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id BE4E71A99;
Wed, 15 Jan 2014 19:09:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0FJ9Bee078280;
Wed, 15 Jan 2014 19:09:11 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0FJ9Bw3078279;
Wed, 15 Jan 2014 19:09:11 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201401151909.s0FJ9Bw3078279@svn.freebsd.org>
From: Hiroki Sato
Date: Wed, 15 Jan 2014 19:09:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260694 - stable/10/release/doc/en_US.ISO8859-1/errata
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Wed, 15 Jan 2014 19:09:11 -0000
Author: hrs
Date: Wed Jan 15 19:09:11 2014
New Revision: 260694
URL: http://svnweb.freebsd.org/changeset/base/260694
Log:
Document a Heimdal fix and interoperability.
Modified:
stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
Modified: stable/10/release/doc/en_US.ISO8859-1/errata/article.xml
==============================================================================
--- stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 18:48:34 2014 (r260693)
+++ stable/10/release/doc/en_US.ISO8859-1/errata/article.xml Wed Jan 15 19:09:11 2014 (r260694)
@@ -168,6 +168,21 @@ boot
vfs.unmapped_buf_allowed=0
+
+
+ A bug in Heimdal (an
+ implementation of Kerberos
+ authentication in &os; base system) has been fixed. It
+ could cause an interoperability issue between
+ Heimdal and the other
+ implementations including MIT
+ Kerberos . However, due to this fix,
+ Heimdal and some applications
+ which depend on it in the previous &os; releases do not work
+ with one in &release.prev; in certain cases. Errata Notice
+ for the supported releases to fix it will be
+ released.
+
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 13:21:32 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id AF1921B6;
Thu, 16 Jan 2014 13:21:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 9A06D1B18;
Thu, 16 Jan 2014 13:21:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GDLWkp008066;
Thu, 16 Jan 2014 13:21:32 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GDLW1T008065;
Thu, 16 Jan 2014 13:21:32 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201401161321.s0GDLW1T008065@svn.freebsd.org>
From: "Andrey V. Elsukov"
Date: Thu, 16 Jan 2014 13:21:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260712 - stable/10/sys/netinet6
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 13:21:32 -0000
Author: ae
Date: Thu Jan 16 13:21:32 2014
New Revision: 260712
URL: http://svnweb.freebsd.org/changeset/base/260712
Log:
MFC r260481:
Add MRT6_DLOG() macro for debugging.
Reduce number of MRT6DEBUG ifdefs and fix some broken format strings.
Modified:
stable/10/sys/netinet6/ip6_mroute.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/netinet6/ip6_mroute.c
==============================================================================
--- stable/10/sys/netinet6/ip6_mroute.c Thu Jan 16 13:20:20 2014 (r260711)
+++ stable/10/sys/netinet6/ip6_mroute.c Thu Jan 16 13:21:32 2014 (r260712)
@@ -221,6 +221,14 @@ static VNET_DEFINE(u_int, mrt6debug) = 0
#define DEBUG_XMIT 0x10
#define DEBUG_REG 0x20
#define DEBUG_PIM 0x40
+#define DEBUG_ERR 0x80
+#define DEBUG_ANY 0x7f
+#define MRT6_DLOG(m, fmt, ...) \
+ if (V_mrt6debug & (m)) \
+ log(((m) & DEBUG_ERR) ? LOG_ERR: LOG_DEBUG, \
+ "%s: " fmt "\n", __func__, ##__VA_ARGS__)
+#else
+#define MRT6_DLOG(m, fmt, ...)
#endif
static void expire_upcalls(void *);
@@ -526,12 +534,8 @@ static int
ip6_mrouter_init(struct socket *so, int v, int cmd)
{
-#ifdef MRT6DEBUG
- if (V_mrt6debug)
- log(LOG_DEBUG,
- "ip6_mrouter_init: so_type = %d, pr_protocol = %d\n",
- so->so_type, so->so_proto->pr_protocol);
-#endif
+ MRT6_DLOG(DEBUG_ANY, "so_type = %d, pr_protocol = %d",
+ so->so_type, so->so_proto->pr_protocol);
if (so->so_type != SOCK_RAW ||
so->so_proto->pr_protocol != IPPROTO_ICMPV6)
@@ -560,11 +564,7 @@ ip6_mrouter_init(struct socket *so, int
expire_upcalls, NULL);
MROUTER6_UNLOCK();
-
-#ifdef MRT6DEBUG
- if (V_mrt6debug)
- log(LOG_DEBUG, "ip6_mrouter_init\n");
-#endif
+ MRT6_DLOG(DEBUG_ANY, "finished");
return (0);
}
@@ -642,11 +642,7 @@ X_ip6_mrouter_done(void)
V_ip6_mrouter_ver = 0;
MROUTER6_UNLOCK();
-
-#ifdef MRT6DEBUG
- if (V_mrt6debug)
- log(LOG_DEBUG, "ip6_mrouter_done\n");
-#endif
+ MRT6_DLOG(DEBUG_ANY, "finished");
return (0);
}
@@ -727,14 +723,8 @@ add_m6if(struct mif6ctl *mifcp)
nummifs = mifcp->mif6c_mifi + 1;
MIF6_UNLOCK();
-
-#ifdef MRT6DEBUG
- if (V_mrt6debug)
- log(LOG_DEBUG,
- "add_mif #%d, phyint %s\n",
- mifcp->mif6c_mifi,
- ifp->if_xname);
-#endif
+ MRT6_DLOG(DEBUG_ANY, "mif #%d, phyint %s", mifcp->mif6c_mifi,
+ if_name(ifp));
return (0);
}
@@ -777,11 +767,7 @@ del_m6if_locked(mifi_t *mifip)
if (mif6table[mifi - 1].m6_ifp)
break;
nummifs = mifi;
-
-#ifdef MRT6DEBUG
- if (V_mrt6debug)
- log(LOG_DEBUG, "del_m6if %d, nummifs %d\n", *mifip, nummifs);
-#endif
+ MRT6_DLOG(DEBUG_ANY, "mif %d, nummifs %d", *mifip, nummifs);
return (0);
}
@@ -817,15 +803,10 @@ add_m6fc(struct mf6cctl *mfccp)
/* If an entry already exists, just update the fields */
if (rt) {
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_MFC) {
- log(LOG_DEBUG,
- "add_m6fc no upcall h %d o %s g %s p %x\n",
- ip6_sprintf(ip6bufo, &mfccp->mf6cc_origin.sin6_addr),
- ip6_sprintf(ip6bufg, &mfccp->mf6cc_mcastgrp.sin6_addr),
- mfccp->mf6cc_parent);
- }
-#endif
+ MRT6_DLOG(DEBUG_MFC, "no upcall o %s g %s p %x",
+ ip6_sprintf(ip6bufo, &mfccp->mf6cc_origin.sin6_addr),
+ ip6_sprintf(ip6bufg, &mfccp->mf6cc_mcastgrp.sin6_addr),
+ mfccp->mf6cc_parent);
rt->mf6c_parent = mfccp->mf6cc_parent;
rt->mf6c_ifset = mfccp->mf6cc_ifset;
@@ -856,16 +837,12 @@ add_m6fc(struct mf6cctl *mfccp)
&mfccp->mf6cc_mcastgrp.sin6_addr),
mfccp->mf6cc_parent, rt->mf6c_stall);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_MFC)
- log(LOG_DEBUG,
- "add_m6fc o %s g %s p %x dbg %x\n",
- ip6_sprintf(ip6bufo,
- &mfccp->mf6cc_origin.sin6_addr),
- ip6_sprintf(ip6bufg,
- &mfccp->mf6cc_mcastgrp.sin6_addr),
- mfccp->mf6cc_parent, rt->mf6c_stall);
-#endif
+ MRT6_DLOG(DEBUG_MFC, "o %s g %s p %x dbg %p",
+ ip6_sprintf(ip6bufo,
+ &mfccp->mf6cc_origin.sin6_addr),
+ ip6_sprintf(ip6bufg,
+ &mfccp->mf6cc_mcastgrp.sin6_addr),
+ mfccp->mf6cc_parent, rt->mf6c_stall);
rt->mf6c_origin = mfccp->mf6cc_origin;
rt->mf6c_mcastgrp = mfccp->mf6cc_mcastgrp;
@@ -898,15 +875,10 @@ add_m6fc(struct mf6cctl *mfccp)
* It is possible that an entry is being inserted without an upcall
*/
if (nstl == 0) {
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_MFC)
- log(LOG_DEBUG,
- "add_mfc no upcall h %d o %s g %s p %x\n",
- hash,
- ip6_sprintf(ip6bufo, &mfccp->mf6cc_origin.sin6_addr),
- ip6_sprintf(ip6bufg, &mfccp->mf6cc_mcastgrp.sin6_addr),
- mfccp->mf6cc_parent);
-#endif
+ MRT6_DLOG(DEBUG_MFC, "no upcall h %lu o %s g %s p %x", hash,
+ ip6_sprintf(ip6bufo, &mfccp->mf6cc_origin.sin6_addr),
+ ip6_sprintf(ip6bufg, &mfccp->mf6cc_mcastgrp.sin6_addr),
+ mfccp->mf6cc_parent);
for (rt = mf6ctable[hash]; rt; rt = rt->mf6c_next) {
@@ -992,6 +964,9 @@ collate(struct timeval *t)
static int
del_m6fc(struct mf6cctl *mfccp)
{
+#ifdef MRT6DEBUG
+ char ip6bufo[INET6_ADDRSTRLEN], ip6bufg[INET6_ADDRSTRLEN];
+#endif
struct sockaddr_in6 origin;
struct sockaddr_in6 mcastgrp;
struct mf6c *rt;
@@ -1002,14 +977,9 @@ del_m6fc(struct mf6cctl *mfccp)
mcastgrp = mfccp->mf6cc_mcastgrp;
hash = MF6CHASH(origin.sin6_addr, mcastgrp.sin6_addr);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_MFC) {
- char ip6bufo[INET6_ADDRSTRLEN], ip6bufg[INET6_ADDRSTRLEN];
- log(LOG_DEBUG,"del_m6fc orig %s mcastgrp %s\n",
- ip6_sprintf(ip6bufo, &origin.sin6_addr),
- ip6_sprintf(ip6bufg, &mcastgrp.sin6_addr));
- }
-#endif
+ MRT6_DLOG(DEBUG_MFC, "orig %s mcastgrp %s",
+ ip6_sprintf(ip6bufo, &origin.sin6_addr),
+ ip6_sprintf(ip6bufg, &mcastgrp.sin6_addr));
MFC6_LOCK();
@@ -1080,13 +1050,9 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
mifi_t mifi;
char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_FORWARD)
- log(LOG_DEBUG, "ip6_mforward: src %s, dst %s, ifindex %d\n",
- ip6_sprintf(ip6bufs, &ip6->ip6_src),
- ip6_sprintf(ip6bufd, &ip6->ip6_dst),
- ifp->if_index);
-#endif
+ MRT6_DLOG(DEBUG_FORWARD, "src %s, dst %s, ifindex %d",
+ ip6_sprintf(ip6bufs, &ip6->ip6_src),
+ ip6_sprintf(ip6bufd, &ip6->ip6_dst), ifp->if_index);
/*
* Don't forward a packet with Hop limit of zero or one,
@@ -1148,12 +1114,9 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
#endif /* UPCALL_TIMING */
MRT6STAT_INC(mrt6s_no_route);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & (DEBUG_FORWARD | DEBUG_MFC))
- log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n",
- ip6_sprintf(ip6bufs, &ip6->ip6_src),
- ip6_sprintf(ip6bufd, &ip6->ip6_dst));
-#endif
+ MRT6_DLOG(DEBUG_FORWARD | DEBUG_MFC, "no rte s %s g %s",
+ ip6_sprintf(ip6bufs, &ip6->ip6_src),
+ ip6_sprintf(ip6bufd, &ip6->ip6_dst));
/*
* Allocate mbufs early so that we don't do extra work if we
@@ -1249,11 +1212,8 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
return (EINVAL);
}
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_FORWARD)
- log(LOG_DEBUG,
- "getting the iif info in the kernel\n");
-#endif
+ MRT6_DLOG(DEBUG_FORWARD,
+ "getting the iif info in the kernel");
for (mifp = mif6table, mifi = 0;
mifi < nummifs && mifp->m6_ifp != ifp;
@@ -1339,6 +1299,9 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru
static void
expire_upcalls(void *unused)
{
+#ifdef MRT6DEBUG
+ char ip6bufo[INET6_ADDRSTRLEN], ip6bufg[INET6_ADDRSTRLEN];
+#endif
struct rtdetq *rte;
struct mf6c *mfc, **nptr;
u_long i;
@@ -1358,15 +1321,9 @@ expire_upcalls(void *unused)
if (rte != NULL &&
mfc->mf6c_expire != 0 &&
--mfc->mf6c_expire == 0) {
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_EXPIRE) {
- char ip6bufo[INET6_ADDRSTRLEN];
- char ip6bufg[INET6_ADDRSTRLEN];
- log(LOG_DEBUG, "expire_upcalls: expiring (%s %s)\n",
- ip6_sprintf(ip6bufo, &mfc->mf6c_origin.sin6_addr),
- ip6_sprintf(ip6bufg, &mfc->mf6c_mcastgrp.sin6_addr));
- }
-#endif
+ MRT6_DLOG(DEBUG_EXPIRE, "expiring (%s %s)",
+ ip6_sprintf(ip6bufo, &mfc->mf6c_origin.sin6_addr),
+ ip6_sprintf(ip6bufg, &mfc->mf6c_mcastgrp.sin6_addr));
/*
* drop all the packets
* free the mbuf with the pkt, if, timing info
@@ -1426,13 +1383,9 @@ ip6_mdq(struct mbuf *m, struct ifnet *if
mifi = rt->mf6c_parent;
if ((mifi >= nummifs) || (mif6table[mifi].m6_ifp != ifp)) {
/* came in the wrong interface */
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_FORWARD)
- log(LOG_DEBUG,
- "wrong if: ifid %d mifi %d mififid %x\n",
- ifp->if_index, mifi,
- mif6table[mifi].m6_ifp->if_index);
-#endif
+ MRT6_DLOG(DEBUG_FORWARD,
+ "wrong if: ifid %d mifi %d mififid %x", ifp->if_index,
+ mifi, mif6table[mifi].m6_ifp->if_index);
MRT6STAT_INC(mrt6s_wrong_if);
rt->mf6c_wrong_if++;
/*
@@ -1509,10 +1462,8 @@ ip6_mdq(struct mbuf *m, struct ifnet *if
MRT6STAT_INC(mrt6s_upcalls);
if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
-#ifdef MRT6DEBUG
- if (V_mrt6debug)
- log(LOG_WARNING, "mdq, ip6_mrouter socket queue full\n");
-#endif
+ MRT6_DLOG(DEBUG_ANY,
+ "ip6_mrouter socket queue full");
MRT6STAT_INC(mrt6s_upq_sockfull);
return (ENOBUFS);
} /* if socket Q full */
@@ -1576,6 +1527,9 @@ ip6_mdq(struct mbuf *m, struct ifnet *if
static void
phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m)
{
+#ifdef MRT6DEBUG
+ char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
+#endif
struct mbuf *mb_copy;
struct ifnet *ifp = mifp->m6_ifp;
int error = 0;
@@ -1613,11 +1567,8 @@ phyint_send(struct ip6_hdr *ip6, struct
error = ip6_output(mb_copy, NULL, NULL, IPV6_FORWARDING, &im6o,
NULL, NULL);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_XMIT)
- log(LOG_DEBUG, "phyint_send on mif %d err %d\n",
- mifp - mif6table, error);
-#endif
+ MRT6_DLOG(DEBUG_XMIT, "mif %u err %d",
+ (uint16_t)(mifp - mif6table), error);
return;
}
@@ -1656,11 +1607,8 @@ phyint_send(struct ip6_hdr *ip6, struct
m_clrprotoflags(m); /* Avoid confusing lower layers. */
error = (*ifp->if_output)(ifp, mb_copy,
(struct sockaddr *)&dst6, NULL);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_XMIT)
- log(LOG_DEBUG, "phyint_send on mif %d err %d\n",
- mifp - mif6table, error);
-#endif
+ MRT6_DLOG(DEBUG_XMIT, "mif %u err %d",
+ (uint16_t)(mifp - mif6table), error);
} else {
/*
* pMTU discovery is intentionally disabled by default, since
@@ -1670,19 +1618,11 @@ phyint_send(struct ip6_hdr *ip6, struct
if (V_ip6_mcast_pmtu)
icmp6_error(mb_copy, ICMP6_PACKET_TOO_BIG, 0, linkmtu);
else {
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_XMIT) {
- char ip6bufs[INET6_ADDRSTRLEN];
- char ip6bufd[INET6_ADDRSTRLEN];
- log(LOG_DEBUG,
- "phyint_send: packet too big on %s o %s "
- "g %s size %d(discarded)\n",
- if_name(ifp),
- ip6_sprintf(ip6bufs, &ip6->ip6_src),
- ip6_sprintf(ip6bufd, &ip6->ip6_dst),
- mb_copy->m_pkthdr.len);
- }
-#endif /* MRT6DEBUG */
+ MRT6_DLOG(DEBUG_XMIT, " packet too big on %s o %s "
+ "g %s size %d (discarded)", if_name(ifp),
+ ip6_sprintf(ip6bufs, &ip6->ip6_src),
+ ip6_sprintf(ip6bufd, &ip6->ip6_dst),
+ mb_copy->m_pkthdr.len);
m_freem(mb_copy); /* simply discard the packet */
}
}
@@ -1691,19 +1631,17 @@ phyint_send(struct ip6_hdr *ip6, struct
static int
register_send(struct ip6_hdr *ip6, struct mif6 *mif, struct mbuf *m)
{
+#ifdef MRT6DEBUG
+ char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
+#endif
struct mbuf *mm;
int i, len = m->m_pkthdr.len;
static struct sockaddr_in6 sin6 = { sizeof(sin6), AF_INET6 };
struct mrt6msg *im6;
-#ifdef MRT6DEBUG
- if (V_mrt6debug) {
- char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
- log(LOG_DEBUG, "** IPv6 register_send **\n src %s dst %s\n",
- ip6_sprintf(ip6bufs, &ip6->ip6_src),
- ip6_sprintf(ip6bufd, &ip6->ip6_dst));
- }
-#endif
+ MRT6_DLOG(DEBUG_ANY, "src %s dst %s",
+ ip6_sprintf(ip6bufs, &ip6->ip6_src),
+ ip6_sprintf(ip6bufd, &ip6->ip6_dst));
PIM6STAT_INC(pim6s_snd_registers);
/* Make a copy of the packet to send to the user level process. */
@@ -1741,11 +1679,7 @@ register_send(struct ip6_hdr *ip6, struc
MRT6STAT_INC(mrt6s_upcalls);
if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) {
-#ifdef MRT6DEBUG
- if (V_mrt6debug)
- log(LOG_WARNING,
- "register_send: ip6_mrouter socket queue full\n");
-#endif
+ MRT6_DLOG(DEBUG_ANY, "ip6_mrouter socket queue full");
MRT6STAT_INC(mrt6s_upq_sockfull);
return (ENOBUFS);
}
@@ -1797,10 +1731,7 @@ pim6_input(struct mbuf **mp, int *offp,
*/
if (pimlen < PIM_MINLEN) {
PIM6STAT_INC(pim6s_rcv_tooshort);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_PIM)
- log(LOG_DEBUG,"pim6_input: PIM packet too short\n");
-#endif
+ MRT6_DLOG(DEBUG_PIM, "PIM packet too short");
m_freem(m);
return (IPPROTO_DONE);
}
@@ -1850,11 +1781,7 @@ pim6_input(struct mbuf **mp, int *offp,
if (in6_cksum(m, IPPROTO_PIM, off, cksumlen)) {
PIM6STAT_INC(pim6s_rcv_badsum);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_PIM)
- log(LOG_DEBUG,
- "pim6_input: invalid checksum\n");
-#endif
+ MRT6_DLOG(DEBUG_PIM, "invalid checksum");
m_freem(m);
return (IPPROTO_DONE);
}
@@ -1864,11 +1791,9 @@ pim6_input(struct mbuf **mp, int *offp,
/* PIM version check */
if (pim->pim_ver != PIM_VERSION) {
PIM6STAT_INC(pim6s_rcv_badversion);
-#ifdef MRT6DEBUG
- log(LOG_ERR,
- "pim6_input: incorrect version %d, expecting %d\n",
+ MRT6_DLOG(DEBUG_ANY | DEBUG_ERR,
+ "incorrect version %d, expecting %d",
pim->pim_ver, PIM_VERSION);
-#endif
m_freem(m);
return (IPPROTO_DONE);
}
@@ -1892,12 +1817,8 @@ pim6_input(struct mbuf **mp, int *offp,
PIM6STAT_INC(pim6s_rcv_registers);
if ((reg_mif_num >= nummifs) || (reg_mif_num == (mifi_t) -1)) {
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_PIM)
- log(LOG_DEBUG,
- "pim6_input: register mif not set: %d\n",
- reg_mif_num);
-#endif
+ MRT6_DLOG(DEBUG_PIM, "register mif not set: %d",
+ reg_mif_num);
m_freem(m);
return (IPPROTO_DONE);
}
@@ -1913,35 +1834,25 @@ pim6_input(struct mbuf **mp, int *offp,
if (pimlen < PIM6_REG_MINLEN) {
PIM6STAT_INC(pim6s_rcv_tooshort);
PIM6STAT_INC(pim6s_rcv_badregisters);
-#ifdef MRT6DEBUG
- log(LOG_ERR,
- "pim6_input: register packet size too "
- "small %d from %s\n",
+ MRT6_DLOG(DEBUG_ANY | DEBUG_ERR, "register packet "
+ "size too small %d from %s",
pimlen, ip6_sprintf(ip6bufs, &ip6->ip6_src));
-#endif
m_freem(m);
return (IPPROTO_DONE);
}
eip6 = (struct ip6_hdr *) (reghdr + 1);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_PIM)
- log(LOG_DEBUG,
- "pim6_input[register], eip6: %s -> %s, "
- "eip6 plen %d\n",
- ip6_sprintf(ip6bufs, &eip6->ip6_src),
- ip6_sprintf(ip6bufd, &eip6->ip6_dst),
- ntohs(eip6->ip6_plen));
-#endif
+ MRT6_DLOG(DEBUG_PIM, "eip6: %s -> %s, eip6 plen %d",
+ ip6_sprintf(ip6bufs, &eip6->ip6_src),
+ ip6_sprintf(ip6bufd, &eip6->ip6_dst),
+ ntohs(eip6->ip6_plen));
/* verify the version number of the inner packet */
if ((eip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) {
PIM6STAT_INC(pim6s_rcv_badregisters);
-#ifdef MRT6DEBUG
- log(LOG_DEBUG, "pim6_input: invalid IP version (%d) "
- "of the inner packet\n",
+ MRT6_DLOG(DEBUG_ANY, "invalid IP version (%d) "
+ "of the inner packet",
(eip6->ip6_vfc & IPV6_VERSION));
-#endif
m_freem(m);
return (IPPROTO_NONE);
}
@@ -1949,13 +1860,9 @@ pim6_input(struct mbuf **mp, int *offp,
/* verify the inner packet is destined to a mcast group */
if (!IN6_IS_ADDR_MULTICAST(&eip6->ip6_dst)) {
PIM6STAT_INC(pim6s_rcv_badregisters);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_PIM)
- log(LOG_DEBUG,
- "pim6_input: inner packet of register "
- "is not multicast %s\n",
- ip6_sprintf(ip6bufd, &eip6->ip6_dst));
-#endif
+ MRT6_DLOG(DEBUG_PIM, "inner packet of register "
+ "is not multicast %s",
+ ip6_sprintf(ip6bufd, &eip6->ip6_dst));
m_freem(m);
return (IPPROTO_DONE);
}
@@ -1965,11 +1872,8 @@ pim6_input(struct mbuf **mp, int *offp,
*/
mcp = m_copy(m, 0, off + PIM6_REG_MINLEN);
if (mcp == NULL) {
-#ifdef MRT6DEBUG
- log(LOG_ERR,
- "pim6_input: pim register: "
- "could not copy register head\n");
-#endif
+ MRT6_DLOG(DEBUG_ANY | DEBUG_ERR, "pim register: "
+ "could not copy register head");
m_freem(m);
return (IPPROTO_DONE);
}
@@ -1978,16 +1882,10 @@ pim6_input(struct mbuf **mp, int *offp,
* forward the inner ip6 packet; point m_data at the inner ip6.
*/
m_adj(m, off + PIM_MINLEN);
-#ifdef MRT6DEBUG
- if (V_mrt6debug & DEBUG_PIM) {
- log(LOG_DEBUG,
- "pim6_input: forwarding decapsulated register: "
- "src %s, dst %s, mif %d\n",
- ip6_sprintf(ip6bufs, &eip6->ip6_src),
- ip6_sprintf(ip6bufd, &eip6->ip6_dst),
- reg_mif_num);
- }
-#endif
+ MRT6_DLOG(DEBUG_PIM, "forwarding decapsulated register: "
+ "src %s, dst %s, mif %d",
+ ip6_sprintf(ip6bufs, &eip6->ip6_src),
+ ip6_sprintf(ip6bufd, &eip6->ip6_dst), reg_mif_num);
rc = if_simloop(mif6table[reg_mif_num].m6_ifp, m,
dst.sin6_family, 0);
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:11:46 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 109E5EA0;
Thu, 16 Jan 2014 14:11:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id EF40210A7;
Thu, 16 Jan 2014 14:11:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GEBjE4028157;
Thu, 16 Jan 2014 14:11:45 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GEBjs5028156;
Thu, 16 Jan 2014 14:11:45 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161411.s0GEBjs5028156@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:11:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260723 - stable/10/sys/kern
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:11:46 -0000
Author: avg
Date: Thu Jan 16 14:11:45 2014
New Revision: 260723
URL: http://svnweb.freebsd.org/changeset/base/260723
Log:
MFC r258354: taskqueue_cancel: garbage collect a write-only variable
Modified:
stable/10/sys/kern/subr_taskqueue.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/kern/subr_taskqueue.c
==============================================================================
--- stable/10/sys/kern/subr_taskqueue.c Thu Jan 16 14:08:11 2014 (r260722)
+++ stable/10/sys/kern/subr_taskqueue.c Thu Jan 16 14:11:45 2014 (r260723)
@@ -377,11 +377,9 @@ taskqueue_cancel_locked(struct taskqueue
int
taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp)
{
- u_int pending;
int error;
TQ_LOCK(queue);
- pending = task->ta_pending;
error = taskqueue_cancel_locked(queue, task, pendp);
TQ_UNLOCK(queue);
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:14:49 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id C83F024F;
Thu, 16 Jan 2014 14:14:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 9A68A10DA;
Thu, 16 Jan 2014 14:14:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GEEnXT028760;
Thu, 16 Jan 2014 14:14:49 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GEEn8U028758;
Thu, 16 Jan 2014 14:14:49 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161414.s0GEEn8U028758@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:14:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260725 - stable/10/tools/regression/fsx
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:14:49 -0000
Author: avg
Date: Thu Jan 16 14:14:49 2014
New Revision: 260725
URL: http://svnweb.freebsd.org/changeset/base/260725
Log:
MFC r258351: fsx: new option to disable msync(MS_SYNC) after each write
Modified:
stable/10/tools/regression/fsx/fsx.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/tools/regression/fsx/fsx.c
==============================================================================
--- stable/10/tools/regression/fsx/fsx.c Thu Jan 16 14:11:56 2014 (r260724)
+++ stable/10/tools/regression/fsx/fsx.c Thu Jan 16 14:14:49 2014 (r260725)
@@ -126,6 +126,7 @@ int randomoplen = 1; /* -O flag disable
int seed = 1; /* -S flag */
int mapped_writes = 1; /* -W flag disables */
int mapped_reads = 1; /* -R flag disables it */
+int mapped_msync = 1; /* -U flag disables */
int fsxgoodfd = 0;
FILE * fsxlogf = NULL;
int badoff = -1;
@@ -679,12 +680,12 @@ domapwrite(unsigned offset, unsigned siz
if ((p = (char *)mmap(0, map_size, PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED, fd,
- (off_t)(offset - pg_offset))) == (char *)-1) {
+ (off_t)(offset - pg_offset))) == MAP_FAILED) {
prterr("domapwrite: mmap");
report_failure(202);
}
memcpy(p + pg_offset, good_buf + offset, size);
- if (msync(p, map_size, 0) != 0) {
+ if (mapped_msync && msync(p, map_size, MS_SYNC) != 0) {
prterr("domapwrite: msync");
report_failure(203);
}
@@ -886,6 +887,7 @@ usage(void)
-S seed: for random # generator (default 1) 0 gets timestamp\n\
-W: mapped write operations DISabled\n\
-R: mapped read operations DISabled)\n\
+ -U: msync after mapped write operations DISabled\n\
fname: this filename is REQUIRED (no default)\n");
exit(90);
}
@@ -941,8 +943,8 @@ main(int argc, char **argv)
setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */
- while ((ch = getopt(argc, argv, "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:W"))
- != -1)
+ while ((ch = getopt(argc, argv,
+ "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1)
switch (ch) {
case 'b':
simulatedopcount = getnum(optarg, &endp);
@@ -1057,6 +1059,11 @@ main(int argc, char **argv)
if (!quiet)
fprintf(stdout, "mapped writes DISABLED\n");
break;
+ case 'U':
+ mapped_msync = 0;
+ if (!quiet)
+ fprintf(stdout, "mapped msync DISABLED\n");
+ break;
default:
usage();
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:17:32 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 50315627;
Thu, 16 Jan 2014 14:17:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 303FD10FD;
Thu, 16 Jan 2014 14:17:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GEHWjr029252;
Thu, 16 Jan 2014 14:17:32 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GEHWSS029251;
Thu, 16 Jan 2014 14:17:32 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161417.s0GEHWSS029251@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:17:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260728 - stable/10/tools/regression/fsx
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:17:32 -0000
Author: avg
Date: Thu Jan 16 14:17:31 2014
New Revision: 260728
URL: http://svnweb.freebsd.org/changeset/base/260728
Log:
MFC r258352: fsx: add an option to randomly call msync(MS_INVALIDATE)
Modified:
stable/10/tools/regression/fsx/fsx.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/tools/regression/fsx/fsx.c
==============================================================================
--- stable/10/tools/regression/fsx/fsx.c Thu Jan 16 14:15:14 2014 (r260727)
+++ stable/10/tools/regression/fsx/fsx.c Thu Jan 16 14:17:31 2014 (r260728)
@@ -90,6 +90,7 @@ int logcount = 0; /* total ops */
#define OP_MAPREAD 5
#define OP_MAPWRITE 6
#define OP_SKIPPED 7
+#define OP_INVALIDATE 8
int page_size;
int page_mask;
@@ -107,6 +108,7 @@ unsigned long testcalls = 0; /* calls t
unsigned long simulatedopcount = 0; /* -b flag */
int closeprob = 0; /* -c flag */
+int invlprob = 0; /* -i flag */
int debug = 0; /* -d flag */
unsigned long debugstart = 0; /* -D flag */
unsigned long maxfilelen = 256 * 1024; /* -l flag */
@@ -131,6 +133,7 @@ int fsxgoodfd = 0;
FILE * fsxlogf = NULL;
int badoff = -1;
int closeopen = 0;
+int invl = 0;
void
@@ -182,14 +185,12 @@ prterr(char *prefix)
void
-log4(int operation, int arg0, int arg1, int arg2)
+do_log4(int operation, int arg0, int arg1, int arg2)
{
struct log_entry *le;
le = &oplog[logptr];
le->operation = operation;
- if (closeopen)
- le->operation = ~ le->operation;
le->args[0] = arg0;
le->args[1] = arg1;
le->args[2] = arg2;
@@ -201,10 +202,21 @@ log4(int operation, int arg0, int arg1,
void
+log4(int operation, int arg0, int arg1, int arg2)
+{
+ do_log4(operation, arg0, arg1, arg2);
+ if (closeopen)
+ do_log4(OP_CLOSEOPEN, 0, 0, 0);
+ if (invl)
+ do_log4(OP_INVALIDATE, 0, 0, 0);
+}
+
+
+void
logdump(void)
{
- int i, count, down;
struct log_entry *lp;
+ int i, count, down, opnum;
prt("LOG DUMP (%d total operations):\n", logcount);
if (logcount < LOGSIZE) {
@@ -214,15 +226,28 @@ logdump(void)
i = logptr;
count = LOGSIZE;
}
+
+ opnum = i + 1 + (logcount/LOGSIZE)*LOGSIZE;
for ( ; count > 0; count--) {
- int opnum;
+ lp = &oplog[i];
+
+ if (lp->operation == OP_CLOSEOPEN ||
+ lp->operation == OP_INVALIDATE) {
+ switch (lp->operation) {
+ case OP_CLOSEOPEN:
+ prt("\t\tCLOSE/OPEN\n");
+ break;
+ case OP_INVALIDATE:
+ prt("\t\tMS_INVALIDATE\n");
+ break;
+ }
+ i++;
+ if (i == LOGSIZE)
+ i = 0;
+ continue;
+ }
- opnum = i+1 + (logcount/LOGSIZE)*LOGSIZE;
prt("%d(%d mod 256): ", opnum, opnum%256);
- lp = &oplog[i];
- if ((closeopen = lp->operation < 0))
- lp->operation = ~ lp->operation;
-
switch (lp->operation) {
case OP_MAPREAD:
prt("MAPREAD\t0x%x thru 0x%x\t(0x%x bytes)",
@@ -275,9 +300,8 @@ logdump(void)
prt("BOGUS LOG ENTRY (operation code = %d)!",
lp->operation);
}
- if (closeopen)
- prt("\n\t\tCLOSE/OPEN");
prt("\n");
+ opnum++;
i++;
if (i == LOGSIZE)
i = 0;
@@ -779,6 +803,36 @@ docloseopen(void)
void
+doinvl(void)
+{
+ char *p;
+
+ if (file_size == 0)
+ return;
+ if (testcalls <= simulatedopcount)
+ return;
+ if (debug)
+ prt("%lu msync(MS_INVALIDATE)\n", testcalls);
+
+ if ((p = (char *)mmap(0, file_size, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, fd, 0)) == MAP_FAILED) {
+ prterr("doinvl: mmap");
+ report_failure(205);
+ }
+
+ if (msync(p, 0, MS_SYNC | MS_INVALIDATE) != 0) {
+ prterr("doinvl: msync");
+ report_failure(206);
+ }
+
+ if (munmap(p, file_size) != 0) {
+ prterr("doinvl: munmap");
+ report_failure(207);
+ }
+}
+
+
+void
test(void)
{
unsigned long offset;
@@ -798,6 +852,8 @@ test(void)
if (closeprob)
closeopen = (rv >> 3) < (1 << 28) / closeprob;
+ if (invlprob)
+ invl = (rv >> 3) < (1 << 28) / invlprob;
if (debugstart > 0 && testcalls >= debugstart)
debug = 1;
@@ -845,6 +901,8 @@ test(void)
}
if (sizechecks && testcalls > simulatedopcount)
check_size();
+ if (invl)
+ doinvl();
if (closeopen)
docloseopen();
}
@@ -869,6 +927,7 @@ usage(void)
-b opnum: beginning operation number (default 1)\n\
-c P: 1 in P chance of file close+open at each op (default infinity)\n\
-d: debug output for all operations\n\
+ -i P: 1 in P chance of calling msync(MS_INVALIDATE) (default infinity)\n\
-l flen: the upper bound on file size (default 262144)\n\
-m startop:endop: monitor (print debug output) specified byte range (default 0:infinity)\n\
-n: no verifications of file size\n\
@@ -944,7 +1003,7 @@ main(int argc, char **argv)
setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */
while ((ch = getopt(argc, argv,
- "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1)
+ "b:c:di:l:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1)
switch (ch) {
case 'b':
simulatedopcount = getnum(optarg, &endp);
@@ -967,6 +1026,15 @@ main(int argc, char **argv)
case 'd':
debug = 1;
break;
+ case 'i':
+ invlprob = getnum(optarg, &endp);
+ if (!quiet)
+ fprintf(stdout,
+ "Chance of MS_INVALIDATE is 1 in %d\n",
+ invlprob);
+ if (invlprob <= 0)
+ usage();
+ break;
case 'l':
maxfilelen = getnum(optarg, &endp);
if (maxfilelen <= 0)
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:21:25 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 22A9FB17;
Thu, 16 Jan 2014 14:21:25 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 0CFDF1194;
Thu, 16 Jan 2014 14:21:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GELOGK031783;
Thu, 16 Jan 2014 14:21:24 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GELOdq031782;
Thu, 16 Jan 2014 14:21:24 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161421.s0GELOdq031782@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:21:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260731 -
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:21:25 -0000
Author: avg
Date: Thu Jan 16 14:21:24 2014
New Revision: 260731
URL: http://svnweb.freebsd.org/changeset/base/260731
Log:
MFC r258638,258642: expose zfs_flags as debug.zfs_flags r/w tunable and sysctl
Sponsored by: HybridCluster
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Jan 16 14:17:55 2014 (r260730)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Jan 16 14:21:24 2014 (r260731)
@@ -243,6 +243,10 @@ int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZF
#else
int zfs_flags = 0;
#endif
+SYSCTL_DECL(_debug);
+TUNABLE_INT("debug.zfs_flags", &zfs_flags);
+SYSCTL_INT(_debug, OID_AUTO, zfs_flags, CTLFLAG_RWTUN, &zfs_flags, 0,
+ "ZFS debug flags.");
/*
* zfs_recover can be set to nonzero to attempt to recover from
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:24:34 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 8022B1D4;
Thu, 16 Jan 2014 14:24:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 6C38811C8;
Thu, 16 Jan 2014 14:24:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GEOYTC032490;
Thu, 16 Jan 2014 14:24:34 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GEOYsm032489;
Thu, 16 Jan 2014 14:24:34 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161424.s0GEOYsm032489@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:24:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260735 - stable/10/tools/tools/zfsboottest
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:24:34 -0000
Author: avg
Date: Thu Jan 16 14:24:33 2014
New Revision: 260735
URL: http://svnweb.freebsd.org/changeset/base/260735
Log:
MFC r258647: zfsboottest: properly specify a library dependency
Modified:
stable/10/tools/tools/zfsboottest/Makefile
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/tools/tools/zfsboottest/Makefile
==============================================================================
--- stable/10/tools/tools/zfsboottest/Makefile Thu Jan 16 14:24:22 2014 (r260734)
+++ stable/10/tools/tools/zfsboottest/Makefile Thu Jan 16 14:24:33 2014 (r260735)
@@ -16,7 +16,7 @@ CFLAGS= -O1 \
-I. \
-fdiagnostics-show-option \
-W -Wextra -Wno-sign-compare -Wno-unused-parameter
-LDFLAGS+=-lmd
+LDADD+= -lmd
.if ${MACHINE_CPUARCH} == "amd64"
beforedepend zfsboottest.o: machine
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:27:21 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 338324B9;
Thu, 16 Jan 2014 14:27:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 1F31411F5;
Thu, 16 Jan 2014 14:27:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GERKj6032906;
Thu, 16 Jan 2014 14:27:20 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GERKRO032905;
Thu, 16 Jan 2014 14:27:20 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161427.s0GERKRO032905@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:27:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260737 - stable/10/sys/kern
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:27:21 -0000
Author: avg
Date: Thu Jan 16 14:27:20 2014
New Revision: 260737
URL: http://svnweb.freebsd.org/changeset/base/260737
Log:
MFC r258648: use saner calculations in should_yield
Modified:
stable/10/sys/kern/kern_synch.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/kern/kern_synch.c
==============================================================================
--- stable/10/sys/kern/kern_synch.c Thu Jan 16 14:24:44 2014 (r260736)
+++ stable/10/sys/kern/kern_synch.c Thu Jan 16 14:27:20 2014 (r260737)
@@ -588,7 +588,7 @@ int
should_yield(void)
{
- return ((unsigned int)(ticks - curthread->td_swvoltick) >= hogticks);
+ return ((u_int)ticks - (u_int)curthread->td_swvoltick >= hogticks);
}
void
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:30:27 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id EA951777;
Thu, 16 Jan 2014 14:30:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id CB41A1216;
Thu, 16 Jan 2014 14:30:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GEUQP1035659;
Thu, 16 Jan 2014 14:30:26 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GEUQEf035657;
Thu, 16 Jan 2014 14:30:26 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161430.s0GEUQEf035657@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:30:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260739 - in stable/10/sys/cddl: compat/opensolaris/kern
contrib/opensolaris/uts/common/sys
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:30:27 -0000
Author: avg
Date: Thu Jan 16 14:30:26 2014
New Revision: 260739
URL: http://svnweb.freebsd.org/changeset/base/260739
Log:
MFC r258628: opensolaris taskq: some cosmetic changes
Modified:
stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
==============================================================================
--- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Thu Jan 16 14:27:29 2014 (r260738)
+++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Thu Jan 16 14:30:26 2014 (r260739)
@@ -121,7 +121,7 @@ taskq_dispatch(taskq_t *tq, task_func_t
mflag = M_WAITOK;
else
mflag = M_NOWAIT;
- /*
+ /*
* If TQ_FRONT is given, we want higher priority for this task, so it
* can go at the front of the queue.
*/
@@ -140,8 +140,6 @@ taskq_dispatch(taskq_t *tq, task_func_t
return ((taskqid_t)(void *)task);
}
-#define TASKQ_MAGIC 0x74541c
-
static void
taskq_run_safe(void *arg, int pending __unused)
{
@@ -156,7 +154,7 @@ taskq_dispatch_safe(taskq_t *tq, task_fu
{
int prio;
- /*
+ /*
* If TQ_FRONT is given, we want higher priority for this task, so it
* can go at the front of the queue.
*/
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Thu Jan 16 14:27:29 2014 (r260738)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Thu Jan 16 14:30:26 2014 (r260739)
@@ -70,24 +70,23 @@ struct proc;
extern taskq_t *system_taskq;
-extern void taskq_init(void);
-extern void taskq_mp_init(void);
+void taskq_init(void);
+void taskq_mp_init(void);
-extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t);
-extern taskq_t *taskq_create_instance(const char *, int, int, pri_t, int,
- int, uint_t);
-extern taskq_t *taskq_create_proc(const char *, int, pri_t, int, int,
+taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t);
+taskq_t *taskq_create_instance(const char *, int, int, pri_t, int, int, uint_t);
+taskq_t *taskq_create_proc(const char *, int, pri_t, int, int,
struct proc *, uint_t);
-extern taskq_t *taskq_create_sysdc(const char *, int, int, int,
+taskq_t *taskq_create_sysdc(const char *, int, int, int,
struct proc *, uint_t, uint_t);
-extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
-extern void nulltask(void *);
-extern void taskq_destroy(taskq_t *);
-extern void taskq_wait(taskq_t *);
-extern void taskq_suspend(taskq_t *);
-extern int taskq_suspended(taskq_t *);
-extern void taskq_resume(taskq_t *);
-extern int taskq_member(taskq_t *, kthread_t *);
+taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
+void nulltask(void *);
+void taskq_destroy(taskq_t *);
+void taskq_wait(taskq_t *);
+void taskq_suspend(taskq_t *);
+int taskq_suspended(taskq_t *);
+void taskq_resume(taskq_t *);
+int taskq_member(taskq_t *, kthread_t *);
#endif /* _KERNEL */
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:34:55 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 56263BE7;
Thu, 16 Jan 2014 14:34:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 3E71912A7;
Thu, 16 Jan 2014 14:34:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GEYtHb036580;
Thu, 16 Jan 2014 14:34:55 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GEYr62036568;
Thu, 16 Jan 2014 14:34:53 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161434.s0GEYr62036568@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:34:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260742 - in stable/10:
cddl/contrib/opensolaris/lib/libzpool/common
cddl/contrib/opensolaris/lib/libzpool/common/sys
sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sy...
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:34:55 -0000
Author: avg
Date: Thu Jan 16 14:34:53 2014
New Revision: 260742
URL: http://svnweb.freebsd.org/changeset/base/260742
Log:
MFC r258630: 734 taskq_dispatch_prealloc() desired
Deleted:
stable/10/sys/cddl/compat/opensolaris/sys/taskq.h
Modified:
stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Thu Jan 16 14:30:46 2014 (r260741)
+++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Thu Jan 16 14:34:53 2014 (r260742)
@@ -23,6 +23,9 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
+/*
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ */
#ifndef _SYS_ZFS_CONTEXT_H
#define _SYS_ZFS_CONTEXT_H
@@ -367,6 +370,16 @@ typedef struct taskq taskq_t;
typedef uintptr_t taskqid_t;
typedef void (task_func_t)(void *);
+typedef struct taskq_ent {
+ struct taskq_ent *tqent_next;
+ struct taskq_ent *tqent_prev;
+ task_func_t *tqent_func;
+ void *tqent_arg;
+ uintptr_t tqent_flags;
+} taskq_ent_t;
+
+#define TQENT_FLAG_PREALLOC 0x1 /* taskq_dispatch_ent used */
+
#define TASKQ_PREPOPULATE 0x0001
#define TASKQ_CPR_SAFE 0x0002 /* Use CPR safe protocol */
#define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */
@@ -378,6 +391,7 @@ typedef void (task_func_t)(void *);
#define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */
#define TQ_FRONT 0x08 /* Queue in front */
+
extern taskq_t *system_taskq;
extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t);
@@ -386,6 +400,8 @@ extern taskq_t *taskq_create(const char
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
(taskq_create(a, b, maxclsyspri, d, e, f))
extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
+extern void taskq_dispatch_ent(taskq_t *, task_func_t, void *, uint_t,
+ taskq_ent_t *);
extern void taskq_destroy(taskq_t *);
extern void taskq_wait(taskq_t *);
extern int taskq_member(taskq_t *, void *);
Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Jan 16 14:30:46 2014 (r260741)
+++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Jan 16 14:34:53 2014 (r260742)
@@ -22,19 +22,15 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ */
#include
int taskq_now;
taskq_t *system_taskq;
-typedef struct task {
- struct task *task_next;
- struct task *task_prev;
- task_func_t *task_func;
- void *task_arg;
-} task_t;
-
#define TASKQ_ACTIVE 0x00010000
struct taskq {
@@ -51,18 +47,18 @@ struct taskq {
int tq_maxalloc;
kcondvar_t tq_maxalloc_cv;
int tq_maxalloc_wait;
- task_t *tq_freelist;
- task_t tq_task;
+ taskq_ent_t *tq_freelist;
+ taskq_ent_t tq_task;
};
-static task_t *
+static taskq_ent_t *
task_alloc(taskq_t *tq, int tqflags)
{
- task_t *t;
+ taskq_ent_t *t;
int rv;
again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
- tq->tq_freelist = t->task_next;
+ tq->tq_freelist = t->tqent_next;
} else {
if (tq->tq_nalloc >= tq->tq_maxalloc) {
if (!(tqflags & KM_SLEEP))
@@ -87,7 +83,7 @@ again: if ((t = tq->tq_freelist) != NULL
}
mutex_exit(&tq->tq_lock);
- t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP);
+ t = kmem_alloc(sizeof (taskq_ent_t), tqflags & KM_SLEEP);
mutex_enter(&tq->tq_lock);
if (t != NULL)
@@ -97,15 +93,15 @@ again: if ((t = tq->tq_freelist) != NULL
}
static void
-task_free(taskq_t *tq, task_t *t)
+task_free(taskq_t *tq, taskq_ent_t *t)
{
if (tq->tq_nalloc <= tq->tq_minalloc) {
- t->task_next = tq->tq_freelist;
+ t->tqent_next = tq->tq_freelist;
tq->tq_freelist = t;
} else {
tq->tq_nalloc--;
mutex_exit(&tq->tq_lock);
- kmem_free(t, sizeof (task_t));
+ kmem_free(t, sizeof (taskq_ent_t));
mutex_enter(&tq->tq_lock);
}
@@ -116,7 +112,7 @@ task_free(taskq_t *tq, task_t *t)
taskqid_t
taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
{
- task_t *t;
+ taskq_ent_t *t;
if (taskq_now) {
func(arg);
@@ -130,26 +126,58 @@ taskq_dispatch(taskq_t *tq, task_func_t
return (0);
}
if (tqflags & TQ_FRONT) {
- t->task_next = tq->tq_task.task_next;
- t->task_prev = &tq->tq_task;
+ t->tqent_next = tq->tq_task.tqent_next;
+ t->tqent_prev = &tq->tq_task;
} else {
- t->task_next = &tq->tq_task;
- t->task_prev = tq->tq_task.task_prev;
+ t->tqent_next = &tq->tq_task;
+ t->tqent_prev = tq->tq_task.tqent_prev;
}
- t->task_next->task_prev = t;
- t->task_prev->task_next = t;
- t->task_func = func;
- t->task_arg = arg;
+ t->tqent_next->tqent_prev = t;
+ t->tqent_prev->tqent_next = t;
+ t->tqent_func = func;
+ t->tqent_arg = arg;
cv_signal(&tq->tq_dispatch_cv);
mutex_exit(&tq->tq_lock);
return (1);
}
void
+taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags,
+ taskq_ent_t *t)
+{
+ ASSERT(func != NULL);
+ ASSERT(!(tq->tq_flags & TASKQ_DYNAMIC));
+
+ /*
+ * Mark it as a prealloc'd task. This is important
+ * to ensure that we don't free it later.
+ */
+ t->tqent_flags |= TQENT_FLAG_PREALLOC;
+ /*
+ * Enqueue the task to the underlying queue.
+ */
+ mutex_enter(&tq->tq_lock);
+
+ if (flags & TQ_FRONT) {
+ t->tqent_next = tq->tq_task.tqent_next;
+ t->tqent_prev = &tq->tq_task;
+ } else {
+ t->tqent_next = &tq->tq_task;
+ t->tqent_prev = tq->tq_task.tqent_prev;
+ }
+ t->tqent_next->tqent_prev = t;
+ t->tqent_prev->tqent_next = t;
+ t->tqent_func = func;
+ t->tqent_arg = arg;
+ cv_signal(&tq->tq_dispatch_cv);
+ mutex_exit(&tq->tq_lock);
+}
+
+void
taskq_wait(taskq_t *tq)
{
mutex_enter(&tq->tq_lock);
- while (tq->tq_task.task_next != &tq->tq_task || tq->tq_active != 0)
+ while (tq->tq_task.tqent_next != &tq->tq_task || tq->tq_active != 0)
cv_wait(&tq->tq_wait_cv, &tq->tq_lock);
mutex_exit(&tq->tq_lock);
}
@@ -158,27 +186,32 @@ static void *
taskq_thread(void *arg)
{
taskq_t *tq = arg;
- task_t *t;
+ taskq_ent_t *t;
+ boolean_t prealloc;
mutex_enter(&tq->tq_lock);
while (tq->tq_flags & TASKQ_ACTIVE) {
- if ((t = tq->tq_task.task_next) == &tq->tq_task) {
+ if ((t = tq->tq_task.tqent_next) == &tq->tq_task) {
if (--tq->tq_active == 0)
cv_broadcast(&tq->tq_wait_cv);
cv_wait(&tq->tq_dispatch_cv, &tq->tq_lock);
tq->tq_active++;
continue;
}
- t->task_prev->task_next = t->task_next;
- t->task_next->task_prev = t->task_prev;
+ t->tqent_prev->tqent_next = t->tqent_next;
+ t->tqent_next->tqent_prev = t->tqent_prev;
+ t->tqent_next = NULL;
+ t->tqent_prev = NULL;
+ prealloc = t->tqent_flags & TQENT_FLAG_PREALLOC;
mutex_exit(&tq->tq_lock);
rw_enter(&tq->tq_threadlock, RW_READER);
- t->task_func(t->task_arg);
+ t->tqent_func(t->tqent_arg);
rw_exit(&tq->tq_threadlock);
mutex_enter(&tq->tq_lock);
- task_free(tq, t);
+ if (!prealloc)
+ task_free(tq, t);
}
tq->tq_nthreads--;
cv_broadcast(&tq->tq_wait_cv);
@@ -217,8 +250,8 @@ taskq_create(const char *name, int nthre
tq->tq_nthreads = nthreads;
tq->tq_minalloc = minalloc;
tq->tq_maxalloc = maxalloc;
- tq->tq_task.task_next = &tq->tq_task;
- tq->tq_task.task_prev = &tq->tq_task;
+ tq->tq_task.tqent_next = &tq->tq_task;
+ tq->tq_task.tqent_prev = &tq->tq_task;
tq->tq_threadlist = kmem_alloc(nthreads * sizeof (thread_t), KM_SLEEP);
if (flags & TASKQ_PREPOPULATE) {
Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
==============================================================================
--- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Thu Jan 16 14:30:46 2014 (r260741)
+++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Thu Jan 16 14:34:53 2014 (r260742)
@@ -46,7 +46,7 @@ static void
system_taskq_init(void *arg)
{
- taskq_zone = uma_zcreate("taskq_zone", sizeof(struct ostask),
+ taskq_zone = uma_zcreate("taskq_zone", sizeof(taskq_ent_t),
NULL, NULL, NULL, NULL, 0, 0);
system_taskq = taskq_create("system_taskq", mp_ncpus, 0, 0, 0, 0);
}
@@ -104,9 +104,9 @@ taskq_member(taskq_t *tq, kthread_t *thr
static void
taskq_run(void *arg, int pending __unused)
{
- struct ostask *task = arg;
+ taskq_ent_t *task = arg;
- task->ost_func(task->ost_arg);
+ task->tqent_func(task->tqent_arg);
uma_zfree(taskq_zone, task);
}
@@ -114,7 +114,7 @@ taskq_run(void *arg, int pending __unuse
taskqid_t
taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags)
{
- struct ostask *task;
+ taskq_ent_t *task;
int mflag, prio;
if ((flags & (TQ_SLEEP | TQ_NOQUEUE)) == TQ_SLEEP)
@@ -131,26 +131,26 @@ taskq_dispatch(taskq_t *tq, task_func_t
if (task == NULL)
return (0);
- task->ost_func = func;
- task->ost_arg = arg;
+ task->tqent_func = func;
+ task->tqent_arg = arg;
- TASK_INIT(&task->ost_task, prio, taskq_run, task);
- taskqueue_enqueue(tq->tq_queue, &task->ost_task);
+ TASK_INIT(&task->tqent_task, prio, taskq_run, task);
+ taskqueue_enqueue(tq->tq_queue, &task->tqent_task);
return ((taskqid_t)(void *)task);
}
static void
-taskq_run_safe(void *arg, int pending __unused)
+taskq_run_ent(void *arg, int pending __unused)
{
- struct ostask *task = arg;
+ taskq_ent_t *task = arg;
- task->ost_func(task->ost_arg);
+ task->tqent_func(task->tqent_arg);
}
-taskqid_t
-taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg, u_int flags,
- struct ostask *task)
+void
+taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, u_int flags,
+ taskq_ent_t *task)
{
int prio;
@@ -160,11 +160,9 @@ taskq_dispatch_safe(taskq_t *tq, task_fu
*/
prio = !!(flags & TQ_FRONT);
- task->ost_func = func;
- task->ost_arg = arg;
+ task->tqent_func = func;
+ task->tqent_arg = arg;
- TASK_INIT(&task->ost_task, prio, taskq_run_safe, task);
- taskqueue_enqueue(tq->tq_queue, &task->ost_task);
-
- return ((taskqid_t)(void *)task);
+ TASK_INIT(&task->tqent_task, prio, taskq_run_ent, task);
+ taskqueue_enqueue(tq->tq_queue, &task->tqent_task);
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Jan 16 14:30:46 2014 (r260741)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Jan 16 14:34:53 2014 (r260742)
@@ -825,7 +825,7 @@ static taskq_t *
spa_taskq_create(spa_t *spa, const char *name, enum zti_modes mode,
uint_t value)
{
- uint_t flags = TASKQ_PREPOPULATE;
+ uint_t flags = 0;
boolean_t batch = B_FALSE;
switch (mode) {
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 16 14:30:46 2014 (r260741)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 16 14:34:53 2014 (r260742)
@@ -24,6 +24,7 @@
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _ZIO_H
@@ -474,10 +475,9 @@ struct zio {
zio_cksum_report_t *io_cksum_report;
uint64_t io_ena;
-#ifdef _KERNEL
- /* FreeBSD only. */
- struct ostask io_task;
-#endif
+ /* Taskq dispatching state */
+ taskq_ent_t io_tqent;
+
avl_node_t io_trim_node;
list_node_t io_trim_link;
};
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 16 14:30:46 2014 (r260741)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 16 14:34:53 2014 (r260742)
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
*/
#include
@@ -1224,7 +1225,7 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
{
spa_t *spa = zio->io_spa;
zio_type_t t = zio->io_type;
- int flags = TQ_SLEEP | (cutinline ? TQ_FRONT : 0);
+ int flags = (cutinline ? TQ_FRONT : 0);
ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT);
@@ -1250,13 +1251,19 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
q++;
ASSERT3U(q, <, ZIO_TASKQ_TYPES);
-#ifdef _KERNEL
- (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q],
- (task_func_t *)zio_execute, zio, flags, &zio->io_task);
+
+ /*
+ * NB: We are assuming that the zio can only be dispatched
+ * to a single taskq at a time. It would be a grievous error
+ * to dispatch the zio to another taskq at the same time.
+ */
+#if defined(illumos) || !defined(_KERNEL)
+ ASSERT(zio->io_tqent.tqent_next == NULL);
#else
- (void) taskq_dispatch(spa->spa_zio_taskq[t][q],
- (task_func_t *)zio_execute, zio, flags);
+ ASSERT(zio->io_tqent.tqent_task.ta_pending == 0);
#endif
+ taskq_dispatch_ent(spa->spa_zio_taskq[t][q],
+ (task_func_t *)zio_execute, zio, flags, &zio->io_tqent);
}
static boolean_t
@@ -3174,16 +3181,15 @@ zio_done(zio_t *zio)
* Reexecution is potentially a huge amount of work.
* Hand it off to the otherwise-unused claim taskq.
*/
-#ifdef _KERNEL
- (void) taskq_dispatch_safe(
- spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
- (task_func_t *)zio_reexecute, zio, TQ_SLEEP,
- &zio->io_task);
+#if defined(illumos) || !defined(_KERNEL)
+ ASSERT(zio->io_tqent.tqent_next == NULL);
#else
- (void) taskq_dispatch(
- spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
- (task_func_t *)zio_reexecute, zio, TQ_SLEEP);
+ ASSERT(zio->io_tqent.tqent_task.ta_pending == 0);
#endif
+ (void) taskq_dispatch_ent(
+ spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
+ (task_func_t *)zio_reexecute, zio, 0,
+ &zio->io_tqent);
}
return (ZIO_PIPELINE_STOP);
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Thu Jan 16 14:30:46 2014 (r260741)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Thu Jan 16 14:34:53 2014 (r260742)
@@ -45,6 +45,12 @@ typedef struct taskq taskq_t;
typedef uintptr_t taskqid_t;
typedef void (task_func_t)(void *);
+typedef struct taskq_ent {
+ struct task tqent_task;
+ task_func_t *tqent_func;
+ void *tqent_arg;
+} taskq_ent_t;
+
struct proc;
/*
@@ -80,6 +86,8 @@ taskq_t *taskq_create_proc(const char *,
taskq_t *taskq_create_sysdc(const char *, int, int, int,
struct proc *, uint_t, uint_t);
taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
+void taskq_dispatch_ent(taskq_t *, task_func_t, void *, uint_t,
+ taskq_ent_t *);
void nulltask(void *);
void taskq_destroy(taskq_t *);
void taskq_wait(taskq_t *);
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:37:32 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 09837D8;
Thu, 16 Jan 2014 14:37:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id E8F7312CD;
Thu, 16 Jan 2014 14:37:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GEbV5n037079;
Thu, 16 Jan 2014 14:37:31 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GEbVjV037078;
Thu, 16 Jan 2014 14:37:31 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161437.s0GEbVjV037078@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:37:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260745 -
stable/10/sys/cddl/contrib/opensolaris/uts/common
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:37:32 -0000
Author: avg
Date: Thu Jan 16 14:37:31 2014
New Revision: 260745
URL: http://svnweb.freebsd.org/changeset/base/260745
Log:
MFC r258743: drop ZUT_OBJ
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Thu Jan 16 14:35:20 2014 (r260744)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Thu Jan 16 14:37:31 2014 (r260745)
@@ -126,6 +126,3 @@ ZFS_OBJS += \
zfs_vfsops.o \
zfs_vnops.o \
zvol.o
-
-ZUT_OBJS += \
- zut.o
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 14:47:31 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 168B2879;
Thu, 16 Jan 2014 14:47:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id EAEBB1390;
Thu, 16 Jan 2014 14:47:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GElU8D041071;
Thu, 16 Jan 2014 14:47:30 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GElUg2041066;
Thu, 16 Jan 2014 14:47:30 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161447.s0GElUg2041066@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 14:47:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260750 - in
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 14:47:31 -0000
Author: avg
Date: Thu Jan 16 14:47:29 2014
New Revision: 260750
URL: http://svnweb.freebsd.org/changeset/base/260750
Log:
MFC r258631: MFV r247578
3581 spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE]->tq_lock is piping hot
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Jan 16 14:42:22 2014 (r260749)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Jan 16 14:47:29 2014 (r260750)
@@ -95,23 +95,25 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hos
static int zfs_ccw_retry_interval = 300;
typedef enum zti_modes {
- zti_mode_fixed, /* value is # of threads (min 1) */
- zti_mode_online_percent, /* value is % of online CPUs */
- zti_mode_batch, /* cpu-intensive; value is ignored */
- zti_mode_null, /* don't create a taskq */
- zti_nmodes
+ ZTI_MODE_FIXED, /* value is # of threads (min 1) */
+ ZTI_MODE_ONLINE_PERCENT, /* value is % of online CPUs */
+ ZTI_MODE_BATCH, /* cpu-intensive; value is ignored */
+ ZTI_MODE_NULL, /* don't create a taskq */
+ ZTI_NMODES
} zti_modes_t;
-#define ZTI_FIX(n) { zti_mode_fixed, (n) }
-#define ZTI_PCT(n) { zti_mode_online_percent, (n) }
-#define ZTI_BATCH { zti_mode_batch, 0 }
-#define ZTI_NULL { zti_mode_null, 0 }
+#define ZTI_P(n, q) { ZTI_MODE_FIXED, (n), (q) }
+#define ZTI_PCT(n) { ZTI_MODE_ONLINE_PERCENT, (n), 1 }
+#define ZTI_BATCH { ZTI_MODE_BATCH, 0, 1 }
+#define ZTI_NULL { ZTI_MODE_NULL, 0, 0 }
-#define ZTI_ONE ZTI_FIX(1)
+#define ZTI_N(n) ZTI_P(n, 1)
+#define ZTI_ONE ZTI_N(1)
typedef struct zio_taskq_info {
- enum zti_modes zti_mode;
+ zti_modes_t zti_mode;
uint_t zti_value;
+ uint_t zti_count;
} zio_taskq_info_t;
static const char *const zio_taskq_types[ZIO_TASKQ_TYPES] = {
@@ -119,17 +121,30 @@ static const char *const zio_taskq_types
};
/*
- * Define the taskq threads for the following I/O types:
- * NULL, READ, WRITE, FREE, CLAIM, and IOCTL
+ * This table defines the taskq settings for each ZFS I/O type. When
+ * initializing a pool, we use this table to create an appropriately sized
+ * taskq. Some operations are low volume and therefore have a small, static
+ * number of threads assigned to their taskqs using the ZTI_N(#) or ZTI_ONE
+ * macros. Other operations process a large amount of data; the ZTI_BATCH
+ * macro causes us to create a taskq oriented for throughput. Some operations
+ * are so high frequency and short-lived that the taskq itself can become a a
+ * point of lock contention. The ZTI_P(#, #) macro indicates that we need an
+ * additional degree of parallelism specified by the number of threads per-
+ * taskq and the number of taskqs; when dispatching an event in this case, the
+ * particular taskq is chosen at random.
+ *
+ * The different taskq priorities are to handle the different contexts (issue
+ * and interrupt) and then to reserve threads for ZIO_PRIORITY_NOW I/Os that
+ * need to be handled with minimum delay.
*/
const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = {
/* ISSUE ISSUE_HIGH INTR INTR_HIGH */
- { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL },
- { ZTI_FIX(8), ZTI_NULL, ZTI_BATCH, ZTI_NULL },
- { ZTI_BATCH, ZTI_FIX(5), ZTI_FIX(8), ZTI_FIX(5) },
- { ZTI_FIX(100), ZTI_NULL, ZTI_ONE, ZTI_NULL },
- { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL },
- { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL },
+ { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* NULL */
+ { ZTI_N(8), ZTI_NULL, ZTI_BATCH, ZTI_NULL }, /* READ */
+ { ZTI_BATCH, ZTI_N(5), ZTI_N(8), ZTI_N(5) }, /* WRITE */
+ { ZTI_P(12, 8), ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* FREE */
+ { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* CLAIM */
+ { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* IOCTL */
};
static void spa_sync_version(void *arg, dmu_tx_t *tx);
@@ -821,50 +836,124 @@ spa_get_errlists(spa_t *spa, avl_tree_t
offsetof(spa_error_entry_t, se_avl));
}
-static taskq_t *
-spa_taskq_create(spa_t *spa, const char *name, enum zti_modes mode,
- uint_t value)
+static void
+spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
{
+ const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
+ enum zti_modes mode = ztip->zti_mode;
+ uint_t value = ztip->zti_value;
+ uint_t count = ztip->zti_count;
+ spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
+ char name[32];
uint_t flags = 0;
boolean_t batch = B_FALSE;
- switch (mode) {
- case zti_mode_null:
- return (NULL); /* no taskq needed */
-
- case zti_mode_fixed:
- ASSERT3U(value, >=, 1);
- value = MAX(value, 1);
- break;
+ if (mode == ZTI_MODE_NULL) {
+ tqs->stqs_count = 0;
+ tqs->stqs_taskq = NULL;
+ return;
+ }
- case zti_mode_batch:
- batch = B_TRUE;
- flags |= TASKQ_THREADS_CPU_PCT;
- value = zio_taskq_batch_pct;
- break;
+ ASSERT3U(count, >, 0);
- case zti_mode_online_percent:
- flags |= TASKQ_THREADS_CPU_PCT;
- break;
+ tqs->stqs_count = count;
+ tqs->stqs_taskq = kmem_alloc(count * sizeof (taskq_t *), KM_SLEEP);
- default:
- panic("unrecognized mode for %s taskq (%u:%u) in "
- "spa_activate()",
- name, mode, value);
- break;
- }
+ for (uint_t i = 0; i < count; i++) {
+ taskq_t *tq;
+
+ switch (mode) {
+ case ZTI_MODE_FIXED:
+ ASSERT3U(value, >=, 1);
+ value = MAX(value, 1);
+ break;
+
+ case ZTI_MODE_BATCH:
+ batch = B_TRUE;
+ flags |= TASKQ_THREADS_CPU_PCT;
+ value = zio_taskq_batch_pct;
+ break;
+
+ case ZTI_MODE_ONLINE_PERCENT:
+ flags |= TASKQ_THREADS_CPU_PCT;
+ break;
+
+ default:
+ panic("unrecognized mode for %s_%s taskq (%u:%u) in "
+ "spa_activate()",
+ zio_type_name[t], zio_taskq_types[q], mode, value);
+ break;
+ }
+
+ if (count > 1) {
+ (void) snprintf(name, sizeof (name), "%s_%s_%u",
+ zio_type_name[t], zio_taskq_types[q], i);
+ } else {
+ (void) snprintf(name, sizeof (name), "%s_%s",
+ zio_type_name[t], zio_taskq_types[q]);
+ }
#ifdef SYSDC
- if (zio_taskq_sysdc && spa->spa_proc != &p0) {
- if (batch)
- flags |= TASKQ_DC_BATCH;
+ if (zio_taskq_sysdc && spa->spa_proc != &p0) {
+ if (batch)
+ flags |= TASKQ_DC_BATCH;
- return (taskq_create_sysdc(name, value, 50, INT_MAX,
- spa->spa_proc, zio_taskq_basedc, flags));
- }
+ tq = taskq_create_sysdc(name, value, 50, INT_MAX,
+ spa->spa_proc, zio_taskq_basedc, flags);
+ } else {
+#endif
+ tq = taskq_create_proc(name, value, maxclsyspri, 50,
+ INT_MAX, spa->spa_proc, flags);
+#ifdef SYSDC
+ }
#endif
- return (taskq_create_proc(name, value, maxclsyspri, 50, INT_MAX,
- spa->spa_proc, flags));
+
+ tqs->stqs_taskq[i] = tq;
+ }
+}
+
+static void
+spa_taskqs_fini(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
+{
+ spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
+
+ if (tqs->stqs_taskq == NULL) {
+ ASSERT0(tqs->stqs_count);
+ return;
+ }
+
+ for (uint_t i = 0; i < tqs->stqs_count; i++) {
+ ASSERT3P(tqs->stqs_taskq[i], !=, NULL);
+ taskq_destroy(tqs->stqs_taskq[i]);
+ }
+
+ kmem_free(tqs->stqs_taskq, tqs->stqs_count * sizeof (taskq_t *));
+ tqs->stqs_taskq = NULL;
+}
+
+/*
+ * Dispatch a task to the appropriate taskq for the ZFS I/O type and priority.
+ * Note that a type may have multiple discrete taskqs to avoid lock contention
+ * on the taskq itself. In that case we choose which taskq at random by using
+ * the low bits of gethrtime().
+ */
+void
+spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
+ task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent)
+{
+ spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
+ taskq_t *tq;
+
+ ASSERT3P(tqs->stqs_taskq, !=, NULL);
+ ASSERT3U(tqs->stqs_count, !=, 0);
+
+ if (tqs->stqs_count == 1) {
+ tq = tqs->stqs_taskq[0];
+ } else {
+ tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count];
+ }
+
+ taskq_dispatch_ent(tq, func, arg, flags, ent);
}
static void
@@ -872,16 +961,7 @@ spa_create_zio_taskqs(spa_t *spa)
{
for (int t = 0; t < ZIO_TYPES; t++) {
for (int q = 0; q < ZIO_TASKQ_TYPES; q++) {
- const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
- enum zti_modes mode = ztip->zti_mode;
- uint_t value = ztip->zti_value;
- char name[32];
-
- (void) snprintf(name, sizeof (name),
- "%s_%s", zio_type_name[t], zio_taskq_types[q]);
-
- spa->spa_zio_taskq[t][q] =
- spa_taskq_create(spa, name, mode, value);
+ spa_taskqs_init(spa, t, q);
}
}
}
@@ -1058,9 +1138,7 @@ spa_deactivate(spa_t *spa)
for (int t = 0; t < ZIO_TYPES; t++) {
for (int q = 0; q < ZIO_TASKQ_TYPES; q++) {
- if (spa->spa_zio_taskq[t][q] != NULL)
- taskq_destroy(spa->spa_zio_taskq[t][q]);
- spa->spa_zio_taskq[t][q] = NULL;
+ spa_taskqs_fini(spa, t, q);
}
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Thu Jan 16 14:42:22 2014 (r260749)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Thu Jan 16 14:47:29 2014 (r260750)
@@ -81,16 +81,16 @@ typedef struct spa_config_dirent {
char *scd_path;
} spa_config_dirent_t;
-enum zio_taskq_type {
+typedef enum zio_taskq_type {
ZIO_TASKQ_ISSUE = 0,
ZIO_TASKQ_ISSUE_HIGH,
ZIO_TASKQ_INTERRUPT,
ZIO_TASKQ_INTERRUPT_HIGH,
ZIO_TASKQ_TYPES
-};
+} zio_taskq_type_t;
/*
- * State machine for the zpool-pooname process. The states transitions
+ * State machine for the zpool-poolname process. The states transitions
* are done as follows:
*
* From To Routine
@@ -108,6 +108,11 @@ typedef enum spa_proc_state {
SPA_PROC_GONE /* spa_thread() is exiting, spa_proc = &p0 */
} spa_proc_state_t;
+typedef struct spa_taskqs {
+ uint_t stqs_count;
+ taskq_t **stqs_taskq;
+} spa_taskqs_t;
+
struct spa {
/*
* Fields protected by spa_namespace_lock.
@@ -126,7 +131,7 @@ struct spa {
uint8_t spa_sync_on; /* sync threads are running */
spa_load_state_t spa_load_state; /* current load operation */
uint64_t spa_import_flags; /* import specific flags */
- taskq_t *spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
+ spa_taskqs_t spa_zio_taskq[ZIO_TYPES][ZIO_TASKQ_TYPES];
dsl_pool_t *spa_dsl_pool;
boolean_t spa_is_initializing; /* true while opening pool */
metaslab_class_t *spa_normal_class; /* normal data class */
@@ -258,6 +263,9 @@ struct spa {
extern const char *spa_config_path;
+extern void spa_taskq_dispatch_ent(spa_t *spa, zio_type_t t, zio_taskq_type_t q,
+ task_func_t *func, void *arg, uint_t flags, taskq_ent_t *ent);
+
#ifdef __cplusplus
}
#endif
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 16 14:42:22 2014 (r260749)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 16 14:47:29 2014 (r260750)
@@ -1221,7 +1221,7 @@ zio_free_bp_init(zio_t *zio)
*/
static void
-zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q, boolean_t cutinline)
+zio_taskq_dispatch(zio_t *zio, zio_taskq_type_t q, boolean_t cutinline)
{
spa_t *spa = zio->io_spa;
zio_type_t t = zio->io_type;
@@ -1244,10 +1244,11 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
t = ZIO_TYPE_NULL;
/*
- * If this is a high priority I/O, then use the high priority taskq.
+ * If this is a high priority I/O, then use the high priority taskq if
+ * available.
*/
if (zio->io_priority == ZIO_PRIORITY_NOW &&
- spa->spa_zio_taskq[t][q + 1] != NULL)
+ spa->spa_zio_taskq[t][q + 1].stqs_count != 0)
q++;
ASSERT3U(q, <, ZIO_TASKQ_TYPES);
@@ -1262,19 +1263,24 @@ zio_taskq_dispatch(zio_t *zio, enum zio_
#else
ASSERT(zio->io_tqent.tqent_task.ta_pending == 0);
#endif
- taskq_dispatch_ent(spa->spa_zio_taskq[t][q],
- (task_func_t *)zio_execute, zio, flags, &zio->io_tqent);
+ spa_taskq_dispatch_ent(spa, t, q, (task_func_t *)zio_execute, zio,
+ flags, &zio->io_tqent);
}
static boolean_t
-zio_taskq_member(zio_t *zio, enum zio_taskq_type q)
+zio_taskq_member(zio_t *zio, zio_taskq_type_t q)
{
kthread_t *executor = zio->io_executor;
spa_t *spa = zio->io_spa;
- for (zio_type_t t = 0; t < ZIO_TYPES; t++)
- if (taskq_member(spa->spa_zio_taskq[t][q], executor))
- return (B_TRUE);
+ for (zio_type_t t = 0; t < ZIO_TYPES; t++) {
+ spa_taskqs_t *tqs = &spa->spa_zio_taskq[t][q];
+ uint_t i;
+ for (i = 0; i < tqs->stqs_count; i++) {
+ if (taskq_member(tqs->stqs_taskq[i], executor))
+ return (B_TRUE);
+ }
+ }
return (B_FALSE);
}
@@ -3186,10 +3192,9 @@ zio_done(zio_t *zio)
#else
ASSERT(zio->io_tqent.tqent_task.ta_pending == 0);
#endif
- (void) taskq_dispatch_ent(
- spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
- (task_func_t *)zio_reexecute, zio, 0,
- &zio->io_tqent);
+ spa_taskq_dispatch_ent(spa, ZIO_TYPE_CLAIM,
+ ZIO_TASKQ_ISSUE, (task_func_t *)zio_reexecute, zio,
+ 0, &zio->io_tqent);
}
return (ZIO_PIPELINE_STOP);
}
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 15:57:41 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 386FCE0C;
Thu, 16 Jan 2014 15:57:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 2065A1957;
Thu, 16 Jan 2014 15:57:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GFvfdo069664;
Thu, 16 Jan 2014 15:57:41 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GFvdOZ069652;
Thu, 16 Jan 2014 15:57:39 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161557.s0GFvdOZ069652@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 15:57:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260763 - in stable/10: cddl/contrib/opensolaris/cmd/ztest
cddl/contrib/opensolaris/lib/libzpool/common/sys
sys/cddl/compat/opensolaris/sys
sys/cddl/contrib/opensolaris/uts/common/fs/zf...
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 15:57:41 -0000
Author: avg
Date: Thu Jan 16 15:57:39 2014
New Revision: 260763
URL: http://svnweb.freebsd.org/changeset/base/260763
Log:
MFC r258632,258704: MFV r255255: 4045 zfs write throttle & i/o scheduler
performance work
Sponsored by: HybridCluster [merge]
Added:
stable/10/sys/cddl/compat/opensolaris/sys/disp.h
- copied unchanged from r258632, head/sys/cddl/compat/opensolaris/sys/disp.h
Modified:
stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c
stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Jan 16 15:47:09 2014 (r260762)
+++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Thu Jan 16 15:57:39 2014 (r260763)
@@ -186,7 +186,7 @@ static const ztest_shared_opts_t ztest_o
extern uint64_t metaslab_gang_bang;
extern uint64_t metaslab_df_alloc_threshold;
-extern uint64_t zfs_deadman_synctime;
+extern uint64_t zfs_deadman_synctime_ms;
static ztest_shared_opts_t *ztest_shared_opts;
static ztest_shared_opts_t ztest_opts;
@@ -5328,10 +5328,10 @@ ztest_deadman_thread(void *arg)
hrtime_t delta, total = 0;
for (;;) {
- delta = (zs->zs_thread_stop - zs->zs_thread_start) /
- NANOSEC + zfs_deadman_synctime;
+ delta = zs->zs_thread_stop - zs->zs_thread_start +
+ MSEC2NSEC(zfs_deadman_synctime_ms);
- (void) poll(NULL, 0, (int)(1000 * delta));
+ (void) poll(NULL, 0, (int)NSEC2MSEC(delta));
/*
* If the pool is suspended then fail immediately. Otherwise,
@@ -5342,12 +5342,12 @@ ztest_deadman_thread(void *arg)
if (spa_suspended(spa)) {
fatal(0, "aborting test after %llu seconds because "
"pool has transitioned to a suspended state.",
- zfs_deadman_synctime);
+ zfs_deadman_synctime_ms / 1000);
return (NULL);
}
vdev_deadman(spa->spa_root_vdev);
- total += zfs_deadman_synctime;
+ total += zfs_deadman_synctime_ms/1000;
(void) printf("ztest has been running for %lld seconds\n",
total);
}
@@ -6080,7 +6080,7 @@ main(int argc, char **argv)
(void) setvbuf(stdout, NULL, _IOLBF, 0);
dprintf_setup(&argc, argv);
- zfs_deadman_synctime = 300;
+ zfs_deadman_synctime_ms = 300000;
ztest_fd_rand = open("/dev/urandom", O_RDONLY);
ASSERT3S(ztest_fd_rand, >=, 0);
Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Thu Jan 16 15:47:09 2014 (r260762)
+++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Thu Jan 16 15:57:39 2014 (r260763)
@@ -65,6 +65,7 @@ extern "C" {
#include
#include
#include
+#include
#include
#include
#include
@@ -204,6 +205,8 @@ extern int aok;
*/
#define curthread ((void *)(uintptr_t)thr_self())
+#define kpreempt(x) sched_yield()
+
typedef struct kthread kthread_t;
#define thread_create(stk, stksize, func, arg, len, pp, state, pri) \
Copied: stable/10/sys/cddl/compat/opensolaris/sys/disp.h (from r258632, head/sys/cddl/compat/opensolaris/sys/disp.h)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/sys/cddl/compat/opensolaris/sys/disp.h Thu Jan 16 15:57:39 2014 (r260763, copy of r258632, head/sys/cddl/compat/opensolaris/sys/disp.h)
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 2013 Andriy Gapon
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _OPENSOLARIS_SYS_DISP_H_
+#define _OPENSOLARIS_SYS_DISP_H_
+
+#ifdef _KERNEL
+
+#include
+
+#define kpreempt(x) kern_yield(PRI_USER)
+
+#endif /* _KERNEL */
+
+#endif /* _OPENSOLARIS_SYS_DISP_H_ */
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 16 15:47:09 2014 (r260762)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 16 15:57:39 2014 (r260763)
@@ -127,6 +127,7 @@
#include
#include
#include
+#include
#ifdef _KERNEL
#include
#endif
@@ -150,10 +151,6 @@ static kmutex_t arc_reclaim_thr_lock;
static kcondvar_t arc_reclaim_thr_cv; /* used to signal reclaim thr */
static uint8_t arc_thread_exit;
-extern int zfs_write_limit_shift;
-extern uint64_t zfs_write_limit_max;
-extern kmutex_t zfs_write_limit_lock;
-
#define ARC_REDUCE_DNLC_PERCENT 3
uint_t arc_reduce_dnlc_percent = ARC_REDUCE_DNLC_PERCENT;
@@ -162,6 +159,12 @@ typedef enum arc_reclaim_strategy {
ARC_RECLAIM_CONS /* Conservative reclaim strategy */
} arc_reclaim_strategy_t;
+/*
+ * The number of iterations through arc_evict_*() before we
+ * drop & reacquire the lock.
+ */
+int arc_evict_iterations = 100;
+
/* number of seconds before growing cache again */
static int arc_grow_retry = 60;
@@ -177,6 +180,11 @@ static int arc_shrink_shift = 5;
*/
static int arc_min_prefetch_lifespan;
+/*
+ * If this percent of memory is free, don't throttle.
+ */
+int arc_lotsfree_percent = 10;
+
static int arc_dead;
extern int zfs_prefetch_disable;
@@ -526,6 +534,7 @@ typedef struct arc_write_callback arc_wr
struct arc_write_callback {
void *awcb_private;
arc_done_func_t *awcb_ready;
+ arc_done_func_t *awcb_physdone;
arc_done_func_t *awcb_done;
arc_buf_t *awcb_buf;
};
@@ -1312,7 +1321,7 @@ arc_change_state(arc_state_t *new_state,
kmutex_t *lock;
ASSERT(MUTEX_HELD(hash_lock));
- ASSERT(new_state != old_state);
+ ASSERT3P(new_state, !=, old_state);
ASSERT(refcnt == 0 || ab->b_datacnt > 0);
ASSERT(ab->b_datacnt == 0 || !GHOST_STATE(new_state));
ASSERT(ab->b_datacnt <= 1 || old_state != arc_anon);
@@ -1937,8 +1946,10 @@ arc_evict(arc_state_t *state, uint64_t s
kmutex_t *hash_lock;
boolean_t have_lock;
void *stolen = NULL;
+ arc_buf_hdr_t marker = { 0 };
+ int count = 0;
static int evict_metadata_offset, evict_data_offset;
- int i, idx, offset, list_count, count;
+ int i, idx, offset, list_count, lists;
ASSERT(state == arc_mru || state == arc_mfu);
@@ -1958,7 +1969,7 @@ arc_evict(arc_state_t *state, uint64_t s
idx = evict_data_offset;
}
bytes_remaining = evicted_state->arcs_lsize[type];
- count = 0;
+ lists = 0;
evict_start:
list = &list_start[idx];
@@ -1985,6 +1996,33 @@ evict_start:
if (recycle && ab->b_size != bytes &&
ab_prev && ab_prev->b_size == bytes)
continue;
+
+ /* ignore markers */
+ if (ab->b_spa == 0)
+ continue;
+
+ /*
+ * It may take a long time to evict all the bufs requested.
+ * To avoid blocking all arc activity, periodically drop
+ * the arcs_mtx and give other threads a chance to run
+ * before reacquiring the lock.
+ *
+ * If we are looking for a buffer to recycle, we are in
+ * the hot code path, so don't sleep.
+ */
+ if (!recycle && count++ > arc_evict_iterations) {
+ list_insert_after(list, ab, &marker);
+ mutex_exit(evicted_lock);
+ mutex_exit(lock);
+ kpreempt(KPREEMPT_SYNC);
+ mutex_enter(lock);
+ mutex_enter(evicted_lock);
+ ab_prev = list_prev(list, &marker);
+ list_remove(list, &marker);
+ count = 0;
+ continue;
+ }
+
hash_lock = HDR_LOCK(ab);
have_lock = MUTEX_HELD(hash_lock);
if (have_lock || mutex_tryenter(hash_lock)) {
@@ -2051,7 +2089,7 @@ evict_start:
mutex_exit(evicted_lock);
mutex_exit(lock);
idx = ((idx + 1) & (list_count - 1));
- count++;
+ lists++;
goto evict_start;
}
} else {
@@ -2063,10 +2101,10 @@ evict_start:
mutex_exit(lock);
idx = ((idx + 1) & (list_count - 1));
- count++;
+ lists++;
if (bytes_evicted < bytes) {
- if (count < list_count)
+ if (lists < list_count)
goto evict_start;
else
dprintf("only evicted %lld bytes from %x",
@@ -2084,28 +2122,14 @@ evict_start:
ARCSTAT_INCR(arcstat_mutex_miss, missed);
/*
- * We have just evicted some data into the ghost state, make
- * sure we also adjust the ghost state size if necessary.
+ * Note: we have just evicted some data into the ghost state,
+ * potentially putting the ghost size over the desired size. Rather
+ * that evicting from the ghost list in this hot code path, leave
+ * this chore to the arc_reclaim_thread().
*/
- if (arc_no_grow &&
- arc_mru_ghost->arcs_size + arc_mfu_ghost->arcs_size > arc_c) {
- int64_t mru_over = arc_anon->arcs_size + arc_mru->arcs_size +
- arc_mru_ghost->arcs_size - arc_c;
-
- if (mru_over > 0 && arc_mru_ghost->arcs_lsize[type] > 0) {
- int64_t todelete =
- MIN(arc_mru_ghost->arcs_lsize[type], mru_over);
- arc_evict_ghost(arc_mru_ghost, 0, todelete);
- } else if (arc_mfu_ghost->arcs_lsize[type] > 0) {
- int64_t todelete = MIN(arc_mfu_ghost->arcs_lsize[type],
- arc_mru_ghost->arcs_size +
- arc_mfu_ghost->arcs_size - arc_c);
- arc_evict_ghost(arc_mfu_ghost, 0, todelete);
- }
- }
+
if (stolen)
ARCSTAT_BUMP(arcstat_stolen);
-
return (stolen);
}
@@ -2122,9 +2146,10 @@ arc_evict_ghost(arc_state_t *state, uint
kmutex_t *hash_lock, *lock;
uint64_t bytes_deleted = 0;
uint64_t bufs_skipped = 0;
+ int count = 0;
static int evict_offset;
int list_count, idx = evict_offset;
- int offset, count = 0;
+ int offset, lists = 0;
ASSERT(GHOST_STATE(state));
@@ -2142,6 +2167,8 @@ evict_start:
mutex_enter(lock);
for (ab = list_tail(list); ab; ab = ab_prev) {
ab_prev = list_prev(list, ab);
+ if (ab->b_type > ARC_BUFC_NUMTYPES)
+ panic("invalid ab=%p", (void *)ab);
if (spa && ab->b_spa != spa)
continue;
@@ -2153,6 +2180,23 @@ evict_start:
/* caller may be trying to modify this buffer, skip it */
if (MUTEX_HELD(hash_lock))
continue;
+
+ /*
+ * It may take a long time to evict all the bufs requested.
+ * To avoid blocking all arc activity, periodically drop
+ * the arcs_mtx and give other threads a chance to run
+ * before reacquiring the lock.
+ */
+ if (count++ > arc_evict_iterations) {
+ list_insert_after(list, ab, &marker);
+ mutex_exit(lock);
+ kpreempt(KPREEMPT_SYNC);
+ mutex_enter(lock);
+ ab_prev = list_prev(list, &marker);
+ list_remove(list, &marker);
+ count = 0;
+ continue;
+ }
if (mutex_tryenter(hash_lock)) {
ASSERT(!HDR_IO_IN_PROGRESS(ab));
ASSERT(ab->b_buf == NULL);
@@ -2188,14 +2232,16 @@ evict_start:
mutex_enter(lock);
ab_prev = list_prev(list, &marker);
list_remove(list, &marker);
- } else
+ } else {
bufs_skipped += 1;
+ }
+
}
mutex_exit(lock);
idx = ((idx + 1) & (ARC_BUFC_NUMDATALISTS - 1));
- count++;
+ lists++;
- if (count < list_count)
+ if (lists < list_count)
goto evict_start;
evict_offset = idx;
@@ -2203,7 +2249,7 @@ evict_start:
(bytes < 0 || bytes_deleted < bytes)) {
list_start = &state->arcs_lists[0];
list_count = ARC_BUFC_NUMMETADATALISTS;
- offset = count = 0;
+ offset = lists = 0;
goto evict_start;
}
@@ -3083,7 +3129,7 @@ arc_read_done(zio_t *zio)
*/
int
arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
- void *private, int priority, int zio_flags, uint32_t *arc_flags,
+ void *private, zio_priority_t priority, int zio_flags, uint32_t *arc_flags,
const zbookmark_t *zb)
{
arc_buf_hdr_t *hdr;
@@ -3699,6 +3745,18 @@ arc_write_ready(zio_t *zio)
hdr->b_flags |= ARC_IO_IN_PROGRESS;
}
+/*
+ * The SPA calls this callback for each physical write that happens on behalf
+ * of a logical write. See the comment in dbuf_write_physdone() for details.
+ */
+static void
+arc_write_physdone(zio_t *zio)
+{
+ arc_write_callback_t *cb = zio->io_private;
+ if (cb->awcb_physdone != NULL)
+ cb->awcb_physdone(zio, cb->awcb_buf, cb->awcb_private);
+}
+
static void
arc_write_done(zio_t *zio)
{
@@ -3779,8 +3837,9 @@ arc_write_done(zio_t *zio)
zio_t *
arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress,
- const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *done,
- void *private, int priority, int zio_flags, const zbookmark_t *zb)
+ const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone,
+ arc_done_func_t *done, void *private, zio_priority_t priority,
+ int zio_flags, const zbookmark_t *zb)
{
arc_buf_hdr_t *hdr = buf->b_hdr;
arc_write_callback_t *callback;
@@ -3797,18 +3856,20 @@ arc_write(zio_t *pio, spa_t *spa, uint64
hdr->b_flags |= ARC_L2COMPRESS;
callback = kmem_zalloc(sizeof (arc_write_callback_t), KM_SLEEP);
callback->awcb_ready = ready;
+ callback->awcb_physdone = physdone;
callback->awcb_done = done;
callback->awcb_private = private;
callback->awcb_buf = buf;
zio = zio_write(pio, spa, txg, bp, buf->b_data, hdr->b_size, zp,
- arc_write_ready, arc_write_done, callback, priority, zio_flags, zb);
+ arc_write_ready, arc_write_physdone, arc_write_done, callback,
+ priority, zio_flags, zb);
return (zio);
}
static int
-arc_memory_throttle(uint64_t reserve, uint64_t inflight_data, uint64_t txg)
+arc_memory_throttle(uint64_t reserve, uint64_t txg)
{
#ifdef _KERNEL
uint64_t available_memory =
@@ -3822,7 +3883,9 @@ arc_memory_throttle(uint64_t reserve, ui
MIN(available_memory, vmem_size(heap_arena, VMEM_FREE));
#endif
#endif /* sun */
- if (available_memory >= zfs_write_limit_max)
+
+ if (cnt.v_free_count + cnt.v_cache_count >
+ (uint64_t)physmem * arc_lotsfree_percent / 100)
return (0);
if (txg > last_txg) {
@@ -3846,20 +3909,6 @@ arc_memory_throttle(uint64_t reserve, ui
return (SET_ERROR(EAGAIN));
}
page_load = 0;
-
- if (arc_size > arc_c_min) {
- uint64_t evictable_memory =
- arc_mru->arcs_lsize[ARC_BUFC_DATA] +
- arc_mru->arcs_lsize[ARC_BUFC_METADATA] +
- arc_mfu->arcs_lsize[ARC_BUFC_DATA] +
- arc_mfu->arcs_lsize[ARC_BUFC_METADATA];
- available_memory += MIN(evictable_memory, arc_size - arc_c_min);
- }
-
- if (inflight_data > available_memory / 4) {
- ARCSTAT_INCR(arcstat_memory_throttle_count, 1);
- return (SET_ERROR(ERESTART));
- }
#endif
return (0);
}
@@ -3877,15 +3926,6 @@ arc_tempreserve_space(uint64_t reserve,
int error;
uint64_t anon_size;
-#ifdef ZFS_DEBUG
- /*
- * Once in a while, fail for no reason. Everything should cope.
- */
- if (spa_get_random(10000) == 0) {
- dprintf("forcing random failure\n");
- return (SET_ERROR(ERESTART));
- }
-#endif
if (reserve > arc_c/4 && !arc_no_grow)
arc_c = MIN(arc_c_max, reserve * 4);
if (reserve > arc_c)
@@ -3903,7 +3943,8 @@ arc_tempreserve_space(uint64_t reserve,
* in order to compress/encrypt/etc the data. We therefore need to
* make sure that there is sufficient available memory for this.
*/
- if (error = arc_memory_throttle(reserve, anon_size, txg))
+ error = arc_memory_throttle(reserve, txg);
+ if (error != 0)
return (error);
/*
@@ -4094,11 +4135,20 @@ arc_init(void)
arc_dead = FALSE;
arc_warm = B_FALSE;
- if (zfs_write_limit_max == 0)
- zfs_write_limit_max = ptob(physmem) >> zfs_write_limit_shift;
- else
- zfs_write_limit_shift = 0;
- mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL);
+ /*
+ * Calculate maximum amount of dirty data per pool.
+ *
+ * If it has been set by /etc/system, take that.
+ * Otherwise, use a percentage of physical memory defined by
+ * zfs_dirty_data_max_percent (default 10%) with a cap at
+ * zfs_dirty_data_max_max (default 4GB).
+ */
+ if (zfs_dirty_data_max == 0) {
+ zfs_dirty_data_max = ptob(physmem) *
+ zfs_dirty_data_max_percent / 100;
+ zfs_dirty_data_max = MIN(zfs_dirty_data_max,
+ zfs_dirty_data_max_max);
+ }
#ifdef _KERNEL
if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_disable", &zfs_prefetch_disable))
@@ -4177,8 +4227,6 @@ arc_fini(void)
mutex_destroy(&arc_l2c_only->arcs_locks[i].arcs_lock);
}
- mutex_destroy(&zfs_write_limit_lock);
-
buf_fini();
ASSERT(arc_loaned_bytes == 0);
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Jan 16 15:47:09 2014 (r260762)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Jan 16 15:57:39 2014 (r260763)
@@ -842,7 +842,7 @@ dbuf_free_range(dnode_t *dn, uint64_t st
atomic_inc_64(&zfs_free_range_recv_miss);
}
- for (db = list_head(&dn->dn_dbufs); db; db = db_next) {
+ for (db = list_head(&dn->dn_dbufs); db != NULL; db = db_next) {
db_next = list_next(&dn->dn_dbufs, db);
ASSERT(db->db_blkid != DMU_BONUS_BLKID);
@@ -1188,6 +1188,8 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t
sizeof (dbuf_dirty_record_t),
offsetof(dbuf_dirty_record_t, dr_dirty_node));
}
+ if (db->db_blkid != DMU_BONUS_BLKID && os->os_dsl_dataset != NULL)
+ dr->dr_accounted = db->db.db_size;
dr->dr_dbuf = db;
dr->dr_txg = tx->tx_txg;
dr->dr_next = *drp;
@@ -1271,7 +1273,10 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t
dbuf_rele(parent, FTAG);
mutex_enter(&db->db_mtx);
- /* possible race with dbuf_undirty() */
+ /*
+ * Since we've dropped the mutex, it's possible that
+ * dbuf_undirty() might have changed this out from under us.
+ */
if (db->db_last_dirty == dr ||
dn->dn_object == DMU_META_DNODE_OBJECT) {
mutex_enter(&di->dt.di.dr_mtx);
@@ -1333,7 +1338,11 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_
ASSERT(db->db.db_size != 0);
- /* XXX would be nice to fix up dn_towrite_space[] */
+ /*
+ * Any space we accounted for in dp_dirty_* will be cleaned up by
+ * dsl_pool_sync(). This is relatively rare so the discrepancy
+ * is not a big deal.
+ */
*drp = dr->dr_next;
@@ -1513,7 +1522,7 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a
/*
* "Clear" the contents of this dbuf. This will mark the dbuf
- * EVICTING and clear *most* of its references. Unfortunetely,
+ * EVICTING and clear *most* of its references. Unfortunately,
* when we are not holding the dn_dbufs_mtx, we can't clear the
* entry in the dn_dbufs list. We have to wait until dbuf_destroy()
* in this case. For callers from the DMU we will usually see:
@@ -1700,7 +1709,7 @@ dbuf_create(dnode_t *dn, uint8_t level,
db->db.db_offset = 0;
} else {
int blocksize =
- db->db_level ? 1<dn_indblkshift : dn->dn_datablksz;
+ db->db_level ? 1 << dn->dn_indblkshift : dn->dn_datablksz;
db->db.db_size = blocksize;
db->db.db_offset = db->db_blkid * blocksize;
}
@@ -1809,7 +1818,7 @@ dbuf_destroy(dmu_buf_impl_t *db)
}
void
-dbuf_prefetch(dnode_t *dn, uint64_t blkid)
+dbuf_prefetch(dnode_t *dn, uint64_t blkid, zio_priority_t prio)
{
dmu_buf_impl_t *db = NULL;
blkptr_t *bp = NULL;
@@ -1833,8 +1842,6 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki
if (dbuf_findbp(dn, 0, blkid, TRUE, &db, &bp) == 0) {
if (bp && !BP_IS_HOLE(bp)) {
- int priority = dn->dn_type == DMU_OT_DDT_ZAP ?
- ZIO_PRIORITY_DDT_PREFETCH : ZIO_PRIORITY_ASYNC_READ;
dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset;
uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
zbookmark_t zb;
@@ -1843,7 +1850,7 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki
dn->dn_object, 0, blkid);
(void) arc_read(NULL, dn->dn_objset->os_spa,
- bp, NULL, NULL, priority,
+ bp, NULL, NULL, prio,
ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE,
&aflags, &zb);
}
@@ -2528,6 +2535,38 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *
mutex_exit(&db->db_mtx);
}
+/*
+ * The SPA will call this callback several times for each zio - once
+ * for every physical child i/o (zio->io_phys_children times). This
+ * allows the DMU to monitor the progress of each logical i/o. For example,
+ * there may be 2 copies of an indirect block, or many fragments of a RAID-Z
+ * block. There may be a long delay before all copies/fragments are completed,
+ * so this callback allows us to retire dirty space gradually, as the physical
+ * i/os complete.
+ */
+/* ARGSUSED */
+static void
+dbuf_write_physdone(zio_t *zio, arc_buf_t *buf, void *arg)
+{
+ dmu_buf_impl_t *db = arg;
+ objset_t *os = db->db_objset;
+ dsl_pool_t *dp = dmu_objset_pool(os);
+ dbuf_dirty_record_t *dr;
+ int delta = 0;
+
+ dr = db->db_data_pending;
+ ASSERT3U(dr->dr_txg, ==, zio->io_txg);
+
+ /*
+ * The callback will be called io_phys_children times. Retire one
+ * portion of our dirty space each time we are called. Any rounding
+ * error will be cleaned up by dsl_pool_sync()'s call to
+ * dsl_pool_undirty_space().
+ */
+ delta = dr->dr_accounted / zio->io_phys_children;
+ dsl_pool_undirty_space(dp, delta, zio->io_txg);
+}
+
/* ARGSUSED */
static void
dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb)
@@ -2622,6 +2661,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b
ASSERT(db->db_dirtycnt > 0);
db->db_dirtycnt -= 1;
db->db_data_pending = NULL;
+
dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg);
}
@@ -2740,8 +2780,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_
ASSERT(db->db_state != DB_NOFILL);
dr->dr_zio = zio_write(zio, os->os_spa, txg,
db->db_blkptr, data->b_data, arc_buf_size(data), &zp,
- dbuf_write_override_ready, dbuf_write_override_done, dr,
- ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb);
+ dbuf_write_override_ready, NULL, dbuf_write_override_done,
+ dr, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb);
mutex_enter(&db->db_mtx);
dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN;
zio_write_override(dr->dr_zio, &dr->dt.dl.dr_overridden_by,
@@ -2752,7 +2792,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_
zp.zp_checksum == ZIO_CHECKSUM_NOPARITY);
dr->dr_zio = zio_write(zio, os->os_spa, txg,
db->db_blkptr, NULL, db->db.db_size, &zp,
- dbuf_write_nofill_ready, dbuf_write_nofill_done, db,
+ dbuf_write_nofill_ready, NULL, dbuf_write_nofill_done, db,
ZIO_PRIORITY_ASYNC_WRITE,
ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_NODATA, &zb);
} else {
@@ -2760,7 +2800,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_
dr->dr_zio = arc_write(zio, os->os_spa, txg,
db->db_blkptr, data, DBUF_IS_L2CACHEABLE(db),
DBUF_IS_L2COMPRESSIBLE(db), &zp, dbuf_write_ready,
- dbuf_write_done, db, ZIO_PRIORITY_ASYNC_WRITE,
- ZIO_FLAG_MUSTSUCCEED, &zb);
+ dbuf_write_physdone, dbuf_write_done, db,
+ ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb);
}
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jan 16 15:47:09 2014 (r260762)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jan 16 15:57:39 2014 (r260763)
@@ -374,13 +374,11 @@ static int
dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint64_t length,
int read, void *tag, int *numbufsp, dmu_buf_t ***dbpp, uint32_t flags)
{
- dsl_pool_t *dp = NULL;
dmu_buf_t **dbp;
uint64_t blkid, nblks, i;
uint32_t dbuf_flags;
int err;
zio_t *zio;
- hrtime_t start;
ASSERT(length <= DMU_MAX_ACCESS);
@@ -408,9 +406,6 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
}
dbp = kmem_zalloc(sizeof (dmu_buf_t *) * nblks, KM_SLEEP);
- if (dn->dn_objset->os_dsl_dataset)
- dp = dn->dn_objset->os_dsl_dataset->ds_dir->dd_pool;
- start = gethrtime();
zio = zio_root(dn->dn_objset->os_spa, NULL, NULL, ZIO_FLAG_CANFAIL);
blkid = dbuf_whichblock(dn, offset);
for (i = 0; i < nblks; i++) {
@@ -434,9 +429,6 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
/* wait for async i/o */
err = zio_wait(zio);
- /* track read overhead when we are in sync context */
- if (dp && dsl_pool_sync_context(dp))
- dp->dp_read_overhead += gethrtime() - start;
if (err) {
dmu_buf_rele_array(dbp, nblks, tag);
return (err);
@@ -518,12 +510,22 @@ dmu_buf_rele_array(dmu_buf_t **dbp_fake,
kmem_free(dbp, sizeof (dmu_buf_t *) * numbufs);
}
+/*
+ * Issue prefetch i/os for the given blocks.
+ *
+ * Note: The assumption is that we *know* these blocks will be needed
+ * almost immediately. Therefore, the prefetch i/os will be issued at
+ * ZIO_PRIORITY_SYNC_READ
+ *
+ * Note: indirect blocks and other metadata will be read synchronously,
+ * causing this function to block if they are not already cached.
+ */
void
dmu_prefetch(objset_t *os, uint64_t object, uint64_t offset, uint64_t len)
{
dnode_t *dn;
uint64_t blkid;
- int nblks, i, err;
+ int nblks, err;
if (zfs_prefetch_disable)
return;
@@ -536,7 +538,7 @@ dmu_prefetch(objset_t *os, uint64_t obje
rw_enter(&dn->dn_struct_rwlock, RW_READER);
blkid = dbuf_whichblock(dn, object * sizeof (dnode_phys_t));
- dbuf_prefetch(dn, blkid);
+ dbuf_prefetch(dn, blkid, ZIO_PRIORITY_SYNC_READ);
rw_exit(&dn->dn_struct_rwlock);
return;
}
@@ -553,16 +555,16 @@ dmu_prefetch(objset_t *os, uint64_t obje
rw_enter(&dn->dn_struct_rwlock, RW_READER);
if (dn->dn_datablkshift) {
int blkshift = dn->dn_datablkshift;
- nblks = (P2ROUNDUP(offset+len, 1<> blkshift;
+ nblks = (P2ROUNDUP(offset + len, 1 << blkshift) -
+ P2ALIGN(offset, 1 << blkshift)) >> blkshift;
} else {
nblks = (offset < dn->dn_datablksz);
}
if (nblks != 0) {
blkid = dbuf_whichblock(dn, offset);
- for (i = 0; i < nblks; i++)
- dbuf_prefetch(dn, blkid+i);
+ for (int i = 0; i < nblks; i++)
+ dbuf_prefetch(dn, blkid + i, ZIO_PRIORITY_SYNC_READ);
}
rw_exit(&dn->dn_struct_rwlock);
@@ -1376,7 +1378,7 @@ dmu_sync_late_arrival(zio_t *pio, objset
zio_nowait(zio_write(pio, os->os_spa, dmu_tx_get_txg(tx), zgd->zgd_bp,
zgd->zgd_db->db_data, zgd->zgd_db->db_size, zp,
- dmu_sync_late_arrival_ready, dmu_sync_late_arrival_done, dsa,
+ dmu_sync_late_arrival_ready, NULL, dmu_sync_late_arrival_done, dsa,
ZIO_PRIORITY_SYNC_WRITE, ZIO_FLAG_CANFAIL, zb));
return (0);
@@ -1516,8 +1518,9 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s
zio_nowait(arc_write(pio, os->os_spa, txg,
bp, dr->dt.dl.dr_data, DBUF_IS_L2CACHEABLE(db),
- DBUF_IS_L2COMPRESSIBLE(db), &zp, dmu_sync_ready, dmu_sync_done,
- dsa, ZIO_PRIORITY_SYNC_WRITE, ZIO_FLAG_CANFAIL, &zb));
+ DBUF_IS_L2COMPRESSIBLE(db), &zp, dmu_sync_ready,
+ NULL, dmu_sync_done, dsa, ZIO_PRIORITY_SYNC_WRITE,
+ ZIO_FLAG_CANFAIL, &zb));
return (0);
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Jan 16 15:47:09 2014 (r260762)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Jan 16 15:57:39 2014 (r260763)
@@ -1028,7 +1028,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio
zio = arc_write(pio, os->os_spa, tx->tx_txg,
os->os_rootbp, os->os_phys_buf, DMU_OS_IS_L2CACHEABLE(os),
DMU_OS_IS_L2COMPRESSIBLE(os), &zp, dmu_objset_write_ready,
- dmu_objset_write_done, os, ZIO_PRIORITY_ASYNC_WRITE,
+ NULL, dmu_objset_write_done, os, ZIO_PRIORITY_ASYNC_WRITE,
ZIO_FLAG_MUSTSUCCEED, &zb);
/*
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Jan 16 15:47:09 2014 (r260762)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Jan 16 15:57:39 2014 (r260763)
@@ -54,6 +54,7 @@ dmu_tx_create_dd(dsl_dir_t *dd)
offsetof(dmu_tx_hold_t, txh_node));
list_create(&tx->tx_callbacks, sizeof (dmu_tx_callback_t),
offsetof(dmu_tx_callback_t, dcb_node));
+ tx->tx_start = gethrtime();
#ifdef ZFS_DEBUG
refcount_create(&tx->tx_space_written);
refcount_create(&tx->tx_space_freed);
@@ -597,13 +598,13 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t
if (txh == NULL)
return;
dn = txh->txh_dnode;
+ dmu_tx_count_dnode(txh);
if (off >= (dn->dn_maxblkid+1) * dn->dn_datablksz)
return;
if (len == DMU_OBJECT_END)
len = (dn->dn_maxblkid+1) * dn->dn_datablksz - off;
- dmu_tx_count_dnode(txh);
/*
* For i/o error checking, we read the first and last level-0
@@ -918,6 +919,161 @@ dmu_tx_dirty_buf(dmu_tx_t *tx, dmu_buf_i
}
#endif
+/*
+ * If we can't do 10 iops, something is wrong. Let us go ahead
+ * and hit zfs_dirty_data_max.
+ */
+hrtime_t zfs_delay_max_ns = MSEC2NSEC(100);
+int zfs_delay_resolution_ns = 100 * 1000; /* 100 microseconds */
+
+/*
+ * We delay transactions when we've determined that the backend storage
+ * isn't able to accommodate the rate of incoming writes.
+ *
+ * If there is already a transaction waiting, we delay relative to when
+ * that transaction finishes waiting. This way the calculated min_time
+ * is independent of the number of threads concurrently executing
+ * transactions.
+ *
+ * If we are the only waiter, wait relative to when the transaction
+ * started, rather than the current time. This credits the transaction for
+ * "time already served", e.g. reading indirect blocks.
+ *
+ * The minimum time for a transaction to take is calculated as:
+ * min_time = scale * (dirty - min) / (max - dirty)
+ * min_time is then capped at zfs_delay_max_ns.
+ *
+ * The delay has two degrees of freedom that can be adjusted via tunables.
+ * The percentage of dirty data at which we start to delay is defined by
+ * zfs_delay_min_dirty_percent. This should typically be at or above
+ * zfs_vdev_async_write_active_max_dirty_percent so that we only start to
+ * delay after writing at full speed has failed to keep up with the incoming
+ * write rate. The scale of the curve is defined by zfs_delay_scale. Roughly
+ * speaking, this variable determines the amount of delay at the midpoint of
+ * the curve.
+ *
+ * delay
+ * 10ms +-------------------------------------------------------------*+
+ * | *|
+ * 9ms + *+
+ * | *|
+ * 8ms + *+
+ * | * |
+ * 7ms + * +
+ * | * |
+ * 6ms + * +
+ * | * |
+ * 5ms + * +
+ * | * |
+ * 4ms + * +
+ * | * |
+ * 3ms + * +
+ * | * |
+ * 2ms + (midpoint) * +
+ * | | ** |
+ * 1ms + v *** +
+ * | zfs_delay_scale ----------> ******** |
+ * 0 +-------------------------------------*********----------------+
+ * 0% <- zfs_dirty_data_max -> 100%
+ *
+ * Note that since the delay is added to the outstanding time remaining on the
+ * most recent transaction, the delay is effectively the inverse of IOPS.
+ * Here the midpoint of 500us translates to 2000 IOPS. The shape of the curve
+ * was chosen such that small changes in the amount of accumulated dirty data
+ * in the first 3/4 of the curve yield relatively small differences in the
+ * amount of delay.
+ *
+ * The effects can be easier to understand when the amount of delay is
+ * represented on a log scale:
+ *
+ * delay
+ * 100ms +-------------------------------------------------------------++
+ * + +
+ * | |
+ * + *+
+ * 10ms + *+
+ * + ** +
+ * | (midpoint) ** |
+ * + | ** +
+ * 1ms + v **** +
+ * + zfs_delay_scale ----------> ***** +
+ * | **** |
+ * + **** +
+ * 100us + ** +
+ * + * +
+ * | * |
+ * + * +
+ * 10us + * +
+ * + +
+ * | |
+ * + +
+ * +--------------------------------------------------------------+
+ * 0% <- zfs_dirty_data_max -> 100%
+ *
+ * Note here that only as the amount of dirty data approaches its limit does
+ * the delay start to increase rapidly. The goal of a properly tuned system
+ * should be to keep the amount of dirty data out of that range by first
+ * ensuring that the appropriate limits are set for the I/O scheduler to reach
+ * optimal throughput on the backend storage, and then by changing the value
+ * of zfs_delay_scale to increase the steepness of the curve.
+ */
+static void
+dmu_tx_delay(dmu_tx_t *tx, uint64_t dirty)
+{
+ dsl_pool_t *dp = tx->tx_pool;
+ uint64_t delay_min_bytes =
+ zfs_dirty_data_max * zfs_delay_min_dirty_percent / 100;
+ hrtime_t wakeup, min_tx_time, now;
+
+ if (dirty <= delay_min_bytes)
+ return;
+
+ /*
+ * The caller has already waited until we are under the max.
+ * We make them pass us the amount of dirty data so we don't
+ * have to handle the case of it being >= the max, which could
+ * cause a divide-by-zero if it's == the max.
+ */
+ ASSERT3U(dirty, <, zfs_dirty_data_max);
+
+ now = gethrtime();
+ min_tx_time = zfs_delay_scale *
+ (dirty - delay_min_bytes) / (zfs_dirty_data_max - dirty);
+ if (now > tx->tx_start + min_tx_time)
+ return;
+
+ min_tx_time = MIN(min_tx_time, zfs_delay_max_ns);
+
+ DTRACE_PROBE3(delay__mintime, dmu_tx_t *, tx, uint64_t, dirty,
+ uint64_t, min_tx_time);
+
+ mutex_enter(&dp->dp_lock);
+ wakeup = MAX(tx->tx_start + min_tx_time,
+ dp->dp_last_wakeup + min_tx_time);
+ dp->dp_last_wakeup = wakeup;
+ mutex_exit(&dp->dp_lock);
+
+#ifdef _KERNEL
+#ifdef illumos
+ mutex_enter(&curthread->t_delay_lock);
+ while (cv_timedwait_hires(&curthread->t_delay_cv,
+ &curthread->t_delay_lock, wakeup, zfs_delay_resolution_ns,
+ CALLOUT_FLAG_ABSOLUTE | CALLOUT_FLAG_ROUNDUP) > 0)
+ continue;
+ mutex_exit(&curthread->t_delay_lock);
+#else
+ pause_sbt("dmu_tx_delay", wakeup * SBT_1NS,
+ zfs_delay_resolution_ns * SBT_1NS, C_ABSOLUTE);
+#endif
+#else
+ hrtime_t delta = wakeup - gethrtime();
+ struct timespec ts;
+ ts.tv_sec = delta / NANOSEC;
+ ts.tv_nsec = delta % NANOSEC;
+ (void) nanosleep(&ts, NULL);
+#endif
+}
+
static int
dmu_tx_try_assign(dmu_tx_t *tx, txg_how_t txg_how)
{
@@ -948,6 +1104,12 @@ dmu_tx_try_assign(dmu_tx_t *tx, txg_how_
return (SET_ERROR(ERESTART));
}
+ if (!tx->tx_waited &&
+ dsl_pool_need_dirty_delay(tx->tx_pool)) {
+ tx->tx_wait_dirty = B_TRUE;
+ return (SET_ERROR(ERESTART));
+ }
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 16:05:22 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 2BE22A41;
Thu, 16 Jan 2014 16:05:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 10B251A2C;
Thu, 16 Jan 2014 16:05:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GG5LkZ073828;
Thu, 16 Jan 2014 16:05:21 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GG5LB7073825;
Thu, 16 Jan 2014 16:05:21 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161605.s0GG5LB7073825@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 16:05:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260768 - in
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 16:05:22 -0000
Author: avg
Date: Thu Jan 16 16:05:21 2014
New Revision: 260768
URL: http://svnweb.freebsd.org/changeset/base/260768
Log:
MFC r258633: MFV r255256: 3954 metaslabs continue to load even after
hitting zfs_mg_alloc_failure limit
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Thu Jan 16 16:04:36 2014 (r260767)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Thu Jan 16 16:05:21 2014 (r260768)
@@ -65,7 +65,8 @@ int zfs_condense_pct = 200;
/*
* This value defines the number of allowed allocation failures per vdev.
* If a device reaches this threshold in a given txg then we consider skipping
- * allocations on that device.
+ * allocations on that device. The value of zfs_mg_alloc_failures is computed
+ * in zio_init() unless it has been overridden in /etc/system.
*/
int zfs_mg_alloc_failures = 0;
TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures);
@@ -74,6 +75,21 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_
"Number of allowed allocation failures per vdev");
/*
+ * The zfs_mg_noalloc_threshold defines which metaslab groups should
+ * be eligible for allocation. The value is defined as a percentage of
+ * a free space. Metaslab groups that have more free space than
+ * zfs_mg_noalloc_threshold are always eligible for allocations. Once
+ * a metaslab group's free space is less than or equal to the
+ * zfs_mg_noalloc_threshold the allocator will avoid allocating to that
+ * group unless all groups in the pool have reached zfs_mg_noalloc_threshold.
+ * Once all groups in the pool reach zfs_mg_noalloc_threshold then all
+ * groups are allowed to accept allocations. Gang blocks are always
+ * eligible to allocate on any metaslab group. The default value of 0 means
+ * no metaslab group will be excluded based on this criterion.
+ */
+int zfs_mg_noalloc_threshold = 0;
+
+/*
* Metaslab debugging: when set, keeps all space maps in core to verify frees.
*/
static int metaslab_debug = 0;
@@ -289,6 +305,53 @@ metaslab_compare(const void *x1, const v
return (0);
}
+/*
+ * Update the allocatable flag and the metaslab group's capacity.
+ * The allocatable flag is set to true if the capacity is below
+ * the zfs_mg_noalloc_threshold. If a metaslab group transitions
+ * from allocatable to non-allocatable or vice versa then the metaslab
+ * group's class is updated to reflect the transition.
+ */
+static void
+metaslab_group_alloc_update(metaslab_group_t *mg)
+{
+ vdev_t *vd = mg->mg_vd;
+ metaslab_class_t *mc = mg->mg_class;
+ vdev_stat_t *vs = &vd->vdev_stat;
+ boolean_t was_allocatable;
+
+ ASSERT(vd == vd->vdev_top);
+
+ mutex_enter(&mg->mg_lock);
+ was_allocatable = mg->mg_allocatable;
+
+ mg->mg_free_capacity = ((vs->vs_space - vs->vs_alloc) * 100) /
+ (vs->vs_space + 1);
+
+ mg->mg_allocatable = (mg->mg_free_capacity > zfs_mg_noalloc_threshold);
+
+ /*
+ * The mc_alloc_groups maintains a count of the number of
+ * groups in this metaslab class that are still above the
+ * zfs_mg_noalloc_threshold. This is used by the allocating
+ * threads to determine if they should avoid allocations to
+ * a given group. The allocator will avoid allocations to a group
+ * if that group has reached or is below the zfs_mg_noalloc_threshold
+ * and there are still other groups that are above the threshold.
+ * When a group transitions from allocatable to non-allocatable or
+ * vice versa we update the metaslab class to reflect that change.
+ * When the mc_alloc_groups value drops to 0 that means that all
+ * groups have reached the zfs_mg_noalloc_threshold making all groups
+ * eligible for allocations. This effectively means that all devices
+ * are balanced again.
+ */
+ if (was_allocatable && !mg->mg_allocatable)
+ mc->mc_alloc_groups--;
+ else if (!was_allocatable && mg->mg_allocatable)
+ mc->mc_alloc_groups++;
+ mutex_exit(&mg->mg_lock);
+}
+
metaslab_group_t *
metaslab_group_create(metaslab_class_t *mc, vdev_t *vd)
{
@@ -339,6 +402,7 @@ metaslab_group_activate(metaslab_group_t
return;
mg->mg_aliquot = metaslab_aliquot * MAX(1, mg->mg_vd->vdev_children);
+ metaslab_group_alloc_update(mg);
if ((mgprev = mc->mc_rotor) == NULL) {
mg->mg_prev = mg;
@@ -426,6 +490,29 @@ metaslab_group_sort(metaslab_group_t *mg
}
/*
+ * Determine if a given metaslab group should skip allocations. A metaslab
+ * group should avoid allocations if its used capacity has crossed the
+ * zfs_mg_noalloc_threshold and there is at least one metaslab group
+ * that can still handle allocations.
+ */
+static boolean_t
+metaslab_group_allocatable(metaslab_group_t *mg)
+{
+ vdev_t *vd = mg->mg_vd;
+ spa_t *spa = vd->vdev_spa;
+ metaslab_class_t *mc = mg->mg_class;
+
+ /*
+ * A metaslab group is considered allocatable if its free capacity
+ * is greater than the set value of zfs_mg_noalloc_threshold, it's
+ * associated with a slog, or there are no other metaslab groups
+ * with free capacity greater than zfs_mg_noalloc_threshold.
+ */
+ return (mg->mg_free_capacity > zfs_mg_noalloc_threshold ||
+ mc != spa_normal_class(spa) || mc->mc_alloc_groups == 0);
+}
+
+/*
* ==========================================================================
* Common allocator routines
* ==========================================================================
@@ -1374,6 +1461,8 @@ metaslab_sync_reassess(metaslab_group_t
vdev_t *vd = mg->mg_vd;
int64_t failures = mg->mg_alloc_failures;
+ metaslab_group_alloc_update(mg);
+
/*
* Re-evaluate all metaslabs which have lower offsets than the
* bonus area.
@@ -1475,6 +1564,8 @@ metaslab_group_alloc(metaslab_group_t *m
if (msp == NULL)
return (-1ULL);
+ mutex_enter(&msp->ms_lock);
+
/*
* If we've already reached the allowable number of failed
* allocation attempts on this metaslab group then we
@@ -1491,11 +1582,10 @@ metaslab_group_alloc(metaslab_group_t *m
"asize %llu, failures %llu", spa_name(spa),
mg->mg_vd->vdev_id, txg, mg, psize, asize,
mg->mg_alloc_failures);
+ mutex_exit(&msp->ms_lock);
return (-1ULL);
}
- mutex_enter(&msp->ms_lock);
-
/*
* Ensure that the metaslab we have selected is still
* capable of handling our request. It's possible that
@@ -1648,6 +1738,21 @@ top:
} else {
allocatable = vdev_allocatable(vd);
}
+
+ /*
+ * Determine if the selected metaslab group is eligible
+ * for allocations. If we're ganging or have requested
+ * an allocation for the smallest gang block size
+ * then we don't want to avoid allocating to the this
+ * metaslab group. If we're in this condition we should
+ * try to allocate from any device possible so that we
+ * don't inadvertently return ENOSPC and suspend the pool
+ * even though space is still available.
+ */
+ if (allocatable && CAN_FASTGANG(flags) &&
+ psize > SPA_GANGBLOCKSIZE)
+ allocatable = metaslab_group_allocatable(mg);
+
if (!allocatable)
goto next;
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Thu Jan 16 16:04:36 2014 (r260767)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Thu Jan 16 16:05:21 2014 (r260768)
@@ -24,7 +24,7 @@
*/
/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#ifndef _SYS_METASLAB_IMPL_H
@@ -45,6 +45,7 @@ struct metaslab_class {
metaslab_group_t *mc_rotor;
space_map_ops_t *mc_ops;
uint64_t mc_aliquot;
+ uint64_t mc_alloc_groups; /* # of allocatable groups */
uint64_t mc_alloc; /* total allocated space */
uint64_t mc_deferred; /* total deferred frees */
uint64_t mc_space; /* total space (alloc + free) */
@@ -58,6 +59,8 @@ struct metaslab_group {
uint64_t mg_aliquot;
uint64_t mg_bonus_area;
uint64_t mg_alloc_failures;
+ boolean_t mg_allocatable; /* can we allocate? */
+ uint64_t mg_free_capacity; /* percentage free */
int64_t mg_bias;
int64_t mg_activation_count;
metaslab_class_t *mg_class;
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 16 16:04:36 2014 (r260767)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 16 16:05:21 2014 (r260768)
@@ -2458,7 +2458,7 @@ zio_alloc_zil(spa_t *spa, uint64_t txg,
if (error) {
error = metaslab_alloc(spa, spa_normal_class(spa), size,
new_bp, 1, txg, old_bp,
- METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID);
+ METASLAB_HINTBP_AVOID);
}
if (error == 0) {
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 16:08:00 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 8DA83BA2;
Thu, 16 Jan 2014 16:08:00 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 5E6ED1A48;
Thu, 16 Jan 2014 16:08:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GG80K8074294;
Thu, 16 Jan 2014 16:08:00 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GG7x11074281;
Thu, 16 Jan 2014 16:07:59 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161607.s0GG7x11074281@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 16:07:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260769 -
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 16:08:00 -0000
Author: avg
Date: Thu Jan 16 16:07:59 2014
New Revision: 260769
URL: http://svnweb.freebsd.org/changeset/base/260769
Log:
MFC r258634: MFV r258376: 3964 L2ARC should always compress metadata buffers
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Thu Jan 16 16:05:21 2014 (r260768)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Thu Jan 16 16:07:59 2014 (r260769)
@@ -329,7 +329,8 @@ boolean_t dbuf_is_metadata(dmu_buf_impl_
((_db)->db_objset->os_secondary_cache == ZFS_CACHE_METADATA)))
#define DBUF_IS_L2COMPRESSIBLE(_db) \
- ((_db)->db_objset->os_compress != ZIO_COMPRESS_OFF)
+ ((_db)->db_objset->os_compress != ZIO_COMPRESS_OFF || \
+ (dbuf_is_metadata(_db) && zfs_mdcomp_disable == B_FALSE))
#ifdef ZFS_DEBUG
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jan 16 16:05:21 2014 (r260768)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jan 16 16:07:59 2014 (r260769)
@@ -24,6 +24,7 @@
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright 2013 DEY Storage Systems, Inc.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -807,6 +808,8 @@ int dmu_diff(const char *tosnap_name, co
#define ZFS_CRC64_POLY 0xC96C5795D7870F42ULL /* ECMA-182, reflected form */
extern uint64_t zfs_crc64_table[256];
+extern int zfs_mdcomp_disable;
+
#ifdef __cplusplus
}
#endif
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Thu Jan 16 16:05:21 2014 (r260768)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Thu Jan 16 16:07:59 2014 (r260769)
@@ -130,7 +130,7 @@ struct objset {
((os)->os_secondary_cache == ZFS_CACHE_ALL || \
(os)->os_secondary_cache == ZFS_CACHE_METADATA)
-#define DMU_OS_IS_L2COMPRESSIBLE(os) ((os)->os_compress != ZIO_COMPRESS_OFF)
+#define DMU_OS_IS_L2COMPRESSIBLE(os) (zfs_mdcomp_disable == B_FALSE)
/* called from zpl */
int dmu_objset_hold(const char *name, void *tag, objset_t **osp);
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 16:13:22 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 0588D31A;
Thu, 16 Jan 2014 16:13:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id E52BC1AE6;
Thu, 16 Jan 2014 16:13:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GGDL1Y078030;
Thu, 16 Jan 2014 16:13:21 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GGDLoH078029;
Thu, 16 Jan 2014 16:13:21 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161613.s0GGDLoH078029@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 16:13:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260773 -
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 16:13:22 -0000
Author: avg
Date: Thu Jan 16 16:13:21 2014
New Revision: 260773
URL: http://svnweb.freebsd.org/changeset/base/260773
Log:
MFC r258739: zfs mappedread_sf: assert that a page is never partially valid
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 16 16:12:09 2014 (r260772)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 16 16:13:21 2014 (r260773)
@@ -580,8 +580,10 @@ mappedread_sf(vnode_t *vp, int nbytes, u
vm_page_activate(pp);
}
vm_page_unlock(pp);
- } else
+ } else {
+ ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL);
vm_page_sunbusy(pp);
+ }
if (error)
break;
uio->uio_resid -= bytes;
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 16:15:39 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 1D38F811;
Thu, 16 Jan 2014 16:15:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 077E71B11;
Thu, 16 Jan 2014 16:15:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GGFc8Z078634;
Thu, 16 Jan 2014 16:15:38 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GGFc4e078629;
Thu, 16 Jan 2014 16:15:38 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161615.s0GGFc4e078629@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 16:15:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260776 -
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 16:15:39 -0000
Author: avg
Date: Thu Jan 16 16:15:38 2014
New Revision: 260776
URL: http://svnweb.freebsd.org/changeset/base/260776
Log:
MFC r258720: MFV r258665: 4347 ZPL can use dmu_tx_assign(TXG_WAIT)
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Thu Jan 16 16:13:44 2014 (r260775)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Thu Jan 16 16:15:38 2014 (r260776)
@@ -951,7 +951,6 @@ zfs_make_xattrdir(znode_t *zp, vattr_t *
return (SET_ERROR(EDQUOT));
}
-top:
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes +
ZFS_SA_BASE_ATTR_SIZE);
@@ -960,13 +959,8 @@ top:
fuid_dirtied = zfsvfs->z_fuid_dirty;
if (fuid_dirtied)
zfs_fuid_txhold(zfsvfs, tx);
- error = dmu_tx_assign(tx, TXG_NOWAIT);
+ error = dmu_tx_assign(tx, TXG_WAIT);
if (error) {
- if (error == ERESTART) {
- dmu_tx_wait(tx);
- dmu_tx_abort(tx);
- goto top;
- }
zfs_acl_ids_free(&acl_ids);
dmu_tx_abort(tx);
return (error);
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 16 16:13:44 2014 (r260775)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 16 16:15:38 2014 (r260776)
@@ -107,11 +107,18 @@
* (3) All range locks must be grabbed before calling dmu_tx_assign(),
* as they can span dmu_tx_assign() calls.
*
- * (4) Always pass TXG_NOWAIT as the second argument to dmu_tx_assign().
- * This is critical because we don't want to block while holding locks.
- * Note, in particular, that if a lock is sometimes acquired before
- * the tx assigns, and sometimes after (e.g. z_lock), then failing to
- * use a non-blocking assign can deadlock the system. The scenario:
+ * (4) If ZPL locks are held, pass TXG_NOWAIT as the second argument to
+ * dmu_tx_assign(). This is critical because we don't want to block
+ * while holding locks.
+ *
+ * If no ZPL locks are held (aside from ZFS_ENTER()), use TXG_WAIT. This
+ * reduces lock contention and CPU usage when we must wait (note that if
+ * throughput is constrained by the storage, nearly every transaction
+ * must wait).
+ *
+ * Note, in particular, that if a lock is sometimes acquired before
+ * the tx assigns, and sometimes after (e.g. z_lock), then failing
+ * to use a non-blocking assign can deadlock the system. The scenario:
*
* Thread A has grabbed a lock before calling dmu_tx_assign().
* Thread B is in an already-assigned tx, and blocks for this lock.
@@ -970,7 +977,6 @@ zfs_write(vnode_t *vp, uio_t *uio, int i
while (n > 0) {
abuf = NULL;
woff = uio->uio_loffset;
-again:
if (zfs_owner_overquota(zfsvfs, zp, B_FALSE) ||
zfs_owner_overquota(zfsvfs, zp, B_TRUE)) {
if (abuf != NULL)
@@ -1022,13 +1028,8 @@ again:
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
dmu_tx_hold_write(tx, zp->z_id, woff, MIN(n, max_blksz));
zfs_sa_upgrade_txholds(tx, zp);
- error = dmu_tx_assign(tx, TXG_NOWAIT);
+ error = dmu_tx_assign(tx, TXG_WAIT);
if (error) {
- if (error == ERESTART) {
- dmu_tx_wait(tx);
- dmu_tx_abort(tx);
- goto again;
- }
dmu_tx_abort(tx);
if (abuf != NULL)
dmu_return_arcbuf(abuf);
@@ -3412,12 +3413,9 @@ top:
zfs_sa_upgrade_txholds(tx, zp);
- err = dmu_tx_assign(tx, TXG_NOWAIT);
- if (err) {
- if (err == ERESTART)
- dmu_tx_wait(tx);
+ err = dmu_tx_assign(tx, TXG_WAIT);
+ if (err)
goto out;
- }
count = 0;
/*
@@ -4525,19 +4523,13 @@ zfs_putapage(vnode_t *vp, page_t *pp, u_
err = SET_ERROR(EDQUOT);
goto out;
}
-top:
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_write(tx, zp->z_id, off, len);
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
zfs_sa_upgrade_txholds(tx, zp);
- err = dmu_tx_assign(tx, TXG_NOWAIT);
+ err = dmu_tx_assign(tx, TXG_WAIT);
if (err != 0) {
- if (err == ERESTART) {
- dmu_tx_wait(tx);
- dmu_tx_abort(tx);
- goto top;
- }
dmu_tx_abort(tx);
goto out;
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 16 16:13:44 2014 (r260775)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 16 16:15:38 2014 (r260776)
@@ -1536,7 +1536,6 @@ zfs_extend(znode_t *zp, uint64_t end)
zfs_range_unlock(rl);
return (0);
}
-top:
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
zfs_sa_upgrade_txholds(tx, zp);
@@ -1556,13 +1555,8 @@ top:
newblksz = 0;
}
- error = dmu_tx_assign(tx, TXG_NOWAIT);
+ error = dmu_tx_assign(tx, TXG_WAIT);
if (error) {
- if (error == ERESTART) {
- dmu_tx_wait(tx);
- dmu_tx_abort(tx);
- goto top;
- }
dmu_tx_abort(tx);
zfs_range_unlock(rl);
return (error);
@@ -1670,17 +1664,11 @@ zfs_trunc(znode_t *zp, uint64_t end)
zfs_range_unlock(rl);
return (error);
}
-top:
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
zfs_sa_upgrade_txholds(tx, zp);
- error = dmu_tx_assign(tx, TXG_NOWAIT);
+ error = dmu_tx_assign(tx, TXG_WAIT);
if (error) {
- if (error == ERESTART) {
- dmu_tx_wait(tx);
- dmu_tx_abort(tx);
- goto top;
- }
dmu_tx_abort(tx);
zfs_range_unlock(rl);
return (error);
@@ -1771,13 +1759,8 @@ log:
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
zfs_sa_upgrade_txholds(tx, zp);
- error = dmu_tx_assign(tx, TXG_NOWAIT);
+ error = dmu_tx_assign(tx, TXG_WAIT);
if (error) {
- if (error == ERESTART) {
- dmu_tx_wait(tx);
- dmu_tx_abort(tx);
- goto log;
- }
dmu_tx_abort(tx);
return (error);
}
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 16:28:20 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 8D425F37;
Thu, 16 Jan 2014 16:28:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 78F221D03;
Thu, 16 Jan 2014 16:28:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GGSKGW083007;
Thu, 16 Jan 2014 16:28:20 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GGSKWb083006;
Thu, 16 Jan 2014 16:28:20 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161628.s0GGSKWb083006@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 16:28:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260779 - stable/10/sys/dev/drm2/ttm
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 16:28:20 -0000
Author: avg
Date: Thu Jan 16 16:28:19 2014
New Revision: 260779
URL: http://svnweb.freebsd.org/changeset/base/260779
Log:
MFC r259612: ttm_bo_vm_lookup_rb: actually make use of the red-black tree
Modified:
stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c
==============================================================================
--- stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Jan 16 16:15:56 2014 (r260778)
+++ stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c Thu Jan 16 16:28:19 2014 (r260779)
@@ -76,13 +76,16 @@ static struct ttm_buffer_object *ttm_bo_
struct ttm_buffer_object *bo;
struct ttm_buffer_object *best_bo = NULL;
- RB_FOREACH(bo, ttm_bo_device_buffer_objects, &bdev->addr_space_rb) {
+ bo = RB_ROOT(&bdev->addr_space_rb);
+ while (bo != NULL) {
cur_offset = bo->vm_node->start;
if (page_start >= cur_offset) {
best_bo = bo;
if (page_start == cur_offset)
break;
- }
+ bo = RB_RIGHT(bo, vm_rb);
+ } else
+ bo = RB_LEFT(bo, vm_rb);
}
if (unlikely(best_bo == NULL))
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 16:44:24 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 7AE6EBFE;
Thu, 16 Jan 2014 16:44:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 65B7E1EF5;
Thu, 16 Jan 2014 16:44:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GGiOKG090769;
Thu, 16 Jan 2014 16:44:24 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GGiOib090767;
Thu, 16 Jan 2014 16:44:24 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201401161644.s0GGiOib090767@svn.freebsd.org>
From: Glen Barber
Date: Thu, 16 Jan 2014 16:44:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260781 - in stable/10/release: . amd64 i386 pkg_repos
scripts
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 16:44:24 -0000
Author: gjb
Date: Thu Jan 16 16:44:23 2014
New Revision: 260781
URL: http://svnweb.freebsd.org/changeset/base/260781
Log:
MFC r260772:
Update the pkg-stage target to be more compatible with pkg-1.2:
- Add a release-dvd.conf pkg(8) configuration file to override
the default FreeBSD.conf configuration.
- Remove architecture-specific pkg-stage.conf files, consolidate,
and move their contents to scripts/pkg-stage.sh.
- Use 'pkg -vv' to determine the ABI, which is used as the
cache directory.
Prior to these changes, it would be possible for pkg-stage to fetch
conflicting binary packages from multiple repositories.
Tested against: head@r260522, stable/10@r260522
Sponsored by: The FreeBSD Foundation
Added:
stable/10/release/pkg_repos/
- copied from r260772, head/release/pkg_repos/
Deleted:
stable/10/release/amd64/pkg-stage.conf
stable/10/release/i386/pkg-stage.conf
Modified:
stable/10/release/Makefile
stable/10/release/scripts/pkg-stage.sh
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/release/Makefile
==============================================================================
--- stable/10/release/Makefile Thu Jan 16 16:37:17 2014 (r260780)
+++ stable/10/release/Makefile Thu Jan 16 16:44:23 2014 (r260781)
@@ -224,9 +224,9 @@ packagesystem: base.txz kernel.txz ${EXT
touch ${.TARGET}
pkg-stage:
-.if !defined(NOPKG) && exists(${.CURDIR}/${TARGET}/pkg-stage.conf)
- sh ${.CURDIR}/scripts/pkg-stage.sh ${.CURDIR}/${TARGET}/pkg-stage.conf \
- ${REVISION}
+.if !defined(NOPKG)
+ env REPOS_DIR=${.CURDIR}/pkg_repos/ \
+ sh ${.CURDIR}/scripts/pkg-stage.sh
mkdir -p ${.OBJDIR}/dvd/packages/repos/
cp ${.CURDIR}/scripts/FreeBSD_install_cdrom.conf \
${.OBJDIR}/dvd/packages/repos/
Modified: stable/10/release/scripts/pkg-stage.sh
==============================================================================
--- stable/10/release/scripts/pkg-stage.sh Thu Jan 16 16:37:17 2014 (r260780)
+++ stable/10/release/scripts/pkg-stage.sh Thu Jan 16 16:44:23 2014 (r260781)
@@ -5,24 +5,31 @@
set -e
-usage() {
- echo "$(basename ${0}) /path/to/pkg-stage.conf revision"
- exit 1
-}
-
-if [ ! -e "${1}" ]; then
- echo "Configuration file not specified."
- echo
- usage
-fi
-
-if [ "$#" -lt 2 ]; then
- usage
-fi
-
-# Source config file for this architecture.
-REVISION="${2}"
-. "${1}" || exit 1
+export ASSUME_ALWAYS_YES=1
+export PKG_DBDIR="/tmp/pkg"
+export PERMISSIVE="YES"
+export REPO_AUTOUPDATE="NO"
+export PKGCMD="/usr/sbin/pkg -d"
+
+DVD_PACKAGES="archivers/unzip
+devel/subversion
+devel/subversion-static
+emulators/linux_base-f10
+misc/freebsd-doc-all
+net/mpd5
+net/rsync
+ports-mgmt/pkg
+ports-mgmt/portmaster
+shells/bash
+shells/zsh
+security/sudo
+sysutils/screen
+www/firefox
+www/links
+x11-drivers/xf86-video-vmware
+x11/gnome2
+x11/kde4
+x11/xorg"
# If NOPORTS is set for the release, do not attempt to build pkg(8).
if [ ! -f /usr/ports/Makefile ]; then
@@ -33,8 +40,13 @@ if [ ! -x /usr/local/sbin/pkg ]; then
/usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean
fi
+export PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}')
+export PKG_CACHEDIR="dvd/packages/${PKG_ABI}"
+
/bin/mkdir -p ${PKG_CACHEDIR}
+# Print pkg(8) information to make debugging easier.
+${PKGCMD} -vv
${PKGCMD} update -f
${PKGCMD} fetch -d ${DVD_PACKAGES}
From owner-svn-src-stable-10@FreeBSD.ORG Thu Jan 16 18:16:01 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 2FC09EFD;
Thu, 16 Jan 2014 18:16:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 185D11834;
Thu, 16 Jan 2014 18:16:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0GIG077030850;
Thu, 16 Jan 2014 18:16:00 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0GIG0Rc030837;
Thu, 16 Jan 2014 18:16:00 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401161816.s0GIG0Rc030837@svn.freebsd.org>
From: Andriy Gapon
Date: Thu, 16 Jan 2014 18:16:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260786 - in stable/10/sys/cddl: compat/opensolaris/kern
compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs
contrib/opensolaris/uts/common/fs/zfs/sys
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Thu, 16 Jan 2014 18:16:01 -0000
Author: avg
Date: Thu Jan 16 18:15:59 2014
New Revision: 260786
URL: http://svnweb.freebsd.org/changeset/base/260786
Log:
MFC r258744-258746: zfs: add zfs_freebsd_putpages
Modified:
stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c
stable/10/sys/cddl/compat/opensolaris/sys/vm.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c
==============================================================================
--- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Thu Jan 16 18:13:18 2014 (r260785)
+++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_vm.c Thu Jan 16 18:15:59 2014 (r260786)
@@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$");
const int zfs_vm_pagerret_bad = VM_PAGER_BAD;
const int zfs_vm_pagerret_error = VM_PAGER_ERROR;
const int zfs_vm_pagerret_ok = VM_PAGER_OK;
+const int zfs_vm_pagerput_sync = VM_PAGER_PUT_SYNC;
+const int zfs_vm_pagerput_inval = VM_PAGER_PUT_INVAL;
void
zfs_vmobject_assert_wlocked(vm_object_t object)
Modified: stable/10/sys/cddl/compat/opensolaris/sys/vm.h
==============================================================================
--- stable/10/sys/cddl/compat/opensolaris/sys/vm.h Thu Jan 16 18:13:18 2014 (r260785)
+++ stable/10/sys/cddl/compat/opensolaris/sys/vm.h Thu Jan 16 18:15:59 2014 (r260786)
@@ -31,14 +31,31 @@
#ifdef _KERNEL
+#include
+
extern const int zfs_vm_pagerret_bad;
extern const int zfs_vm_pagerret_error;
extern const int zfs_vm_pagerret_ok;
+extern const int zfs_vm_pagerput_sync;
+extern const int zfs_vm_pagerput_inval;
void zfs_vmobject_assert_wlocked(vm_object_t object);
void zfs_vmobject_wlock(vm_object_t object);
void zfs_vmobject_wunlock(vm_object_t object);
+static inline caddr_t
+zfs_map_page(vm_page_t pp, struct sf_buf **sfp)
+{
+ *sfp = sf_buf_alloc(pp, 0);
+ return ((caddr_t)sf_buf_kva(*sfp));
+}
+
+static inline void
+zfs_unmap_page(struct sf_buf *sf)
+{
+ sf_buf_free(sf);
+}
+
#endif /* _KERNEL */
#endif /* _OPENSOLARIS_SYS_VM_H_ */
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jan 16 18:13:18 2014 (r260785)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Thu Jan 16 18:15:59 2014 (r260786)
@@ -45,6 +45,7 @@
#include
#include
#ifdef _KERNEL
+#include
#include
#endif
@@ -1184,6 +1185,64 @@ dmu_write_pages(objset_t *os, uint64_t o
dmu_buf_rele_array(dbp, numbufs, FTAG);
return (err);
}
+
+#else
+
+int
+dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size,
+ vm_page_t *ma, dmu_tx_t *tx)
+{
+ dmu_buf_t **dbp;
+ struct sf_buf *sf;
+ int numbufs, i;
+ int err;
+
+ if (size == 0)
+ return (0);
+
+ err = dmu_buf_hold_array(os, object, offset, size,
+ FALSE, FTAG, &numbufs, &dbp);
+ if (err)
+ return (err);
+
+ for (i = 0; i < numbufs; i++) {
+ int tocpy, copied, thiscpy;
+ int bufoff;
+ dmu_buf_t *db = dbp[i];
+ caddr_t va;
+
+ ASSERT(size > 0);
+ ASSERT3U(db->db_size, >=, PAGESIZE);
+
+ bufoff = offset - db->db_offset;
+ tocpy = (int)MIN(db->db_size - bufoff, size);
+
+ ASSERT(i == 0 || i == numbufs-1 || tocpy == db->db_size);
+
+ if (tocpy == db->db_size)
+ dmu_buf_will_fill(db, tx);
+ else
+ dmu_buf_will_dirty(db, tx);
+
+ for (copied = 0; copied < tocpy; copied += PAGESIZE) {
+ ASSERT3U(ptoa((*ma)->pindex), ==, db->db_offset + bufoff);
+ thiscpy = MIN(PAGESIZE, tocpy - copied);
+ va = zfs_map_page(*ma, &sf);
+ bcopy(va, (char *)db->db_data + bufoff, thiscpy);
+ zfs_unmap_page(sf);
+ ma += 1;
+ bufoff += PAGESIZE;
+ }
+
+ if (tocpy == db->db_size)
+ dmu_buf_fill_done(db, tx);
+
+ offset += tocpy;
+ size -= tocpy;
+ }
+ dmu_buf_rele_array(dbp, numbufs, FTAG);
+ return (err);
+}
#endif /* sun */
#endif
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jan 16 18:13:18 2014 (r260785)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jan 16 18:15:59 2014 (r260786)
@@ -606,8 +606,15 @@ int dmu_write_uio(objset_t *os, uint64_t
dmu_tx_t *tx);
int dmu_write_uio_dbuf(dmu_buf_t *zdb, struct uio *uio, uint64_t size,
dmu_tx_t *tx);
+#ifdef _KERNEL
+#ifdef sun
int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
uint64_t size, struct page *pp, dmu_tx_t *tx);
+#else
+int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
+ uint64_t size, struct vm_page **ppa, dmu_tx_t *tx);
+#endif
+#endif
struct arc_buf *dmu_request_arcbuf(dmu_buf_t *handle, int size);
void dmu_return_arcbuf(struct arc_buf *buf);
void dmu_assign_arcbuf(dmu_buf_t *handle, uint64_t offset, struct arc_buf *buf,
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 16 18:13:18 2014 (r260785)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 16 18:15:59 2014 (r260786)
@@ -71,7 +71,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -452,21 +451,6 @@ page_unhold(vm_page_t pp)
vm_page_unlock(pp);
}
-static caddr_t
-zfs_map_page(vm_page_t pp, struct sf_buf **sfp)
-{
-
- *sfp = sf_buf_alloc(pp, 0);
- return ((caddr_t)sf_buf_kva(*sfp));
-}
-
-static void
-zfs_unmap_page(struct sf_buf *sf)
-{
-
- sf_buf_free(sf);
-}
-
/*
* When a file is memory mapped, we must keep the IO data synchronized
* between the DMU cache and the memory mapped pages. What this means:
@@ -483,6 +467,7 @@ update_pages(vnode_t *vp, int64_t start,
caddr_t va;
int off;
+ ASSERT(segflg != UIO_NOCOPY);
ASSERT(vp->v_mount != NULL);
obj = vp->v_object;
ASSERT(obj != NULL);
@@ -493,27 +478,7 @@ update_pages(vnode_t *vp, int64_t start,
vm_page_t pp;
int nbytes = imin(PAGESIZE - off, len);
- if (segflg == UIO_NOCOPY) {
- pp = vm_page_lookup(obj, OFF_TO_IDX(start));
- KASSERT(pp != NULL,
- ("zfs update_pages: NULL page in putpages case"));
- KASSERT(off == 0,
- ("zfs update_pages: unaligned data in putpages case"));
- KASSERT(pp->valid == VM_PAGE_BITS_ALL,
- ("zfs update_pages: invalid page in putpages case"));
- KASSERT(vm_page_sbusied(pp),
- ("zfs update_pages: unbusy page in putpages case"));
- KASSERT(!pmap_page_is_write_mapped(pp),
- ("zfs update_pages: writable page in putpages case"));
- zfs_vmobject_wunlock(obj);
-
- va = zfs_map_page(pp, &sf);
- (void) dmu_write(os, oid, start, nbytes, va, tx);
- zfs_unmap_page(sf);
-
- zfs_vmobject_wlock(obj);
- vm_page_undirty(pp);
- } else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) {
+ if ((pp = page_busy(vp, start, off, nbytes)) != NULL) {
zfs_vmobject_wunlock(obj);
va = zfs_map_page(pp, &sf);
@@ -527,8 +492,7 @@ update_pages(vnode_t *vp, int64_t start,
len -= nbytes;
off = 0;
}
- if (segflg != UIO_NOCOPY)
- vm_object_pip_wakeupn(obj, 0);
+ vm_object_pip_wakeupn(obj, 0);
zfs_vmobject_wunlock(obj);
}
@@ -5815,6 +5779,168 @@ zfs_freebsd_getpages(ap)
}
static int
+zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t len, int flags,
+ int *rtvals)
+{
+ znode_t *zp = VTOZ(vp);
+ zfsvfs_t *zfsvfs = zp->z_zfsvfs;
+ rl_t *rl;
+ dmu_tx_t *tx;
+ struct sf_buf *sf;
+ vm_object_t object;
+ vm_page_t m;
+ caddr_t va;
+ size_t tocopy;
+ size_t lo_len;
+ vm_ooffset_t lo_off;
+ vm_ooffset_t off;
+ uint_t blksz;
+ int ncount;
+ int pcount;
+ int err;
+ int i;
+
+ ZFS_ENTER(zfsvfs);
+ ZFS_VERIFY_ZP(zp);
+
+ object = vp->v_object;
+ pcount = btoc(len);
+ ncount = pcount;
+
+ KASSERT(ma[0]->object == object, ("mismatching object"));
+ KASSERT(len > 0 && (len & PAGE_MASK) == 0, ("unexpected length"));
+
+ for (i = 0; i < pcount; i++)
+ rtvals[i] = zfs_vm_pagerret_error;
+
+ off = IDX_TO_OFF(ma[0]->pindex);
+ blksz = zp->z_blksz;
+ lo_off = rounddown(off, blksz);
+ lo_len = roundup(len + (off - lo_off), blksz);
+ rl = zfs_range_lock(zp, lo_off, lo_len, RL_WRITER);
+
+ zfs_vmobject_wlock(object);
+ if (len + off > object->un_pager.vnp.vnp_size) {
+ if (object->un_pager.vnp.vnp_size > off) {
+ int pgoff;
+
+ len = object->un_pager.vnp.vnp_size - off;
+ ncount = btoc(len);
+ if ((pgoff = (int)len & PAGE_MASK) != 0) {
+ /*
+ * If the object is locked and the following
+ * conditions hold, then the page's dirty
+ * field cannot be concurrently changed by a
+ * pmap operation.
+ */
+ m = ma[ncount - 1];
+ vm_page_assert_sbusied(m);
+ KASSERT(!pmap_page_is_write_mapped(m),
+ ("zfs_putpages: page %p is not read-only", m));
+ vm_page_clear_dirty(m, pgoff, PAGE_SIZE -
+ pgoff);
+ }
+ } else {
+ len = 0;
+ ncount = 0;
+ }
+ if (ncount < pcount) {
+ for (i = ncount; i < pcount; i++) {
+ rtvals[i] = zfs_vm_pagerret_bad;
+ }
+ }
+ }
+ zfs_vmobject_wunlock(object);
+
+ if (ncount == 0)
+ goto out;
+
+ if (zfs_owner_overquota(zfsvfs, zp, B_FALSE) ||
+ zfs_owner_overquota(zfsvfs, zp, B_TRUE)) {
+ goto out;
+ }
+
+top:
+ tx = dmu_tx_create(zfsvfs->z_os);
+ dmu_tx_hold_write(tx, zp->z_id, off, len);
+
+ dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
+ zfs_sa_upgrade_txholds(tx, zp);
+ err = dmu_tx_assign(tx, TXG_NOWAIT);
+ if (err != 0) {
+ if (err == ERESTART) {
+ dmu_tx_wait(tx);
+ dmu_tx_abort(tx);
+ goto top;
+ }
+ dmu_tx_abort(tx);
+ goto out;
+ }
+
+ if (zp->z_blksz < PAGE_SIZE) {
+ i = 0;
+ for (i = 0; len > 0; off += tocopy, len -= tocopy, i++) {
+ tocopy = len > PAGE_SIZE ? PAGE_SIZE : len;
+ va = zfs_map_page(ma[i], &sf);
+ dmu_write(zfsvfs->z_os, zp->z_id, off, tocopy, va, tx);
+ zfs_unmap_page(sf);
+ }
+ } else {
+ err = dmu_write_pages(zfsvfs->z_os, zp->z_id, off, len, ma, tx);
+ }
+
+ if (err == 0) {
+ uint64_t mtime[2], ctime[2];
+ sa_bulk_attr_t bulk[3];
+ int count = 0;
+
+ SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MTIME(zfsvfs), NULL,
+ &mtime, 16);
+ SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL,
+ &ctime, 16);
+ SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_FLAGS(zfsvfs), NULL,
+ &zp->z_pflags, 8);
+ zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime,
+ B_TRUE);
+ zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0);
+
+ zfs_vmobject_wlock(object);
+ for (i = 0; i < ncount; i++) {
+ rtvals[i] = zfs_vm_pagerret_ok;
+ vm_page_undirty(ma[i]);
+ }
+ zfs_vmobject_wunlock(object);
+ PCPU_INC(cnt.v_vnodeout);
+ PCPU_ADD(cnt.v_vnodepgsout, ncount);
+ }
+ dmu_tx_commit(tx);
+
+out:
+ zfs_range_unlock(rl);
+ if ((flags & (zfs_vm_pagerput_sync | zfs_vm_pagerput_inval)) != 0 ||
+ zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
+ zil_commit(zfsvfs->z_log, zp->z_id);
+ ZFS_EXIT(zfsvfs);
+ return (rtvals[0]);
+}
+
+int
+zfs_freebsd_putpages(ap)
+ struct vop_putpages_args /* {
+ struct vnode *a_vp;
+ vm_page_t *a_m;
+ int a_count;
+ int a_sync;
+ int *a_rtvals;
+ vm_ooffset_t a_offset;
+ } */ *ap;
+{
+
+ return (zfs_putpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_sync,
+ ap->a_rtvals));
+}
+
+static int
zfs_freebsd_bmap(ap)
struct vop_bmap_args /* {
struct vnode *a_vp;
@@ -6960,6 +7086,7 @@ struct vop_vector zfs_vnodeops = {
.vop_setacl = zfs_freebsd_setacl,
.vop_aclcheck = zfs_freebsd_aclcheck,
.vop_getpages = zfs_freebsd_getpages,
+ .vop_putpages = zfs_freebsd_putpages,
};
struct vop_vector zfs_fifoops = {
From owner-svn-src-stable-10@FreeBSD.ORG Fri Jan 17 10:34:02 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id BE90B470;
Fri, 17 Jan 2014 10:34:02 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id A971D14E8;
Fri, 17 Jan 2014 10:34:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0HAY2vU021091;
Fri, 17 Jan 2014 10:34:02 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0HAY2lZ021083;
Fri, 17 Jan 2014 10:34:02 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401171034.s0HAY2lZ021083@svn.freebsd.org>
From: Andriy Gapon
Date: Fri, 17 Jan 2014 10:34:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260813 - in stable/10/sys: kern modules/dtrace
modules/dtrace/dtio modules/dtrace/dtraceall
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Fri, 17 Jan 2014 10:34:02 -0000
Author: avg
Date: Fri Jan 17 10:34:01 2014
New Revision: 260813
URL: http://svnweb.freebsd.org/changeset/base/260813
Log:
MFC r257037: Redefine the io provider using the SDT(9) macros
MFC slacker: markj
Deleted:
stable/10/sys/kern/dtio_kdtrace.c
stable/10/sys/modules/dtrace/dtio/
Modified:
stable/10/sys/kern/subr_devstat.c
stable/10/sys/modules/dtrace/Makefile
stable/10/sys/modules/dtrace/dtraceall/dtraceall.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/kern/subr_devstat.c
==============================================================================
--- stable/10/sys/kern/subr_devstat.c Fri Jan 17 10:23:46 2014 (r260812)
+++ stable/10/sys/kern/subr_devstat.c Fri Jan 17 10:34:01 2014 (r260813)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
#include
@@ -46,57 +47,21 @@ __FBSDID("$FreeBSD$");
#include
-#ifdef KDTRACE_HOOKS
-#include
+SDT_PROVIDER_DEFINE(io);
-dtrace_io_start_probe_func_t dtrace_io_start_probe;
-dtrace_io_done_probe_func_t dtrace_io_done_probe;
-dtrace_io_wait_start_probe_func_t dtrace_io_wait_start_probe;
-dtrace_io_wait_done_probe_func_t dtrace_io_wait_done_probe;
-
-uint32_t dtio_start_id;
-uint32_t dtio_done_id;
-uint32_t dtio_wait_start_id;
-uint32_t dtio_wait_done_id;
-
-#define DTRACE_DEVSTAT_START() \
- if (dtrace_io_start_probe != NULL) \
- (*dtrace_io_start_probe)(dtio_start_id, NULL, ds);
-
-#define DTRACE_DEVSTAT_BIO_START() \
- if (dtrace_io_start_probe != NULL) \
- (*dtrace_io_start_probe)(dtio_start_id, bp, ds);
-
-#define DTRACE_DEVSTAT_DONE() \
- if (dtrace_io_done_probe != NULL) \
- (*dtrace_io_done_probe)(dtio_done_id, NULL, ds);
-
-#define DTRACE_DEVSTAT_BIO_DONE() \
- if (dtrace_io_done_probe != NULL) \
- (*dtrace_io_done_probe)(dtio_done_id, bp, ds);
-
-#define DTRACE_DEVSTAT_WAIT_START() \
- if (dtrace_io_wait_start_probe != NULL) \
- (*dtrace_io_wait_start_probe)(dtio_wait_start_id, NULL, ds);
-
-#define DTRACE_DEVSTAT_WAIT_DONE() \
- if (dtrace_io_wait_done_probe != NULL) \
- (*dtrace_io_wait_done_probe)(dtio_wait_done_id, NULL, ds);
-
-#else /* ! KDTRACE_HOOKS */
-
-#define DTRACE_DEVSTAT_START()
-
-#define DTRACE_DEVSTAT_BIO_START()
-
-#define DTRACE_DEVSTAT_DONE()
-
-#define DTRACE_DEVSTAT_BIO_DONE()
-
-#define DTRACE_DEVSTAT_WAIT_START()
-
-#define DTRACE_DEVSTAT_WAIT_DONE()
-#endif /* KDTRACE_HOOKS */
+SDT_PROBE_DEFINE2(io, , , start, start, "struct bio *", "struct devstat *");
+SDT_PROBE_DEFINE2(io, , , done, done, "struct bio *", "struct devstat *");
+SDT_PROBE_DEFINE2(io, , , wait_start, wait-start, "struct bio *",
+ "struct devstat *");
+SDT_PROBE_DEFINE2(io, , , wait_done, wait-done, "struct bio *",
+ "struct devstat *");
+
+#define DTRACE_DEVSTAT_START() SDT_PROBE2(io, , , start, NULL, ds)
+#define DTRACE_DEVSTAT_BIO_START() SDT_PROBE2(io, , , start, bp, ds)
+#define DTRACE_DEVSTAT_DONE() SDT_PROBE2(io, , , done, NULL, ds)
+#define DTRACE_DEVSTAT_BIO_DONE() SDT_PROBE2(io, , , done, bp, ds)
+#define DTRACE_DEVSTAT_WAIT_START() SDT_PROBE2(io, , , wait_start, NULL, ds)
+#define DTRACE_DEVSTAT_WAIT_DONE() SDT_PROBE2(io, , , wait_done, NULL, ds)
static int devstat_num_devs;
static long devstat_generation = 1;
Modified: stable/10/sys/modules/dtrace/Makefile
==============================================================================
--- stable/10/sys/modules/dtrace/Makefile Fri Jan 17 10:23:46 2014 (r260812)
+++ stable/10/sys/modules/dtrace/Makefile Fri Jan 17 10:34:01 2014 (r260813)
@@ -9,7 +9,6 @@ SUBDIR= dtmalloc \
dtrace \
dtraceall \
dtrace_test \
- dtio \
lockstat \
profile \
prototype \
Modified: stable/10/sys/modules/dtrace/dtraceall/dtraceall.c
==============================================================================
--- stable/10/sys/modules/dtrace/dtraceall/dtraceall.c Fri Jan 17 10:23:46 2014 (r260812)
+++ stable/10/sys/modules/dtrace/dtraceall/dtraceall.c Fri Jan 17 10:34:01 2014 (r260813)
@@ -66,7 +66,6 @@ MODULE_VERSION(dtraceall, 1);
MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1);
MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1);
MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1);
-MODULE_DEPEND(dtraceall, dtio, 1, 1, 1);
MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1);
MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1);
#if defined(NFSCLIENT)
From owner-svn-src-stable-10@FreeBSD.ORG Fri Jan 17 10:48:45 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id E0707884;
Fri, 17 Jan 2014 10:48:44 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id C12C815C6;
Fri, 17 Jan 2014 10:48:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0HAmiB3025686;
Fri, 17 Jan 2014 10:48:44 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0HAmiPf025684;
Fri, 17 Jan 2014 10:48:44 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401171048.s0HAmiPf025684@svn.freebsd.org>
From: Andriy Gapon
Date: Fri, 17 Jan 2014 10:48:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260815 - stable/10/sys/netinet
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Fri, 17 Jan 2014 10:48:45 -0000
Author: avg
Date: Fri Jan 17 10:48:44 2014
New Revision: 260815
URL: http://svnweb.freebsd.org/changeset/base/260815
Log:
MFC r258605: Convert over the TCP probes to use mtod()
MFC slacker: adrian
Modified:
stable/10/sys/netinet/tcp_input.c
stable/10/sys/netinet/tcp_subr.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/netinet/tcp_input.c
==============================================================================
--- stable/10/sys/netinet/tcp_input.c Fri Jan 17 10:35:18 2014 (r260814)
+++ stable/10/sys/netinet/tcp_input.c Fri Jan 17 10:48:44 2014 (r260815)
@@ -1393,7 +1393,7 @@ relocked:
}
#endif
- TCP_PROBE5(receive, NULL, tp, m->m_data, tp, th);
+ TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th);
/*
* Segment belongs to a connection in SYN_SENT, ESTABLISHED or later
@@ -1405,7 +1405,7 @@ relocked:
return;
dropwithreset:
- TCP_PROBE5(receive, NULL, tp, m->m_data, tp, th);
+ TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th);
if (ti_locked == TI_WLOCKED) {
INP_INFO_WUNLOCK(&V_tcbinfo);
@@ -1429,7 +1429,7 @@ dropwithreset:
dropunlock:
if (m != NULL)
- TCP_PROBE5(receive, NULL, tp, m->m_data, tp, th);
+ TCP_PROBE5(receive, NULL, tp, mtod(m, const char *), tp, th);
if (ti_locked == TI_WLOCKED) {
INP_INFO_WUNLOCK(&V_tcbinfo);
@@ -1928,8 +1928,8 @@ tcp_do_segment(struct mbuf *m, struct tc
goto dropwithreset;
}
if ((thflags & (TH_ACK|TH_RST)) == (TH_ACK|TH_RST)) {
- TCP_PROBE5(connect_refused, NULL, tp, m->m_data, tp,
- th);
+ TCP_PROBE5(connect_refused, NULL, tp,
+ mtod(m, const char *), tp, th);
tp = tcp_drop(tp, ECONNREFUSED);
}
if (thflags & TH_RST)
@@ -1982,7 +1982,7 @@ tcp_do_segment(struct mbuf *m, struct tc
} else {
tcp_state_change(tp, TCPS_ESTABLISHED);
TCP_PROBE5(connect_established, NULL, tp,
- m->m_data, tp, th);
+ mtod(m, const char *), tp, th);
cc_conn_init(tp);
tcp_timer_activate(tp, TT_KEEP,
TP_KEEPIDLE(tp));
@@ -2387,8 +2387,8 @@ tcp_do_segment(struct mbuf *m, struct tc
tp->t_flags &= ~TF_NEEDFIN;
} else {
tcp_state_change(tp, TCPS_ESTABLISHED);
- TCP_PROBE5(accept_established, NULL, tp, m->m_data, tp,
- th);
+ TCP_PROBE5(accept_established, NULL, tp,
+ mtod(m, const char *), tp, th);
cc_conn_init(tp);
tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp));
}
Modified: stable/10/sys/netinet/tcp_subr.c
==============================================================================
--- stable/10/sys/netinet/tcp_subr.c Fri Jan 17 10:35:18 2014 (r260814)
+++ stable/10/sys/netinet/tcp_subr.c Fri Jan 17 10:48:44 2014 (r260815)
@@ -706,9 +706,10 @@ tcp_respond(struct tcpcb *tp, void *ipge
tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0);
#endif
if (flags & TH_RST)
- TCP_PROBE5(accept_refused, NULL, NULL, m->m_data, tp, nth);
+ TCP_PROBE5(accept_refused, NULL, NULL, mtod(m, const char *),
+ tp, nth);
- TCP_PROBE5(send, NULL, tp, m->m_data, tp, nth);
+ TCP_PROBE5(send, NULL, tp, mtod(m, const char *), tp, nth);
#ifdef INET6
if (isipv6)
(void) ip6_output(m, NULL, NULL, ipflags, NULL, NULL, inp);
From owner-svn-src-stable-10@FreeBSD.ORG Fri Jan 17 10:59:06 2014
Return-Path:
Delivered-To: svn-src-stable-10@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
(No client certificate requested)
by hub.freebsd.org (Postfix) with ESMTPS id 4876AC92;
Fri, 17 Jan 2014 10:59:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
[IPv6:2001:1900:2254:2068::e6a:0])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mx1.freebsd.org (Postfix) with ESMTPS id 301771674;
Fri, 17 Jan 2014 10:59:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0HAx6Kn029782;
Fri, 17 Jan 2014 10:59:06 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0HAx0nE029733;
Fri, 17 Jan 2014 10:59:00 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201401171059.s0HAx0nE029733@svn.freebsd.org>
From: Andriy Gapon
Date: Fri, 17 Jan 2014 10:59:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject: svn commit: r260817 - in stable/10: share/man/man9 sys/cam/ctl
sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/compat/linux sys/dev/xen/blkback
sys/kern sys/net sys/netinet sys/opencrypto sys/security/mac...
X-SVN-Group: stable-10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-10@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: SVN commit messages for only the 10-stable src tree
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help: