diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-02 20:47:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-02 20:47:46 +0000 |
commit | 5b7ddc4bd2dcdde201ffa2681ede9a0a029bad96 (patch) | |
tree | 352b477f97c1c36105310589c7568259c76e9385 /nvme-filters.c | |
parent | Adding upstream version 1.12. (diff) | |
download | nvme-cli-5b7ddc4bd2dcdde201ffa2681ede9a0a029bad96.tar.xz nvme-cli-5b7ddc4bd2dcdde201ffa2681ede9a0a029bad96.zip |
Adding upstream version 1.14.upstream/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; |