]) # LC_BI_STATUS
#
-# LC_BIO_INTEGRITY_ENABLED
-#
-# 4.13 removed bio_integrity_enabled
-#
-AC_DEFUN([LC_SRC_BIO_INTEGRITY_ENABLED], [
- LB2_LINUX_TEST_SRC([bio_integrity_enabled], [
- #include <linux/bio.h>
- ],[
- bio_integrity_enabled(NULL);
- ])
-])
-AC_DEFUN([LC_BIO_INTEGRITY_ENABLED], [
- AC_MSG_CHECKING([if 'bio_integrity_enabled' exist])
- LB2_LINUX_TEST_RESULT([bio_integrity_enabled], [
- AC_DEFINE(HAVE_BIO_INTEGRITY_ENABLED, 1,
- ['bio_integrity_enabled' is available])
- ])
-]) # LC_BIO_INTEGRITY_ENABLED
-
-#
# LC_PAGEVEC_INIT_ONE_PARAM
#
# 4.14 pagevec_init takes one parameter
LC_SRC_BI_STATUS
# 4.13
- LC_SRC_BIO_INTEGRITY_ENABLED
LC_SRC_HAVE_GET_INODE_USAGE
# 4.14
LC_BI_STATUS
# 4.13
- LC_BIO_INTEGRITY_ENABLED
LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
LC_HAVE_GET_INODE_USAGE
RETURN(rc);
}
-
-#ifndef HAVE_BIO_INTEGRITY_ENABLED
-bool bio_integrity_enabled(struct bio *bio)
-{
- struct blk_integrity *bi = blk_get_integrity(bio_get_disk(bio));
-
- if (bio_op(bio) != REQ_OP_READ && bio_op(bio) != REQ_OP_WRITE)
- return false;
-
- if (!bio_sectors(bio))
- return false;
-
- /* Already protected? */
- if (bio_integrity(bio))
- return false;
-
- if (bi == NULL)
- return false;
-
- if (bio_data_dir(bio) == READ && bi->profile->verify_fn != NULL &&
- (bi->flags & BLK_INTEGRITY_VERIFY))
- return true;
-
- if (bio_data_dir(bio) == WRITE && bi->profile->generate_fn != NULL &&
- (bi->flags & BLK_INTEGRITY_GENERATE))
- return true;
-
- return false;
-}
-#endif
return bh;
}
-#ifndef HAVE_BIO_INTEGRITY_ENABLED
-bool bio_integrity_enabled(struct bio *bio);
-#endif
-
#ifdef HAVE_EXT4_JOURNAL_GET_WRITE_ACCESS_4ARGS
# define osd_ldiskfs_journal_get_write_access(handle, sb, bh, flags) \
ldiskfs_journal_get_write_access((handle), (sb), (bh), (flags))