From: Shaun Tancheff Date: Sat, 24 Jun 2023 05:08:48 +0000 (+0700) Subject: LU-16925 osd-ldiskfs: Remove unused bio_integrity_enabled X-Git-Tag: 2.15.57~80 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F51432%2F2;p=fs%2Flustre-release.git LU-16925 osd-ldiskfs: Remove unused bio_integrity_enabled bio_integrity_enabled() is not used in lustre. Remove the configure check and the associated code. Test-Parameters: trivial HPE-bug-id: LUS-10118 Signed-off-by: Shaun Tancheff Change-Id: I9d07333b91210a2f6545945cf48293179a71258e Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51432 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 713d2c3..9057da9 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2414,26 +2414,6 @@ AC_DEFUN([LC_BI_STATUS], [ ]) # 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 - ],[ - 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 @@ -3935,7 +3915,6 @@ AC_DEFUN([LC_PROG_LINUX_SRC], [ LC_SRC_BI_STATUS # 4.13 - LC_SRC_BIO_INTEGRITY_ENABLED LC_SRC_HAVE_GET_INODE_USAGE # 4.14 @@ -4190,7 +4169,6 @@ AC_DEFUN([LC_PROG_LINUX_RESULTS], [ LC_BI_STATUS # 4.13 - LC_BIO_INTEGRITY_ENABLED LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL LC_HAVE_GET_INODE_USAGE diff --git a/lustre/osd-ldiskfs/osd_compat.c b/lustre/osd-ldiskfs/osd_compat.c index 97fb9c0..f8e766b 100644 --- a/lustre/osd-ldiskfs/osd_compat.c +++ b/lustre/osd-ldiskfs/osd_compat.c @@ -1467,33 +1467,3 @@ int osd_obj_spec_lookup(struct osd_thread_info *info, struct osd_device *osd, 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 diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index 5324ef3..4d57ecb 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -1479,10 +1479,6 @@ static inline struct buffer_head *__ldiskfs_bread(handle_t *handle, 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))