From 978b296a76019bb93e5ef64336020e0b65e2636b Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Mon, 14 Nov 2022 21:29:50 -0600 Subject: [PATCH] LU-15544 osd: Handle removal of EXT4_GET_BLOCKS_KEEP_SIZE Linux commit v5.6-rc4-4-g4337ecd1fe99 ext4: remove EXT4_EOFBLOCKS_FL and associated code This change removes the define for EXT4_EOFBLOCKS_FL as well as the enum value EXT_INODE_EOFBLOCKS. Linux commit v5.7-rc4-4-g9e52484c7133 ext4: remove EXT4_GET_BLOCKS_KEEP_SIZE flag This change removes the define for EXT4_GET_BLOCKS_KEEP_SIZE Fix the usage in osd_io.c to check for the existence of the related definitions and remove the configure test. Test-Parameters: trivial Fixes: 791f656a03 ("LU-14776 ldiskfs: Add Ubuntu 20.04 HWE support") HPE-bug-id: LUS-10744 Signed-off-by: Shaun Tancheff Change-Id: I883708ce2879f4d7d41ad3f7b75db2e751f6eb9b Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49134 Reviewed-by: Neil Brown Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- config/lustre-build-ldiskfs.m4 | 24 ------------------------ lustre/osd-ldiskfs/osd_io.c | 4 ++-- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/config/lustre-build-ldiskfs.m4 b/config/lustre-build-ldiskfs.m4 index e839cdd..846f0c5 100644 --- a/config/lustre-build-ldiskfs.m4 +++ b/config/lustre-build-ldiskfs.m4 @@ -460,29 +460,6 @@ EXTRA_KCFLAGS="$tmp_flags" ]) # LB_JBD2_H_TOTAL_CREDITS # -# LB_EXT4_GET_BLOCKS_KEEP_SIZE -# -# kernel 5.6-rc4 commit 9e52484c713321e84e8834803a44ca0a001376d2 -# ext4: remove EXT4_GET_BLOCKS_KEEP_SIZE flag -# -AC_DEFUN([LB_EXT4_GET_BLOCKS_KEEP_SIZE], [ -tmp_flags="$EXTRA_KCFLAGS" -EXTRA_KCFLAGS="-Werror" -LB_CHECK_COMPILE([if EXT4_GET_BLOCKS_KEEP_SIZE exists], -ext4_get_blocks_keep_size, [ - #include - #include "$EXT4_SRC_DIR/ext4.h" -],[ - int f = EXT4_IGET_SPECIAL; - (void)f; -],[ - AC_DEFINE(HAVE_LDISKFS_GET_BLOCKS_KEEP_SIZE, 1, - [EXT4_GET_BLOCKS_KEEP_SIZE exists]) -]) -EXTRA_KCFLAGS="$tmp_flags" -]) # LB_EXT4_GET_BLOCKS_KEEP_SIZE - -# # LB_EXT4_INC_DEC_COUNT_2ARGS # # Linux v5.9-rc7-8-g15ed2851b0f4 @@ -574,7 +551,6 @@ AS_IF([test x$enable_ldiskfs != xno],[ LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS LB_LDISKFSFS_DIRHASH_WANTS_DIR LB_JBD2_H_TOTAL_CREDITS - LB_EXT4_GET_BLOCKS_KEEP_SIZE LB_EXT4_INC_DEC_COUNT_2ARGS LB_JBD2_JOURNAL_GET_MAX_TXN_BUFS AC_DEFINE(CONFIG_LDISKFS_FS_POSIX_ACL, 1, [posix acls for ldiskfs]) diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 0447fee..f0d098d 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -2372,7 +2372,7 @@ static int osd_fallocate_preallocate(const struct lu_env *env, !ldiskfs_test_inode_flag(inode, LDISKFS_INODE_EXTENTS)) ? LDISKFS_GET_BLOCKS_CREATE_ZERO : LDISKFS_GET_BLOCKS_CREATE_UNWRIT_EXT; -#ifndef HAVE_LDISKFS_GET_BLOCKS_KEEP_SIZE +#ifdef LDISKFS_GET_BLOCKS_KEEP_SIZE if (mode & FALLOC_FL_KEEP_SIZE) flags |= LDISKFS_GET_BLOCKS_KEEP_SIZE; #endif @@ -2437,7 +2437,7 @@ static int osd_fallocate_preallocate(const struct lu_env *env, epos = end; if (ldiskfs_update_inode_size(inode, epos) & 0x1) inode->i_mtime = inode->i_ctime; -#ifndef HAVE_LDISKFS_GET_BLOCKS_KEEP_SIZE +#ifdef LDISKFS_EOFBLOCKS_FL } else { if (epos > inode->i_size) ldiskfs_set_inode_flag(inode, -- 1.8.3.1