Skip to content

Commit

Permalink
lightnvm: eliminate nvm_lun abstraction in mm
Browse files Browse the repository at this point in the history
In order to naturally support multi-target instances on an Open-Channel
SSD, targets should own the LUNs they get blocks from and manage
provisioning internally. This is done in several steps.

Since targets own the LUNs the are instantiated on top of and manage the
free block list internally, there is no need for a LUN abstraction in
the media manager. LUNs are intrinsically managed as in the physical
layout (ch:0,lun:0, ..., ch:0,lun:n, ch:1,lun:0, ch:1,lun:n, ...,
ch:m,lun:0, ch:m,lun:n) and given to the targets based on the target
creation ioctl. This simplifies LUN management and clears the path for a
partition manager to sit directly underneath LightNVM targets.

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>
  • Loading branch information
Javier González authored and Jens Axboe committed Nov 29, 2016
1 parent 2a02e62 commit 8e53624
Show file tree
Hide file tree
Showing 7 changed files with 419 additions and 164 deletions.
14 changes: 9 additions & 5 deletions drivers/lightnvm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,19 @@ int nvm_set_bb_tbl(struct nvm_dev *dev, struct ppa_addr *ppas, int nr_ppas,
}
EXPORT_SYMBOL(nvm_set_bb_tbl);

int nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
int nvm_submit_io(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd)
{
return dev->mt->submit_io(dev, rqd);
struct nvm_dev *dev = tgt_dev->parent;

return dev->mt->submit_io(tgt_dev, rqd);
}
EXPORT_SYMBOL(nvm_submit_io);

int nvm_erase_blk(struct nvm_dev *dev, struct ppa_addr *p, int flags)
int nvm_erase_blk(struct nvm_tgt_dev *tgt_dev, struct ppa_addr *p, int flags)
{
return dev->mt->erase_blk(dev, p, flags);
struct nvm_dev *dev = tgt_dev->parent;

return dev->mt->erase_blk(tgt_dev, p, flags);
}
EXPORT_SYMBOL(nvm_erase_blk);

Expand Down Expand Up @@ -350,7 +354,7 @@ static int __nvm_submit_ppa(struct nvm_dev *dev, struct nvm_rq *rqd, int opcode,

nvm_generic_to_addr_mode(dev, rqd);

rqd->dev = dev;
rqd->dev = NULL;
rqd->opcode = opcode;
rqd->flags = flags;
rqd->bio = bio;
Expand Down
Loading

0 comments on commit 8e53624

Please sign in to comment.