aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/lightnvm.h
diff options
context:
space:
mode:
authorMatias Bjørling <m@bjorling.me>2016-07-07 09:54:16 +0200
committerJens Axboe <axboe@fb.com>2016-07-07 08:51:52 -0600
commitb76eb20bb0c6f4f9c2e1ad493f73c52817b8aaff (patch)
treeb066ae87ea129c6b01bcab50e24efc8acb3e62b0 /include/linux/lightnvm.h
parentlightnvm: rename gennvm and update description (diff)
downloadwireguard-linux-b76eb20bb0c6f4f9c2e1ad493f73c52817b8aaff.tar.xz
wireguard-linux-b76eb20bb0c6f4f9c2e1ad493f73c52817b8aaff.zip
lightnvm: move target mgmt into media mgr
To enable persistent block management to easily control creation and removal of targets, we move target management into the media manager. The LightNVM core continues to maintain which target types are registered, while the media manager now keeps track of its initialized targets. Two new callbacks for the media manager are introduced. create_tgt and remove_tgt. Note that remove_tgt returns 0 on successfully removing a target, and returns 1 if the target was not found. 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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index 8b51d5767331..d619f6dde7df 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -1,7 +1,9 @@
#ifndef NVM_H
#define NVM_H
+#include <linux/blkdev.h>
#include <linux/types.h>
+#include <uapi/linux/lightnvm.h>
enum {
NVM_IO_OK = 0,
@@ -447,6 +449,8 @@ struct nvm_tgt_type {
struct list_head list;
};
+extern struct nvm_tgt_type *nvm_find_target_type(const char *, int);
+
extern int nvm_register_tgt_type(struct nvm_tgt_type *);
extern void nvm_unregister_tgt_type(struct nvm_tgt_type *);
@@ -455,6 +459,9 @@ extern void nvm_dev_dma_free(struct nvm_dev *, void *, dma_addr_t);
typedef int (nvmm_register_fn)(struct nvm_dev *);
typedef void (nvmm_unregister_fn)(struct nvm_dev *);
+
+typedef int (nvmm_create_tgt_fn)(struct nvm_dev *, struct nvm_ioctl_create *);
+typedef int (nvmm_remove_tgt_fn)(struct nvm_dev *, struct nvm_ioctl_remove *);
typedef struct nvm_block *(nvmm_get_blk_fn)(struct nvm_dev *,
struct nvm_lun *, unsigned long);
typedef void (nvmm_put_blk_fn)(struct nvm_dev *, struct nvm_block *);
@@ -480,6 +487,9 @@ struct nvmm_type {
nvmm_register_fn *register_mgr;
nvmm_unregister_fn *unregister_mgr;
+ nvmm_create_tgt_fn *create_tgt;
+ nvmm_remove_tgt_fn *remove_tgt;
+
/* Block administration callbacks */
nvmm_get_blk_fn *get_blk_unlocked;
nvmm_put_blk_fn *put_blk_unlocked;