|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
From 2e05cd6b4aee656f69e11cf8b5e280dd47a14b1b Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
From: Dan Williams <dan.j.williams@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Date: Wed, 5 Jan 2022 13:32:15 -0800
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Subject: [PATCH 075/217] ndctl: Deprecate BLK aperture support
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
The kernel is dropping its BLK aperture support, so deprecate the same in
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ndctl. The options will still be supported, and the library calls will not
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
be deleted in case code needs them to compile. However the documentation
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
and the tests for BLK mode can be removed.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Link: https://lore.kernel.org/r/164141833579.3990253.17885822648406789915.stgit@dwillia2-desk3.amr.corp.intel.com
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Tested-by: Alison Schofield <alison.schofield@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Tested-by: Vaibhav Jain <vaibhav@linux.ibm.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
---
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
.gitignore | 4 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Documentation/ndctl/labels-description.txt | 5 +-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
.../ndctl/ndctl-create-namespace.txt | 29 +-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Documentation/ndctl/ndctl-init-labels.txt | 7 +-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Documentation/ndctl/ndctl-list.txt | 4 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Documentation/ndctl/region-description.txt | 10 +-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
README.md | 1 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
contrib/nfit_test_depmod.conf | 1 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ndctl/Makefile.am | 6 +-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ndctl/bat.c | 5 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ndctl/test.c | 11 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test.h | 3 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/Makefile.am | 31 --
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/blk-exhaust.sh | 30 --
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/blk_namespaces.c | 357 ------------------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/core.c | 1 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/create.sh | 13 -
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/dpa-alloc.c | 326 ----------------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/libndctl.c | 198 ++--------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/multi-pmem.c | 285 --------------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/parent-uuid.c | 254 -------------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
21 files changed, 51 insertions(+), 1530 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
delete mode 100755 test/blk-exhaust.sh
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
delete mode 100644 test/blk_namespaces.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
delete mode 100644 test/dpa-alloc.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
delete mode 100644 test/multi-pmem.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
delete mode 100644 test/parent-uuid.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/.gitignore b/.gitignore
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 6468c7a..6b19d90 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/.gitignore
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/.gitignore
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -42,20 +42,16 @@ cscope*.out
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
tags
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/*.log
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/*.trs
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-test/blk-ns
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/dax-dev
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/dax-errors
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/dax-pmd
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/daxdev-errors
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/device-dax
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-test/dpa-alloc
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/dsm-fail
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/hugetlb
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/image
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/libndctl
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/mmap
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-test/multi-pmem
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-test/parent-uuid
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/pmem-ns
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/smart-listen
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test/smart-notify
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/Documentation/ndctl/labels-description.txt b/Documentation/ndctl/labels-description.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 6244a49..a246edc 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/Documentation/ndctl/labels-description.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/Documentation/ndctl/labels-description.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -3,6 +3,5 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
DESCRIPTION
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-----------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
The namespace label area is a small persistent partition of capacity
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-available on some NVDIMM devices. The label area is used to resolve
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-aliasing between 'pmem' and 'blk' capacity by delineating namespace
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-boundaries.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+available on some NVDIMM devices. The label area is used to provision
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+one, or more, namespaces from regions.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/Documentation/ndctl/ndctl-create-namespace.txt b/Documentation/ndctl/ndctl-create-namespace.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 92a89dd..afb085e 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/Documentation/ndctl/ndctl-create-namespace.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/Documentation/ndctl/ndctl-create-namespace.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -28,27 +28,17 @@ ndctl create-namespace -f -e namespace0.0 --mode=sector
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
OPTIONS
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--t::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
---type=::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- Create a 'pmem' or 'blk' namespace (subject to available
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- capacity). A pmem namespace supports the dax (direct access)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- capability to linkndctl:mmap[2] persistent memory directly into
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- a process address space. A blk namespace access persistent
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- memory through a block-window-aperture. Compared to pmem it
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- supports a traditional storage error model (EIO on error rather
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- than a cpu exception on a bad memory access), but it does not
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- support dax.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-m::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--mode=::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- "raw": expose the namespace capacity directly with
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- limitations. Neither a raw pmem namepace nor raw blk
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- namespace support sector atomicity by default (see "sector"
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- mode below). A raw pmem namespace may have limited to no dax
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- support depending the kernel. In other words operations like
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- direct-I/O targeting a dax buffer may fail for a pmem
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- namespace in raw mode or indirect through a page-cache buffer.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- See "fsdax" and "devdax" mode for dax operation.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ limitations. A raw pmem namepace namespace does not support
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ sector atomicity (see "sector" mode below). A raw pmem
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ namespace may have limited to no dax support depending the
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ kernel. In other words operations like direct-I/O targeting a
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ dax buffer may fail for a pmem namespace in raw mode or
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ indirect through a page-cache buffer. See "fsdax" and
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ "devdax" mode for dax operation.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- "sector": persistent memory, given that it is byte
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
addressable, does not support sector atomicity. The
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -206,8 +196,7 @@ OPTIONS
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
* NVDIMM does not support labels
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
* The NVDIMM supports labels, but the Label Index Block (see
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- UEFI 2.7) is not present and there is no capacity aliasing
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- between 'blk' and 'pmem' regions.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ UEFI 2.7) is not present.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- In the latter case the configuration can be upgraded to
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
labelled operation by writing an index block on all DIMMs in a
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/Documentation/ndctl/ndctl-init-labels.txt b/Documentation/ndctl/ndctl-init-labels.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 733ef0e..73685b3 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/Documentation/ndctl/ndctl-init-labels.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/Documentation/ndctl/ndctl-init-labels.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -13,10 +13,9 @@ SYNOPSIS
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
'ndctl init-labels' <nmem0> [<nmem1>..<nmemN>] [<options>]
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
include::labels-description.txt[]
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-By default, and in kernels prior to v4.10, the kernel only honors labels
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-when a DIMM aliases PMEM and BLK capacity. Starting with v4.10 the
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-kernel will honor labels for sub-dividing PMEM if all the DIMMs in an
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-interleave set / region have a valid namespace index block.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+Starting with v4.10 the kernel will honor labels for sub-dividing PMEM
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+if all the DIMMs in an interleave set / region have a valid namespace
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+index block.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
This command can be used to initialize the namespace index block if it
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
is missing or reinitialize it if it is damaged. Note that
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/Documentation/ndctl/ndctl-list.txt b/Documentation/ndctl/ndctl-list.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index b8d517d..2922f10 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/Documentation/ndctl/ndctl-list.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/Documentation/ndctl/ndctl-list.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -82,10 +82,6 @@ include::xable-bus-options.txt[]
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
'X.Y'. Limit the namespace list to the single identified device
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
if present.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--t::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
---type=::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- Filter listing by region type ('pmem' or 'blk')
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-m::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--mode=::
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Filter listing by the mode ('raw', 'fsdax', 'sector' or 'devdax')
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/Documentation/ndctl/region-description.txt b/Documentation/ndctl/region-description.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index c14416a..ce268a0 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/Documentation/ndctl/region-description.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/Documentation/ndctl/region-description.txt
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -2,9 +2,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
DESCRIPTION
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-----------
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-A generic REGION device is registered for each PMEM range or
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-BLK-aperture set. LIBNVDIMM provides a built-in driver for these REGION
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-devices. This driver is responsible for reconciling the aliased DPA
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-mappings across all regions, parsing the LABEL, if present, and then
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-emitting NAMESPACE devices with the resolved/exclusive DPA-boundaries
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-for the nd_pmem or nd_blk device driver to consume.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+A generic REGION device is registered for each PMEM range /
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+interleave-set. LIBNVDIMM provides a built-in driver for these REGION
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+devices. This driver is responsible for parsing namespace labels and
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+instantiating PMEM namespaces for each coherent set of labels.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/README.md b/README.md
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 89dfc87..6f36a6d 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/README.md
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/README.md
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -110,7 +110,6 @@ override dax_pmem * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override dax_pmem_core * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override dax_pmem_compat * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override libnvdimm * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-override nd_blk * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override nd_btt * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override nd_e820 * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override nd_pmem * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/contrib/nfit_test_depmod.conf b/contrib/nfit_test_depmod.conf
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 9f8498e..0e0574e 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/contrib/nfit_test_depmod.conf
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/contrib/nfit_test_depmod.conf
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -5,7 +5,6 @@ override dax_pmem * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override dax_pmem_core * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override dax_pmem_compat * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override libnvdimm * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-override nd_blk * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override nd_btt * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override nd_e820 * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
override nd_pmem * extra
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 4e99510..93b682e 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/ndctl/Makefile.am
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/ndctl/Makefile.am
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -45,8 +45,7 @@ endif
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
EXTRA_DIST += keys.readme monitor.conf ndctl-monitor.service
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
if ENABLE_DESTRUCTIVE
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-ndctl_SOURCES += ../test/blk_namespaces.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../test/pmem_namespaces.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ndctl_SOURCES += ../test/pmem_namespaces.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ndctl_SOURCES += bat.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
endif
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -67,9 +66,6 @@ if ENABLE_TEST
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ndctl_SOURCES += ../test/libndctl.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
../test/dsm-fail.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
../util/sysfs.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../test/dpa-alloc.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../test/parent-uuid.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../test/multi-pmem.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
../test/core.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
test.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
endif
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/ndctl/bat.c b/ndctl/bat.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index ef00a3b..13e964d 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/ndctl/bat.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/ndctl/bat.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -41,11 +41,6 @@ int cmd_bat(int argc, const char **argv, struct ndctl_ctx *ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_blk_namespaces(loglevel, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "test_blk_namespaces: %s\n", rc ? "FAIL" : "PASS");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc && rc != 77)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
rc = test_pmem_namespaces(loglevel, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
fprintf(stderr, "test_pmem_namespaces: %s\n", rc ? "FAIL" : "PASS");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/ndctl/test.c b/ndctl/test.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 6a05d8d..a0f5bc9 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/ndctl/test.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/ndctl/test.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -58,16 +58,5 @@ int cmd_test(int argc, const char **argv, struct ndctl_ctx *ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
if (rc && rc != 77)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_dpa_alloc(loglevel, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "test-dpa-alloc: %s\n", result(rc));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc && rc != 77)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_parent_uuid(loglevel, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "test-parent-uuid: %s\n", result(rc));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_multi_pmem(loglevel, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "test-multi-pmem: %s\n", result(rc));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test.h b/test.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 7de13fe..b2267e6 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/test.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -26,7 +26,6 @@ int ndctl_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
struct ndctl_ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int test_multi_pmem(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int test_dax_directio(int dax_fd, unsigned long align, void *dax_addr, off_t offset);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int test_dax_remap(struct ndctl_test *test, int dax_fd, unsigned long align, void *dax_addr,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
off_t offset, bool fsdax);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -40,9 +39,7 @@ static inline int test_dax_poison(struct ndctl_test *test, int dax_fd,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int test_dpa_alloc(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int test_dsm_fail(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int test_libndctl(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int test_blk_namespaces(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int test_pmem_namespaces(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#endif /* __TEST_H__ */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/Makefile.am b/test/Makefile.am
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index c5b8764..a5a54df 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/Makefile.am
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/test/Makefile.am
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -3,9 +3,6 @@ include $(top_srcdir)/Makefile.am.in
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
TESTS =\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
libndctl \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dsm-fail \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- dpa-alloc \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- parent-uuid \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- multi-pmem \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
create.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
clear.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
pmem-errors.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -13,7 +10,6 @@ TESTS =\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
multi-dax.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
btt-check.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
label-compat.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk-exhaust.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
sector-mode.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
inject-error.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
btt-errors.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -35,9 +31,6 @@ EXTRA_DIST += $(TESTS) common \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
check_PROGRAMS =\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
libndctl \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dsm-fail \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- dpa-alloc \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- parent-uuid \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- multi-pmem \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dax-errors \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
smart-notify \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
smart-listen \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -48,7 +41,6 @@ check_PROGRAMS =\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
if ENABLE_DESTRUCTIVE
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
TESTS +=\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk-ns \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
pmem-ns \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
sub-section.sh \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dax-dev \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -68,7 +60,6 @@ TESTS += security.sh
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
endif
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
check_PROGRAMS +=\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk-ns \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
pmem-ns \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dax-dev \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dax-pmd \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -108,18 +99,9 @@ ack_shutdown_count_set_SOURCES =\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ack_shutdown_count_set_LDADD = $(LIBNDCTL_LIB) $(KMOD_LIBS)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-blk_ns_SOURCES = blk_namespaces.c $(testcore)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-blk_ns_LDADD = $(LIBNDCTL_LIB) $(KMOD_LIBS) $(UUID_LIBS)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
pmem_ns_SOURCES = pmem_namespaces.c $(testcore)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
pmem_ns_LDADD = $(LIBNDCTL_LIB) $(KMOD_LIBS) $(UUID_LIBS)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-dpa_alloc_SOURCES = dpa-alloc.c $(testcore)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-dpa_alloc_LDADD = $(LIBNDCTL_LIB) $(UUID_LIBS) $(KMOD_LIBS)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-parent_uuid_SOURCES = parent-uuid.c $(testcore)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-parent_uuid_LDADD = $(LIBNDCTL_LIB) $(UUID_LIBS) $(KMOD_LIBS)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dax_dev_SOURCES = dax-dev.c $(testcore)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
dax_dev_LDADD = $(LIBNDCTL_LIB) $(KMOD_LIBS)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -169,19 +151,6 @@ smart_notify_LDADD = $(LIBNDCTL_LIB)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
smart_listen_SOURCES = smart-listen.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
smart_listen_LDADD = $(LIBNDCTL_LIB)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-multi_pmem_SOURCES = \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- multi-pmem.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- $(testcore) \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../ndctl/namespace.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../ndctl/check.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../util/json.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-multi_pmem_LDADD = \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- $(LIBNDCTL_LIB) \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- $(JSON_LIBS) \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- $(UUID_LIBS) \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- $(KMOD_LIBS) \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ../libutil.a
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
list_smart_dimm_SOURCES = \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
list-smart-dimm.c \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
../util/json.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/blk-exhaust.sh b/test/blk-exhaust.sh
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
deleted file mode 100755
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index b6d3808..0000000
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/blk-exhaust.sh
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ /dev/null
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -1,30 +0,0 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#!/bin/bash -x
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# SPDX-License-Identifier: GPL-2.0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# Copyright (C) 2015-2020 Intel Corporation. All rights reserved.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-set -e
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-rc=77
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-. $(dirname $0)/common
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-check_min_kver "4.11" || do_skip "may lack blk-exhaustion fix"
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-trap 'err $LINENO' ERR
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# setup (reset nfit_test dimms)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-modprobe nfit_test
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-reset
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# if the kernel accounting is correct we should be able to create two
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# pmem and two blk namespaces on nfit_test.0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-rc=1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t pmem
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t blk -m raw
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-$NDCTL create-namespace -b $NFIT_TEST_BUS0 -t blk -m raw
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# clearnup and exit
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-_cleanup
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-exit 0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/blk_namespaces.c b/test/blk_namespaces.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
deleted file mode 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index f076e85..0000000
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/blk_namespaces.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ /dev/null
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -1,357 +0,0 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// SPDX-License-Identifier: LGPL-2.1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// Copyright (C) 2015-2020, Intel Corporation. All rights reserved.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <errno.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <fcntl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <linux/fs.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ndctl/libndctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdio.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdlib.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <string.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <sys/ioctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <syslog.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <sys/stat.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <sys/types.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ndctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <unistd.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <uuid/uuid.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <linux/version.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <test.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <libkmod.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ccan/array_size/array_size.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-/* The purpose of this test is to verify that we can successfully do I/O to
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * multiple nd_blk namespaces that have discontiguous segments. It first
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * sets up two namespaces, each 1/2 the total size of the NVDIMM and each with
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * two discontiguous segments, arranged like this:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- *
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +-------+-------+-------+-------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * | nd0 | nd1 | nd0 | nd1 |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +-------+-------+-------+-------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- *
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * It then runs some I/O to the beginning, middle and end of each of these
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * namespaces, checking data integrity. The I/O to the middle of the
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * namespace will hit two pages, one on either side of the segment boundary.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#define err(msg)\
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s:%d: %s (%s)\n", __func__, __LINE__, msg, strerror(errno))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct ndctl_namespace *create_blk_namespace(int region_fraction,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_region *region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns, *seed_ns = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long long size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_set_align(region, sysconf(_SC_PAGESIZE));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach(region, ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_get_size(ndns) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- seed_ns = ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!seed_ns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_generate(uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = ndctl_region_get_size(region)/region_fraction;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_set_uuid(seed_ns, uuid) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_set_size(seed_ns, size) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_set_sector_size(seed_ns, 512) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_enable(seed_ns) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return seed_ns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int disable_blk_namespace(struct ndctl_namespace *ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_disable_invalidate(ndns) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_delete(ndns) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int ns_do_io(const char *bdev)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int fd, i;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc = 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- const int page_size = 4096;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- const int num_pages = 4;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long num_dev_pages, num_blocks;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- off_t addr;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- void *random_page[num_pages];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- void *blk_page[num_pages];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = posix_memalign(random_page, page_size, page_size * num_pages);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "posix_memalign failure\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = posix_memalign(blk_page, page_size, page_size * num_pages);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "posix_memalign failure\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_free_blk;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 1; i < num_pages; i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- random_page[i] = (char*)random_page[0] + page_size * i;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk_page[i] = (char*)blk_page[0] + page_size * i;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* read random data into random_page */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if ((fd = open("/dev/urandom", O_RDONLY)) < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("open");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_free_all;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = read(fd, random_page[0], page_size * num_pages);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("read");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- close(fd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_free_all;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- close(fd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if ((fd = open(bdev, O_RDWR|O_DIRECT)) < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("open");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_free_all;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ioctl(fd, BLKGETSIZE, &num_blocks);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- num_dev_pages = num_blocks / 8;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* write the random data out to each of the segments */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = pwrite(fd, random_page[0], page_size, 0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("write");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_close;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* two pages that span the region discontinuity */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- addr = page_size * (num_dev_pages/2 - 1);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = pwrite(fd, random_page[1], page_size*2, addr);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("write");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_close;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- addr = page_size * (num_dev_pages - 1);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = pwrite(fd, random_page[3], page_size, addr);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("write");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_close;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* read back the random data into blk_page */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = pread(fd, blk_page[0], page_size, 0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("read");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_close;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* two pages that span the region discontinuity */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- addr = page_size * (num_dev_pages/2 - 1);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = pread(fd, blk_page[1], page_size*2, addr);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("read");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_close;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- addr = page_size * (num_dev_pages - 1);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = pread(fd, blk_page[3], page_size, addr);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err("read");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_close;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* verify the data */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (memcmp(random_page[0], blk_page[0], page_size * num_pages)) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "Block data miscompare\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -EIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_close;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err_close:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- close(fd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err_free_all:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- free(random_page[0]);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err_free_blk:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- free(blk_page[0]);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static const char *comm = "test-blk-namespaces";
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int test_blk_namespaces(int log_level, struct ndctl_test *test,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_ctx *ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- char bdev[50];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc = -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_bus *bus;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_dimm *dimm;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_module *mod = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_ctx *kmod_ctx = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns[2];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_region *region, *blk_region = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 2, 0)))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_set_log_priority(ctx, log_level);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = ndctl_bus_get_by_provider(ctx, "ACPI.NFIT");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (bus) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* skip this bus if no BLK regions */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_region_get_nstype(region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- == ND_DEVICE_NAMESPACE_BLK)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!bus) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "ACPI.NFIT unavailable falling back to nfit_test\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_test_init(&kmod_ctx, &mod, NULL, log_level, test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_invalidate(ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0 || !bus) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_test_skip(test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "nfit_test unavailable skipping tests\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: found provider: %s\n", comm,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_bus_get_provider(bus));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* get the system to a clean state */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_dimm_foreach(bus, dimm) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_dimm_zero_labels(dimm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to zero %s\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_dimm_get_devname(dimm));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_module;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* create our config */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strcmp(ndctl_region_get_type_name(region), "blk") == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk_region = region;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!blk_region || ndctl_region_enable(blk_region) < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to find block region\n", comm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns[0] = create_blk_namespace(4, blk_region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns[0]) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to create block namespace\n", comm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns[1] = create_blk_namespace(4, blk_region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns[1]) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to create block namespace\n", comm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = disable_blk_namespace(ndns[0]);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to disable block namespace\n", comm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns[0] = create_blk_namespace(2, blk_region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns[0]) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to create block namespace\n", comm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = disable_blk_namespace(ndns[1]);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to disable block namespace\n", comm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns[1] = create_blk_namespace(2, blk_region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns[1]) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to create block namespace\n", comm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* okay, all set up, do some I/O */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = -EIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- sprintf(bdev, "/dev/%s", ndctl_namespace_get_block_device(ndns[0]));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ns_do_io(bdev))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- sprintf(bdev, "/dev/%s", ndctl_namespace_get_block_device(ndns[1]));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ns_do_io(bdev))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err_cleanup;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err_cleanup:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* unload nfit_test */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (bus)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = ndctl_bus_get_by_provider(ctx, "nfit_test.1");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (bus)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (mod)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_module_remove_module(mod, 0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err_module:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (kmod_ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_unref(kmod_ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int __attribute__((weak)) main(int argc, char *argv[])
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_test *test = ndctl_test_new(0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_ctx *ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- comm = argv[0];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!test) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to initialize test\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_new(&ctx;;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_blk_namespaces(LOG_DEBUG, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_unref(ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/core.c b/test/core.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 93e1dae..dc1405d 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/core.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/test/core.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -123,7 +123,6 @@ int ndctl_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
"dax_pmem_core",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
"dax_pmem_compat",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
"libnvdimm",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- "nd_blk",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
"nd_btt",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
"nd_e820",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
"nd_pmem",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/create.sh b/test/create.sh
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index e9baaa0..9a6f373 100755
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/create.sh
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/test/create.sh
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -40,19 +40,6 @@ eval $(echo $json | json2var)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
# free capacity for blk creation
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
$NDCTL destroy-namespace -f $dev
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# create blk
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-dev="x"
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-json=$($NDCTL create-namespace -b $NFIT_TEST_BUS0 -t blk -m raw -v)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-eval $(echo $json | json2var)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-[ $dev = "x" ] && echo "fail: $LINENO" && exit 1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-[ $mode != "raw" ] && echo "fail: $LINENO" && exit 1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-# convert blk to sector mode
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-json=$($NDCTL create-namespace -m sector -l $SECTOR_SIZE -f -e $dev)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-eval $(echo $json | json2var)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-[ $sector_size != $SECTOR_SIZE ] && echo "fail: $LINENO" && exit 1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-[ $mode != "sector" ] && echo "fail: $LINENO" && exit 1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
_cleanup
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
exit 0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
deleted file mode 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 59185cf..0000000
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/dpa-alloc.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ /dev/null
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -1,326 +0,0 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// SPDX-License-Identifier: LGPL-2.1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// Copyright (C) 2014-2020, Intel Corporation. All rights reserved.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdio.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stddef.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdlib.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <string.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <fcntl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ctype.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <errno.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <unistd.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <limits.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <syslog.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <libkmod.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <uuid/uuid.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <test.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ndctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <util/size.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <linux/version.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ndctl/libndctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ccan/array_size/array_size.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static const char *NFIT_PROVIDER0 = "nfit_test.0";
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static const char *NFIT_PROVIDER1 = "nfit_test.1";
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#define NUM_NAMESPACES 4
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-struct test_dpa_namespace {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long long size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-} namespaces[NUM_NAMESPACES];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#define MIN_SIZE SZ_4M
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned int default_available_slots, available_slots, i;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_region *region, *blk_region = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_dimm *dimm;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long size, page_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_bus *bus;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- char uuid_str[40];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int round;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- page_size = sysconf(_SC_PAGESIZE);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* disable nfit_test.1, not used in this test */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = ndctl_bus_get_by_provider(ctx, NFIT_PROVIDER1);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!bus)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_set_align(region, sysconf(_SC_PAGESIZE)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * ndctl_region_get_interleave_ways(region));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* init nfit_test.0 */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = ndctl_bus_get_by_provider(ctx, NFIT_PROVIDER0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!bus)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_set_align(region, sysconf(_SC_PAGESIZE)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * ndctl_region_get_interleave_ways(region));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_dimm_foreach(bus, dimm) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_dimm_zero_labels(dimm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to zero %s\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_dimm_get_devname(dimm));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * Find a guineapig BLK region, we know that the dimm with
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * handle==0 from nfit_test.0 always allocates from highest DPA
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * to lowest with no excursions into BLK only ranges.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_region_get_type(region) != ND_DEVICE_REGION_BLK)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- dimm = ndctl_region_get_first_dimm(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!dimm)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_dimm_get_handle(dimm) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk_region = region;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!blk_region || ndctl_region_enable(blk_region) < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to find a usable BLK region\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- region = blk_region;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_region_get_available_size(region) / MIN_SIZE < NUM_NAMESPACES) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s insufficient available_size\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_get_devname(region));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- default_available_slots = ndctl_dimm_get_available_labels(dimm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* grow namespaces */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 0; i < ARRAY_SIZE(namespaces); i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = ndctl_region_get_namespace_seed(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to get seed: %d\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_get_devname(region), i);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_generate_random(uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_set_uuid(ndns, uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_set_sector_size(ndns, 512);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_set_size(ndns, MIN_SIZE);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_enable(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to enable %s: %d\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_devname(ndns), rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_disable_invalidate(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_set_size(ndns, page_size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to init %s to size: %lu\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_devname(ndns),
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- page_size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- namespaces[i].ndns = ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_uuid(ndns, namespaces[i].uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- available_slots = ndctl_dimm_get_available_labels(dimm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (available_slots != default_available_slots
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- - ARRAY_SIZE(namespaces)) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "expected %ld slots available\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- default_available_slots
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- - ARRAY_SIZE(namespaces));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENOSPC;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* exhaust label space, by round-robin allocating 4K */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- round = 1;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 0; i < available_slots; i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = namespaces[i % ARRAY_SIZE(namespaces)].ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (i % ARRAY_SIZE(namespaces) == 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- round++;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = page_size * round;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_set_size(ndns, size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: set_size: %lx failed: %d\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_devname(ndns), size, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * The last namespace we updated should still be modifiable via
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * the kernel's reserve label
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- i--;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- round++;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = namespaces[i % ARRAY_SIZE(namespaces)].ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = page_size * round;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_set_size(ndns, size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s failed to update while labels full\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_devname(ndns));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- round--;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = page_size * round;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_set_size(ndns, size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s failed to reduce size while labels full\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_devname(ndns));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* do the allocations survive a region cycle? */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 0; i < ARRAY_SIZE(namespaces); i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = namespaces[i].ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- namespaces[i].size = ndctl_namespace_get_size(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- namespaces[i].ndns = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_region_enable(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to re-enable %s: %d\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_get_devname(region), rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach(region, ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_uuid(ndns, uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 0; i < ARRAY_SIZE(namespaces); i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (uuid_compare(uuid, namespaces[i].uuid) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- namespaces[i].ndns = ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* validate that they all came back */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 0; i < ARRAY_SIZE(namespaces); i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = namespaces[i].ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = ndns ? ndctl_namespace_get_size(ndns) : 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndns && size == namespaces[i].size)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_unparse(namespaces[i].uuid, uuid_str);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to recover %s\n", uuid_str);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* test deletion and merging */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = namespaces[0].ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 1; i < ARRAY_SIZE(namespaces); i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *victim = namespaces[i].ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_unparse(namespaces[i].uuid, uuid_str);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = ndctl_namespace_get_size(victim);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_disable(victim);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to disable %s\n", uuid_str);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_delete(victim);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to delete %s\n", uuid_str);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size += ndctl_namespace_get_size(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_namespace_set_size(ndns, size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to merge %s\n", uuid_str);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* there can be only one */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- i = 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach(region, ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long long sz = ndctl_namespace_get_size(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (sz) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- i++;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (sz == size)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s size: %llx expected %lx\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_devname(ndns),
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- sz, size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (i != 1) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to delete namespaces\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- available_slots = ndctl_dimm_get_available_labels(dimm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (available_slots != default_available_slots - 1) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "mishandled slot count\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int test_dpa_alloc(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_module *mod;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_ctx *kmod_ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int err, result = EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 2, 0)))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_set_log_priority(ctx, loglevel);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (err < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_test_skip(test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "nfit_test unavailable skipping tests\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err = do_test(ctx, test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (err == 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- result = EXIT_SUCCESS;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_module_remove_module(mod, 0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_unref(kmod_ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return result;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int __attribute__((weak)) main(int argc, char *argv[])
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_test *test = ndctl_test_new(0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_ctx *ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!test) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to initialize test\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_new(&ctx;;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_dpa_alloc(LOG_DEBUG, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_unref(ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/libndctl.c b/test/libndctl.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 1e97926..35e7cfa 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/libndctl.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/test/libndctl.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -30,46 +30,35 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
/*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
* Kernel provider "nfit_test.0" produces an NFIT with the following attributes:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * (a) (b) DIMM BLK-REGION
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +-------------------+--------+--------+--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +------+ | pm0.0 | blk2.0 | pm1.0 | blk2.1 | 0 region2
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * | imc0 +--+- - - region0- - - +--------+ +--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +--+---+ | pm0.0 | blk3.0 | pm1.0 | blk3.1 | 1 region3
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * | +-------------------+--------v v--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +--+---+ | |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * | cpu0 | region1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +--+---+ | |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * | +----------------------------^ ^--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +--+---+ | blk4.0 | pm1.0 | blk4.0 | 2 region4
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * | imc1 +--+----------------------------| +--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +------+ | blk5.0 | pm1.0 | blk5.0 | 3 region5
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * +----------------------------+--------+--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * (a) (b) DIMM
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +-------------------+--------+--------+--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +------+ | pm0.0 | free | pm1.0 | free | 0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * | imc0 +--+- - - region0- - - +--------+ +--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +--+---+ | pm0.0 | free | pm1.0 | free | 1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * | +-------------------+--------v v--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +--+---+ | |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * | cpu0 | region1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +--+---+ | |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * | +----------------------------^ ^--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +--+---+ | free | pm1.0 | free | 2
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * | imc1 +--+----------------------------| +--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +------+ | free | pm1.0 | free | 3
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * +----------------------------+--------+--------+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * *) In this layout we have four dimms and two memory controllers in one
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * socket. Each unique interface ("blk" or "pmem") to DPA space
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * is identified by a region device with a dynamically assigned id.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * In this platform we have four DIMMs and two memory controllers in one
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * socket. Each PMEM interleave set is identified by a region device with
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * a dynamically assigned id.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * *) The first portion of dimm0 and dimm1 are interleaved as REGION0.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * A single "pmem" namespace is created in the REGION0-"spa"-range
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * that spans dimm0 and dimm1 with a user-specified name of "pm0.0".
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * Some of that interleaved "spa" range is reclaimed as "bdw"
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * accessed space starting at offset (a) into each dimm. In that
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * reclaimed space we create two "bdw" "namespaces" from REGION2 and
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * REGION3 where "blk2.0" and "blk3.0" are just human readable names
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * that could be set to any user-desired name in the label.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * 1. The first portion of DIMM0 and DIMM1 are interleaved as REGION0. A
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * single PMEM namespace is created in the REGION0-SPA-range that spans most
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * of DIMM0 and DIMM1 with a user-specified name of "pm0.0". Some of that
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * interleaved system-physical-address range is left free for
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * another PMEM namespace to be defined.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * *) In the last portion of dimm0 and dimm1 we have an interleaved
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * "spa" range, REGION1, that spans those two dimms as well as dimm2
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * and dimm3. Some of REGION1 allocated to a "pmem" namespace named
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * "pm1.0" the rest is reclaimed in 4 "bdw" namespaces (for each
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * dimm in the interleave set), "blk2.1", "blk3.1", "blk4.0", and
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * "blk5.0".
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- *
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * *) The portion of dimm2 and dimm3 that do not participate in the
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * REGION1 interleaved "spa" range (i.e. the DPA address below
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * offset (b) are also included in the "blk4.0" and "blk5.0"
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * namespaces. Note, that this example shows that "bdw" namespaces
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * don't need to be contiguous in DPA-space.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * 2. In the last portion of DIMM0 and DIMM1 we have an interleaved
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * system-physical-address range, REGION1, that spans those two DIMMs as
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * well as DIMM2 and DIMM3. Some of REGION1 is allocated to a PMEM namespace
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ * named "pm1.0".
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
* Kernel provider "nfit_test.1" produces an NFIT with the following attributes:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -127,10 +116,10 @@ struct dimm {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
(((n & 0xfff) << 16) | ((s & 0xf) << 12) | ((i & 0xf) << 8) \
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
| ((c & 0xf) << 4) | (d & 0xf))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static struct dimm dimms0[] = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { DIMM_HANDLE(0, 0, 0, 0, 0), 0, 0, 2016, 10, 42, { 0 }, 2, { 0x201, 0x301, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { DIMM_HANDLE(0, 0, 0, 0, 1), 1, 0, 2016, 10, 42, { 0 }, 2, { 0x201, 0x301, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { DIMM_HANDLE(0, 0, 1, 0, 0), 2, 0, 2016, 10, 42, { 0 }, 2, { 0x201, 0x301, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { DIMM_HANDLE(0, 0, 1, 0, 1), 3, 0, 2016, 10, 42, { 0 }, 2, { 0x201, 0x301, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ { DIMM_HANDLE(0, 0, 0, 0, 0), 0, 0, 2016, 10, 42, { 0 }, 1, { 0x201, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ { DIMM_HANDLE(0, 0, 0, 0, 1), 1, 0, 2016, 10, 42, { 0 }, 1, { 0x201, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ { DIMM_HANDLE(0, 0, 1, 0, 0), 2, 0, 2016, 10, 42, { 0 }, 1, { 0x201, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ { DIMM_HANDLE(0, 0, 1, 0, 1), 3, 0, 2016, 10, 42, { 0 }, 1, { 0x201, }, },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static struct dimm dimms1[] = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -240,7 +229,6 @@ struct namespace {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static uuid_t null_uuid;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static unsigned long blk_sector_sizes[] = { 512, 520, 528, 4096, 4104, 4160, 4224, };
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static unsigned long pmem_sector_sizes[] = { 512, 4096 };
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static unsigned long io_sector_sizes[] = { 0 };
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -262,60 +250,6 @@ static struct namespace namespace1_pmem0 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ARRAY_SIZE(pmem_sector_sizes), pmem_sector_sizes,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct namespace namespace2_blk0 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 0, "namespace_blk", NULL, NULL, NULL, SZ_7M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { 3, 3, 3, 3,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 3, 3, 3, 3,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 3, 3, 3, 3,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 3, 3, 3, 3, }, 1, 1, 0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ARRAY_SIZE(blk_sector_sizes), blk_sector_sizes,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct namespace namespace2_blk1 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 1, "namespace_blk", NULL, NULL, NULL, SZ_11M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { 4, 4, 4, 4,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 4, 4, 4, 4,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 4, 4, 4, 4,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 4, 4, 4, 4, }, 1, 1, 0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ARRAY_SIZE(blk_sector_sizes), blk_sector_sizes,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct namespace namespace3_blk0 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 0, "namespace_blk", NULL, NULL, NULL, SZ_7M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { 5, 5, 5, 5,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 5, 5, 5, 5,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 5, 5, 5, 5,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 5, 5, 5, 5, }, 1, 1, 0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ARRAY_SIZE(blk_sector_sizes), blk_sector_sizes,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct namespace namespace3_blk1 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 1, "namespace_blk", NULL, NULL, NULL, SZ_11M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { 6, 6, 6, 6,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 6, 6, 6, 6,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 6, 6, 6, 6,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 6, 6, 6, 6, }, 1, 1, 0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ARRAY_SIZE(blk_sector_sizes), blk_sector_sizes,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct namespace namespace4_blk0 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 0, "namespace_blk", &btt_settings, NULL, NULL, SZ_27M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { 7, 7, 7, 7,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 7, 7, 7, 7,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 7, 7, 7, 7,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 7, 7, 7, 7, }, 1, 1, 0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ARRAY_SIZE(blk_sector_sizes), blk_sector_sizes,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct namespace namespace5_blk0 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 0, "namespace_blk", &btt_settings, NULL, NULL, SZ_27M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { 8, 8, 8, 8,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 8, 8, 8, 8,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 8, 8, 8, 8,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- 8, 8, 8, 8, }, 1, 1, 0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ARRAY_SIZE(blk_sector_sizes), blk_sector_sizes,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static struct region regions0[] = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
{ { 1 }, 2, 1, "pmem", SZ_32M, SZ_32M, { 1 },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
.namespaces = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -339,40 +273,6 @@ static struct region regions0[] = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
[0] = &default_pfn,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
},
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
},
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { { DIMM_HANDLE(0, 0, 0, 0, 0) }, 1, 1, "blk", SZ_18M, SZ_32M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .namespaces = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &namespace2_blk0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [1] = &namespace2_blk1,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .btts = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &default_btt,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { { DIMM_HANDLE(0, 0, 0, 0, 1) }, 1, 1, "blk", SZ_18M, SZ_32M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .namespaces = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &namespace3_blk0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [1] = &namespace3_blk1,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .btts = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &default_btt,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { { DIMM_HANDLE(0, 0, 1, 0, 0) }, 1, 1, "blk", SZ_27M, SZ_32M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .namespaces = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &namespace4_blk0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .btts = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &default_btt,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- { { DIMM_HANDLE(0, 0, 1, 0, 1) }, 1, 1, "blk", SZ_27M, SZ_32M,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .namespaces = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &namespace5_blk0,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- .btts = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- [0] = &default_btt,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- },
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static struct namespace namespace1 = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -485,26 +385,6 @@ static struct ndctl_region *get_pmem_region_by_range_index(struct ndctl_bus *bus
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct ndctl_region *get_blk_region_by_dimm_handle(struct ndctl_bus *bus,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned int handle)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_region *region;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_mapping *map;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_region_get_type(region) != ND_DEVICE_REGION_BLK)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_mapping_foreach(region, map) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_dimm *dimm = ndctl_mapping_get_dimm(map);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_dimm_get_handle(dimm) == handle)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return region;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
enum ns_mode {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
BTT, PFN, DAX,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -522,11 +402,8 @@ static int check_regions(struct ndctl_bus *bus, struct region *regions, int n,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
struct ndctl_interleave_set *iset;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
char devname[50];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strcmp(regions[i].type, "pmem") == 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- region = get_pmem_region_by_range_index(bus, regions[i].range_index);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- else
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- region = get_blk_region_by_dimm_handle(bus, regions[i].handle);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ region = get_pmem_region_by_range_index(bus,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ regions[i].range_index);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
if (!region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
fprintf(stderr, "failed to find region type: %s ident: %x\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
regions[i].type, regions[i].handle);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -1065,7 +942,6 @@ static int check_btt_create(struct ndctl_region *region, struct ndctl_namespace
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
for (i = 0; i < btt_s->num_sector_sizes; i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ns_seed = ndctl_region_get_namespace_seed(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
struct ndctl_btt *btt_seed = ndctl_region_get_btt_seed(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
enum ndctl_namespace_mode mode;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -1115,16 +991,6 @@ static int check_btt_create(struct ndctl_region *region, struct ndctl_namespace
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
goto err;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* check new seed creation for BLK regions */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_region_get_type(region) == ND_DEVICE_REGION_BLK) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ns_seed == ndctl_region_get_namespace_seed(region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- && ndns == ns_seed) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s: failed to advance namespace seed\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_get_devname(region));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- goto err;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
if (namespace->ro) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
ndctl_region_set_ro(region, 0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
rc = ndctl_btt_enable(btt);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/multi-pmem.c b/test/multi-pmem.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
deleted file mode 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 3ea08cc..0000000
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/multi-pmem.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ /dev/null
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -1,285 +0,0 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// SPDX-License-Identifier: GPL-2.0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// Copyright (C) 2015-2020 Intel Corporation. All rights reserved.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdio.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <errno.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <unistd.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdlib.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <syslog.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <string.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <sys/stat.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <sys/mman.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <sys/time.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <libkmod.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <uuid/uuid.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <sys/types.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <util/size.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <linux/falloc.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <linux/version.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ndctl/libndctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ccan/array_size/array_size.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ndctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <builtin.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <test.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#define NUM_NAMESPACES 4
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#define SZ_NAMESPACE SZ_16M
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int setup_namespace(struct ndctl_region *region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_ctx *ctx = ndctl_region_get_ctx(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- const char *argv[] = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- "__func__", "-v", "-m", "raw", "-s", "16M", "-r", "",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- };
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int argc = ARRAY_SIZE(argv);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- argv[argc - 1] = ndctl_region_get_devname(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- builtin_xaction_namespace_reset();
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return cmd_create_namespace(argc, argv, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static void destroy_namespace(struct ndctl_namespace *ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_ctx *ctx = ndctl_namespace_get_ctx(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- const char *argv[] = {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- "__func__", "-v", "-f", "",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- };
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int argc = ARRAY_SIZE(argv);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- argv[argc - 1] = ndctl_namespace_get_devname(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- builtin_xaction_namespace_reset();
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- cmd_destroy_namespace(argc, argv, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-/* Check that the namespace device is gone (if it wasn't the seed) */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int check_deleted(struct ndctl_region *region, const char *devname,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_test *test)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 10, 0)))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach(region, ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strcmp(devname, ndctl_namespace_get_devname(ndns)))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndns == ndctl_region_get_namespace_seed(region))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: expected %s to be deleted\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- devname);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int do_multi_pmem(struct ndctl_ctx *ctx, struct ndctl_test *test)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int i;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- char devname[100];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_bus *bus;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid[NUM_NAMESPACES];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_dimm *dimm_target, *dimm;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_region *region, *target = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *namespaces[NUM_NAMESPACES];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long long blk_avail, blk_avail_orig, expect;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 9, 0))) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_test_skip(test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!bus)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* disable all regions so that set_config_data commands are permitted */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_dimm_foreach(bus, dimm) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc = ndctl_dimm_zero_labels(dimm);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to zero %s\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_dimm_get_devname(dimm));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * Set regions back to their default state and find our target
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * region.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_enable(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_region_get_available_size(region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- == SZ_NAMESPACE * NUM_NAMESPACES)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- target = region;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!target) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: failed to find target region\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- region = target;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 0; i < (int) ARRAY_SIZE(uuid); i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (setup_namespace(region) != 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: failed to setup namespace: %d\n", i);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- sprintf(devname, "namespace%d.%d",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_get_id(region), i);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach(region, ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strcmp(ndctl_namespace_get_devname(ndns), devname) == 0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- && ndctl_namespace_is_enabled(ndns))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: failed to find namespace: %s\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- devname);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_uuid(ndns, uuid[i]);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* bounce the region and verify everything came back as expected */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_enable(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 0; i < (int) ARRAY_SIZE(uuid); i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- char uuid_str1[40], uuid_str2[40];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid_check;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- sprintf(devname, "namespace%d.%d",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_get_id(region), i);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach(region, ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strcmp(ndctl_namespace_get_devname(ndns), devname) == 0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- && ndctl_namespace_is_enabled(ndns))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: failed to restore namespace: %s\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- devname);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_uuid(ndns, uuid_check);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_unparse(uuid_check, uuid_str2);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_unparse(uuid[i], uuid_str1);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (uuid_compare(uuid_check, uuid[i]) != 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: expected uuid[%d]: %s, got %s\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- i, uuid_str1, uuid_str2);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- namespaces[i] = ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /*
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * Check that aliased blk capacity does not increase until the
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * highest dpa pmem-namespace is deleted.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- dimm_target = ndctl_region_get_first_dimm(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!dimm_target) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: failed to retrieve dimm from %s\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_get_devname(region));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- dimm = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_region_get_type(region) != ND_DEVICE_REGION_BLK)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_dimm_foreach_in_region(region, dimm)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (dimm == dimm_target)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (dimm)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk_avail_orig = ndctl_region_get_available_size(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- for (i = 1; i < NUM_NAMESPACES - 1; i++) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = namespaces[i];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- sprintf(devname, "%s", ndctl_namespace_get_devname(ndns));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- destroy_namespace(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk_avail = ndctl_region_get_available_size(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (blk_avail != blk_avail_orig) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: destroy %s %llx avail, expect %llx\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- devname, blk_avail, blk_avail_orig);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (check_deleted(target, devname, test) != 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = namespaces[NUM_NAMESPACES - 1];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- sprintf(devname, "%s", ndctl_namespace_get_devname(ndns));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- destroy_namespace(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk_avail = ndctl_region_get_available_size(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- expect = (SZ_NAMESPACE / ndctl_region_get_interleave_ways(target))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- * (NUM_NAMESPACES - 1) + blk_avail_orig;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (blk_avail != expect) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "multi-pmem: destroy %s %llx avail, expect %llx\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- devname, blk_avail, expect);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (check_deleted(target, devname, test) != 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_bus_foreach(ctx, bus) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strncmp(ndctl_bus_get_provider(bus), "nfit_test", 9) != 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int test_multi_pmem(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_module *mod;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_ctx *kmod_ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int err, result = EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 2, 0)))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_set_log_priority(ctx, loglevel);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (err < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- result = 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_test_skip(test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "%s unavailable skipping tests\n",
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- "nfit_test");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return result;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- result = do_multi_pmem(ctx, test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_module_remove_module(mod, 0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_unref(kmod_ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return result;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int __attribute__((weak)) main(int argc, char *argv[])
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_test *test = ndctl_test_new(0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_ctx *ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!test) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to initialize test\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_new(&ctx;;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_multi_pmem(LOG_DEBUG, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_unref(ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/test/parent-uuid.c b/test/parent-uuid.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
deleted file mode 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index bded33a..0000000
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/test/parent-uuid.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ /dev/null
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -1,254 +0,0 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// SPDX-License-Identifier: LGPL-2.1
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-// Copyright (C) 2015-2020, Intel Corporation. All rights reserved.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdio.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stddef.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <stdlib.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <string.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <fcntl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ctype.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <errno.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <unistd.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <limits.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <syslog.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <libkmod.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <uuid/uuid.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <linux/version.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <test.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-#include <ndctl/libndctl.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static const char *PROVIDER = "nfit_test.0";
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct ndctl_bus *get_bus_by_provider(struct ndctl_ctx *ctx,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- const char *provider)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_bus *bus;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_bus_foreach(ctx, bus)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strcmp(provider, ndctl_bus_get_provider(bus)) == 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return bus;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct ndctl_btt *get_idle_btt(struct ndctl_region *region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_btt *btt;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_foreach(region, btt)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_btt_is_enabled(btt)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- && !ndctl_btt_is_configured(btt))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return btt;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct ndctl_namespace *create_blk_namespace(int region_fraction,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_region *region, unsigned long long req_size,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns, *seed_ns = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long long size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_set_align(region, sysconf(_SC_PAGESIZE));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach(region, ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_get_size(ndns) == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- seed_ns = ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!seed_ns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = ndctl_region_get_size(region)/region_fraction;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (req_size)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- size = req_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_set_uuid(seed_ns, uuid) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_set_size(seed_ns, size) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_set_sector_size(seed_ns, 512) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_enable(seed_ns) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return seed_ns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int disable_blk_namespace(struct ndctl_namespace *ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_disable_invalidate(ndns) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_delete(ndns) < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static struct ndctl_btt *check_valid_btt(struct ndctl_region *region,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns, uuid_t btt_uuid)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_btt *btt = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_foreach(region, btt) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *btt_ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uu;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_get_uuid(btt, uu);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (uuid_compare(uu, btt_uuid) != 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_btt_is_enabled(btt))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- btt_ndns = ndctl_btt_get_namespace(btt);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!btt_ndns || strcmp(ndctl_namespace_get_devname(btt_ndns),
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_get_devname(ndns)) != 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return btt;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-static int do_test(struct ndctl_ctx *ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_bus *bus;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_btt *btt, *found = NULL, *_btt;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_region *region, *blk_region = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_namespace *ndns, *_ndns;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- unsigned long long ns_size = 18874368;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t uuid = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_t btt_uuid;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- bus = get_bus_by_provider(ctx, PROVIDER);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!bus) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to find NFIT-provider: %s\n", PROVIDER);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (strcmp(ndctl_region_get_type_name(region), "blk") == 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- blk_region = region;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- break;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!blk_region) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to find block region\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENODEV;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* create a blk namespace */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = create_blk_namespace(1, blk_region, ns_size, uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to create block namespace\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* create a btt for this namespace */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_generate(btt_uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- btt = get_idle_btt(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!btt)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_disable_invalidate(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_set_uuid(btt, btt_uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_set_sector_size(btt, 512);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_set_namespace(btt, ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_btt_enable(btt);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to create btt 0\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* re-create the namespace - this should auto-enable the btt */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- disable_blk_namespace(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = create_blk_namespace(1, blk_region, ns_size, uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to re-create block namespace\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* Verify btt was auto-created */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- found = check_valid_btt(blk_region, ndns, btt_uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!found)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- btt = found;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /*disable the btt and namespace again */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_delete(btt);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- disable_blk_namespace(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* recreate the namespace with a different uuid */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- uuid_generate(uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndns = create_blk_namespace(1, blk_region, ns_size, uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndns) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to re-create block namespace\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- /* make sure there is no btt on this namespace */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- found = check_valid_btt(blk_region, ndns, btt_uuid);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (found) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "found a stale btt\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_foreach_safe(blk_region, btt, _btt)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_btt_delete(btt);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_namespace_foreach_safe(blk_region, ndns, _ndns)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (ndctl_namespace_get_size(ndns) != 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- disable_blk_namespace(ndns);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_foreach(bus, region)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_region_disable_invalidate(region);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_module *mod;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct kmod_ctx *kmod_ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int err, result = EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 3, 0)))
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_set_log_priority(ctx, loglevel);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err = ndctl_test_init(&kmod_ctx, &mod, NULL, loglevel, test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (err < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_test_skip(test);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "nfit_test unavailable skipping tests\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return 77;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- err = do_test(ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (err == 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- result = EXIT_SUCCESS;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_module_remove_module(mod, 0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- kmod_unref(kmod_ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return result;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-int __attribute__((weak)) main(int argc, char *argv[])
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_test *test = ndctl_test_new(0);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- struct ndctl_ctx *ctx;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- int rc;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (!test) {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- fprintf(stderr, "failed to initialize test\n");
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return EXIT_FAILURE;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- }
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = ndctl_new(&ctx;;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- if (rc)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- rc = test_parent_uuid(LOG_DEBUG, test, ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- ndctl_unref(ctx);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
- return ndctl_test_result(test, rc);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
-}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
2.27.0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|