PlatformLab / HomaModule

A Linux kernel module that implements the Homa transport protocol.
175 stars 43 forks source link

providing backward compatibility based on kernel versions for poll function of proto_ops struct #2

Closed sarsanaee closed 5 years ago

sarsanaee commented 5 years ago

Hi,

I tried to make the code backward compatible for older kernel versions with some slight changes as we talked in the issue #1 . You may merge this request if it doesn't have any code style violations.

It seems that the __poll_t came from 4.16.0 Linux version, so I opt to hardcode it there.

Thanks, Alireza

johnousterhout commented 5 years ago

Thanks for the pull request. I think there may be a slightly cleaner way to fix this problem, though. How about adding code like the following to homa_impl.h (perhaps right below the #includes?):

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,16,0)
typedef unsigned __poll_t;
#endif

This way it won't be necessary to modify every place where __poll_t appears.

Could you give this a try? If it works for you, I'll merge it. BTW, what version are you running? I'd like to keep a list in the README.md of versions known to work.

Thanks.

sarsanaee commented 5 years ago

Sorry about it, that's definitely right. I put unsigned int in the typedef statement. Let me know if it still has any problem.

My current version is 4.15.0-38-generic.

johnousterhout commented 5 years ago

Thanks; I have merged this now.

-John-

On Tue, Oct 30, 2018 at 10:09 AM alireza sanaee notifications@github.com wrote:

Sorry about it, that's definitely right. I put unsigned int in the typedef statement. Let me know if it still has any problem.

My current version is 4.15.0-38-generic.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PlatformLab/HomaModule/pull/2#issuecomment-434386860, or mute the thread https://github.com/notifications/unsubscribe-auth/AJzqCoZrgwjJSdqJsVn8yHHvc2cWCRRoks5uqIfXgaJpZM4X9RJO .