From: Vishal Verma <vishal.l.verma@intel.com>
To: linux-nvdimm@lists.01.org
Cc: Jacek Zloch <jacek.zloch@intel.com>
Subject: [ndctl PATCH] ndctl: add an api for getting ars_status flags
Date: Tue, 5 Jun 2018 18:00:34 -0600 [thread overview]
Message-ID: <20180606000034.12161-1-vishal.l.verma@intel.com> (raw)
The ARS status command defines a 'flags' field that wasn't being exposed
via an API yet. Add a new ndctl_cmd_ars_get_flags() helper to retrieve
this field.
Reported-by: Jacek Zloch <jacek.zloch@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
ndctl/lib/ars.c | 10 ++++++++++
ndctl/lib/libndctl.sym | 1 +
ndctl/libndctl.h | 1 +
3 files changed, 12 insertions(+)
diff --git a/ndctl/lib/ars.c b/ndctl/lib/ars.c
index e04b51e..b0a7ae6 100644
--- a/ndctl/lib/ars.c
+++ b/ndctl/lib/ars.c
@@ -269,6 +269,16 @@ NDCTL_EXPORT unsigned long long ndctl_cmd_ars_get_record_len(
return ars_stat->ars_status->records[rec_index].length;
}
+NDCTL_EXPORT unsigned int ndctl_cmd_ars_get_flags(struct ndctl_cmd *ars_stat)
+{
+ struct ndctl_ctx *ctx = ndctl_bus_get_ctx(cmd_to_bus(ars_stat));
+
+ if (!validate_ars_stat(ctx, ars_stat))
+ return 0;
+
+ return ars_stat->ars_status->flags;
+}
+
NDCTL_EXPORT struct ndctl_cmd *ndctl_bus_cmd_new_clear_error(
unsigned long long address, unsigned long long len,
struct ndctl_cmd *ars_cap)
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
index c1228e5..9940c7a 100644
--- a/ndctl/lib/libndctl.sym
+++ b/ndctl/lib/libndctl.sym
@@ -365,4 +365,5 @@ global:
ndctl_cmd_ars_cap_get_clear_unit;
ndctl_namespace_inject_error2;
ndctl_namespace_uninject_error2;
+ ndctl_cmd_ars_get_flags;
} LIBNDCTL_15;
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
index be997ac..99218e6 100644
--- a/ndctl/libndctl.h
+++ b/ndctl/libndctl.h
@@ -210,6 +210,7 @@ struct ndctl_cmd *ndctl_bus_cmd_new_clear_error(unsigned long long address,
unsigned long long ndctl_cmd_clear_error_get_cleared(
struct ndctl_cmd *clear_err);
unsigned int ndctl_cmd_ars_cap_get_clear_unit(struct ndctl_cmd *ars_cap);
+unsigned int ndctl_cmd_ars_get_flags(struct ndctl_cmd *ars_stat);
/*
* Note: ndctl_cmd_smart_get_temperature is an alias for
--
2.17.0
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next reply other threads:[~2018-06-06 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-06 0:00 Vishal Verma [this message]
2018-06-06 2:07 ` [ndctl PATCH] ndctl: add an api for getting ars_status flags Dan Williams
2018-06-06 5:09 ` Verma, Vishal L
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180606000034.12161-1-vishal.l.verma@intel.com \
--to=vishal.l.verma@intel.com \
--cc=jacek.zloch@intel.com \
--cc=linux-nvdimm@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).