This support went into the kernel with commit abe8b4e3cef8 "nvdimm, btt:
add a size attribute for BTTs"

Signed-off-by: Dan Williams <[email protected]>
---
 test/libndctl.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/libndctl.c b/test/libndctl.c
index 38a0bb746905..0381ee2cdefb 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -970,6 +970,8 @@ static int check_pfn_create(struct ndctl_region *region,
 
 static int check_btt_size(struct ndctl_btt *btt)
 {
+       struct ndctl_ctx *ctx = ndctl_btt_get_ctx(btt);
+       struct ndctl_test *test = ndctl_get_private_data(ctx);
        struct ndctl_namespace *ndns = ndctl_btt_get_namespace(btt);
        unsigned long long ns_size = ndctl_namespace_get_size(ndns);
        unsigned long sect_size = ndctl_btt_get_sector_size(btt);
@@ -1018,6 +1020,10 @@ static int check_btt_size(struct ndctl_btt *btt)
                return -ENXIO;
        }
 
+       /* prior to 4.8 btt devices did not have a size attribute */
+       if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 8, 0)))
+               return 0;
+
        expect = expect_table[size_select][sect_select];
        actual = ndctl_btt_get_size(btt);
        if (expect != actual) {

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to