Commit 3120b49
linux: add nvme_get_ana_log_len_from_id_ctrl()
The existing function nvme_get_ana_log_len() returns the maximum length
of the ANA log page but has a few restrictions:
- It doesn't work with NVMe-MI controllers, only file descriptors
- It combines calculating the ANA log length from Identify Controller
with issuing the Identify Controller command
- It always returns a maximum length for the ANA log page with NSIDs.
If the ANA log page is going to be fetched with the RGO bit set,
the max length may be much lower, so a smaller buffer could be used.
nvme_get_ana_log_len_from_id_ctrl() is more flexible: it uses an
existing Identify Controller response and accepts a rgo parameter.
This allows it to work with Identify Controller reponses
from MI devices or to reuse existing Identify Controller results.
And it can return a tighter length bound when the RGO bit will be set.
This makes it suitable for use in nvme-cli.
Signed-off-by: Caleb Sander Mateos <[email protected]>1 parent 166a144 commit 3120b49
3 files changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
389 | 399 | | |
390 | 400 | | |
391 | 401 | | |
| |||
400 | 410 | | |
401 | 411 | | |
402 | 412 | | |
403 | | - | |
404 | | - | |
405 | | - | |
| 413 | + | |
406 | 414 | | |
407 | 415 | | |
408 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
131 | 141 | | |
132 | 142 | | |
133 | 143 | | |
| |||
0 commit comments