Page MenuHomeFreeBSD

recode nfs_advlock() so that it does "goto out" instead of many return()s. No semantic change.
ClosedPublic

Authored by rmacklem on Nov 6 2018, 12:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 4:51 AM
Unknown Object (File)
Nov 18 2023, 3:07 AM
Unknown Object (File)
Nov 18 2023, 3:03 AM
Unknown Object (File)
Nov 18 2023, 3:02 AM
Unknown Object (File)
Nov 18 2023, 2:13 AM
Unknown Object (File)
May 3 2023, 1:51 AM
Unknown Object (File)
Apr 25 2023, 6:37 PM
Unknown Object (File)
Apr 7 2023, 4:36 PM
Subscribers

Details

Summary

kib@ suggested that recoding nfs_advlock() to avoid the many cases of
NFSVOPUNLOCK(vp, 0);
return (Exxx);
and instead have a single
NFSVOPUNLOCK(vp, 0);
return (error);
at the end would make the code more readable w.r.t. vnode locking.
This patch does that. It does not change any semantics.
(Kostik, the "svn -x -U999999" command didn't work for me. I did this diff with "-U 20" so there are more lines of context.)

Test Plan

Tested for lock behaviour using the connectathon lock tests for both NFSv3 with "nolockd" and NFSv4.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Thus looks fine, thank you.

While reviewing it, I noted the only and really unexplanaible use of Giant in nfs code in nfs_dolock(). Is it needed at all ? If needed, can it be replaced by some sx lock and s/tsleep/sx_xlock/ ?

This revision is now accepted and ready to land.Nov 6 2018, 1:48 AM

nfs_dolock() is the front end for the NLM stuff, which I know nothing about.
I'll try emailing dfr@ and see if he can tell me what locking is required.
(You might have noticed that I don't have much use for the NLM;-)

Thanks for the review, rick

This revision was automatically updated to reflect the committed changes.