summaryrefslogtreecommitdiff
path: root/drivers/lightnvm/pblk-init.c
diff options
context:
space:
mode:
authorIgor Konopko <igor.j.konopko@intel.com>2018-12-11 20:16:23 +0100
committerJens Axboe <axboe@kernel.dk>2018-12-11 12:22:35 -0700
commitfaa79f27f0a46cd6c3ac3de5e7f3e142598217fc (patch)
treec5c8451a59169385de0f0b17c56651a5a5791f3d /drivers/lightnvm/pblk-init.c
parentdd439496dfbcfee1eb1e0d14984f98acb2b84c16 (diff)
lightnvm: pblk: add helpers for OOB metadata
pblk currently assumes that size of OOB metadata on drive is always equal to size of pblk_sec_meta struct. This commit add helpers which will allow to handle different sizes of OOB metadata on drive in the future. After this patch only OOB metadata equal to 16 bytes is supported. 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-init.c')
-rw-r--r--drivers/lightnvm/pblk-init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 72ad3e70318c..33361bfb85c3 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -405,6 +405,12 @@ static int pblk_core_init(struct pblk *pblk)
queue_max_hw_sectors(dev->q) / (geo->csecs >> SECTOR_SHIFT));
pblk_set_sec_per_write(pblk, pblk->min_write_pgs);
+ pblk->oob_meta_size = geo->sos;
+ if (pblk->oob_meta_size != sizeof(struct pblk_sec_meta)) {
+ pblk_err(pblk, "Unsupported metadata size\n");
+ return -EINVAL;
+ }
+
pblk->pad_dist = kcalloc(pblk->min_write_pgs - 1, sizeof(atomic64_t),
GFP_KERNEL);
if (!pblk->pad_dist)