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)
Sat, Sep 12, 11:57 AM
Unknown Object (File)
Thu, Sep 10, 7:20 PM
Unknown Object (File)
Tue, Sep 8, 1:29 PM
Unknown Object (File)
Tue, Sep 8, 9:37 AM
Unknown Object (File)
Tue, Sep 8, 7:01 AM
Unknown Object (File)
Tue, Sep 8, 4:06 AM
Unknown Object (File)
Sun, Sep 6, 3:35 PM
Unknown Object (File)
Sun, Sep 6, 6:46 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 71741
Build 68624: arc lint + arc unit

Event Timeline

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

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