Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information