diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-02 20:49:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-02 20:49:35 +0000 |
commit | f2c543b4ccad3b9f8871d952cddf66b3b438595b (patch) | |
tree | c3c363d1cc72514221685c42a79a19b320114acc /nvme-filters.c | |
parent | Adding debian version 1.12-8. (diff) | |
download | nvme-cli-f2c543b4ccad3b9f8871d952cddf66b3b438595b.tar.xz nvme-cli-f2c543b4ccad3b9f8871d952cddf66b3b438595b.zip |
Merging upstream version 1.14.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'nvme-filters.c')
-rw-r--r-- | nvme-filters.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nvme-filters.c b/nvme-filters.c index a4133f8..17c375f 100644 --- a/nvme-filters.c +++ b/nvme-filters.c @@ -7,6 +7,22 @@ /* global, used for controller specific namespace filter */ int current_index; +int scan_ctrl_namespace_filter(const struct dirent *d) +{ + int c, i, n; + + if (d->d_name[0] == '.') + return 0; + + if (strstr(d->d_name, "nvme")) { + if (sscanf(d->d_name, "nvme%dc%dn%d", &i, &c, &n) == 3) + return 1; + if (sscanf(d->d_name, "nvme%dn%d", &i, &n) == 2) + return 1; + } + return 0; +} + int scan_namespace_filter(const struct dirent *d) { int i, n; |