diff options
author | Matias Bjørling <m@bjorling.me> | 2016-01-12 09:49:39 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-01-12 18:21:18 +0300 |
commit | 8b4970c41f88ad772771f87b1c82c395248a84d8 (patch) | |
tree | 4667e602605483b9be057e43ecbd57f4a2f0a047 /include/linux/lightnvm.h | |
parent | b769207678176d590ea61ce7a64c9100925668b7 (diff) | |
download | linux-8b4970c41f88ad772771f87b1c82c395248a84d8.tar.xz |
lightnvm: introduce factory reset
Now that a device can be managed using the system blocks, a method to
reset the device is necessary as well. This patch introduces logic to
reset the device easily to factory state and exposes it through an
ioctl.
The ioctl takes the following flags:
NVM_FACTORY_ERASE_ONLY_USER
By default all blocks, except host-reserved blocks are erased upon
factory reset. Instead of this, only erase host-reserved blocks.
NVM_FACTORY_RESET_HOST_BLKS
Mark host-reserved blocks to be erased and set their type to free.
NVM_FACTORY_RESET_GRWN_BBLKS
Mark "grown bad blocks" to be erased and set their type to free.
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/lightnvm.h')
-rw-r--r-- | include/linux/lightnvm.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 02f36bdf216e..fc0e7c924967 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -527,6 +527,8 @@ struct nvm_system_block { extern int nvm_get_sysblock(struct nvm_dev *, struct nvm_sb_info *); extern int nvm_update_sysblock(struct nvm_dev *, struct nvm_sb_info *); extern int nvm_init_sysblock(struct nvm_dev *, struct nvm_sb_info *); + +extern int nvm_dev_factory(struct nvm_dev *, int flags); #else /* CONFIG_NVM */ struct nvm_dev_ops; |