mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
lightnvm: introduce ioctl to initialize device
Based on the previous patch, we now introduce an ioctl to initialize the device using nvm_init_sysblock and create the necessary system blocks. The user may specify the media manager that they wish to instantiate on top. Default from user-space will be "gennvm". Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
e3eb3799f7
commit
5569615424
2 changed files with 61 additions and 0 deletions
|
@ -101,6 +101,12 @@ struct nvm_ioctl_remove {
|
|||
__u32 flags;
|
||||
};
|
||||
|
||||
struct nvm_ioctl_dev_init {
|
||||
char dev[DISK_NAME_LEN]; /* open-channel SSD device */
|
||||
char mmtype[NVM_MMTYPE_LEN]; /* register to media manager */
|
||||
|
||||
__u32 flags;
|
||||
};
|
||||
|
||||
/* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */
|
||||
enum {
|
||||
|
@ -111,6 +117,9 @@ enum {
|
|||
/* device level cmds */
|
||||
NVM_DEV_CREATE_CMD,
|
||||
NVM_DEV_REMOVE_CMD,
|
||||
|
||||
/* Init a device to support LightNVM media managers */
|
||||
NVM_DEV_INIT_CMD,
|
||||
};
|
||||
|
||||
#define NVM_IOCTL 'L' /* 0x4c */
|
||||
|
@ -123,6 +132,8 @@ enum {
|
|||
struct nvm_ioctl_create)
|
||||
#define NVM_DEV_REMOVE _IOW(NVM_IOCTL, NVM_DEV_REMOVE_CMD, \
|
||||
struct nvm_ioctl_remove)
|
||||
#define NVM_DEV_INIT _IOW(NVM_IOCTL, NVM_DEV_INIT_CMD, \
|
||||
struct nvm_ioctl_dev_init)
|
||||
|
||||
#define NVM_VERSION_MAJOR 1
|
||||
#define NVM_VERSION_MINOR 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue