
Functions and macros dependent on different kernel versions are now generated before compilation basing on current kernel capabilities instead of hardcoding them for specific kernels. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
32 lines
1.0 KiB
Bash
32 lines
1.0 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Copyright(c) 2012-2019 Intel Corporation
|
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
|
#
|
|
|
|
. `dirname $0`/conf_framework
|
|
|
|
if compile_module "struct bio b;b.bi_end_io(NULL, 0)" "linux/bio.h"
|
|
then
|
|
add_define "CAS_BIO_ENDIO(BIO, BYTES_DONE, ERROR) \\
|
|
bio_endio(BIO, ERROR)"
|
|
add_define "CAS_DECLARE_BLOCK_CALLBACK(name, BIO, BYTES_DONE, ERROR) \\
|
|
void name##_callback(BIO, ERROR)"
|
|
add_define "CAS_BLOCK_CALLBACK_ERROR(BIO, ERROR) \\
|
|
ERROR"
|
|
elif compile_module "struct bio b;b.bi_end_io(NULL)" "linux/bio.h"
|
|
then
|
|
add_define "CAS_BIO_ENDIO(BIO, BYTES_DONE, ERROR) \\
|
|
({ CAS_BIO_OP_STATUS(BIO) = ERROR; bio_endio(BIO); })"
|
|
add_define "CAS_DECLARE_BLOCK_CALLBACK(name, BIO, BYTES_DONE, ERROR) \\
|
|
void name##_callback(BIO)"
|
|
add_define "CAS_BLOCK_CALLBACK_ERROR(BIO, ERROR) \\
|
|
CAS_BIO_OP_STATUS(BIO)"
|
|
fi
|
|
add_define "CAS_REFER_BLOCK_CALLBACK(name) \\
|
|
name##_callback"
|
|
add_define "CAS_BLOCK_CALLBACK_INIT(BIO) \\
|
|
{; }"
|
|
add_define "CAS_BLOCK_CALLBACK_RETURN(BIO) \\
|
|
{ return; }"
|