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
Unknown Object (File)
Wed, Apr 29, 5:21 AM
Unknown Object (File)
Wed, Apr 29, 5:12 AM
Unknown Object (File)
Wed, Apr 29, 3:25 AM
Unknown Object (File)
Wed, Apr 29, 3:18 AM
Unknown Object (File)
Tue, Apr 28, 4:31 PM
Unknown Object (File)
Tue, Apr 28, 2:41 PM
Unknown Object (File)
Mon, Apr 27, 5:45 PM
Unknown Object (File)
Tue, Apr 21, 1:33 PM
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 Not Applicable
Unit
Tests Not Applicable