Whamcloud - gitweb
LU-15544 osd: Handle removal of EXT4_GET_BLOCKS_KEEP_SIZE 34/49134/4
authorShaun Tancheff <shaun.tancheff@hpe.com>
Tue, 15 Nov 2022 03:29:50 +0000 (21:29 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 22 Nov 2022 04:22:21 +0000 (04:22 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: I883708ce2879f4d7d41ad3f7b75db2e751f6eb9b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49134
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
config/lustre-build-ldiskfs.m4
lustre/osd-ldiskfs/osd_io.c

index e839cdd..846f0c5 100644 (file)
@@ -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 <linux/fs.h>
-       #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])
index 0447fee..f0d098d 100644 (file)
@@ -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,