diff options
author | Keith Busch <keith.busch@intel.com> | 2015-02-19 13:39:03 -0700 |
---|---|---|
committer | Keith Busch <keith.busch@intel.com> | 2015-02-19 16:15:35 -0700 |
commit | e1e5e5641e6f271321aec257ed26a72715e4a8c2 (patch) | |
tree | 8dc9aecb4a660826ac8c8d223719c963ca283948 /drivers/mtd/bcm47xxpart.c | |
parent | 89d3fa45b4add00cd0056361a2498e978cb1e119 (diff) | |
download | op-kernel-dev-e1e5e5641e6f271321aec257ed26a72715e4a8c2.zip op-kernel-dev-e1e5e5641e6f271321aec257ed26a72715e4a8c2.tar.gz |
NVMe: Metadata format support
Adds support for NVMe metadata formats and exposes block devices for
all namespaces regardless of their format. Namespace formats that are
unusable will have disk capacity set to 0, but a handle to the block
device is created to simplify device management. A namespace is not
usable when the format requires host interleave block and metadata in
single buffer, has no provisioned storage, or has better data but failed
to register with blk integrity.
The namespace has to be scanned in two phases to support separate
metadata formats. The first establishes the sector size and capacity
prior to invoking add_disk. If metadata is required, the capacity will
be temporarilly set to 0 until it can be revalidated and registered with
the integrity extenstions after add_disk completes.
The driver relies on the integrity extensions to provide the metadata
buffer. NVMe requires this be a single physically contiguous region,
so only one integrity segment is allowed per command. If the metadata
is used for T10 PI, the driver provides mappings to save and restore
the reftag physical block translation. The driver provides no-op
functions for generate and verify if metadata is not used for protection
information. This way the setup is always provided by the block layer.
If a request does not supply a required metadata buffer, the command
is failed with bad address. This could only happen if a user manually
disables verify/generate on such a disk. The only exception to where
this is okay is if the controller is capable of stripping/generating
the metadata, which is possible on some types of formats.
The metadata scatter gather list now occupies the spot in the nvme_iod
that used to be used to link retryable IOD's, but we don't do that
anymore, so the field was unused.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'drivers/mtd/bcm47xxpart.c')
0 files changed, 0 insertions, 0 deletions