Move lock_profile_object_{init,destroy}() into lock_{init,destroy}().
This commit is contained in:
parent
f407fc8e9b
commit
f78df6dd24
@ -550,7 +550,6 @@ lockinit(lkp, prio, wmesg, timo, flags)
|
||||
#ifdef DEBUG_LOCKS
|
||||
stack_zero(&lkp->lk_stack);
|
||||
#endif
|
||||
lock_profile_object_init(&lkp->lk_object, &lock_class_lockmgr, wmesg);
|
||||
lock_init(&lkp->lk_object, &lock_class_lockmgr, wmesg, NULL,
|
||||
LO_RECURSABLE | LO_SLEEPABLE | LO_UPGRADABLE);
|
||||
}
|
||||
@ -562,9 +561,9 @@ void
|
||||
lockdestroy(lkp)
|
||||
struct lock *lkp;
|
||||
{
|
||||
|
||||
CTR2(KTR_LOCK, "lockdestroy(): lkp == %p (lk_wmesg == \"%s\")",
|
||||
lkp, lkp->lk_wmesg);
|
||||
lock_profile_object_destroy(&lkp->lk_object);
|
||||
lock_destroy(&lkp->lk_object);
|
||||
}
|
||||
|
||||
|
@ -711,7 +711,6 @@ mtx_init(struct mtx *m, const char *name, const char *type, int opts)
|
||||
m->mtx_lock = MTX_UNOWNED;
|
||||
m->mtx_recurse = 0;
|
||||
|
||||
lock_profile_object_init(&m->lock_object, class, name);
|
||||
lock_init(&m->lock_object, class, name, type, flags);
|
||||
}
|
||||
|
||||
@ -742,7 +741,6 @@ mtx_destroy(struct mtx *m)
|
||||
}
|
||||
|
||||
m->mtx_lock = MTX_DESTROYED;
|
||||
lock_profile_object_destroy(&m->lock_object);
|
||||
lock_destroy(&m->lock_object);
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,6 @@ rw_init(struct rwlock *rw, const char *name)
|
||||
|
||||
rw->rw_lock = RW_UNLOCKED;
|
||||
|
||||
lock_profile_object_init(&rw->lock_object, &lock_class_rw, name);
|
||||
lock_init(&rw->lock_object, &lock_class_rw, name, NULL, LO_WITNESS |
|
||||
LO_RECURSABLE | LO_UPGRADABLE);
|
||||
}
|
||||
@ -134,7 +133,6 @@ rw_destroy(struct rwlock *rw)
|
||||
|
||||
KASSERT(rw->rw_lock == RW_UNLOCKED, ("rw lock not unlocked"));
|
||||
rw->rw_lock = RW_DESTROYED;
|
||||
lock_profile_object_destroy(&rw->lock_object);
|
||||
lock_destroy(&rw->lock_object);
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,6 @@ sx_init_flags(struct sx *sx, const char *description, int opts)
|
||||
flags |= opts & SX_ADAPTIVESPIN;
|
||||
sx->sx_lock = SX_LOCK_UNLOCKED;
|
||||
sx->sx_recurse = 0;
|
||||
lock_profile_object_init(&sx->lock_object, &lock_class_sx, description);
|
||||
lock_init(&sx->lock_object, &lock_class_sx, description, NULL, flags);
|
||||
}
|
||||
|
||||
@ -194,7 +193,6 @@ sx_destroy(struct sx *sx)
|
||||
KASSERT(sx->sx_lock == SX_LOCK_UNLOCKED, ("sx lock still held"));
|
||||
KASSERT(sx->sx_recurse == 0, ("sx lock still recursed"));
|
||||
sx->sx_lock = SX_LOCK_DESTROYED;
|
||||
lock_profile_object_destroy(&sx->lock_object);
|
||||
lock_destroy(&sx->lock_object);
|
||||
}
|
||||
|
||||
|
@ -215,6 +215,7 @@ lock_init(struct lock_object *lock, struct lock_class *class, const char *name,
|
||||
lock->lo_flags |= flags | LO_INITIALIZED;
|
||||
LOCK_LOG_INIT(lock, 0);
|
||||
WITNESS_INIT(lock);
|
||||
lock_profile_object_init(lock, class, name);
|
||||
}
|
||||
|
||||
void
|
||||
@ -222,6 +223,7 @@ lock_destroy(struct lock_object *lock)
|
||||
{
|
||||
|
||||
KASSERT(lock_initalized(lock), ("lock %p is not initialized", lock));
|
||||
lock_profile_object_destroy(lock);
|
||||
WITNESS_DESTROY(lock);
|
||||
LOCK_LOG_DESTROY(lock, 0);
|
||||
lock->lo_flags &= ~LO_INITIALIZED;
|
||||
|
Loading…
Reference in New Issue
Block a user