diff options
author | Christoph Hellwig <hch@lst.de> | 2015-05-10 18:14:56 +0200 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-06-01 00:25:34 -0700 |
commit | 0a06d4309dc168dfa70cec3cf0cd9eb7fc15a2fd (patch) | |
tree | 38dda3f7dc5e049761c80b55796e48cacbb6924c /drivers/target/target_core_internal.h | |
parent | 4624773765699ac3f4e0b918306b638cba385713 (diff) | |
download | talos-op-linux-0a06d4309dc168dfa70cec3cf0cd9eb7fc15a2fd.tar.gz talos-op-linux-0a06d4309dc168dfa70cec3cf0cd9eb7fc15a2fd.zip |
target: simplify backend driver registration
Rewrite the backend driver registration based on what we did to the fabric
drivers: introduce a read-only struct target_bakckend_ops that the driver
registers, which is then instanciate as a struct target_backend by the
core. This allows the ops vector to be smaller and allows us to mark it
const. At the same time the registration function can set up the
configfs attributes, avoiding the need to add additional boilerplate code
for that to the drivers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_internal.h')
-rw-r--r-- | drivers/target/target_core_internal.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_internal.h index ce80ca76f68b..01181aed67dc 100644 --- a/drivers/target/target_core_internal.h +++ b/drivers/target/target_core_internal.h @@ -1,6 +1,19 @@ #ifndef TARGET_CORE_INTERNAL_H #define TARGET_CORE_INTERNAL_H +struct target_backend { + struct list_head list; + + const struct target_backend_ops *ops; + + struct config_item_type tb_dev_cit; + struct config_item_type tb_dev_attrib_cit; + struct config_item_type tb_dev_pr_cit; + struct config_item_type tb_dev_wwn_cit; + struct config_item_type tb_dev_alua_tg_pt_gps_cit; + struct config_item_type tb_dev_stat_cit; +}; + /* target_core_alua.c */ extern struct t10_alua_lu_gp *default_lu_gp; @@ -40,6 +53,9 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name); int target_configure_device(struct se_device *dev); void target_free_device(struct se_device *); +/* target_core_configfs.c */ +void target_setup_backend_cits(struct target_backend *); + /* target_core_fabric_lib.c */ int target_get_pr_transport_id_len(struct se_node_acl *nacl, struct t10_pr_registration *pr_reg, int *format_code); |