Commit 17323520 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

If the OC doesn't have a boc, don't lock unnecessarily lock the OH

The objcore won't gain a boc in a way that would call for locking the
OH when checking if it wasn't there in the first place. So if the
oc->boc is NULL, return early. This saves a mutex lock/unlock in the
common case.
parent b1f0b29e
......@@ -749,6 +749,8 @@ HSH_RefBoc(const struct objcore *oc)
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
oh = oc->objhead;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
if (oc->boc == NULL)
return (NULL);
Lck_Lock(&oh->mtx);
assert(oc->refcnt > 0);
boc = oc->boc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment