aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/mount.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-02-07 22:45:09 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-02-07 22:45:09 +0000
commit8f2b73dc86852b85d59a48b004d9d381da444a10 (patch)
tree7d9cd703362a868a287401fe967fe49fd109ad03 /sys/sys/mount.h
parentea77ce6ef9d2f3971d1190cf82e3b6f4d45fe433 (diff)
downloadsrc-8f2b73dc86852b85d59a48b004d9d381da444a10.tar.gz
src-8f2b73dc86852b85d59a48b004d9d381da444a10.zip
vfs: use newly added zpcpu routines instead of direct access where appropriate
Notes
Notes: svn path=/head/; revision=357674
Diffstat (limited to 'sys/sys/mount.h')
-rw-r--r--sys/sys/mount.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 6c23cb25c352..f5e31fb18d84 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -1001,14 +1001,14 @@ int vfs_mount_fetch_counter(struct mount *, enum mount_counter);
*/
#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_counter);
#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 */