HomeFreeBSD

nfscl: Add a check for "has acquired a delegation" to nfscl_removedeleg()

Description

nfscl: Add a check for "has acquired a delegation" to nfscl_removedeleg()

Commit 5e5ca4c8fc53 added a flag to a NFSv4 mount point that is set when
the first delegation is acquired from the NFSv4 server.

For a common case where delegations are not being issued by the
NFSv4 server, the nfscl_removedeleg() code acquires the mutex lock for
open/lock state, finds the delegation list empty, then just unlocks the
mutex and returns. This patch adds a check of the flag to avoid the
need to acquire the mutex for this common case.

This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

(cherry picked from commit 62c5be4ab4c8b8127185286e148638cb8cdf45f4)

Details

Provenance
rmacklemAuthored on Sep 27 2021, 1:37 AM
Parents
rG3b55b6137195: selsocket: handle sopoll() errors correctly
Branches
Unknown
Tags
Unknown