diff options
author | Dan Williams <dan.j.williams@intel.com> | 2021-08-24 19:05:35 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2021-08-24 22:08:28 +0300 |
commit | 9761b02d40de4b7f9f4947f801b69993817883ee (patch) | |
tree | 53e3196289601099fe47a1aad7d93e8b4c84281f /drivers/nvdimm/nd.h | |
parent | b4366a827f6cf6e58c93e076e335d9ee9ee0480f (diff) | |
download | linux-9761b02d40de4b7f9f4947f801b69993817883ee.tar.xz |
libnvdimm/labels: Add isetcookie validation helper
In preparation to handle CXL labels with the same code that handles EFI
labels, add a specific interleave-set-cookie validation helper
rather than a getter since the CXL label type does not support this
concept. The answer for CXL labels will always be true.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/162982113550.1124374.206762177785773038.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/nd.h')
-rw-r--r-- | drivers/nvdimm/nd.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 61f43f0edabf..b3feaf3699f7 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -83,6 +83,13 @@ static inline u64 nsl_get_isetcookie(struct nvdimm_drvdata *ndd, return __le64_to_cpu(nd_label->isetcookie); } +static inline bool nsl_validate_isetcookie(struct nvdimm_drvdata *ndd, + struct nd_namespace_label *nd_label, + u64 cookie) +{ + return cookie == __le64_to_cpu(nd_label->isetcookie); +} + static inline u16 nsl_get_position(struct nvdimm_drvdata *ndd, struct nd_namespace_label *nd_label) { |