Page MenuHomeFreeBSD

Add vn_lktype_write()
ClosedPublic

Authored by kib on Aug 4 2021, 2:38 AM.
Tags
None
Referenced Files
F102782543: D31405.diff
Sun, Nov 17, 3:11 AM
Unknown Object (File)
Oct 18 2024, 3:13 AM
Unknown Object (File)
Oct 10 2024, 5:51 PM
Unknown Object (File)
Oct 6 2024, 9:54 PM
Unknown Object (File)
Oct 4 2024, 4:15 AM
Unknown Object (File)
Oct 3 2024, 1:26 AM
Unknown Object (File)
Oct 1 2024, 6:20 PM
Unknown Object (File)
Sep 30 2024, 6:38 PM
Subscribers
None

Details

Reviewers
khng
markj
Group Reviewers
cam
Commits
rG0ef5eee9d941: Add vn_lktype_write()
Summary

and remove repetetive code that calculates vnode locking type for write.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Aug 4 2021, 2:38 AM
This revision is now accepted and ready to land.Aug 4 2021, 2:50 AM
sys/kern/vfs_vnops.c
3091

When is it possible for vn_start_write() to return mp = NULL? Clearly it will happen if the vnode is doomed. Are there other cases? If so, is it possible to have mp == NULL && outvp->v_mount != NULL?

sys/kern/vfs_vnops.c
3091

Official case is for VOP_GETWRITEMOUNT() to return EOPNOTSUPP. In this case vn_start_write() succeeds and sets mp to NULL, regardless of the reclamation status of the vnode.

This was designed as a simple opt-out for filesystems that do need support write suspension and do not want to pay for the overhead of maintaining the mnt_writeopcount.

Until we have such support, we should accept a possibility that mp == NULL but vp->v_mount != NULL.

This revision was automatically updated to reflect the committed changes.