mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 19:21:26 +00:00
Merge branch 'svn-trunk'
This commit is contained in:
@@ -989,7 +989,8 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
||||
sizeof(*isert_dev->cq_qps),
|
||||
GFP_KERNEL);
|
||||
if (unlikely(isert_dev->cq_qps == NULL)) {
|
||||
PRINT_ERROR("Failed to allocate iser cq_qps");
|
||||
PRINT_ERROR("Failed to allocate %d iser cq_qps",
|
||||
isert_dev->num_cqs);
|
||||
err = -ENOMEM;
|
||||
goto free_isert_dev;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
ABT_DETAILS="x86_64"
|
||||
ABT_JOBS=5
|
||||
ABT_KERNELS=" \
|
||||
4.12.9 \
|
||||
4.13.4 \
|
||||
4.12.14-nc \
|
||||
4.11.12-nc \
|
||||
4.10.17-nc \
|
||||
4.9.45-nc \
|
||||
|
||||
@@ -272,6 +272,9 @@ done
|
||||
|
||||
# General kernel patches.
|
||||
|
||||
scsi_exec_req_fifo_defined=0
|
||||
scst_io_context=0
|
||||
|
||||
scst_03_public_headers="scst/include/scst.h scst/include/scst_const.h \
|
||||
scst/include/scst_event.h scst/include/backport.h"
|
||||
scst_04_main="scst/src/scst_main.c scst/src/scst_module.c scst/src/scst_priv.h \
|
||||
|
||||
@@ -108,6 +108,10 @@ function evaluate(stmnt, pattern, arg, op, result) {
|
||||
gsub("defined\\(HAVE_IB_DMA_MAP_OPS\\)",
|
||||
"(LINUX_VERSION_CODE >= KERNEL_VERSION(0, 0, 0))", stmnt)
|
||||
|
||||
gsub("defined(ENABLE_NPIV)", 0, stmnt)
|
||||
|
||||
gsub("defined(FC_VPORT_CREATE_DEFINED)", 0, stmnt)
|
||||
|
||||
gsub("LINUX_VERSION_CODE", LINUX_VERSION_CODE, stmnt)
|
||||
|
||||
pattern="KERNEL_VERSION\\([[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*,[[:blank:]]*([0-9]+)[[:blank:]]*\\)"
|
||||
@@ -122,6 +126,8 @@ function evaluate(stmnt, pattern, arg, op, result) {
|
||||
|
||||
gsub("defined\\(CONFIG_SUSE_KERNEL\\)", "0", stmnt)
|
||||
|
||||
gsub("defined\\(CONFIG_SCST_STRICT_SERIALIZING\\)", "0", stmnt)
|
||||
|
||||
if (RHEL_MAJOR == "")
|
||||
{
|
||||
gsub("defined\\(RHEL_MAJOR\\)", "0", stmnt)
|
||||
@@ -337,6 +343,8 @@ function handle_if(evaluated)
|
||||
if ($0 ~ "LINUX_VERSION_CODE" \
|
||||
|| $0 ~ "CONFIG_SCST_PROC" \
|
||||
|| $0 ~ "CREATE_SEND_MAD_HAS_BASE_ARG" \
|
||||
|| $0 ~ "ENABLE_NPIV" \
|
||||
|| $0 ~ "FC_VPORT_CREATE_DEFINED" \
|
||||
|| $0 ~ "HAVE_IB_DMA_MAP_OPS" \
|
||||
|| $0 ~ "HAVE_IB_QUERY_DEVICE" \
|
||||
|| $0 ~ "HAVE_IB_SET_CPI_RESP_TIME" \
|
||||
@@ -349,6 +357,7 @@ function handle_if(evaluated)
|
||||
|| $0 ~ "IB_QUERY_GID_HAS_ATTR_ARG" \
|
||||
|| $0 ~ "INSIDE_KERNEL_TREE" \
|
||||
|| $0 ~ "MAD_HANDLER_TAKES_SEND_BUF" \
|
||||
|| $0 ~ "CONFIG_SCST_STRICT_SERIALIZING" \
|
||||
|| $0 ~ "MOFED_MAJOR" \
|
||||
|| $0 ~ "RDMA_CREATE_ID_TAKES_NET_ARG" \
|
||||
|| $0 ~ "REGISTER_MAD_AGENT_HAS_FLAGS_ARG" \
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/bio.h>
|
||||
#include <linux/blkdev.h> /* struct request_queue */
|
||||
#include <linux/scatterlist.h> /* struct scatterlist */
|
||||
#include <linux/slab.h> /* kmalloc() */
|
||||
@@ -45,6 +46,19 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* <linux/bio.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
static inline struct bio_set *bioset_create_backport(unsigned int pool_size,
|
||||
unsigned int front_pad,
|
||||
int flags)
|
||||
{
|
||||
WARN_ON_ONCE(flags != 0);
|
||||
return bioset_create(pool_size, front_pad);
|
||||
}
|
||||
#define bioset_create bioset_create_backport
|
||||
#endif
|
||||
|
||||
/* <linux/blkdev.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
|
||||
|
||||
@@ -5495,6 +5495,7 @@ void scst_dev_inquiry_data_changed(struct scst_device *dev);
|
||||
* allows exclusive wake ups of threads in LIFO order. We need it to let (yet)
|
||||
* unneeded threads sleep and not pollute CPU cache by their stacks.
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
static inline void prepare_to_wait_exclusive_head(wait_queue_head_t *q,
|
||||
wait_queue_t *wait, int state)
|
||||
{
|
||||
@@ -5507,6 +5508,20 @@ static inline void prepare_to_wait_exclusive_head(wait_queue_head_t *q,
|
||||
set_current_state(state);
|
||||
spin_unlock_irqrestore(&q->lock, flags);
|
||||
}
|
||||
#else
|
||||
static inline void prepare_to_wait_exclusive_head(struct wait_queue_head *wq_head,
|
||||
struct wait_queue_entry *wq_entry, int state)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
wq_entry->flags |= WQ_FLAG_EXCLUSIVE;
|
||||
spin_lock_irqsave(&wq_head->lock, flags);
|
||||
if (list_empty(&wq_entry->entry))
|
||||
__add_wait_queue(wq_head, wq_entry);
|
||||
set_current_state(state);
|
||||
spin_unlock_irqrestore(&wq_head->lock, flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* wait_event_locked() - Wait until a condition becomes true.
|
||||
|
||||
@@ -6563,7 +6563,11 @@ static void blockio_endio(struct bio *bio, int error)
|
||||
#else
|
||||
static void blockio_endio(struct bio *bio)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
int error = bio->bi_error;
|
||||
#else
|
||||
int error = blk_status_to_errno(bio->bi_status);
|
||||
#endif
|
||||
#endif
|
||||
struct scst_blockio_work *blockio_work = bio->bi_private;
|
||||
|
||||
@@ -7039,7 +7043,11 @@ static void vdev_flush_end_io(struct bio *bio, int error)
|
||||
#else
|
||||
static void vdev_flush_end_io(struct bio *bio)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
int error = bio->bi_error;
|
||||
#else
|
||||
int error = blk_status_to_errno(bio->bi_status);
|
||||
#endif
|
||||
#endif
|
||||
struct scst_cmd *cmd = bio->bi_private;
|
||||
|
||||
@@ -7155,7 +7163,11 @@ static void blockio_end_sync_io(struct bio *bio, int error)
|
||||
#else
|
||||
static void blockio_end_sync_io(struct bio *bio)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
int error = bio->bi_error;
|
||||
#else
|
||||
int error = blk_status_to_errno(bio->bi_status);
|
||||
#endif
|
||||
#endif
|
||||
struct bio_priv_sync *s = bio->bi_private;
|
||||
|
||||
@@ -7788,7 +7800,7 @@ static int vdisk_create_bioset(struct scst_vdisk_dev *virt_dev)
|
||||
EXTRACHECKS_BUG_ON(virt_dev->vdisk_bioset || !virt_dev->blockio);
|
||||
|
||||
/* Pool size doesn't really matter */
|
||||
virt_dev->vdisk_bioset = bioset_create(2, 0);
|
||||
virt_dev->vdisk_bioset = bioset_create(2, 0, 0);
|
||||
if (virt_dev->vdisk_bioset == NULL) {
|
||||
PRINT_ERROR("Failed to create bioset (dev %s)", virt_dev->name);
|
||||
res = -ENOMEM;
|
||||
|
||||
@@ -7809,7 +7809,11 @@ static void blk_bio_map_kern_endio(struct bio *bio, int err)
|
||||
#else
|
||||
static void blk_bio_map_kern_endio(struct bio *bio)
|
||||
{
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
int err = bio->bi_error;
|
||||
#else
|
||||
int err = blk_status_to_errno(bio->bi_status);
|
||||
#endif
|
||||
#endif
|
||||
struct blk_kern_sg_work *bw = bio->bi_private;
|
||||
|
||||
@@ -7961,22 +7965,33 @@ static struct request *blk_make_request(struct request_queue *q,
|
||||
if (IS_ERR(rq))
|
||||
return rq;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
#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);
|
||||
#else
|
||||
blk_rq_set_block_pc(rq);
|
||||
#endif
|
||||
|
||||
for_each_bio(bio) {
|
||||
struct bio *bounce_bio = bio;
|
||||
int ret;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
struct bio *bounce_bio = bio;
|
||||
|
||||
blk_queue_bounce(q, &bounce_bio);
|
||||
ret = blk_rq_append_bio(rq, bounce_bio);
|
||||
if (unlikely(ret)) {
|
||||
blk_put_request(rq);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
#else
|
||||
ret = blk_rq_append_bio(rq, bio);
|
||||
if (unlikely(ret)) {
|
||||
blk_put_request(rq);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return rq;
|
||||
@@ -8175,7 +8190,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, 11, 0)
|
||||
#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);
|
||||
#else
|
||||
rq->cmd_type = REQ_TYPE_BLOCK_PC;
|
||||
@@ -8361,7 +8378,11 @@ out:
|
||||
#endif /* !defined(SCSI_EXEC_REQ_FIFO_DEFINED) */
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
static void scsi_end_async(struct request *req, int error)
|
||||
#else
|
||||
static void scsi_end_async(struct request *req, blk_status_t error)
|
||||
#endif
|
||||
{
|
||||
struct scsi_io_context *sioc = req->end_io_data;
|
||||
int result;
|
||||
@@ -8520,7 +8541,11 @@ out_free_unmap:
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
|
||||
b->bi_end_io(b, res);
|
||||
#else
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
|
||||
b->bi_error = res;
|
||||
#else
|
||||
b->bi_status = errno_to_blk_status(res);
|
||||
#endif
|
||||
b->bi_end_io(b);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user