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
F167582945: D56108.id174522.diff
Sat, Aug 22, 9:13 PM
Unknown Object (File)
Thu, Aug 13, 8:06 PM
Unknown Object (File)
Thu, Aug 13, 3:08 AM
Unknown Object (File)
Wed, Aug 12, 7:20 PM
Unknown Object (File)
Tue, Aug 11, 11:10 PM
Unknown Object (File)
Tue, Aug 11, 11:10 PM
Unknown Object (File)
Tue, Aug 11, 11:07 PM
Unknown Object (File)
Mon, Aug 10, 2:29 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

Event Timeline

olce requested review of this revision.Mar 27 2026, 3:02 PM
sys/kern/vfs_vnops.c
2371–2372

Dont' this leak the mnt interlock?

Don't leak the mountpoint's lock on VR_START_WRITE.

This revision is now accepted and ready to land.Mar 29 2026, 11:42 PM