aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/include/os/linux
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-11-04 21:18:51 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-11-04 21:18:51 +0000
commit4a0b7fd50256e1866763ba6fcca00dcbfa211004 (patch)
tree9c36e426f1ceed307fdf094d2472fff5e4d0a6a1 /sys/contrib/openzfs/include/os/linux
parent8ce21ae6ba8422fbf328d0171eb0fba940c29bfe (diff)
downloadsrc-4a0b7fd50256e1866763ba6fcca00dcbfa211004.tar.gz
src-4a0b7fd50256e1866763ba6fcca00dcbfa211004.zip
zfs: add branch prediction to ZFS_ENTER and ZFS_VERIFY_ZP macros
They are expected to fail only in corner cases.
Notes
Notes: svn path=/head/; revision=367343
Diffstat (limited to 'sys/contrib/openzfs/include/os/linux')
-rw-r--r--sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_znode_impl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_znode_impl.h b/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_znode_impl.h
index 39bbd135ac06..a641210a8334 100644
--- a/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_znode_impl.h
+++ b/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_znode_impl.h
@@ -76,7 +76,7 @@ extern "C" {
#define ZFS_ENTER_ERROR(zfsvfs, error) \
do { \
rrm_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \
- if ((zfsvfs)->z_unmounted) { \
+ if (unlikely((zfsvfs)->z_unmounted)) { \
ZFS_EXIT(zfsvfs); \
return (error); \
} \
@@ -95,7 +95,7 @@ do { \
/* Verifies the znode is valid. */
#define ZFS_VERIFY_ZP_ERROR(zp, error) \
do { \
- if ((zp)->z_sa_hdl == NULL) { \
+ if (unlikely((zp)->z_sa_hdl == NULL)) { \
ZFS_EXIT(ZTOZSB(zp)); \
return (error); \
} \