Noone directly calls those functions, so get rid of of the global definitions. Signed-off-by: Joern Engel <joern@xxxxxxxxx> --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 88 ++++++++++++++++++------------------ drivers/scsi/qla2xxx/tcm_qla2xxx.h | 53 --------------------- 2 files changed, 44 insertions(+), 97 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index c8e5b68..5c9a07f 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -57,12 +57,12 @@ extern struct workqueue_struct *tcm_qla2xxx_free_wq; extern struct workqueue_struct *tcm_qla2xxx_cmd_wq; -int tcm_qla2xxx_check_true(struct se_portal_group *se_tpg) +static int tcm_qla2xxx_check_true(struct se_portal_group *se_tpg) { return 1; } -int tcm_qla2xxx_check_false(struct se_portal_group *se_tpg) +static int tcm_qla2xxx_check_false(struct se_portal_group *se_tpg) { return 0; } @@ -73,7 +73,7 @@ int tcm_qla2xxx_check_false(struct se_portal_group *se_tpg) * the name is the same as what would be generated by ft_format_wwn() * so the name and wwn are mapped one-to-one. */ -ssize_t tcm_qla2xxx_parse_wwn(const char *name, u64 *wwn, int strict) +static ssize_t tcm_qla2xxx_parse_wwn(const char *name, u64 *wwn, int strict) { const char *cp; char c; @@ -116,7 +116,7 @@ fail: return -1; } -ssize_t tcm_qla2xxx_format_wwn(char *buf, size_t len, u64 wwn) +static ssize_t tcm_qla2xxx_format_wwn(char *buf, size_t len, u64 wwn) { u8 b[8]; @@ -126,7 +126,7 @@ ssize_t tcm_qla2xxx_format_wwn(char *buf, size_t len, u64 wwn) b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]); } -char *tcm_qla2xxx_get_fabric_name(void) +static char *tcm_qla2xxx_get_fabric_name(void) { return "qla2xxx"; } @@ -162,7 +162,7 @@ static int tcm_qla2xxx_npiv_extract_wwn(const char *ns, u64 *nm) /* * This parsing logic follows drivers/scsi/scsi_transport_fc.c:store_fc_host_vport_create() */ -int tcm_qla2xxx_npiv_parse_wwn( +static int tcm_qla2xxx_npiv_parse_wwn( const char *name, size_t count, u64 *wwpn, @@ -193,7 +193,7 @@ int tcm_qla2xxx_npiv_parse_wwn( return 0; } -ssize_t tcm_qla2xxx_npiv_format_wwn(char *buf, size_t len, u64 wwpn, u64 wwnn) +static ssize_t tcm_qla2xxx_npiv_format_wwn(char *buf, size_t len, u64 wwpn, u64 wwnn) { u8 b[8], b2[8]; @@ -206,12 +206,12 @@ ssize_t tcm_qla2xxx_npiv_format_wwn(char *buf, size_t len, u64 wwpn, u64 wwnn) b2[0], b2[1], b2[2], b2[3], b2[4], b2[5], b2[6], b2[7]); } -char *tcm_qla2xxx_npiv_get_fabric_name(void) +static char *tcm_qla2xxx_npiv_get_fabric_name(void) { return "qla2xxx_npiv"; } -u8 tcm_qla2xxx_get_fabric_proto_ident(struct se_portal_group *se_tpg) +static u8 tcm_qla2xxx_get_fabric_proto_ident(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -228,7 +228,7 @@ u8 tcm_qla2xxx_get_fabric_proto_ident(struct se_portal_group *se_tpg) return proto_id; } -char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg) +static char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -237,7 +237,7 @@ char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *se_tpg) return &lport->lport_name[0]; } -char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg) +static char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -246,19 +246,19 @@ char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *se_tpg) return &lport->lport_npiv_name[0]; } -u16 tcm_qla2xxx_get_tag(struct se_portal_group *se_tpg) +static u16 tcm_qla2xxx_get_tag(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); return tpg->lport_tpgt; } -u32 tcm_qla2xxx_get_default_depth(struct se_portal_group *se_tpg) +static u32 tcm_qla2xxx_get_default_depth(struct se_portal_group *se_tpg) { return 1; } -u32 tcm_qla2xxx_get_pr_transport_id( +static u32 tcm_qla2xxx_get_pr_transport_id( struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct t10_pr_registration *pr_reg, @@ -281,7 +281,7 @@ u32 tcm_qla2xxx_get_pr_transport_id( return ret; } -u32 tcm_qla2xxx_get_pr_transport_id_len( +static u32 tcm_qla2xxx_get_pr_transport_id_len( struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, struct t10_pr_registration *pr_reg, @@ -303,7 +303,7 @@ u32 tcm_qla2xxx_get_pr_transport_id_len( return ret; } -char *tcm_qla2xxx_parse_pr_out_transport_id( +static char *tcm_qla2xxx_parse_pr_out_transport_id( struct se_portal_group *se_tpg, const char *buf, u32 *out_tid_len, @@ -325,7 +325,7 @@ char *tcm_qla2xxx_parse_pr_out_transport_id( return tid; } -int tcm_qla2xxx_check_demo_mode(struct se_portal_group *se_tpg) +static int tcm_qla2xxx_check_demo_mode(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -333,7 +333,7 @@ int tcm_qla2xxx_check_demo_mode(struct se_portal_group *se_tpg) return QLA_TPG_ATTRIB(tpg)->generate_node_acls; } -int tcm_qla2xxx_check_demo_mode_cache(struct se_portal_group *se_tpg) +static int tcm_qla2xxx_check_demo_mode_cache(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -341,7 +341,7 @@ int tcm_qla2xxx_check_demo_mode_cache(struct se_portal_group *se_tpg) return QLA_TPG_ATTRIB(tpg)->cache_dynamic_acls; } -int tcm_qla2xxx_check_demo_write_protect(struct se_portal_group *se_tpg) +static int tcm_qla2xxx_check_demo_write_protect(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -349,7 +349,7 @@ int tcm_qla2xxx_check_demo_write_protect(struct se_portal_group *se_tpg) return QLA_TPG_ATTRIB(tpg)->demo_mode_write_protect; } -int tcm_qla2xxx_check_prod_write_protect(struct se_portal_group *se_tpg) +static int tcm_qla2xxx_check_prod_write_protect(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -370,7 +370,7 @@ struct se_node_acl *tcm_qla2xxx_alloc_fabric_acl(struct se_portal_group *se_tpg) return &nacl->se_node_acl; } -void tcm_qla2xxx_release_fabric_acl( +static void tcm_qla2xxx_release_fabric_acl( struct se_portal_group *se_tpg, struct se_node_acl *se_nacl) { @@ -379,7 +379,7 @@ void tcm_qla2xxx_release_fabric_acl( kfree(nacl); } -u32 tcm_qla2xxx_tpg_get_inst_index(struct se_portal_group *se_tpg) +static u32 tcm_qla2xxx_tpg_get_inst_index(struct se_portal_group *se_tpg) { struct tcm_qla2xxx_tpg *tpg = container_of(se_tpg, struct tcm_qla2xxx_tpg, se_tpg); @@ -418,7 +418,7 @@ static void tcm_qla2xxx_complete_free(struct work_struct *work) * tcm_qla2xxx_release_cmd via normal struct target_core_fabric_ops * release callback. qla_hw_data->hardware_lock is expected to be held */ -void tcm_qla2xxx_free_cmd(struct qla_tgt_cmd *cmd) +static void tcm_qla2xxx_free_cmd(struct qla_tgt_cmd *cmd) { INIT_WORK(&cmd->work, tcm_qla2xxx_complete_free); queue_work(tcm_qla2xxx_free_wq, &cmd->work); @@ -427,7 +427,7 @@ void tcm_qla2xxx_free_cmd(struct qla_tgt_cmd *cmd) /* * Called from struct target_core_fabric_ops->check_stop_free() context */ -int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd) +static int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd) { return target_put_sess_cmd(se_cmd->se_sess, se_cmd); } @@ -435,7 +435,7 @@ int tcm_qla2xxx_check_stop_free(struct se_cmd *se_cmd) /* tcm_qla2xxx_release_cmd - Callback from TCM Core to release underlying fabric descriptor * @se_cmd command to release */ -void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd) +static void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd) { struct qla_tgt_cmd *cmd; @@ -450,7 +450,7 @@ void tcm_qla2xxx_release_cmd(struct se_cmd *se_cmd) qla_tgt_free_cmd(cmd); } -int tcm_qla2xxx_shutdown_session(struct se_session *se_sess) +static int tcm_qla2xxx_shutdown_session(struct se_session *se_sess) { struct qla_tgt_sess *sess = se_sess->fabric_sess_ptr; struct scsi_qla_host *vha; @@ -467,7 +467,7 @@ int tcm_qla2xxx_shutdown_session(struct se_session *se_sess) return 1; } -void tcm_qla2xxx_close_session(struct se_session *se_sess) +static void tcm_qla2xxx_close_session(struct se_session *se_sess) { struct qla_tgt_sess *sess = se_sess->fabric_sess_ptr; struct scsi_qla_host *vha; @@ -481,7 +481,7 @@ void tcm_qla2xxx_close_session(struct se_session *se_sess) spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); } -u32 tcm_qla2xxx_sess_get_index(struct se_session *se_sess) +static u32 tcm_qla2xxx_sess_get_index(struct se_session *se_sess) { return 0; } @@ -511,7 +511,7 @@ static enum dma_data_direction tcm_qla2xxx_mapping_dir(struct se_cmd *se_cmd) } } -int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd) +static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd) { struct qla_tgt_cmd *cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); @@ -527,7 +527,7 @@ int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd) return qla_tgt_rdy_to_xfer(cmd); } -int tcm_qla2xxx_write_pending_status(struct se_cmd *se_cmd) +static int tcm_qla2xxx_write_pending_status(struct se_cmd *se_cmd) { unsigned long flags; /* @@ -546,19 +546,19 @@ int tcm_qla2xxx_write_pending_status(struct se_cmd *se_cmd) return 0; } -void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl) +static void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl) { return; } -u32 tcm_qla2xxx_get_task_tag(struct se_cmd *se_cmd) +static u32 tcm_qla2xxx_get_task_tag(struct se_cmd *se_cmd) { struct qla_tgt_cmd *cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); return cmd->tag; } -int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd) +static int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd) { return 0; } @@ -566,7 +566,7 @@ int tcm_qla2xxx_get_cmd_state(struct se_cmd *se_cmd) /* * Called from process context in qla_target.c:qla_tgt_do_work() code */ -int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, +static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, unsigned char *cdb, uint32_t data_length, int fcp_task_attr, int data_dir, int bidi) { @@ -596,7 +596,7 @@ int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, return 0; } -void tcm_qla2xxx_do_rsp(struct work_struct *work) +static void tcm_qla2xxx_do_rsp(struct work_struct *work) { struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work); /* @@ -608,7 +608,7 @@ void tcm_qla2xxx_do_rsp(struct work_struct *work) /* * Called from qla_target.c:qla_tgt_do_ctio_completion() */ -int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) +static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) { struct se_cmd *se_cmd = &cmd->se_cmd; unsigned long flags; @@ -644,7 +644,7 @@ int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) /* * Called from qla_target.c:qla_tgt_issue_task_mgmt() */ -int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun, +static int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun, uint8_t tmr_func, uint32_t tag) { struct qla_tgt_sess *sess = mcmd->sess; @@ -654,7 +654,7 @@ int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun, tmr_func, GFP_ATOMIC, tag, TARGET_SCF_ACK_KREF); } -int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) +static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) { struct qla_tgt_cmd *cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); @@ -672,7 +672,7 @@ int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) se_cmd->scsi_status); } -int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) +static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) { struct qla_tgt_cmd *cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); int xmit_type = QLA_TGT_XMIT_STATUS; @@ -700,7 +700,7 @@ int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) return qla_tgt_xmit_response(cmd, xmit_type, se_cmd->scsi_status); } -int tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) +static int tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) { struct se_tmr_req *se_tmr = se_cmd->se_tmr_req; struct qla_tgt_mgmt_cmd *mcmd = container_of(se_cmd, @@ -736,12 +736,12 @@ int tcm_qla2xxx_queue_tm_rsp(struct se_cmd *se_cmd) return 0; } -u16 tcm_qla2xxx_get_fabric_sense_len(void) +static u16 tcm_qla2xxx_get_fabric_sense_len(void) { return 0; } -u16 tcm_qla2xxx_set_fabric_sense_len(struct se_cmd *se_cmd, u32 sense_length) +static u16 tcm_qla2xxx_set_fabric_sense_len(struct se_cmd *se_cmd, u32 sense_length) { return 0; } @@ -816,7 +816,7 @@ static int tcm_qla2xxx_setup_nacl_from_rport( /* * Expected to be called with struct qla_hw_data->hardware_lock held */ -void tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess) +static void tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess) { struct se_node_acl *se_nacl = sess->se_sess->se_node_acl; struct se_portal_group *se_tpg = se_nacl->se_tpg; @@ -850,7 +850,7 @@ void tcm_qla2xxx_clear_nacl_from_fcport_map(struct qla_tgt_sess *sess) nacl->nport_id); } -void tcm_qla2xxx_put_sess(struct qla_tgt_sess *sess) +static void tcm_qla2xxx_put_sess(struct qla_tgt_sess *sess) { target_put_session(sess->se_sess); } diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.h b/drivers/scsi/qla2xxx/tcm_qla2xxx.h index 41730ed..1822a44 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.h +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.h @@ -94,56 +94,3 @@ struct tcm_qla2xxx_lport { /* Returned by tcm_qla2xxx_make_lport() */ struct se_wwn lport_wwn; }; - -extern int tcm_qla2xxx_check_true(struct se_portal_group *); -extern int tcm_qla2xxx_check_false(struct se_portal_group *); -extern ssize_t tcm_qla2xxx_parse_wwn(const char *, u64 *, int); -extern ssize_t tcm_qla2xxx_format_wwn(char *, size_t, u64); -extern char *tcm_qla2xxx_get_fabric_name(void); -extern int tcm_qla2xxx_npiv_parse_wwn(const char *name, size_t, u64 *, u64 *); -extern ssize_t tcm_qla2xxx_npiv_format_wwn(char *, size_t, u64, u64); -extern char *tcm_qla2xxx_npiv_get_fabric_name(void); -extern u8 tcm_qla2xxx_get_fabric_proto_ident(struct se_portal_group *); -extern char *tcm_qla2xxx_get_fabric_wwn(struct se_portal_group *); -extern char *tcm_qla2xxx_npiv_get_fabric_wwn(struct se_portal_group *); -extern u16 tcm_qla2xxx_get_tag(struct se_portal_group *); -extern u32 tcm_qla2xxx_get_default_depth(struct se_portal_group *); -extern u32 tcm_qla2xxx_get_pr_transport_id(struct se_portal_group *, struct se_node_acl *, - struct t10_pr_registration *, int *, unsigned char *); -extern u32 tcm_qla2xxx_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *, - struct t10_pr_registration *, int *); -extern char *tcm_qla2xxx_parse_pr_out_transport_id(struct se_portal_group *, const char *, - u32 *, char **); -extern int tcm_qla2xxx_check_demo_mode(struct se_portal_group *); -extern int tcm_qla2xxx_check_demo_mode_cache(struct se_portal_group *); -extern int tcm_qla2xxx_check_demo_write_protect(struct se_portal_group *); -extern int tcm_qla2xxx_check_prod_write_protect(struct se_portal_group *); -extern struct se_node_acl *tcm_qla2xxx_alloc_fabric_acl(struct se_portal_group *); -extern void tcm_qla2xxx_release_fabric_acl(struct se_portal_group *, struct se_node_acl *); -extern u32 tcm_qla2xxx_tpg_get_inst_index(struct se_portal_group *); -extern void tcm_qla2xxx_free_cmd(struct qla_tgt_cmd *); -extern int tcm_qla2xxx_check_stop_free(struct se_cmd *); -extern void tcm_qla2xxx_release_cmd(struct se_cmd *); -extern int tcm_qla2xxx_shutdown_session(struct se_session *); -extern void tcm_qla2xxx_close_session(struct se_session *); -extern void tcm_qla2xxx_stop_session(struct se_session *, int, int); -extern void tcm_qla2xxx_reset_nexus(struct se_session *); -extern int tcm_qla2xxx_sess_logged_in(struct se_session *); -extern u32 tcm_qla2xxx_sess_get_index(struct se_session *); -extern int tcm_qla2xxx_write_pending(struct se_cmd *); -extern int tcm_qla2xxx_write_pending_status(struct se_cmd *); -extern void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *); -extern u32 tcm_qla2xxx_get_task_tag(struct se_cmd *); -extern int tcm_qla2xxx_get_cmd_state(struct se_cmd *); -extern int tcm_qla2xxx_handle_cmd(struct scsi_qla_host *, struct qla_tgt_cmd *, - unsigned char *, uint32_t, int, int, int); -extern int tcm_qla2xxx_new_cmd_map(struct se_cmd *); -extern int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *); -extern int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *, uint32_t, - uint8_t, uint32_t); -extern int tcm_qla2xxx_queue_data_in(struct se_cmd *); -extern int tcm_qla2xxx_queue_status(struct se_cmd *); -extern int tcm_qla2xxx_queue_tm_rsp(struct se_cmd *); -extern u16 tcm_qla2xxx_get_fabric_sense_len(void); -extern u16 tcm_qla2xxx_set_fabric_sense_len(struct se_cmd *, u32); -extern int tcm_qla2xxx_is_state_remove(struct se_cmd *); -- 1.7.9.1 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html