open-cas-linux/configure.d/global_page_state.conf
Michal Mielewczyk 1e5355eba1 Extending 'configure' script
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>
2019-05-30 06:29:07 -04:00

33 lines
821 B
Bash

#!/bin/bash
#
# Copyright(c) 2012-2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
. `dirname $0`/conf_framework
if compile_module "global_zone_page_state(1)" "linux/mm.h"
then
add_function "
static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
{
return global_zone_page_state(item);
}"
add_define "CAS_BIO_SET_DEV(bio, bdev) \\
bio_set_dev(bio, bdev)"
add_define "CAS_BIO_GET_DEV(bio) \\
bio->bi_disk"
elif compile_module "global_page_state(1)" "linux/mm.h"
then
add_function "
static inline unsigned long cas_global_zone_page_state(enum zone_stat_item item)
{
return global_page_state(item);
}"
add_define "CAS_BIO_SET_DEV(bio, bdev) \\
bio->bi_bdev = bdev"
add_define "CAS_BIO_GET_DEV(bio) \\
bio->bi_bdev->bd_disk"
fi