mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
zfs: add branch prediction to ZFS_ENTER and ZFS_VERIFY_ZP macros
They are expected to fail only in corner cases.
This commit is contained in:
parent
8ce21ae6ba
commit
4a0b7fd502
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367343
@ -119,7 +119,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); \
|
||||
} \
|
||||
@ -130,7 +130,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); \
|
||||
} \
|
||||
|
@ -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); \
|
||||
} \
|
||||
|
Loading…
Reference in New Issue
Block a user