Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Feb 2020 22:45:09 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r357674 - head/sys/sys
Message-ID:  <202002072245.017Mj91v037975@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Fri Feb  7 22:45:09 2020
New Revision: 357674
URL: https://svnweb.freebsd.org/changeset/base/357674

Log:
  vfs: use newly added zpcpu routines instead of direct access where appropriate

Modified:
  head/sys/sys/mount.h

Modified: head/sys/sys/mount.h
==============================================================================
--- head/sys/sys/mount.h	Fri Feb  7 22:44:41 2020	(r357673)
+++ head/sys/sys/mount.h	Fri Feb  7 22:45:09 2020	(r357674)
@@ -1001,14 +1001,14 @@ int	vfs_mount_fetch_counter(struct mount *, enum mount
  */
 #define vfs_op_thread_entered(mp) ({				\
 	MPASS(curthread->td_critnest > 0);			\
-	*(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1;	\
+	*zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1;		\
 })
 
 #define vfs_op_thread_enter(mp) ({				\
 	bool _retval = true;					\
 	critical_enter();					\
 	MPASS(!vfs_op_thread_entered(mp));			\
-	*(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) = 1;	\
+	zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 1);	\
 	atomic_thread_fence_seq_cst();				\
 	if (__predict_false(mp->mnt_vfs_ops > 0)) {		\
 		vfs_op_thread_exit(mp);				\
@@ -1020,18 +1020,18 @@ int	vfs_mount_fetch_counter(struct mount *, enum mount
 #define vfs_op_thread_exit(mp) do {				\
 	MPASS(vfs_op_thread_entered(mp));			\
 	atomic_thread_fence_rel();				\
-	*(int *)zpcpu_get(mp->mnt_thread_in_ops_pcpu) = 0;	\
+	zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 0);	\
 	critical_exit();					\
 } while (0)
 
 #define vfs_mp_count_add_pcpu(mp, count, val) do {		\
 	MPASS(vfs_op_thread_entered(mp));			\
-	(*(int *)zpcpu_get(mp->mnt_##count##_pcpu)) += val;	\
+	zpcpu_add_protected(mp->mnt_##count##_pcpu, val);	\
 } while (0)
 
 #define vfs_mp_count_sub_pcpu(mp, count, val) do {		\
 	MPASS(vfs_op_thread_entered(mp));			\
-	(*(int *)zpcpu_get(mp->mnt_##count##_pcpu)) -= val;	\
+	zpcpu_sub_protected(mp->mnt_##count##_pcpu, val);	\
 } while (0)
 
 #else /* !_KERNEL */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002072245.017Mj91v037975>