Page MenuHomeFreeBSD

simplify interop with file_operations
ClosedPublic

Authored by mmacy on Feb 20 2019, 10:45 PM.

Details

Summary

There are a couple of issues

  • loff_t is defined as long long on Linux. On FreeBSD it's defined as long. For all intents and purposes we only care about 64-bit so we'll just pretend like that always DTRT. It would be easier to interoperate with FreeBSD code if we just used off_t. I could go either way and convert the debugfs consumer back to using loff_t if we agree to actually use the type Linux uses.
  • struct linux_file is what we actually pass around, using struct file and redefining it leads to conflicts in build, let's just use linux_file.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mmacy created this revision.Feb 20 2019, 10:45 PM

Did you do a LINT build to make sure nothing gets broken by this patch for both i386 and amd64?

If you grep for llseek you'll see it is used a couple of places in sys/ofed .

If you grep for llseek you'll see it is used a couple of places in sys/ofed .

I will do a make tinderbox for the two

mmacy updated this revision to Diff 54236.Feb 22 2019, 11:06 PM
  • update to fix LINT

Build works now giving loff_t a correct definition (negative offsets are possible)

hselasky accepted this revision.Feb 23 2019, 11:11 AM
This revision is now accepted and ready to land.Feb 23 2019, 11:11 AM
This revision was automatically updated to reflect the committed changes.