A few of the INP lookup operations that lock INPs after the lookup do so using this mechanism (to maintain lock ordering):
- Lock lookup structure.
- Find INP.
- Acquire reference on INP.
- Drop lock on lookup structure.
- Acquire INP lock.
- Drop reference on INP.
This change provides a slightly shorter path for cases where the INP lock is uncontested:
- Lock lookup structure.
- Find INP.
- Try to acquire the INP lock.
- If successful, drop lock on lookup structure.
Of course, if the INP lock is contested, the functions will need to revert to the previous way of switching locks safely.