mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
lightnvm: export set bad block table
Bad blocks should be managed by block owners. This would be either targets for data blocks or sysblk for system blocks. In order to support this, export two functions: One to mark a block as an specific type (e.g., bad block) and another to update the bad block table on the device. Move bad block management to rrpc. 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>
This commit is contained in:
parent
8a3c95ab38
commit
a24ba4644b
5 changed files with 77 additions and 50 deletions
|
@ -423,6 +423,15 @@ static inline struct ppa_addr block_to_ppa(struct nvm_dev *dev,
|
|||
return ppa;
|
||||
}
|
||||
|
||||
static inline int ppa_cmp_blk(struct ppa_addr ppa1, struct ppa_addr ppa2)
|
||||
{
|
||||
if (ppa_empty(ppa1) || ppa_empty(ppa2))
|
||||
return 0;
|
||||
|
||||
return ((ppa1.g.ch == ppa2.g.ch) && (ppa1.g.lun == ppa2.g.lun) &&
|
||||
(ppa1.g.blk == ppa2.g.blk));
|
||||
}
|
||||
|
||||
static inline int ppa_to_slc(struct nvm_dev *dev, int slc_pg)
|
||||
{
|
||||
return dev->lptbl[slc_pg];
|
||||
|
@ -528,7 +537,9 @@ extern struct nvm_dev *nvm_alloc_dev(int);
|
|||
extern int nvm_register(struct nvm_dev *);
|
||||
extern void nvm_unregister(struct nvm_dev *);
|
||||
|
||||
void nvm_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type);
|
||||
extern void nvm_mark_blk(struct nvm_dev *dev, struct ppa_addr ppa, int type);
|
||||
extern int nvm_set_bb_tbl(struct nvm_dev *dev, struct ppa_addr *ppas,
|
||||
int nr_ppas, int type);
|
||||
|
||||
extern int nvm_submit_io(struct nvm_dev *, struct nvm_rq *);
|
||||
extern void nvm_generic_to_addr_mode(struct nvm_dev *, struct nvm_rq *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue