Skip to content

Commit fceb5bc

Browse files
Christoph HellwigNicholas Bellinger
authored andcommitted
iscsit: mark various functions static
This patch marks a number of functions static to appease sparse static checking. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 parent d7ca663 commit fceb5bc

10 files changed

+23
-25
lines changed

drivers/target/iscsi/iscsi_target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ int iscsit_reset_np_thread(
427427
return 0;
428428
}
429429

430-
int iscsit_del_np_comm(struct iscsi_np *np)
430+
static int iscsit_del_np_comm(struct iscsi_np *np)
431431
{
432432
if (np->np_socket)
433433
sock_release(np->np_socket);

drivers/target/iscsi/iscsi_target.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,9 @@ extern struct kmem_cache *lio_cmd_cache;
3838
extern struct kmem_cache *lio_qr_cache;
3939
extern struct kmem_cache *lio_r2t_cache;
4040

41+
extern struct idr sess_idr;
42+
extern struct mutex auth_id_lock;
43+
extern spinlock_t sess_idr_lock;
44+
45+
4146
#endif /*** ISCSI_TARGET_H ***/

drivers/target/iscsi/iscsi_target_configfs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static struct configfs_attribute *lio_target_portal_attrs[] = {
135135

136136
#define MAX_PORTAL_LEN 256
137137

138-
struct se_tpg_np *lio_target_call_addnptotpg(
138+
static struct se_tpg_np *lio_target_call_addnptotpg(
139139
struct se_portal_group *se_tpg,
140140
struct config_group *group,
141141
const char *name)
@@ -1170,7 +1170,7 @@ static struct configfs_attribute *lio_target_tpg_attrs[] = {
11701170

11711171
/* Start items for lio_target_tiqn_cit */
11721172

1173-
struct se_portal_group *lio_target_tiqn_addtpg(
1173+
static struct se_portal_group *lio_target_tiqn_addtpg(
11741174
struct se_wwn *wwn,
11751175
struct config_group *group,
11761176
const char *name)
@@ -1220,7 +1220,7 @@ struct se_portal_group *lio_target_tiqn_addtpg(
12201220
return NULL;
12211221
}
12221222

1223-
void lio_target_tiqn_deltpg(struct se_portal_group *se_tpg)
1223+
static void lio_target_tiqn_deltpg(struct se_portal_group *se_tpg)
12241224
{
12251225
struct iscsi_portal_group *tpg;
12261226
struct iscsi_tiqn *tiqn;
@@ -1252,7 +1252,7 @@ static struct configfs_attribute *lio_target_wwn_attrs[] = {
12521252
NULL,
12531253
};
12541254

1255-
struct se_wwn *lio_target_call_coreaddtiqn(
1255+
static struct se_wwn *lio_target_call_coreaddtiqn(
12561256
struct target_fabric_configfs *tf,
12571257
struct config_group *group,
12581258
const char *name)
@@ -1300,7 +1300,7 @@ struct se_wwn *lio_target_call_coreaddtiqn(
13001300
return &tiqn->tiqn_wwn;
13011301
}
13021302

1303-
void lio_target_call_coredeltiqn(
1303+
static void lio_target_call_coredeltiqn(
13041304
struct se_wwn *wwn)
13051305
{
13061306
struct iscsi_tiqn *tiqn = container_of(wwn, struct iscsi_tiqn, tiqn_wwn);

drivers/target/iscsi/iscsi_target_erl0.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ static int iscsit_dataout_post_crc_failed(
685685
* Called from iscsit_handle_data_out() before DataOUT Payload is received
686686
* and CRC computed.
687687
*/
688-
extern int iscsit_check_pre_dataout(
688+
int iscsit_check_pre_dataout(
689689
struct iscsi_cmd *cmd,
690690
unsigned char *buf)
691691
{
@@ -789,7 +789,7 @@ static void iscsit_handle_time2retain_timeout(unsigned long data)
789789
target_put_session(sess->se_sess);
790790
}
791791

792-
extern void iscsit_start_time2retain_handler(struct iscsi_session *sess)
792+
void iscsit_start_time2retain_handler(struct iscsi_session *sess)
793793
{
794794
int tpg_active;
795795
/*
@@ -822,7 +822,7 @@ extern void iscsit_start_time2retain_handler(struct iscsi_session *sess)
822822
/*
823823
* Called with spin_lock_bh(&struct se_portal_group->session_lock) held
824824
*/
825-
extern int iscsit_stop_time2retain_timer(struct iscsi_session *sess)
825+
int iscsit_stop_time2retain_timer(struct iscsi_session *sess)
826826
{
827827
struct iscsi_portal_group *tpg = ISCSI_TPG_S(sess);
828828
struct se_portal_group *se_tpg = &tpg->tpg_se_tpg;
@@ -926,7 +926,7 @@ static void iscsit_handle_connection_cleanup(struct iscsi_conn *conn)
926926
}
927927
}
928928

929-
extern void iscsit_take_action_for_connection_exit(struct iscsi_conn *conn)
929+
void iscsit_take_action_for_connection_exit(struct iscsi_conn *conn)
930930
{
931931
spin_lock_bh(&conn->state_lock);
932932
if (atomic_read(&conn->connection_exit)) {

drivers/target/iscsi/iscsi_target_erl2.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,13 @@ int iscsit_remove_active_connection_recovery_entry(
193193
return 0;
194194
}
195195

196-
int iscsit_remove_inactive_connection_recovery_entry(
196+
static void iscsit_remove_inactive_connection_recovery_entry(
197197
struct iscsi_conn_recovery *cr,
198198
struct iscsi_session *sess)
199199
{
200200
spin_lock(&sess->cr_i_lock);
201201
list_del(&cr->cr_list);
202202
spin_unlock(&sess->cr_i_lock);
203-
204-
return 0;
205203
}
206204

207205
/*

drivers/target/iscsi/iscsi_target_login.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
#include "iscsi_target.h"
4040
#include "iscsi_target_parameters.h"
4141

42-
extern struct idr sess_idr;
43-
extern struct mutex auth_id_lock;
44-
extern spinlock_t sess_idr_lock;
45-
4642
static int iscsi_login_init_conn(struct iscsi_conn *conn)
4743
{
4844
INIT_LIST_HEAD(&conn->conn_list);

drivers/target/iscsi/iscsi_target_nego.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void convert_null_to_semi(char *buf, int len)
4444
buf[i] = ';';
4545
}
4646

47-
int strlen_semi(char *buf)
47+
static int strlen_semi(char *buf)
4848
{
4949
int i = 0;
5050

drivers/target/iscsi/iscsi_target_tmr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static int iscsit_task_reassign_complete(
462462
* Right now the only one that its really needed for is
463463
* connection recovery releated TASK_REASSIGN.
464464
*/
465-
extern int iscsit_tmr_post_handler(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
465+
int iscsit_tmr_post_handler(struct iscsi_cmd *cmd, struct iscsi_conn *conn)
466466
{
467467
struct iscsi_tmr_req *tmr_req = cmd->tmr_req;
468468
struct se_tmr_req *se_tmr = cmd->se_cmd.se_tmr_req;
@@ -477,7 +477,7 @@ extern int iscsit_tmr_post_handler(struct iscsi_cmd *cmd, struct iscsi_conn *con
477477
/*
478478
* Nothing to do here, but leave it for good measure. :-)
479479
*/
480-
int iscsit_task_reassign_prepare_read(
480+
static int iscsit_task_reassign_prepare_read(
481481
struct iscsi_tmr_req *tmr_req,
482482
struct iscsi_conn *conn)
483483
{
@@ -552,7 +552,7 @@ static void iscsit_task_reassign_prepare_unsolicited_dataout(
552552
}
553553
}
554554

555-
int iscsit_task_reassign_prepare_write(
555+
static int iscsit_task_reassign_prepare_write(
556556
struct iscsi_tmr_req *tmr_req,
557557
struct iscsi_conn *conn)
558558
{

drivers/target/iscsi/iscsi_target_tq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void iscsi_add_ts_to_active_list(struct iscsi_thread_set *ts)
4040
spin_unlock(&active_ts_lock);
4141
}
4242

43-
extern void iscsi_add_ts_to_inactive_list(struct iscsi_thread_set *ts)
43+
static void iscsi_add_ts_to_inactive_list(struct iscsi_thread_set *ts)
4444
{
4545
spin_lock(&inactive_ts_lock);
4646
list_add_tail(&ts->ts_list, &inactive_ts_list);
@@ -76,7 +76,7 @@ static struct iscsi_thread_set *iscsi_get_ts_from_inactive_list(void)
7676
return ts;
7777
}
7878

79-
extern int iscsi_allocate_thread_sets(u32 thread_pair_count)
79+
int iscsi_allocate_thread_sets(u32 thread_pair_count)
8080
{
8181
int allocated_thread_pair_count = 0, i, thread_id;
8282
struct iscsi_thread_set *ts = NULL;
@@ -140,7 +140,7 @@ extern int iscsi_allocate_thread_sets(u32 thread_pair_count)
140140
return allocated_thread_pair_count;
141141
}
142142

143-
extern void iscsi_deallocate_thread_sets(void)
143+
void iscsi_deallocate_thread_sets(void)
144144
{
145145
u32 released_count = 0;
146146
struct iscsi_thread_set *ts = NULL;

drivers/target/iscsi/iscsi_target_tq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Defines for thread sets.
66
*/
77
extern int iscsi_thread_set_force_reinstatement(struct iscsi_conn *);
8-
extern void iscsi_add_ts_to_inactive_list(struct iscsi_thread_set *);
98
extern int iscsi_allocate_thread_sets(u32);
109
extern void iscsi_deallocate_thread_sets(void);
1110
extern void iscsi_activate_thread_set(struct iscsi_conn *, struct iscsi_thread_set *);

0 commit comments

Comments
 (0)