Skip to content
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

nbft: Refactor use of nvme_msg in nbft.c #669

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

ikegami-t
Copy link
Contributor

No description provided.

@ikegami-t
Copy link
Contributor Author

Changes for the issue #619.

src/nvme/nbft.h Outdated
@@ -1227,7 +1229,7 @@ struct nbft_info {
*
* Return: 0 on success, errno otherwise.
*/
int nvme_nbft_read(struct nbft_info **nbft, const char *filename);
int nvme_nbft_read(nvme_root_t r, struct nbft_info **nbft, const char *filename);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just passing in a nvme_root_t root object for printing the message is not the right thing to do. During review of this code we figured that this is not the right thing to do. That's why this argument is missing.

We have the same problem for all non fabric functions that we don't have a nvme_root_t object and we might also want to print errors etc in those functions.

The only way I see a way around this is to introduce a global variable containing the file descriptor to print to. Obviously, not totally happy with it, but what else can we do?

@ikegami-t
Copy link
Contributor Author

Thanks for your review comments. Just fixed the patch as mentioned.

@ikegami-t
Copy link
Contributor Author

Sorry missed to set NULL the variable after the nvme root deleted so I will update the changes later.

@ikegami-t
Copy link
Contributor Author

Fixed the patch again so now it is set NULL to the variable by deleting the root correctly.

Signed-off-by: Tokunori Ikegami <[email protected]>
[dwagner: export new function, update docs, reorder free sequence]
Signed-off-by: Daniel Wagner <[email protected]>
@igaw
Copy link
Collaborator

igaw commented Sep 20, 2023

export new function, update docs, reorder free sequence

@igaw igaw merged commit 9797fd2 into linux-nvme:master Sep 20, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants