Date: Fri, 5 Dec 2014 23:55:45 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275535 - in vendor-sys/illumos/dist/uts/common: dtrace fs/zfs Message-ID: <201412052355.sB5NtjuD018528@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Fri Dec 5 23:55:44 2014 New Revision: 275535 URL: https://svnweb.freebsd.org/changeset/base/275535 Log: 5255 uts shouldn't open-code ISP2 Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Robert Mustacchi <rm@joyent.com> Author: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> illumos/illumos-gate@de710d24d2fae4468e64da999e1d952a247f142c Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Fri Dec 5 23:51:20 2014 (r275534) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Fri Dec 5 23:55:44 2014 (r275535) @@ -139,7 +139,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; @@ -13039,7 +13039,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: vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c Fri Dec 5 23:51:20 2014 (r275534) +++ vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c Fri Dec 5 23:55:44 2014 (r275535) @@ -2156,7 +2156,7 @@ fasttrap_attach(dev_info_t *devi, ddi_at 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); @@ -2169,7 +2169,7 @@ fasttrap_attach(dev_info_t *devi, ddi_at * ... 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); @@ -2182,7 +2182,7 @@ fasttrap_attach(dev_info_t *devi, ddi_at * ... 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: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Dec 5 23:51:20 2014 (r275534) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Dec 5 23:55:44 2014 (r275535) @@ -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> @@ -121,7 +122,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; #ifndef _KERNEL
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412052355.sB5NtjuD018528>