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 #1987

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nbft.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int nbft_filter(const struct dirent *dent)
return !fnmatch(NBFT_SYSFS_FILENAME, dent->d_name, FNM_PATHNAME);
}

int read_nbft_files(struct list_head *nbft_list, char *path)
int read_nbft_files(nvme_root_t r, struct list_head *nbft_list, char *path)
{
struct dirent **dent;
char filename[PATH_MAX];
Expand All @@ -54,7 +54,7 @@ int read_nbft_files(struct list_head *nbft_list, char *path)

for (i = 0; i < count; i++) {
snprintf(filename, sizeof(filename), "%s/%s", path, dent[i]->d_name);
ret = nvme_nbft_read(&nbft, filename);
ret = nvme_nbft_read(r, &nbft, filename);
if (!ret) {
entry = calloc(1, sizeof(*entry));
entry->nbft = nbft;
Expand Down Expand Up @@ -96,7 +96,7 @@ int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg,
return 0;

list_head_init(&nbft_list);
ret = read_nbft_files(&nbft_list, nbft_path);
ret = read_nbft_files(r, &nbft_list, nbft_path);
if (ret)
goto out_free_2;

Expand Down
2 changes: 1 addition & 1 deletion nbft.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct nbft_file_entry {
struct nbft_info *nbft;
};

int read_nbft_files(struct list_head *nbft_list, char *path);
int read_nbft_files(nvme_root_t r, struct list_head *nbft_list, char *path);
void free_nbfts(struct list_head *nbft_list);

extern int discover_from_nbft(nvme_root_t r, char *hostnqn_arg, char *hostid_arg,
Expand Down
2 changes: 1 addition & 1 deletion plugins/nbft/nbft-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin)
show_subsys = show_hfi = show_discovery = true;

list_head_init(&nbft_list);
ret = read_nbft_files(&nbft_list, nbft_path);
ret = read_nbft_files(NULL, &nbft_list, nbft_path);
if (!ret) {
if (flags == NORMAL)
normal_show_nbfts(&nbft_list, show_subsys, show_hfi, show_discovery);
Expand Down