mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-20 22:26:23 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
+18
-20
@@ -146,36 +146,34 @@ extern struct fc4_prov ft_prov;
|
||||
/*
|
||||
* SCST interface.
|
||||
*/
|
||||
int ft_send_response(struct scst_cmd *);
|
||||
int ft_send_xfer_rdy(struct scst_cmd *);
|
||||
void ft_cmd_timeout(struct scst_cmd *);
|
||||
void ft_cmd_free(struct scst_cmd *);
|
||||
void ft_cmd_tm_done(struct scst_mgmt_cmd *);
|
||||
int ft_tgt_release(struct scst_tgt *);
|
||||
int ft_tgt_enable(struct scst_tgt *, bool);
|
||||
bool ft_tgt_enabled(struct scst_tgt *);
|
||||
int ft_report_aen(struct scst_aen *);
|
||||
int ft_get_transport_id(struct scst_tgt *, struct scst_session *, uint8_t **);
|
||||
int ft_send_response(struct scst_cmd *cmd);
|
||||
int ft_send_xfer_rdy(struct scst_cmd *cmd);
|
||||
void ft_cmd_timeout(struct scst_cmd *cmd);
|
||||
void ft_cmd_free(struct scst_cmd *cmd);
|
||||
void ft_cmd_tm_done(struct scst_mgmt_cmd *mcmd);
|
||||
int ft_tgt_release(struct scst_tgt *tgt);
|
||||
int ft_tgt_enable(struct scst_tgt *tgt, bool enable);
|
||||
bool ft_tgt_enabled(struct scst_tgt *tgt);
|
||||
int ft_report_aen(struct scst_aen *aen);
|
||||
int ft_get_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess,
|
||||
uint8_t **result);
|
||||
|
||||
/*
|
||||
* Session interface.
|
||||
*/
|
||||
int ft_lport_notify(struct notifier_block *, unsigned long, void *);
|
||||
void ft_lport_add(struct fc_lport *, void *);
|
||||
void ft_lport_del(struct fc_lport *, void *);
|
||||
int ft_lport_notify(struct notifier_block *nb, unsigned long event, void *arg);
|
||||
void ft_lport_add(struct fc_lport *lport, void *arg);
|
||||
void ft_lport_del(struct fc_lport *lport, void *arg);
|
||||
|
||||
/*
|
||||
* other internal functions.
|
||||
*/
|
||||
int ft_thread(void *);
|
||||
bool ft_test_and_set_cmd_state(struct ft_cmd *fcmd, enum ft_cmd_state old,
|
||||
enum ft_cmd_state new);
|
||||
void ft_recv_req(struct ft_sess *, struct fc_frame *);
|
||||
void ft_recv_write_data(struct scst_cmd *, struct fc_frame *);
|
||||
int ft_send_read_data(struct scst_cmd *);
|
||||
struct ft_tpg *ft_lport_find_tpg(struct fc_lport *);
|
||||
struct ft_node_acl *ft_acl_get(struct ft_tpg *, struct fc_rport_priv *);
|
||||
void ft_cmd_dump(struct scst_cmd *, const char *);
|
||||
void ft_recv_req(struct ft_sess *sess, struct fc_frame *fp);
|
||||
void ft_recv_write_data(struct scst_cmd *cmd, struct fc_frame *fp);
|
||||
int ft_send_read_data(struct scst_cmd *cmd);
|
||||
void ft_cmd_dump(struct scst_cmd *cmd, const char *caller);
|
||||
|
||||
/* #define FCST_INJECT_SEND_ERRORS 2 */
|
||||
|
||||
|
||||
+30
-26
@@ -540,15 +540,15 @@ extern struct kmem_cache *iscsi_conn_cache;
|
||||
extern struct kmem_cache *iscsi_sess_cache;
|
||||
|
||||
/* iscsi.c */
|
||||
extern struct iscsi_cmnd *cmnd_alloc(struct iscsi_conn *,
|
||||
extern struct iscsi_cmnd *cmnd_alloc(struct iscsi_conn *conn,
|
||||
struct iscsi_cmnd *parent);
|
||||
extern int cmnd_rx_start(struct iscsi_cmnd *);
|
||||
extern int cmnd_rx_start(struct iscsi_cmnd *cmnd);
|
||||
extern int cmnd_rx_continue(struct iscsi_cmnd *req);
|
||||
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 cmnd_rx_end(struct iscsi_cmnd *cmnd);
|
||||
extern void cmnd_tx_start(struct iscsi_cmnd *cmnd);
|
||||
extern void cmnd_tx_end(struct iscsi_cmnd *cmnd);
|
||||
extern void req_cmnd_release_force(struct iscsi_cmnd *req);
|
||||
extern void rsp_cmnd_release(struct iscsi_cmnd *);
|
||||
extern void rsp_cmnd_release(struct iscsi_cmnd *cmnd);
|
||||
extern void iscsi_drop_delayed_tm_rsp(struct iscsi_cmnd *tm_rsp);
|
||||
extern void cmnd_done(struct iscsi_cmnd *cmnd);
|
||||
extern void conn_abort(struct iscsi_conn *conn);
|
||||
@@ -567,19 +567,21 @@ extern void iscsi_threads_pool_put(struct iscsi_thread_pool *p);
|
||||
#ifndef CONFIG_SCST_PROC
|
||||
extern struct kobj_type iscsi_conn_ktype;
|
||||
#endif
|
||||
extern struct iscsi_conn *conn_lookup(struct iscsi_session *, u16);
|
||||
extern void conn_reinst_finished(struct iscsi_conn *);
|
||||
extern int __add_conn(struct iscsi_session *, struct iscsi_kern_conn_info *);
|
||||
extern int __del_conn(struct iscsi_session *, struct iscsi_kern_conn_info *);
|
||||
extern void conn_free(struct iscsi_conn *);
|
||||
extern struct iscsi_conn *conn_lookup(struct iscsi_session *session, u16 cid);
|
||||
extern void conn_reinst_finished(struct iscsi_conn *conn);
|
||||
extern int __add_conn(struct iscsi_session *session,
|
||||
struct iscsi_kern_conn_info *info);
|
||||
extern int __del_conn(struct iscsi_session *session,
|
||||
struct iscsi_kern_conn_info *info);
|
||||
extern void conn_free(struct iscsi_conn *conn);
|
||||
extern void iscsi_make_conn_rd_active(struct iscsi_conn *conn);
|
||||
#define ISCSI_CONN_ACTIVE_CLOSE 1
|
||||
#define ISCSI_CONN_DELETING 2
|
||||
extern void __mark_conn_closed(struct iscsi_conn *, int);
|
||||
extern void mark_conn_closed(struct iscsi_conn *);
|
||||
extern void iscsi_make_conn_wr_active(struct iscsi_conn *);
|
||||
extern void __mark_conn_closed(struct iscsi_conn *conn, int flags);
|
||||
extern void mark_conn_closed(struct iscsi_conn *conn);
|
||||
extern void iscsi_make_conn_wr_active(struct iscsi_conn *conn);
|
||||
#ifdef CONFIG_SCST_PROC
|
||||
extern void conn_info_show(struct seq_file *, struct iscsi_session *);
|
||||
extern void conn_info_show(struct seq_file *seq, struct iscsi_session *session);
|
||||
#endif
|
||||
extern void iscsi_check_tm_data_wait_timeouts(struct iscsi_conn *conn,
|
||||
bool force);
|
||||
@@ -607,8 +609,8 @@ extern ssize_t iscsi_sysfs_send_event(uint32_t tid,
|
||||
enum iscsi_kern_event_code code,
|
||||
const char *param1, const char *param2, void **data);
|
||||
#endif
|
||||
extern struct iscsi_target *target_lookup_by_id(u32);
|
||||
extern int __add_target(struct iscsi_kern_target_info *);
|
||||
extern struct iscsi_target *target_lookup_by_id(u32 id);
|
||||
extern int __add_target(struct iscsi_kern_target_info *info);
|
||||
extern int __del_target(u32 id);
|
||||
extern ssize_t iscsi_sysfs_add_target(const char *target_name, char *params);
|
||||
extern ssize_t iscsi_sysfs_del_target(const char *target_name);
|
||||
@@ -637,23 +639,25 @@ extern const struct attribute *iscsi_sess_attrs[];
|
||||
extern const struct attribute *iscsi_acg_attrs[];
|
||||
#endif
|
||||
extern const struct file_operations session_seq_fops;
|
||||
extern struct iscsi_session *session_lookup(struct iscsi_target *, u64);
|
||||
extern void sess_reinst_finished(struct iscsi_session *);
|
||||
extern int __add_session(struct iscsi_target *,
|
||||
struct iscsi_kern_session_info *);
|
||||
extern int __del_session(struct iscsi_target *, u64);
|
||||
extern struct iscsi_session *session_lookup(struct iscsi_target *target,
|
||||
u64 sid);
|
||||
extern void sess_reinst_finished(struct iscsi_session *session);
|
||||
extern int __add_session(struct iscsi_target *target,
|
||||
struct iscsi_kern_session_info *info);
|
||||
extern int __del_session(struct iscsi_target *target, u64 sid);
|
||||
extern int session_free(struct iscsi_session *session, bool del);
|
||||
extern void iscsi_sess_force_close(struct iscsi_session *sess);
|
||||
|
||||
/* params.c */
|
||||
extern const char *iscsi_get_digest_name(int val, char *res);
|
||||
extern const char *iscsi_get_bool_value(int val);
|
||||
extern int iscsi_params_set(struct iscsi_target *,
|
||||
struct iscsi_kern_params_info *, int);
|
||||
extern int iscsi_params_set(struct iscsi_target *target,
|
||||
struct iscsi_kern_params_info *info, int set);
|
||||
|
||||
/* event.c */
|
||||
extern int event_send(u32, u64, u32, u32, enum iscsi_kern_event_code,
|
||||
const char *param1, const char *param2);
|
||||
extern int event_send(u32 tid, u64 sid, u32 cid, u32 cookie,
|
||||
enum iscsi_kern_event_code code,
|
||||
const char *param1, const char *param2);
|
||||
extern int event_init(void);
|
||||
extern void event_exit(void);
|
||||
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
ABT_DETAILS="x86_64"
|
||||
ABT_JOBS=5
|
||||
ABT_KERNELS=" \
|
||||
4.13.4 \
|
||||
4.14 \
|
||||
4.13.12-nc \
|
||||
4.12.14-nc \
|
||||
4.11.12-nc \
|
||||
4.10.17-nc \
|
||||
4.9.45-nc \
|
||||
4.9.61-nc \
|
||||
4.8.17-nc \
|
||||
4.7.10-nc \
|
||||
4.6.7-nc \
|
||||
|
||||
@@ -746,4 +746,27 @@ static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <scsi/scsi_request.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
||||
static inline struct request *scsi_req(struct request *rq)
|
||||
{
|
||||
return rq;
|
||||
}
|
||||
|
||||
static inline void scsi_req_init(struct request *rq)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
|
||||
rq->cmd_type = REQ_TYPE_BLOCK_PC;
|
||||
rq->__data_len = 0;
|
||||
rq->__sector = (sector_t) -1;
|
||||
rq->bio = rq->biotail = NULL;
|
||||
memset(rq->__cmd, 0, sizeof(rq->__cmd));
|
||||
rq->cmd = rq->__cmd;
|
||||
#else
|
||||
return blk_rq_set_block_pc(rq);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SCST_BACKPORT_H_ */
|
||||
|
||||
+4
-3
@@ -5532,7 +5532,7 @@ static inline void prepare_to_wait_exclusive_head(struct wait_queue_head *wq_hea
|
||||
*
|
||||
* Caller must hold lock of type @lock_type on @lock.
|
||||
*/
|
||||
#define wait_event_locked(wq, condition, lock_type, lock) \
|
||||
#define wait_event_locked(wq, condition, lock_type, lock) do { \
|
||||
if (!(condition)) { \
|
||||
DEFINE_WAIT(__wait); \
|
||||
\
|
||||
@@ -5546,7 +5546,8 @@ if (!(condition)) { \
|
||||
spin_ ## lock_type(&(lock)); \
|
||||
} while (!(condition)); \
|
||||
finish_wait(&(wq), &__wait); \
|
||||
}
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Only use get_unaligned_be24() if reading p - 1 is allowed. */
|
||||
static inline uint32_t get_unaligned_be24(const uint8_t *const p)
|
||||
@@ -5717,7 +5718,7 @@ ssize_t scst_writev(struct file *file, const struct iovec *vec,
|
||||
unsigned long vlen, loff_t *pos);
|
||||
void scst_write_same(struct scst_cmd *cmd, struct scst_data_descriptor *where);
|
||||
int scst_scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
int data_direction, void *buffer, unsigned bufflen,
|
||||
int data_direction, void *buffer, unsigned int bufflen,
|
||||
unsigned char *sense, int timeout, int retries,
|
||||
u64 flags);
|
||||
|
||||
|
||||
+7
-22
@@ -6014,9 +6014,9 @@ ssize_t scst_readv(struct file *file, const struct iovec *vec,
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
|
||||
(defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
return vfs_readv(file, (const struct iovec __user*)vec, vlen, pos, 0);
|
||||
return vfs_readv(file, (const struct iovec __user *)vec, vlen, pos, 0);
|
||||
#else
|
||||
return vfs_readv(file, (const struct iovec __user*)vec, vlen, pos);
|
||||
return vfs_readv(file, (const struct iovec __user *)vec, vlen, pos);
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL(scst_readv);
|
||||
@@ -6040,8 +6040,8 @@ ssize_t scst_writev(struct file *file, const struct iovec *vec,
|
||||
struct iov_iter iter;
|
||||
ssize_t ret;
|
||||
|
||||
ret = import_iovec(WRITE, (const struct iovec __force __user*)vec, vlen,
|
||||
ARRAY_SIZE(iovstack), &iov, &iter);
|
||||
ret = import_iovec(WRITE, (const struct iovec __force __user *)vec,
|
||||
vlen, ARRAY_SIZE(iovstack), &iov, &iter);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
file_start_write(file);
|
||||
@@ -6052,9 +6052,9 @@ ssize_t scst_writev(struct file *file, const struct iovec *vec,
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \
|
||||
(defined(CONFIG_SUSE_KERNEL) && \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
return vfs_writev(file, (const struct iovec __user*)vec, vlen, pos, 0);
|
||||
return vfs_writev(file, (const struct iovec __user *)vec, vlen, pos, 0);
|
||||
#else
|
||||
return vfs_writev(file, (const struct iovec __user*)vec, vlen, pos);
|
||||
return vfs_writev(file, (const struct iovec __user *)vec, vlen, pos);
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL(scst_writev);
|
||||
@@ -6978,7 +6978,7 @@ out:
|
||||
}
|
||||
|
||||
int scst_scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
|
||||
int data_direction, void *buffer, unsigned bufflen,
|
||||
int data_direction, void *buffer, unsigned int bufflen,
|
||||
unsigned char *sense, int timeout, int retries, u64 flags)
|
||||
{
|
||||
return scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense,
|
||||
@@ -8061,11 +8061,7 @@ static struct request *blk_make_request(struct request_queue *q,
|
||||
if (IS_ERR(rq))
|
||||
return rq;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
|
||||
scsi_req_init(scsi_req(rq));
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
scsi_req_init(rq);
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
rq->cmd_flags = bio_data_dir(bio) == READ ? REQ_OP_SCSI_IN :
|
||||
REQ_OP_SCSI_OUT;
|
||||
@@ -8297,15 +8293,9 @@ static struct request *blk_map_kern_sg(struct request_queue *q,
|
||||
if (unlikely(!rq))
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
|
||||
scsi_req_init(scsi_req(rq));
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
scsi_req_init(rq);
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
rq->cmd_flags = reading ? REQ_OP_SCSI_IN : REQ_OP_SCSI_OUT;
|
||||
#else
|
||||
blk_rq_set_block_pc(rq);
|
||||
#endif
|
||||
goto out;
|
||||
}
|
||||
@@ -8610,12 +8600,7 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data,
|
||||
sioc->data = data;
|
||||
sioc->done = done;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
req = scsi_req(rq);
|
||||
#else
|
||||
req = rq;
|
||||
#endif
|
||||
|
||||
req->cmd_len = cmd_len;
|
||||
if (req->cmd_len <= BLK_MAX_CDB) {
|
||||
memset(req->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
|
||||
|
||||
@@ -3826,8 +3826,8 @@ static int scst_exec_check_sn(struct scst_cmd **active_cmd)
|
||||
|
||||
/* dev->qerr can be changed behind our back */
|
||||
q = cmd->dev->qerr;
|
||||
/* ACCESS_ONCE doesn't work for bit fields */
|
||||
qerr = ACCESS_ONCE(q);
|
||||
/* READ_ONCE doesn't work for bit fields */
|
||||
qerr = READ_ONCE(q);
|
||||
|
||||
switch (qerr) {
|
||||
case SCST_QERR_2_RESERVED:
|
||||
|
||||
Reference in New Issue
Block a user