+# LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
+#
+# kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
+# ext4: avoid declaring fs inconsistent due to invalid file handles
+# __ext4_find_entry became a helper function for ext4_find_entry
+# conflicting with previous ldiskfs patches.
+# ldiskfs patches map ext4_find_entry to ldiskfs_find_entry_locked to
+# avoid conflicting with __ext4_find_entry
+#
+# When the following check succeeds __ext4_find_entry helper is not
+# used.
+#
+AC_DEFUN([LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if __ldiskfs_find_entry is available],
+ldiskfs_find_entry_locked, [
+ #include <linux/fs.h>
+ #include "$EXT4_SRC_DIR/ext4.h"
+ #include "$EXT4_SRC_DIR/namei.c"
+
+ static int __ext4_find_entry(void) { return 0; }
+],[
+ int x = __ext4_find_entry();
+ (void)x;
+],[
+ AC_DEFINE(HAVE___LDISKFS_FIND_ENTRY, 1,
+ [if __ldiskfs_find_entry is available])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LB_LDISKFS_FIND_ENTRY_LOCKED_EXISTS
+
+#
+# LB_LDISKFSFS_DIRHASH_WANTS_DIR
+#
+# kernel 5.2 commit 8a363970d1dc38c4ec4ad575c862f776f468d057
+# ext4fs_dirhash UNICODE support
+#
+AC_DEFUN([LB_LDISKFSFS_DIRHASH_WANTS_DIR], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if ldiskfsfs_dirhash takes an inode argument],
+ext4fs_dirhash, [
+ #include <linux/fs.h>
+ #include "$EXT4_SRC_DIR/ext4.h"
+
+ int ext4fs_dirhash(const struct inode *dir, const char *name, int len,
+ struct dx_hash_info *hinfo)
+ {
+ (void)dir;
+ (void)name;
+ (void)len;
+ (void)hinfo;
+ return 0;
+ }
+],[
+ int f = ext4fs_dirhash(NULL, NULL, 0, NULL);
+ (void)f;
+],[
+ AC_DEFINE(HAVE_LDISKFSFS_GETHASH_INODE_ARG, 1,
+ [if ldiskfsfs_dirhash takes an inode argument])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LB_LDISKFSFS_DIRHASH_WANTS_DIR
+
+#