]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libnvdimm: namespace indices: read and validate
authorDan Williams <dan.j.williams@intel.com>
Tue, 9 Jun 2015 20:09:36 +0000 (16:09 -0400)
committerDan Duval <dan.duval@oracle.com>
Tue, 11 Oct 2016 18:36:50 +0000 (14:36 -0400)
commit5f394b979d1fc5ee43843eee3a76154a8ba1eb84
tree1450adac1e1142f1cfb16a50a5dc22225abfb9b5
parent1a6ad1c978c54dae19c2d40303e8258ab9255d59
libnvdimm: namespace indices: read and validate

Orabug: 22913653

This on media label format [1] consists of two index blocks followed by
an array of labels.  None of these structures are ever updated in place.
A sequence number tracks the current active index and the next one to
write, while labels are written to free slots.

    +------------+
    |            |
    |  nsindex0  |
    |            |
    +------------+
    |            |
    |  nsindex1  |
    |            |
    +------------+
    |   label0   |
    +------------+
    |   label1   |
    +------------+
    |            |
     ....nslot...
    |            |
    +------------+
    |   labelN   |
    +------------+

After reading valid labels, store the dpa ranges they claim into
per-dimm resource trees.

[1]: http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf

Cc: Neil Brown <neilb@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
(cherry picked from commit 4a826c83db4edc040da3a66dbefd53f0cfcf457d)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/nvdimm/Makefile
drivers/nvdimm/dimm.c
drivers/nvdimm/dimm_devs.c
drivers/nvdimm/label.c [new file with mode: 0644]
drivers/nvdimm/label.h [new file with mode: 0644]
drivers/nvdimm/nd.h
include/uapi/linux/ndctl.h