vfs: ifdef out noop vop_* primitives on !DEBUG_VFS_LOCKS kernels

This removes calls to empty functions like vop_lock_{pre/post} from
common vfs routines.

Approved by:	re (gjb)
This commit is contained in:
Mateusz Guzik 2016-06-17 19:41:30 +00:00
parent 023075def4
commit e896fb3bae
2 changed files with 14 additions and 13 deletions

View File

@ -4529,10 +4529,10 @@ vop_rename_pre(void *ap)
vhold(a->a_tvp);
}
#ifdef DEBUG_VFS_LOCKS
void
vop_strategy_pre(void *ap)
{
#ifdef DEBUG_VFS_LOCKS
struct vop_strategy_args *a;
struct buf *bp;
@ -4552,56 +4552,48 @@ vop_strategy_pre(void *ap)
if (vfs_badlock_ddb)
kdb_enter(KDB_WHY_VFSLOCK, "lock violation");
}
#endif
}
void
vop_lock_pre(void *ap)
{
#ifdef DEBUG_VFS_LOCKS
struct vop_lock1_args *a = ap;
if ((a->a_flags & LK_INTERLOCK) == 0)
ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK");
else
ASSERT_VI_LOCKED(a->a_vp, "VOP_LOCK");
#endif
}
void
vop_lock_post(void *ap, int rc)
{
#ifdef DEBUG_VFS_LOCKS
struct vop_lock1_args *a = ap;
ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK");
if (rc == 0 && (a->a_flags & LK_EXCLOTHER) == 0)
ASSERT_VOP_LOCKED(a->a_vp, "VOP_LOCK");
#endif
}
void
vop_unlock_pre(void *ap)
{
#ifdef DEBUG_VFS_LOCKS
struct vop_unlock_args *a = ap;
if (a->a_flags & LK_INTERLOCK)
ASSERT_VI_LOCKED(a->a_vp, "VOP_UNLOCK");
ASSERT_VOP_LOCKED(a->a_vp, "VOP_UNLOCK");
#endif
}
void
vop_unlock_post(void *ap, int rc)
{
#ifdef DEBUG_VFS_LOCKS
struct vop_unlock_args *a = ap;
if (a->a_flags & LK_INTERLOCK)
ASSERT_VI_UNLOCKED(a->a_vp, "VOP_UNLOCK");
#endif
}
#endif
void
vop_create_post(void *ap, int rc)

View File

@ -781,8 +781,6 @@ void vop_close_post(void *a, int rc);
void vop_create_post(void *a, int rc);
void vop_deleteextattr_post(void *a, int rc);
void vop_link_post(void *a, int rc);
void vop_lock_pre(void *a);
void vop_lock_post(void *a, int rc);
void vop_lookup_post(void *a, int rc);
void vop_lookup_pre(void *a);
void vop_mkdir_post(void *a, int rc);
@ -797,10 +795,21 @@ void vop_rename_pre(void *a);
void vop_rmdir_post(void *a, int rc);
void vop_setattr_post(void *a, int rc);
void vop_setextattr_post(void *a, int rc);
void vop_strategy_pre(void *a);
void vop_symlink_post(void *a, int rc);
#ifdef DEBUG_VFS_LOCKS
void vop_strategy_pre(void *a);
void vop_lock_pre(void *a);
void vop_lock_post(void *a, int rc);
void vop_unlock_post(void *a, int rc);
void vop_unlock_pre(void *a);
#else
#define vop_strategy_pre(x) do { } while (0)
#define vop_lock_pre(x) do { } while (0)
#define vop_lock_post(x, y) do { } while (0)
#define vop_unlock_post(x, y) do { } while (0)
#define vop_unlock_pre(x) do { } while (0)
#endif
void vop_rename_fail(struct vop_rename_args *ap);