open-cas-linux/configure.d/1_queue_limits.conf
Michal Mielewczyk 42f981918d Force ordering in configure script
To prevent using macros before they are defined, enfoce calling them in an
appropriate order.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-06-03 08:34:32 -04:00

54 lines
1.9 KiB
Bash

#!/bin/bash
#
# Copyright(c) 2012-2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
. `dirname $0`/conf_framework
# RHEL 7.3
if compile_module "struct queue_limits q;q.limits_aux" "linux/blkdev.h"
then
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);
}"
elif compile_module "struct queue_limits q;q.max_write_zeroes_sectors" "linux/blkdev.h"
then
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;
}"
elif compile_module "struct queue_limits q;q.max_write_same_sectors" "linux/blkdev.h"
then
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;
}"
fi