Pull lightnvm fixes and updates from Jens Axboe: "This should have been part of the drivers branch, but it arrived a bit late and wasn't based on the official core block driver branch. So they got a small scolding, but got a pass since it's still new. Hence it's in a separate branch. This is mostly pure fixes, contained to lightnvm/, and minor feature additions" * 'for-4.5/lightnvm' of git://git.kernel.dk/linux-block: (26 commits) lightnvm: ensure that nvm_dev_ops can be used without CONFIG_NVM lightnvm: introduce factory reset lightnvm: use system block for mm initialization lightnvm: introduce ioctl to initialize device lightnvm: core on-disk initialization lightnvm: introduce mlc lower page table mappings lightnvm: add mccap support lightnvm: manage open and closed blocks separately lightnvm: fix missing grown bad block type lightnvm: reference rrpc lun in rrpc block lightnvm: introduce nvm_submit_ppa lightnvm: move rq->error to nvm_rq->error lightnvm: support multiple ppas in nvm_erase_ppa lightnvm: move the pages per block check out of the loop lightnvm: sectors first in ppa list lightnvm: fix locking and mempool in rrpc_lun_gc lightnvm: put block back to gc list on its reclaim fail lightnvm: check bi_error in gc lightnvm: return the get_bb_tbl return value lightnvm: refactor end_io functions for sync ...
Showing the changes to include/uapi (1 of 10 files). Show all
Unified · Split
| @@ -33,6 +33,7 @@ · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | #define NVM_TTYPE_NAME_MAX 48 |
| 35 | 35 | #define NVM_TTYPE_MAX 63 |
| 36 | +#define NVM_MMTYPE_LEN 8 | |
| 36 | 37 | |
| 37 | 38 | #define NVM_CTRL_FILE "/dev/lightnvm/control" |
| 38 | 39 | |
| @@ -100,6 +101,26 @@ struct nvm_ioctl_remove { · 61 unmodified lines | ||
| 100 | 101 | __u32 flags; |
| 101 | 102 | }; |
| 102 | 103 | |
| 104 | +struct nvm_ioctl_dev_init { | |
| 105 | + char dev[DISK_NAME_LEN]; /* open-channel SSD device */ | |
| 106 | + char mmtype[NVM_MMTYPE_LEN]; /* register to media manager */ | |
| 107 | + | |
| 108 | + __u32 flags; | |
| 109 | +}; | |
| 110 | + | |
| 111 | +enum { | |
| 112 | + NVM_FACTORY_ERASE_ONLY_USER = 1 << 0, /* erase only blocks used as | |
| 113 | + * host blks or grown blks */ | |
| 114 | + NVM_FACTORY_RESET_HOST_BLKS = 1 << 1, /* remove host blk marks */ | |
| 115 | + NVM_FACTORY_RESET_GRWN_BBLKS = 1 << 2, /* remove grown blk marks */ | |
| 116 | + NVM_FACTORY_NR_BITS = 1 << 3, /* stops here */ | |
| 117 | +}; | |
| 118 | + | |
| 119 | +struct nvm_ioctl_dev_factory { | |
| 120 | + char dev[DISK_NAME_LEN]; | |
| 121 | + | |
| 122 | + __u32 flags; | |
| 123 | +}; | |
| 103 | 124 | |
| 104 | 125 | /* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */ |
| 105 | 126 | enum { |
| @@ -110,6 +131,12 @@ enum { · 4 unmodified lines | ||
| 110 | 131 | /* device level cmds */ |
| 111 | 132 | NVM_DEV_CREATE_CMD, |
| 112 | 133 | NVM_DEV_REMOVE_CMD, |
| 134 | + | |
| 135 | + /* Init a device to support LightNVM media managers */ | |
| 136 | + NVM_DEV_INIT_CMD, | |
| 137 | + | |
| 138 | + /* Factory reset device */ | |
| 139 | + NVM_DEV_FACTORY_CMD, | |
| 113 | 140 | }; |
| 114 | 141 | |
| 115 | 142 | #define NVM_IOCTL 'L' /* 0x4c */ |
| @@ -122,6 +149,10 @@ enum { · 6 unmodified lines | ||
| 122 | 149 | struct nvm_ioctl_create) |
| 123 | 150 | #define NVM_DEV_REMOVE _IOW(NVM_IOCTL, NVM_DEV_REMOVE_CMD, \ |
| 124 | 151 | struct nvm_ioctl_remove) |
| 152 | +#define NVM_DEV_INIT _IOW(NVM_IOCTL, NVM_DEV_INIT_CMD, \ | |
| 153 | + struct nvm_ioctl_dev_init) | |
| 154 | +#define NVM_DEV_FACTORY _IOW(NVM_IOCTL, NVM_DEV_FACTORY_CMD, \ | |
| 155 | + struct nvm_ioctl_dev_factory) | |
| 125 | 156 | |
| 126 | 157 | #define NVM_VERSION_MAJOR 1 |
| 127 | 158 | #define NVM_VERSION_MINOR 0 |