Page MenuHomeFreeBSD

vfs: Simplify vfs_write_resume()/vn_start_write_refed()
ClosedPublic

Authored by olce on Mar 27 2026, 3:02 PM.
Tags
None
Referenced Files
F162636378: D56108.diff
Wed, Jul 15, 7:14 AM
F162636377: D56108.diff
Wed, Jul 15, 7:14 AM
Unknown Object (File)
Wed, Jul 8, 9:22 AM
Unknown Object (File)
Wed, Jul 8, 9:22 AM
Unknown Object (File)
Sun, Jul 5, 4:32 AM
Unknown Object (File)
Thu, Jun 18, 8:52 PM
Unknown Object (File)
Jun 6 2026, 4:28 PM
Unknown Object (File)
May 21 2026, 3:59 AM
Subscribers

Details

Summary

The call to vn_start_write_refed() from vfs_write_resume() with
'mplocked' set to 'true' exactly boils down to doing an increment of
'mnt_writeopcount', albeit with lots of unnecessary verifications.

Replace it with an inline incrementation. As the original call was the
last with 'mplocked' with 'true', remove the 'mplocked' parameter from
vfs_write_resume(), simplifying its code accordingly ('mplocked' always
false).

While here, in vfs_write_resume(), initialize 'error' out of the mount
lock.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71794
Build 68677: arc lint + arc unit