};
#ifdef CONFIG_SCST_DEBUG
-void iscsi_dump_iov(struct msghdr *msg)
-{
- if (trace_flag & TRACE_D_IOV) {
- int i;
- printk(LOG_FLAG "%p, %zd\n", msg->msg_iov, msg->msg_iovlen);
- for (i = 0; i < min_t(size_t, msg->msg_iovlen,
- ISCSI_CONN_IOV_MAX); i++) {
- printk(LOG_FLAG "%d: %p,%zd\n",
- i, msg->msg_iov[i].iov_base,
- msg->msg_iov[i].iov_len);
- }
- }
-}
-
static void iscsi_dump_char(int ch)
{
static unsigned char text[16];
static void cmnd_prepare_get_rejected_cmd_data(struct iscsi_cmnd *cmnd);
static void iscsi_check_send_delayed_tm_resp(struct iscsi_session *sess);
static void iscsi_session_push_cmnd(struct iscsi_cmnd *cmnd);
+static void req_cmnd_release(struct iscsi_cmnd *req);
static inline u32 cmnd_write_size(struct iscsi_cmnd *cmnd)
{
* Corresponding conn may also gets destroyed atfer this function, except only
* if it's called from the read thread!
*/
-void req_cmnd_release(struct iscsi_cmnd *req)
+static void req_cmnd_release(struct iscsi_cmnd *req)
{
struct iscsi_cmnd *c, *t;
extern void cmnd_rx_end(struct iscsi_cmnd *);
extern void cmnd_tx_start(struct iscsi_cmnd *);
extern void cmnd_tx_end(struct iscsi_cmnd *);
-extern void req_cmnd_release(struct iscsi_cmnd *req);
extern void req_cmnd_release_force(struct iscsi_cmnd *req, int flags);
extern void rsp_cmnd_release(struct iscsi_cmnd *);
extern void cmnd_done(struct iscsi_cmnd *cmnd);
#endif
#ifdef CONFIG_SCST_DEBUG
-struct msghdr;
struct iscsi_pdu;
-extern void iscsi_dump_iov(struct msghdr *msg);
extern void iscsi_dump_pdu(struct iscsi_pdu *pdu);
#else
-#define iscsi_dump_iov(x) do {} while (0)
#define iscsi_dump_pdu(x) do {} while (0)
#endif
void scst_set_sense(uint8_t *buffer, int len, int key,
int asc, int ascq);
-void scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense,
- unsigned int len);
-
/*
* Returnes a pseudo-random number for debugging purposes. Available only in
* the DEBUG build.
static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev);
static void scst_check_internal_sense(struct scst_device *dev, int result,
uint8_t *sense, int sense_len);
+static void scst_alloc_set_UA(struct scst_tgt_dev *tgt_dev,
+ const uint8_t *sense, int sense_len, int head);
+static void scst_free_all_UA(struct scst_tgt_dev *tgt_dev);
+static void scst_release_space(struct scst_cmd *cmd);
+static void scst_sess_free_tgt_devs(struct scst_session *sess);
+static void scst_unblock_cmds(struct scst_device *dev);
+
+#ifdef CONFIG_SCST_DEBUG_TM
+static void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev,
+ struct scst_acg_dev *acg_dev);
+static void tm_dbg_deinit_tgt_dev(struct scst_tgt_dev *tgt_dev);
+#else
+static inline void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev,
+ struct scst_acg_dev *acg_dev) {}
+static inline void tm_dbg_deinit_tgt_dev(struct scst_tgt_dev *tgt_dev) {}
+#endif /* CONFIG_SCST_DEBUG_TM */
int scst_alloc_sense(struct scst_cmd *cmd, int atomic)
{
}
EXPORT_SYMBOL(scst_set_sense);
-void scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense,
+static void scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense,
unsigned int len)
{
TRACE_ENTRY();
return res;
}
-struct scst_cmd *scst_create_prepare_internal_cmd(
+static struct scst_cmd *scst_create_prepare_internal_cmd(
struct scst_cmd *orig_cmd, int bufsize)
{
struct scst_cmd *res;
return res;
}
-void scst_free_internal_cmd(struct scst_cmd *cmd)
+static void scst_free_internal_cmd(struct scst_cmd *cmd)
{
TRACE_ENTRY();
}
/* No locks */
-void scst_block_dev(struct scst_device *dev, int outstanding)
+static void scst_block_dev(struct scst_device *dev, int outstanding)
{
spin_lock_bh(&dev->dev_lock);
__scst_block_dev(dev);
*/
struct mutex scst_mutex;
-struct list_head scst_template_list;
+ /* All 3 protected by scst_mutex */
+static struct list_head scst_template_list;
struct list_head scst_dev_list;
struct list_head scst_dev_type_list;
wait_queue_head_t scst_dev_cmd_waitQ;
-struct mutex scst_suspend_mutex;
-struct list_head scst_cmd_lists_list;
+static struct mutex scst_suspend_mutex;
+/* protected by scst_suspend_mutex */
+static struct list_head scst_cmd_lists_list;
static int scst_threads;
struct scst_threads_info_t scst_threads_info;
#endif
#endif
-unsigned int scst_max_cmd_mem;
+static unsigned int scst_max_cmd_mem;
unsigned int scst_max_dev_cmd_mem;
module_param_named(scst_threads, scst_threads, int, 0);
}
TRACE_EXIT();
+ return;
}
void sgv_pool_set_allocator(struct sgv_pool *pool,
#define SCST_TGT_RETRY_TIMEOUT (3/2*HZ)
-extern unsigned int scst_max_cmd_mem;
extern unsigned int scst_max_dev_cmd_mem;
extern mempool_t *scst_mgmt_mempool;
extern unsigned long scst_flags;
extern struct mutex scst_mutex;
extern atomic_t scst_cmd_count;
-extern struct list_head scst_template_list; /* protected by scst_mutex */
-extern struct list_head scst_dev_list; /* protected by scst_mutex */
-extern struct list_head scst_dev_type_list; /* protected by scst_mutex */
+extern struct list_head scst_dev_list;
+extern struct list_head scst_dev_type_list;
extern wait_queue_head_t scst_dev_cmd_waitQ;
-extern struct mutex scst_suspend_mutex;
-/* protected by scst_suspend_mutex */
-extern struct list_head scst_cmd_lists_list;
-
extern struct list_head scst_acg_list;
extern struct scst_acg *scst_default_acg;
struct scst_acg *scst_alloc_add_acg(const char *acg_name);
int scst_destroy_acg(struct scst_acg *acg);
-int scst_proc_group_add_tree(struct scst_acg *acg, const char *name);
-void scst_proc_del_acg_tree(struct proc_dir_entry *acg_proc_root,
- const char *name);
int scst_sess_alloc_tgt_devs(struct scst_session *sess);
-void scst_sess_free_tgt_devs(struct scst_session *sess);
void scst_nexus_loss(struct scst_tgt_dev *tgt_dev);
int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev,
int scst_acg_add_name(struct scst_acg *acg, const char *name);
int scst_acg_remove_name(struct scst_acg *acg, const char *name);
-struct scst_cmd *scst_create_prepare_internal_cmd(
- struct scst_cmd *orig_cmd, int bufsize);
-void scst_free_internal_cmd(struct scst_cmd *cmd);
int scst_prepare_request_sense(struct scst_cmd *orig_cmd);
struct scst_cmd *scst_complete_request_sense(struct scst_cmd *cmd);
return;
}
-void scst_proccess_redirect_cmd(struct scst_cmd *cmd,
- enum scst_exec_context context, int check_retries);
void scst_check_retries(struct scst_tgt *tgt);
void scst_tgt_retry_timer_fn(unsigned long arg);
#endif
int scst_alloc_space(struct scst_cmd *cmd);
-void scst_release_space(struct scst_cmd *cmd);
void scst_scsi_op_list_init(void);
enum scst_sg_copy_dir {
uint64_t scst_unpack_lun(const uint8_t *lun, int len);
-struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
- uint64_t tag);
-
struct scst_mgmt_cmd *scst_alloc_mgmt_cmd(gfp_t gfp_mask);
void scst_free_mgmt_cmd(struct scst_mgmt_cmd *mcmd);
void scst_done_cmd_mgmt(struct scst_cmd *cmd);
void scst_check_set_UA(struct scst_tgt_dev *tgt_dev,
const uint8_t *sense, int sense_len, int head);
-void scst_alloc_set_UA(struct scst_tgt_dev *tgt_dev, const uint8_t *sense,
- int sense_len, int head);
-void scst_free_all_UA(struct scst_tgt_dev *tgt_dev);
int scst_set_pending_UA(struct scst_cmd *cmd);
void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd,
*/
extern int scst_inc_on_dev_cmd(struct scst_cmd *cmd);
-extern void scst_unblock_cmds(struct scst_device *dev);
extern void __scst_block_dev(struct scst_device *dev);
-extern void scst_block_dev(struct scst_device *dev, int outstanding);
extern void scst_block_dev_cmd(struct scst_cmd *cmd, int outstanding);
extern void scst_unblock_dev(struct scst_device *dev);
extern void scst_unblock_dev_cmd(struct scst_cmd *cmd);
}
#ifdef CONFIG_SCST_DEBUG_TM
-extern void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev,
- struct scst_acg_dev *acg_dev);
-extern void tm_dbg_deinit_tgt_dev(struct scst_tgt_dev *tgt_dev);
extern void tm_dbg_check_released_cmds(void);
extern int tm_dbg_check_cmd(struct scst_cmd *cmd);
extern void tm_dbg_release_cmd(struct scst_cmd *cmd);
int force);
extern int tm_dbg_is_release(void);
#else
-static inline void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev,
- struct scst_acg_dev *acg_dev) {}
-static inline void tm_dbg_deinit_tgt_dev(struct scst_tgt_dev *tgt_dev) {}
static inline void tm_dbg_check_released_cmds(void) {}
static inline int tm_dbg_check_cmd(struct scst_cmd *cmd)
{
return;
}
-int scst_proc_group_add_tree(struct scst_acg *acg, const char *name)
+static int scst_proc_group_add_tree(struct scst_acg *acg, const char *name)
{
int res = 0;
struct proc_dir_entry *generic;
goto out;
}
-void scst_proc_del_acg_tree(struct proc_dir_entry *acg_proc_root,
+static void scst_proc_del_acg_tree(struct proc_dir_entry *acg_proc_root,
const char *name)
{
TRACE_ENTRY();
static void scst_cmd_set_sn(struct scst_cmd *cmd);
static int __scst_init_cmd(struct scst_cmd *cmd);
static void scst_finish_cmd_mgmt(struct scst_cmd *cmd);
+static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
+ uint64_t tag);
+static void scst_proccess_redirect_cmd(struct scst_cmd *cmd,
+ enum scst_exec_context context, int check_retries);
static inline void scst_schedule_tasklet(struct scst_cmd *cmd)
{