compat (errno): Adds cross-platform compatibility for errno values.#3311
compat (errno): Adds cross-platform compatibility for errno values.#3311bgoing-micron-oss wants to merge 2 commits into
Conversation
| * Since the error returned by drives unsupported. | ||
| */ | ||
| return -ENAVAIL; | ||
| return ERR_IGNORE_INVALID_FIELD; |
There was a problem hiding this comment.
Why not returning NVME_SC_INVALID_FIELD. This avoids introducing a new define and matches the existing return pattern. Negative values for internal errors (userland/kernel) and positive values for the protocol level status info.
There was a problem hiding this comment.
Good idea.
|
Could you also split these two changes into two patches? Thanks! |
Some errno values used in the code are only available on Linux. Substitutes good equivalent errno value for unsupported values used by nvme/util.c when converting status to errno. Signed-off-by: Broc Going <bgoing@micron.com>
Replaces non-portable ENAVAIL usage in nvme.c with NVME_SC_INVALID_FIELD. Signed-off-by: Broc Going <bgoing@micron.com>
35f293b to
c03da86
Compare
@igaw I have split the changes. Would you like them in separate pull requests, or will this work? |
|
No need for separate PRs. Just a sec |
|
i've tweaked the commit message slightly. The subject prefix is used to 'point' to the file which is edited. I know this is different to the usage in different context but let's stick to what we have so far. Since I can't push these changes back to this branch I merged them directly. |
|
Thanks! |
Some errno values used in the code are only available on Linux. Adds compatible handling of errno values not available on all platforms.