
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>
28 lines
785 B
Bash
28 lines
785 B
Bash
#!/bin/bash
|
|
#
|
|
# Copyright(c) 2012-2019 Intel Corporation
|
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
|
#
|
|
|
|
. `dirname $0`/conf_framework
|
|
|
|
if compile_module "bio_clone(NULL, 0)" "linux/bio.h"
|
|
then
|
|
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
|
{
|
|
return bio_clone(bio, gfp_mask);
|
|
}"
|
|
elif compile_module "bio_clone_kmalloc(NULL, 0)" "linux/bio.h"
|
|
then
|
|
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
|
{
|
|
return bio_clone_kmalloc(bio, gfp_mask);
|
|
}"
|
|
elif compile_module "bio_clone_fast(NULL, 0, NULL)" "linux/bio.h"
|
|
then
|
|
add_function "static inline struct bio *cas_bio_clone(struct bio *bio, gfp_t gfp_mask)
|
|
{
|
|
return bio_clone_fast(bio, gfp_mask, NULL);
|
|
}"
|
|
fi
|