mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-02-07 15:53:41 +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
91b48a42e0
commit
ea8a9768e7
@ -102,13 +102,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [
|
|||||||
int op __attribute__ ((unused)) = REQ_OP_FLUSH;
|
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], [
|
ZFS_LINUX_TEST_SRC([bio_set_op_attrs], [
|
||||||
#include <linux/bio.h>
|
#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_DEFUN([ZFS_AC_KERNEL_BIO_SET_OP_ATTRS], [
|
||||||
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
||||||
ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [
|
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_DISCARD
|
||||||
ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE
|
ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE
|
||||||
ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH
|
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_OP_ATTRS
|
||||||
|
|
||||||
ZFS_AC_KERNEL_BIO_SET_DEV
|
ZFS_AC_KERNEL_BIO_SET_DEV
|
||||||
|
@ -399,11 +399,7 @@ vdev_lookup_bdev(const char *path, dev_t *dev)
|
|||||||
static inline void
|
static inline void
|
||||||
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_BIO_BI_OPF)
|
|
||||||
bio->bi_opf = rw | flags;
|
bio->bi_opf = rw | flags;
|
||||||
#else
|
|
||||||
bio->bi_rw |= rw | flags;
|
|
||||||
#endif /* HAVE_BIO_BI_OPF */
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -446,9 +442,6 @@ bio_set_flush(struct bio *bio)
|
|||||||
* 4.8-rc0 - 4.8-rc1,
|
* 4.8-rc0 - 4.8-rc1,
|
||||||
* REQ_PREFLUSH
|
* REQ_PREFLUSH
|
||||||
*
|
*
|
||||||
* 2.6.36 - 4.7 API,
|
|
||||||
* REQ_FLUSH
|
|
||||||
*
|
|
||||||
* in all cases but may have a performance impact for some kernels. It
|
* 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.
|
* has the advantage of minimizing kernel specific changes in the zvol code.
|
||||||
*
|
*
|
||||||
@ -456,14 +449,10 @@ bio_set_flush(struct bio *bio)
|
|||||||
static inline boolean_t
|
static inline boolean_t
|
||||||
bio_is_flush(struct bio *bio)
|
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));
|
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);
|
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
|
#else
|
||||||
#error "Unsupported kernel"
|
#error "Unsupported kernel"
|
||||||
#endif
|
#endif
|
||||||
@ -472,20 +461,11 @@ bio_is_flush(struct bio *bio)
|
|||||||
/*
|
/*
|
||||||
* 4.8 API,
|
* 4.8 API,
|
||||||
* REQ_FUA flag moved to bio->bi_opf
|
* REQ_FUA flag moved to bio->bi_opf
|
||||||
*
|
|
||||||
* 2.6.x - 4.7 API,
|
|
||||||
* REQ_FUA
|
|
||||||
*/
|
*/
|
||||||
static inline boolean_t
|
static inline boolean_t
|
||||||
bio_is_fua(struct bio *bio)
|
bio_is_fua(struct bio *bio)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_BIO_BI_OPF)
|
|
||||||
return (bio->bi_opf & REQ_FUA);
|
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