]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
nbft: Add SSNS 'discovered' flag
authorTomas Bzatek <tbzatek@redhat.com>
Mon, 19 Feb 2024 13:50:09 +0000 (08:50 -0500)
committerDaniel Wagner <wagi@monom.org>
Mon, 18 Mar 2024 17:34:23 +0000 (18:34 +0100)
Indicates that the SSNS record was obtained through discovery.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
src/nvme/nbft.c
src/nvme/nbft.h

index 3bdbeb1ba1bc1e6a805f50ea1406afb52aad12ef..b7d0dc84db39180d2c3fd853496e3c82295bd5ef 100644 (file)
@@ -249,6 +249,8 @@ static int read_ssns(struct nbft_info *nbft,
        /* flags */
        ssns->unavailable = !!(le16_to_cpu(raw_ssns->flags) &
                               NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL);
+       ssns->discovered = !!(le16_to_cpu(raw_ssns->flags) &
+                             NBFT_SSNS_DISCOVERED_NAMESPACE);
 
        /* security profile */
        if (raw_ssns->security_desc_index) {
index 8bd415b68c65dd0f210db25fb35e77426a62a8db..8abc134a3edd7273dfdd48811f955e0c2d0a897b 100644 (file)
@@ -1180,6 +1180,8 @@ enum nbft_info_nid_type {
  *                             Descriptor) or 0 if not supported.
  * @dhcp_root_path_string:     DHCP Root Path Override string (SSNS Extended
  *                             Information Descriptor).
+ * @discovered:                        Indicates that this namespace was acquired
+ *                             through discovery.
  * @unavailable:               Namespace is unavailable as indicated by
  *                             the pre-OS driver.
  */
@@ -1202,6 +1204,7 @@ struct nbft_info_subsystem_ns {
        int controller_id;
        int asqsz;
        char *dhcp_root_path_string;
+       bool discovered;
        bool unavailable;
 };