mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
config: remove HAVE_BIO_BI_OPF
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
parent
afcc0fb0fa
commit
43bf9a712b
@ -102,13 +102,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [
|
||||
int op __attribute__ ((unused)) = REQ_OP_FLUSH;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bio_bi_opf], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio bio __attribute__ ((unused));
|
||||
bio.bi_opf = 0;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bio_set_op_attrs], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
@ -148,16 +141,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH], [
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
|
||||
AC_MSG_CHECKING([whether bio->bi_opf is defined])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bi_opf], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_OP_ATTRS], [
|
||||
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [
|
||||
@ -432,7 +415,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH
|
||||
ZFS_AC_KERNEL_BIO_BI_OPF
|
||||
ZFS_AC_KERNEL_BIO_SET_OP_ATTRS
|
||||
|
||||
ZFS_AC_KERNEL_BIO_SET_DEV
|
||||
|
@ -426,11 +426,7 @@ vdev_lookup_bdev(const char *path, dev_t *dev)
|
||||
static inline void
|
||||
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
||||
{
|
||||
#if defined(HAVE_BIO_BI_OPF)
|
||||
bio->bi_opf = rw | flags;
|
||||
#else
|
||||
bio->bi_rw |= rw | flags;
|
||||
#endif /* HAVE_BIO_BI_OPF */
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -473,9 +469,6 @@ bio_set_flush(struct bio *bio)
|
||||
* 4.8-rc0 - 4.8-rc1,
|
||||
* REQ_PREFLUSH
|
||||
*
|
||||
* 2.6.36 - 4.7 API,
|
||||
* REQ_FLUSH
|
||||
*
|
||||
* in all cases but may have a performance impact for some kernels. It
|
||||
* has the advantage of minimizing kernel specific changes in the zvol code.
|
||||
*
|
||||
@ -483,14 +476,10 @@ bio_set_flush(struct bio *bio)
|
||||
static inline boolean_t
|
||||
bio_is_flush(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_REQ_OP_FLUSH) && defined(HAVE_BIO_BI_OPF)
|
||||
#if defined(HAVE_REQ_OP_FLUSH)
|
||||
return ((bio_op(bio) == REQ_OP_FLUSH) || (bio->bi_opf & REQ_PREFLUSH));
|
||||
#elif defined(HAVE_REQ_PREFLUSH) && defined(HAVE_BIO_BI_OPF)
|
||||
#elif defined(HAVE_REQ_PREFLUSH)
|
||||
return (bio->bi_opf & REQ_PREFLUSH);
|
||||
#elif defined(HAVE_REQ_PREFLUSH) && !defined(HAVE_BIO_BI_OPF)
|
||||
return (bio->bi_rw & REQ_PREFLUSH);
|
||||
#elif defined(HAVE_REQ_FLUSH)
|
||||
return (bio->bi_rw & REQ_FLUSH);
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
@ -499,20 +488,11 @@ bio_is_flush(struct bio *bio)
|
||||
/*
|
||||
* 4.8 API,
|
||||
* REQ_FUA flag moved to bio->bi_opf
|
||||
*
|
||||
* 2.6.x - 4.7 API,
|
||||
* REQ_FUA
|
||||
*/
|
||||
static inline boolean_t
|
||||
bio_is_fua(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_BIO_BI_OPF)
|
||||
return (bio->bi_opf & REQ_FUA);
|
||||
#elif defined(REQ_FUA)
|
||||
return (bio->bi_rw & REQ_FUA);
|
||||
#else
|
||||
#error "Allowing the build will cause fua requests to be ignored."
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user