-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use uint32_t & uint64_t instead of u32 & u64, and fix #includes #164
base: master
Are you sure you want to change the base?
Conversation
I would suggest breaking this into multiple commits (each patch should do one thing well, rather than doing multiple things mashed together); it makes it easier if someone wants to backport one change but not the other. But that's not a hard requirement. In this case, an obvious split would be: |
@@ -180,6 +181,7 @@ static void netlink_configure(int index, int *sockfds, int num_connects, | |||
NBD_CMD_CONNECT, 0); | |||
if (index >= 0) | |||
NLA_PUT_U32(msg, NBD_ATTR_INDEX, index); | |||
|
|||
NLA_PUT_U64(msg, NBD_ATTR_SIZE_BYTES, size64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spurious whitespace change?
I'm not sure if Wouter has a Signed-off-by policy for userspace nbd; but given that the Linux kernel has a policy on S-o-b and this interacts closely with the kernel nbd.ko, I personally like using S-o-b on all my commits in this project. |
Overall, the changes look sane to me. |
Good point. I'll try, if the #include dependencies would not change again by the removal of u64 & u32, because the header where they are defined are no longer necessary after the change. I'll see. Btw, do github's merge requests work well with reset & rebase when I replace the one commit by two different commits? |
|
This looks sane to me and is fine to merge, but it's still marked as draft :) |
I'll make a new PR ASAP, during holidays I'd say. |
I'd favor to get rid of the non-standard typedefs
u32
andu64
and use C99 standard typesuint32_t
anduint64_t
everywhere. These types are already used in the project, but mixed wildly with the old types.During this I also moved some #include directives so each .h includes only the headers to fulfill its own needs (e.g. to use foreign declarations for its own declarations). Headers that are only needed for the implementation are included only in the .c file.
Redundant or unneeded includes are removed at all.