summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/pblk-sysfs.c
diff options
context:
space:
mode:
authorIgor Konopko <igor.j.konopko@intel.com>2018-12-11 20:16:26 +0100
committerJens Axboe <axboe@kernel.dk>2018-12-11 20:22:35 +0100
commit55d8ec35398e7ab001989473cf6ed6f40b5ef4a6 (patch)
tree69558b01d608060e20b49d32edd5d9e6ce8c5e40 /drivers/lightnvm/pblk-sysfs.c
parentlightnvm: disable interleaved metadata (diff)
downloadlinux-55d8ec35398e7ab001989473cf6ed6f40b5ef4a6.tar.xz
linux-55d8ec35398e7ab001989473cf6ed6f40b5ef4a6.zip
lightnvm: pblk: support packed metadata
pblk performs recovery of open lines by storing the LBA in the per LBA metadata field. Recovery therefore only works for drives that has this field. This patch adds support for packed metadata, which store l2p mapping for open lines in last sector of every write unit and enables drives without per IO metadata to recover open lines. After this patch, drives with OOB size <16B will use packed metadata and metadata size larger than16B will continue to use the device per IO metadata. Reviewed-by: Javier González <javier@cnexlabs.com> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-sysfs.c')
-rw-r--r--drivers/lightnvm/pblk-sysfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-sysfs.c b/drivers/lightnvm/pblk-sysfs.c
index 2d2818155aa8..7d8958df9472 100644
--- a/drivers/lightnvm/pblk-sysfs.c
+++ b/drivers/lightnvm/pblk-sysfs.c
@@ -479,6 +479,13 @@ static ssize_t pblk_sysfs_set_sec_per_write(struct pblk *pblk,
if (kstrtouint(page, 0, &sec_per_write))
return -EINVAL;
+ if (!pblk_is_oob_meta_supported(pblk)) {
+ /* For packed metadata case it is
+ * not allowed to change sec_per_write.
+ */
+ return -EINVAL;
+ }
+
if (sec_per_write < pblk->min_write_pgs
|| sec_per_write > pblk->max_write_pgs
|| sec_per_write % pblk->min_write_pgs != 0)