Date: Wed, 20 Aug 2014 06:15:53 +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: r270193 - in vendor-sys/illumos/dist/uts/common: dtrace fs os sys Message-ID: <201408200615.s7K6Fr6w008501@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Wed Aug 20 06:15:53 2014 New Revision: 270193 URL: http://svnweb.freebsd.org/changeset/base/270193 Log: 5042 stop using deprecated atomic functions 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@75d94465dbafa487b716482dc36d5150a4ec9853 Modified: vendor-sys/illumos/dist/uts/common/dtrace/systrace.c vendor-sys/illumos/dist/uts/common/fs/vnode.c vendor-sys/illumos/dist/uts/common/os/fm.c vendor-sys/illumos/dist/uts/common/sys/bitmap.h vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Modified: vendor-sys/illumos/dist/uts/common/dtrace/systrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/systrace.c Wed Aug 20 01:32:04 2014 (r270192) +++ vendor-sys/illumos/dist/uts/common/dtrace/systrace.c Wed Aug 20 06:15:53 2014 (r270193) @@ -164,11 +164,11 @@ systrace_enable(void *arg, dtrace_id_t i return (0); } - (void) casptr(&sysent[sysnum].sy_callc, + (void) atomic_cas_ptr(&sysent[sysnum].sy_callc, (void *)systrace_sysent[sysnum].stsy_underlying, (void *)dtrace_systrace_syscall); #ifdef _SYSCALL32_IMPL - (void) casptr(&sysent32[sysnum].sy_callc, + (void) atomic_cas_ptr(&sysent32[sysnum].sy_callc, (void *)systrace_sysent32[sysnum].stsy_underlying, (void *)dtrace_systrace_syscall32); #endif @@ -184,12 +184,12 @@ systrace_disable(void *arg, dtrace_id_t systrace_sysent[sysnum].stsy_return == DTRACE_IDNONE); if (disable) { - (void) casptr(&sysent[sysnum].sy_callc, + (void) atomic_cas_ptr(&sysent[sysnum].sy_callc, (void *)dtrace_systrace_syscall, (void *)systrace_sysent[sysnum].stsy_underlying); #ifdef _SYSCALL32_IMPL - (void) casptr(&sysent32[sysnum].sy_callc, + (void) atomic_cas_ptr(&sysent32[sysnum].sy_callc, (void *)dtrace_systrace_syscall32, (void *)systrace_sysent32[sysnum].stsy_underlying); #endif Modified: vendor-sys/illumos/dist/uts/common/fs/vnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/vnode.c Wed Aug 20 01:32:04 2014 (r270192) +++ vendor-sys/illumos/dist/uts/common/fs/vnode.c Wed Aug 20 06:15:53 2014 (r270193) @@ -2837,11 +2837,12 @@ vn_setops(vnode_t *vp, vnodeops_t *vnode op = vp->v_op; membar_consumer(); /* - * If vp->v_femhead == NULL, then we'll call casptr() to do the - * compare-and-swap on vp->v_op. If either fails, then FEM is + * If vp->v_femhead == NULL, then we'll call atomic_cas_ptr() to do + * the compare-and-swap on vp->v_op. If either fails, then FEM is * in effect on the vnode and we need to have FEM deal with it. */ - if (vp->v_femhead != NULL || casptr(&vp->v_op, op, vnodeops) != op) { + if (vp->v_femhead != NULL || atomic_cas_ptr(&vp->v_op, op, vnodeops) != + op) { fem_setvnops(vp, vnodeops); } } Modified: vendor-sys/illumos/dist/uts/common/os/fm.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/os/fm.c Wed Aug 20 01:32:04 2014 (r270192) +++ vendor-sys/illumos/dist/uts/common/os/fm.c Wed Aug 20 06:15:53 2014 (r270193) @@ -374,7 +374,7 @@ fm_panic(const char *format, ...) { va_list ap; - (void) casptr((void *)&fm_panicstr, NULL, (void *)format); + (void) atomic_cas_ptr((void *)&fm_panicstr, NULL, (void *)format); #if defined(__i386) || defined(__amd64) fastreboot_disable_highpil(); #endif /* __i386 || __amd64 */ Modified: vendor-sys/illumos/dist/uts/common/sys/bitmap.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/bitmap.h Wed Aug 20 01:32:04 2014 (r270192) +++ vendor-sys/illumos/dist/uts/common/sys/bitmap.h Wed Aug 20 06:15:53 2014 (r270193) @@ -171,9 +171,9 @@ extern int odd_parity(ulong_t); * to 0 otherwise. */ #define BT_ATOMIC_SET(bitmap, bitindex) \ - { atomic_or_long(&(BT_WIM(bitmap, bitindex)), BT_BIW(bitindex)); } + { atomic_or_ulong(&(BT_WIM(bitmap, bitindex)), BT_BIW(bitindex)); } #define BT_ATOMIC_CLEAR(bitmap, bitindex) \ - { atomic_and_long(&(BT_WIM(bitmap, bitindex)), ~BT_BIW(bitindex)); } + { atomic_and_ulong(&(BT_WIM(bitmap, bitindex)), ~BT_BIW(bitindex)); } #define BT_ATOMIC_SET_EXCL(bitmap, bitindex, result) \ { result = atomic_set_long_excl(&(BT_WIM(bitmap, bitindex)), \ Modified: vendor-sys/illumos/dist/uts/common/sys/cpuvar.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Wed Aug 20 01:32:04 2014 (r270192) +++ vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Wed Aug 20 06:15:53 2014 (r270193) @@ -528,8 +528,8 @@ typedef ulong_t cpuset_t; /* a set of CP largest = (uint_t)(highbit(set) - 1); \ } -#define CPUSET_ATOMIC_DEL(set, cpu) atomic_and_long(&(set), ~CPUSET(cpu)) -#define CPUSET_ATOMIC_ADD(set, cpu) atomic_or_long(&(set), CPUSET(cpu)) +#define CPUSET_ATOMIC_DEL(set, cpu) atomic_and_ulong(&(set), ~CPUSET(cpu)) +#define CPUSET_ATOMIC_ADD(set, cpu) atomic_or_ulong(&(set), CPUSET(cpu)) #define CPUSET_ATOMIC_XADD(set, cpu, result) \ { result = atomic_set_long_excl(&(set), (cpu)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408200615.s7K6Fr6w008501>