Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2018-07-13 18:44:00 -07:00
7 changed files with 28 additions and 12 deletions

View File

@@ -90,16 +90,6 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
static inline void blk_queue_flag_set(unsigned int flag,
struct request_queue *q)
{
#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6
queue_flag_set_unlocked(flag, q);
#endif
}
#endif
/* <linux/compiler.h> */
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 20)

View File

@@ -4971,7 +4971,7 @@ static inline struct scatterlist *sg_next_inline(struct scatterlist *sg)
static inline void sg_clear(struct scatterlist *sg)
{
memset(sg, 0, sizeof(*sg));
#ifdef CONFIG_DEBUG_SG
#if 0 // def CONFIG_DEBUG_SG
sg->sg_magic = SG_MAGIC;
#endif
}

View File

@@ -1230,7 +1230,14 @@ static int scst_local_change_queue_depth(struct scsi_device *sdev, int qdepth)
static int scst_local_slave_alloc(struct scsi_device *sdev)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)
#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6
queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdev->request_queue);
#endif
#else
blk_queue_flag_set(QUEUE_FLAG_BIDI, sdev->request_queue);
#endif
return 0;
}

View File

@@ -184,6 +184,12 @@ conftest/create_send_mad_base/result-$(KVER).txt: \
echo "$(call run_conftest,create_send_mad_base, \
-DCREATE_SEND_MAD_HAS_BASE_ARG)" >"$@"
conftest/dev_attr_max_send_sge/result-$(KVER).txt: \
conftest/dev_attr_max_send_sge/dev_attr_max_send_sge.c \
conftest/dev_attr_max_send_sge/Makefile
echo "$(call run_conftest_bool,dev_attr_max_send_sge, \
HAVE_DEV_ATTR_MAX_SEND_SGE)" >"$@"
conftest/gid_change/result-$(KVER).txt: \
conftest/gid_change/gid_change.c \
conftest/gid_change/Makefile

View File

@@ -0,0 +1,3 @@
LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE)
obj-m += dev_attr_max_send_sge.o

View File

@@ -0,0 +1,10 @@
#include <linux/module.h>
#include <linux/stddef.h>
#include <rdma/ib_verbs.h>
static int modinit(void)
{
return offsetof(struct ib_device_attr, max_send_sge);
}
module_init(modinit);

View File

@@ -2249,7 +2249,7 @@ retry:
* max_sge values < max_sge_delta, use max_sge. For intermediate
* max_sge values, use max_sge_delta.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
#if HAVE_DEV_ATTR_MAX_SEND_SGE
ch->max_send_sge = sdev->dev_attr.max_send_sge;
ch->max_recv_sge = sdev->dev_attr.max_recv_sge;
#else