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
Unknown Object (File)
Thu, Dec 19, 2:45 PM
Unknown Object (File)
Sun, Dec 1, 12:48 PM
Unknown Object (File)
Thu, Nov 28, 9:59 AM
Unknown Object (File)
Thu, Nov 28, 9:59 AM
Unknown Object (File)
Thu, Nov 28, 9:59 AM
Unknown Object (File)
Thu, Nov 28, 9:57 AM
Unknown Object (File)
Thu, Nov 28, 9:35 AM
Unknown Object (File)
Nov 15 2024, 3:22 AM
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.