Skip to content

Refactor decref() to lock node only on last reference

The detachnode() and decref() would always lock the nodelock even in cases where the node reference would be greater than 1, so no action would be taken. By reordering the contents of decrement_reference() and changing the meaning of its return value by incorporating the checks from detachnode(), we can avoid the locking when the node is referenced by more than one user.

Closes #3811

Merge request reports