
Allows for faster configuration in known environments Signed-off-by: Robert Baldyga <robert.baldyga@intel.com> Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
73 lines
2.2 KiB
Bash
73 lines
2.2 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Copyright(c) 2012-2019 Intel Corporation
|
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
|
#
|
|
|
|
. `dirname $0`/conf_framework
|
|
|
|
# RHEL 7.3
|
|
check() {
|
|
if compile_module "struct queue_limits q;q.limits_aux" "linux/blkdev.h"
|
|
then
|
|
echo "1"
|
|
elif compile_module "struct queue_limits q;q.max_write_zeroes_sectors" "linux/blkdev.h"
|
|
then
|
|
echo "2"
|
|
elif compile_module "struct queue_limits q;q.max_write_same_sectors" "linux/blkdev.h"
|
|
then
|
|
echo "3"
|
|
else
|
|
echo "X"
|
|
fi
|
|
}
|
|
|
|
apply() {
|
|
case "$1" in
|
|
"1")
|
|
add_function "
|
|
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
|
struct request_queue *cache_q, struct request_queue *core_q)
|
|
{
|
|
struct queue_limits_aux *l_aux = exp_q->limits.limits_aux;
|
|
exp_q->limits = cache_q->limits;
|
|
exp_q->limits.limits_aux = l_aux;
|
|
if (exp_q->limits.limits_aux && cache_q->limits.limits_aux)
|
|
*exp_q->limits.limits_aux = *cache_q->limits.limits_aux;
|
|
exp_q->limits.max_sectors = core_q->limits.max_sectors;
|
|
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
|
exp_q->limits.max_segments = core_q->limits.max_segments;
|
|
exp_q->limits.max_write_same_sectors = 0;
|
|
if (queue_virt_boundary(cache_q))
|
|
queue_flag_set(QUEUE_FLAG_NOMERGES, cache_q);
|
|
}" ;;
|
|
"2")
|
|
add_function "
|
|
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
|
struct request_queue *cache_q, struct request_queue *core_q)
|
|
{
|
|
exp_q->limits = cache_q->limits;
|
|
exp_q->limits.max_sectors = core_q->limits.max_sectors;
|
|
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
|
exp_q->limits.max_segments = core_q->limits.max_segments;
|
|
exp_q->limits.max_write_same_sectors = 0;
|
|
exp_q->limits.max_write_zeroes_sectors = 0;
|
|
}" ;;
|
|
"3")
|
|
add_function "
|
|
static inline void cas_copy_queue_limits(struct request_queue *exp_q,
|
|
struct request_queue *cache_q, struct request_queue *core_q)
|
|
{
|
|
exp_q->limits = cache_q->limits;
|
|
exp_q->limits.max_sectors = core_q->limits.max_sectors;
|
|
exp_q->limits.max_hw_sectors = core_q->limits.max_hw_sectors;
|
|
exp_q->limits.max_segments = core_q->limits.max_segments;
|
|
exp_q->limits.max_write_same_sectors = 0;
|
|
}" ;;
|
|
*)
|
|
exit 1
|
|
esac
|
|
}
|
|
|
|
conf_run $@
|