open-cas-linux/configure.d/1_queue_chunk_sectors.conf
Robert Baldyga 13c51041ff Generate and apply config
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>
2019-07-11 03:32:53 -04:00

32 lines
553 B
Bash

#!/bin/bash
#
# Copyright(c) 2012-2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
. `dirname $0`/conf_framework
check() {
if compile_module "struct request_queue q;q.limits.chunk_sectors" "linux/blkdev.h"
then
echo "1"
else
echo "2"
fi
}
apply() {
case "$1" in
"1")
add_define "CAS_SET_QUEUE_CHUNK_SECTORS(queue, chunk_size) \\
queue->limits.chunk_sectors = chunk_size" ;;
"2")
add_define "CAS_SET_QUEUE_CHUNK_SECTORS(queue, chunk_size) \\
{;}" ;;
*)
exit 1
esac
}
conf_run $@