2 dnl # Interface for issuing a discard bio:
3 dnl # 2.6.28-2.6.35: BIO_RW_DISCARD
4 dnl # 2.6.36-3.x: REQ_DISCARD
7 dnl # Since REQ_DISCARD is a preprocessor definition, there is no need for an
8 dnl # autotools check for it. Also, REQ_DISCARD existed in the request layer
9 dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the
10 dnl # request layer and bio layer flags, so it would be wrong to assume that
11 dnl # the APIs are mutually exclusive contrary to the typical case.
12 AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_DISCARD], [
13 AC_MSG_CHECKING([whether BIO_RW_DISCARD is defined])
14 ZFS_LINUX_TRY_COMPILE([
15 #include <linux/bio.h>
17 int flags __attribute__ ((unused));
18 flags = BIO_RW_DISCARD;
21 AC_DEFINE(HAVE_BIO_RW_DISCARD, 1, [BIO_RW_DISCARD is defined])