mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Add branch prediction to ZFS_ENTER and ZFS_VERIFY_ZP macros
They are expected to fail only in corner cases. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matt Macy <mmacy@FreeBSD.org> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Closes #11153
This commit is contained in:
committed by
Tony Hutter
parent
455ea5bb1f
commit
bb21c0aa3b
@@ -123,7 +123,7 @@ extern minor_t zfsdev_minor_alloc(void);
|
||||
#define ZFS_ENTER(zfsvfs) \
|
||||
{ \
|
||||
rrm_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \
|
||||
if ((zfsvfs)->z_unmounted) { \
|
||||
if (__predict_false((zfsvfs)->z_unmounted)) { \
|
||||
ZFS_EXIT(zfsvfs); \
|
||||
return (EIO); \
|
||||
} \
|
||||
@@ -134,7 +134,7 @@ extern minor_t zfsdev_minor_alloc(void);
|
||||
|
||||
/* Verifies the znode is valid */
|
||||
#define ZFS_VERIFY_ZP(zp) \
|
||||
if ((zp)->z_sa_hdl == NULL) { \
|
||||
if (__predict_false((zp)->z_sa_hdl == NULL)) { \
|
||||
ZFS_EXIT((zp)->z_zfsvfs); \
|
||||
return (EIO); \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user