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:
@@ -36,10 +36,13 @@
|
||||
#ifndef __ISER_H__
|
||||
#define __ISER_H__
|
||||
|
||||
#include <linux/version.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <rdma/ib_verbs.h>
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
|
||||
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 5
|
||||
static inline u16 vlan_dev_vlan_id(const void *dev)
|
||||
{
|
||||
|
||||
@@ -36,9 +36,11 @@
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/in.h>
|
||||
#include <linux/in6.h>
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
|
||||
#include "isert_dbg.h"
|
||||
#include "iser.h"
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
|
||||
#include <asm/atomic.h>
|
||||
@@ -55,6 +54,7 @@
|
||||
#include <scst/isert_scst.h>
|
||||
#include <scst/iscsi_scst.h>
|
||||
#else
|
||||
#include <linux/version.h>
|
||||
#include "isert_scst.h"
|
||||
#include "iscsi_scst.h"
|
||||
#endif
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
#ifndef ISERT_DBG_H
|
||||
#define ISERT_DBG_H
|
||||
|
||||
#include <linux/version.h>
|
||||
|
||||
#ifdef LOG_PREFIX
|
||||
#undef LOG_PREFIX
|
||||
#endif
|
||||
@@ -27,6 +25,7 @@
|
||||
#ifdef INSIDE_KERNEL_TREE
|
||||
#include <scst/scst_debug.h>
|
||||
#else
|
||||
#include <linux/version.h>
|
||||
#include <scst_debug.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
#include <linux/errno.h> /* error codes */
|
||||
#include <linux/poll.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
|
||||
#include <linux/freezer.h>
|
||||
#else
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
|
||||
#include <linux/export.h>
|
||||
#endif
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
#include <linux/poll.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
#include <linux/sched/signal.h>
|
||||
#endif
|
||||
|
||||
#define LOG_PREFIX DEV_USER_NAME
|
||||
|
||||
@@ -33,11 +29,16 @@
|
||||
#include <scst/scst.h>
|
||||
#include <scst/scst_user.h>
|
||||
#else
|
||||
#include <linux/version.h>
|
||||
#include "scst.h"
|
||||
#include "scst_user.h"
|
||||
#endif
|
||||
#include "scst_dev_handler.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
#include <linux/sched/signal.h>
|
||||
#endif
|
||||
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
|
||||
#warning HIGHMEM kernel configurations are not supported by this module, \
|
||||
|
||||
@@ -1091,7 +1091,9 @@ check:
|
||||
if (virt_dev->unmap_opt_gran == virt_dev->unmap_align)
|
||||
virt_dev->unmap_align = 0;
|
||||
virt_dev->unmap_max_lba_cnt = q->limits.max_discard_sectors >> (block_shift - 9);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
|
||||
virt_dev->discard_zeroes_data = q->limits.discard_zeroes_data;
|
||||
#endif
|
||||
#else
|
||||
sBUG();
|
||||
#endif
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/version.h>
|
||||
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/module.h>
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
#include <linux/sched/signal.h>
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,9 @@
|
||||
#include <asm/kmap_types.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <asm/checksum.h>
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
|
||||
#include <linux/crc-t10dif.h>
|
||||
#endif
|
||||
@@ -43,10 +45,6 @@
|
||||
#include <linux/namei.h>
|
||||
#include <linux/mount.h>
|
||||
|
||||
#ifndef INSIDE_KERNEL_TREE
|
||||
#include <linux/version.h>
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
|
||||
#include <linux/writeback.h>
|
||||
#endif
|
||||
@@ -8366,7 +8364,7 @@ out:
|
||||
static void scsi_end_async(struct request *req, int error)
|
||||
{
|
||||
struct scsi_io_context *sioc = req->end_io_data;
|
||||
int errors;
|
||||
int result;
|
||||
|
||||
TRACE_DBG("sioc %p, cmd %p, error %d / %d", sioc, sioc->data, error,
|
||||
req->errors);
|
||||
@@ -8378,20 +8376,31 @@ static void scsi_end_async(struct request *req, int error)
|
||||
lockdep_assert_held(req->q->queue_lock);
|
||||
#endif
|
||||
|
||||
errors = req->errors && !IS_ERR_VALUE((long)req->errors) ? req->errors :
|
||||
IS_ERR_VALUE((long)req->errors) || error ?
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
result = scsi_req(req)->result;
|
||||
#else
|
||||
result = req->errors;
|
||||
#endif
|
||||
result = result && !IS_ERR_VALUE((long)result) ? result :
|
||||
IS_ERR_VALUE((long)result) || error ?
|
||||
SAM_STAT_CHECK_CONDITION : 0;
|
||||
|
||||
if (sioc->done)
|
||||
if (sioc->done) {
|
||||
int resid_len;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
|
||||
sioc->done(sioc->data, sioc->sense, errors,
|
||||
scsi_req(req)->resid_len);
|
||||
resid_len = scsi_req(req)->resid_len;
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
|
||||
sioc->done(sioc->data, sioc->sense, errors, req->resid_len);
|
||||
#else
|
||||
sioc->done(sioc->data, sioc->sense, errors, req->data_len);
|
||||
resid_len = req->resid_len;
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
|
||||
sioc->done(sioc->data, sioc->sense, result, resid_len);
|
||||
#else
|
||||
sioc->done(sioc->data, sioc->sense, result, req->data_len);
|
||||
#endif
|
||||
}
|
||||
|
||||
kmem_cache_free(scsi_io_context_cache, sioc);
|
||||
|
||||
__blk_put_request(req->q, req);
|
||||
@@ -8479,7 +8488,11 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data,
|
||||
req->sense = sioc->sense;
|
||||
req->sense_len = sizeof(sioc->sense);
|
||||
rq->timeout = cmd->timeout;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||
req->retries = cmd->retries;
|
||||
#else
|
||||
rq->retries = cmd->retries;
|
||||
#endif
|
||||
rq->end_io_data = sioc;
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
|
||||
rq->cmd_flags |= REQ_FAILFAST_MASK;
|
||||
|
||||
Reference in New Issue
Block a user