svn commit: r277547 - in stable/10/sys/cddl/contrib/opensolaris/uts/common: dtrace fs/zfs
Xin LI
delphij at FreeBSD.org
Fri Jan 23 00:27:10 UTC 2015
Author: delphij
Date: Fri Jan 23 00:27:08 2015
New Revision: 277547
URL: https://svnweb.freebsd.org/changeset/base/277547
Log:
MFC r275562: MFV r275535:
Unexpand ISP2() and MSEC2NSEC().
Illumos issue:
5255 uts shouldn't open-code ISP2
Modified:
stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
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/dtrace/dtrace.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jan 23 00:23:48 2015 (r277546)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jan 23 00:27:08 2015 (r277547)
@@ -176,7 +176,7 @@ dtrace_optval_t dtrace_ustackframes_defa
dtrace_optval_t dtrace_jstackframes_default = 50;
dtrace_optval_t dtrace_jstackstrsize_default = 512;
int dtrace_msgdsize_max = 128;
-hrtime_t dtrace_chill_max = 500 * (NANOSEC / MILLISEC); /* 500 ms */
+hrtime_t dtrace_chill_max = MSEC2NSEC(500); /* 500 ms */
hrtime_t dtrace_chill_interval = NANOSEC; /* 1000 ms */
int dtrace_devdepth_max = 32;
int dtrace_err_verbose;
@@ -13782,7 +13782,7 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_
if (!(sec->dofs_flags & DOF_SECF_LOAD))
continue; /* just ignore non-loadable sections */
- if (sec->dofs_align & (sec->dofs_align - 1)) {
+ if (!ISP2(sec->dofs_align)) {
dtrace_dof_error(dof, "bad section alignment");
return (-1);
}
Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Jan 23 00:23:48 2015 (r277546)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Jan 23 00:27:08 2015 (r277547)
@@ -2479,7 +2479,7 @@ fasttrap_load(void)
if (nent == 0 || nent > 0x1000000)
nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
- if ((nent & (nent - 1)) == 0)
+ if (ISP2(nent))
fasttrap_tpoints.fth_nent = nent;
else
fasttrap_tpoints.fth_nent = 1 << fasttrap_highbit(nent);
@@ -2497,7 +2497,7 @@ fasttrap_load(void)
* ... and the providers hash table...
*/
nent = FASTTRAP_PROVIDERS_DEFAULT_SIZE;
- if ((nent & (nent - 1)) == 0)
+ if (ISP2(nent))
fasttrap_provs.fth_nent = nent;
else
fasttrap_provs.fth_nent = 1 << fasttrap_highbit(nent);
@@ -2533,7 +2533,7 @@ fasttrap_load(void)
* ... and the procs hash table.
*/
nent = FASTTRAP_PROCS_DEFAULT_SIZE;
- if ((nent & (nent - 1)) == 0)
+ if (ISP2(nent))
fasttrap_procs.fth_nent = nent;
else
fasttrap_procs.fth_nent = 1 << fasttrap_highbit(nent);
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 Fri Jan 23 00:23:48 2015 (r277546)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jan 23 00:27:08 2015 (r277547)
@@ -24,6 +24,7 @@
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
*/
+#include <sys/sysmacros.h>
#include <sys/zfs_context.h>
#include <sys/fm/fs/zfs.h>
#include <sys/spa.h>
@@ -153,7 +154,7 @@ zio_init(void)
size_t align = 0;
size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0;
- while (p2 & (p2 - 1))
+ while (!ISP2(p2))
p2 &= p2 - 1;
#ifdef illumos
More information about the svn-src-stable
mailing list