Only take 'olock' when needed for REMFREE.
Sponsored by: EMC / Isilon Storage Division
This looks fine.
It seems you do not need to evaluate olock if B_REMFREE flag is not set.
Move olock calculation there.
Sure. But it isn't expensive either:
if (qindex == QUEUE_DIRTY)
return (struct mtx *)(&bqdirty);
return (struct mtx *)(&bqclean);
Move olock calculation to only where it is needed.
Committed in r284719.