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
F105714554: D22371.diff
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 Passed
Unit
No Test Coverage
Build Status
Buildable 27520
Build 25749: arc lint + arc unit

Event Timeline

trasz added a reviewer: Linux Emulation.
sys/compat/linux/linux_file.c
916

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

Should have a comment sync_file_range flags?

sys/arm/linux/syscalls.master
1701

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

sys/arm64/linux/syscalls.master
457

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

I’m not quite sure what you mean?

Fix most of the problems.

sys/compat/linux/linux_file.c
916

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

Ah, so an XXX comment would do?

emaste added inline comments.
sys/compat/linux/linux_file.c
916

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