open-cas-linux/configure.d/1_append_bio.conf
Adam Rutkowski ef223cfd47 configure.d: fix detecting and usage of cas_blk_rq_append_bio
1. When generating cas_blk_rq_append_bio, check whether a
   version with double pointer compiles successfully. This
   is a better criteria than the version with single pointer
   since the latter may compile successfully regardless of
   kernel blk_rq_append_bio prototype.
2. Always provide single pointer to cas_blk_rq_append_bio
   macro - its up to cas_blk_rq_append_bio implementation to
   decide whether extra level of indirection is needed.

This fixes compilation with kernel 4.14.98.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-07-02 14:40:51 -04:00

17 lines
430 B
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;blk_rq_append_bio(NULL, &b)" "linux/blkdev.h"
then
add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\
blk_rq_append_bio(rq, &bounce_bio)"
else
add_define "cas_blk_rq_append_bio(rq, bounce_bio) \\
blk_rq_append_bio(rq, bounce_bio)"
fi