aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/gennvm.c
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2016-11-28 16:39:07 -0500
committerJens Axboe <axboe@fb.com>2016-11-29 14:12:51 -0500
commit0ac4072eb10c9627415eb1ca511121156e20012c (patch)
treea2581ae27e54d08e0f95bdff8712fd5daade109e /drivers/lightnvm/gennvm.c
parent8e79b5cb1d3b8eceaf6862995952dd4de431dd99 (diff)
lightnvm: remove get_lun operation on gennvm
Since LUNs are managed internally on the target, there is no need for the media manager to implement a get_lun operation. Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm/gennvm.c')
-rw-r--r--drivers/lightnvm/gennvm.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c
index 8791a2aaa9e3..3cf5d5947070 100644
--- a/drivers/lightnvm/gennvm.c
+++ b/drivers/lightnvm/gennvm.c
@@ -159,7 +159,7 @@ static int gen_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
159 tdisk->fops = &gen_fops; 159 tdisk->fops = &gen_fops;
160 tdisk->queue = tqueue; 160 tdisk->queue = tqueue;
161 161
162 targetdata = tt->init(tgt_dev, tdisk, s->lun_begin, s->lun_end); 162 targetdata = tt->init(tgt_dev, tdisk, &t->lun_list);
163 if (IS_ERR(targetdata)) 163 if (IS_ERR(targetdata))
164 goto err_init; 164 goto err_init;
165 165
@@ -613,16 +613,6 @@ static int gen_erase_blk(struct nvm_dev *dev, struct nvm_block *blk, int flags)
613 return nvm_erase_ppa(dev, &addr, 1, flags); 613 return nvm_erase_ppa(dev, &addr, 1, flags);
614} 614}
615 615
616static struct nvm_lun *gen_get_lun(struct nvm_dev *dev, int lunid)
617{
618 struct gen_dev *gn = dev->mp;
619
620 if (unlikely(lunid >= dev->geo.nr_luns))
621 return NULL;
622
623 return &gn->luns[lunid];
624}
625
626static void gen_lun_info_print(struct nvm_dev *dev) 616static void gen_lun_info_print(struct nvm_dev *dev)
627{ 617{
628 struct gen_dev *gn = dev->mp; 618 struct gen_dev *gn = dev->mp;
@@ -655,7 +645,6 @@ static struct nvmm_type gen = {
655 645
656 .mark_blk = gen_mark_blk, 646 .mark_blk = gen_mark_blk,
657 647
658 .get_lun = gen_get_lun,
659 .lun_info_print = gen_lun_info_print, 648 .lun_info_print = gen_lun_info_print,
660 649
661 .get_area = gen_get_area, 650 .get_area = gen_get_area,