FBSD: avoid vrefl()

Commit 20dc283226 (correctly) introduced changes so that we
avoid interacting with vnodes marked as VI_DOOMED to the extent
possible, but in doing so inadvertendly used the vrefl() KPI that
was only introduced in FreeBSD 11.0.

Rewrite the relevant logic to use the older vref() KPI, at the cost
of a few more unlock/locks, in order to have a single codepath that
works on all supported FreeBSD versions.

Change-Id: Ib315d59ea6c6208bbd0c908d8eaf502a4de51869
Reviewed-on: https://gerrit.openafs.org/14373
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Benjamin Kaduk 2020-09-25 09:22:16 -07:00
parent 0066f4e9f2
commit 81ea654494

View File

@ -131,13 +131,14 @@ osi_vnhold(struct vcache *avc)
{
struct vnode *vp = AFSTOV(avc);
vref(vp);
VI_LOCK(vp);
if ((vp->v_iflag & VI_DOOMED) != 0) {
VI_UNLOCK(vp);
vrele(vp);
return ENOENT;
}
vrefl(AFSTOV(avc));
VI_UNLOCK(vp);
return 0;
}