Page MenuHomeFreeBSD

factor out the code that actually does the truncation from vn_truncate() into vn_truncate_locked()
ClosedPublic

Authored by rmacklem on Jun 30 2019, 12:26 AM.
Tags
None
Referenced Files
F157135255: D20808.id59288.diff
Mon, May 18, 4:33 PM
F157031086: D20808.id59288.diff
Mon, May 18, 1:15 AM
F157031073: D20808.id59209.diff
Mon, May 18, 1:15 AM
F157028141: D20808.diff
Mon, May 18, 12:54 AM
Unknown Object (File)
Tue, Apr 21, 1:37 PM
Unknown Object (File)
Apr 15 2026, 3:14 AM
Unknown Object (File)
Apr 13 2026, 11:17 AM
Unknown Object (File)
Apr 12 2026, 6:48 PM
Subscribers

Details

Summary

This patch factors out the code that actually does the truncation from vn_truncate() into vn_truncate_locked().
This will allow vn_truncate_locked() to be called within the NFS server and by D20584 for the copy_file_range(2) syscall,
instead of needing to carry across any changes (such as the recent r347151) made to vn_truncate() over to the NFS
server code (and copy_file_range(2) when added to head.

There should be no semantic change to vn_truncate().

Test Plan

Tested using a program that calls the truncate(2) syscall and a program I use to test copy_file_range(2) for a
sparse file.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable