Page MenuHomeFreeBSD

Add sync_file_range(2) to linux(4).
ClosedPublic

Authored by trasz on Nov 14 2019, 2:00 PM.
Tags
None
Referenced Files
F83566682: D22371.id64343.diff
Sat, May 11, 11:29 PM
Unknown Object (File)
Feb 19 2024, 10:02 AM
Unknown Object (File)
Feb 12 2024, 6:52 AM
Unknown Object (File)
Jan 27 2024, 5:00 PM
Unknown Object (File)
Jan 23 2024, 4:00 PM
Unknown Object (File)
Dec 20 2023, 6:48 AM
Unknown Object (File)
Sep 26 2023, 2:04 AM
Unknown Object (File)
Sep 5 2023, 10:18 PM
Subscribers

Details

Summary

Add sync_file_range(2) implementation to linux(4); underneath it's a wrapper over the usual fsync(2). This silences some warnings when running "apt-get upgrade".

Diff Detail

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

Event Timeline

trasz added a reviewer: Linux Emulation.
sys/compat/linux/linux_file.c
916 ↗(On Diff #64319)

This is a perfectly reasonable way to implement this in the linuxulator, but we should have some way to track this in the future, maybe a probe as done elsewhere in the linuxulator?

sys/compat/linux/linux_file.h
137 ↗(On Diff #64319)

Should have a comment sync_file_range flags?

sys/arm/linux/syscalls.master
1701 ↗(On Diff #64319)

Remove the ); on this line. It's interesting that this worked at all...

sys/arm64/linux/syscalls.master
457 ↗(On Diff #64319)

Another extra );. Note that the sys calls above have the wrong style (); should be on it's own line).

sys/compat/linux/linux_file.c
916 ↗(On Diff #64319)

I’m not quite sure what you mean?

Fix most of the problems.

sys/compat/linux/linux_file.c
916 ↗(On Diff #64319)

sorry I didn't provide enough context.

From linux sync_file_range manpage:

offset is the starting byte of the file range to be synchronized.
nbytes specifies the length of the range to be synchronized, in
bytes

so for the purpose of the linuxulator it's reasonable to translate this to plain kern_fsync, but we should have some reminder or other way to know we should revisit this in the future if we grow a FreeBSD interface for fine-grained sync

The syscalls.master bits look correct now.

This revision is now accepted and ready to land.Nov 14 2019, 10:05 PM
sys/compat/linux/linux_file.c
916 ↗(On Diff #64319)

Ah, so an XXX comment would do?

emaste added inline comments.
sys/compat/linux/linux_file.c
916 ↗(On Diff #64319)

Sure, I'd say ideally a LIN_SDT_PROBE* but at least an XXX comment.