]) # LC_HAVE_ITER_FILE_SPLICE_WRITE
#
+# LC_HAVE_BDI_DEBUG_STATS
+#
+# Linux kernel v5.10 commit 2d146b924ec3c0873f06308d149684dc1105d9a3
+# backing-dev: no need to check return value of debugfs_create functions
+# backing_dev_info.debug_stats was remove.
+#
+AC_DEFUN([LC_SRC_HAVE_BDI_DEBUG_STATS], [
+ LB2_LINUX_TEST_SRC([bdi_has_debug_stats], [
+ #include <linux/backing-dev-defs.h>
+ ],[
+ struct backing_dev_info info;
+
+ info.debug_stats = NULL;
+ ],[-Werror])
+])
+AC_DEFUN([LC_HAVE_BDI_DEBUG_STATS], [
+ AC_MSG_CHECKING([if 'struct backing_dev_info' has 'debug_stats' field])
+ LB2_LINUX_TEST_RESULT([bdi_has_debug_stats], [
+ AC_DEFINE(HAVE_BDI_DEBUG_STATS, 1,
+ [backing_dev_info has debug_stats])
+ ])
+]) # LC_HAVE_BDI_DEBUG_STATS
+
+#
# LC_FSCRYPT_IS_NOKEY_NAME
#
# Kernel 5.10-rc4 159e1de201b6fca10bfec50405a3b53a561096a8
LC_SRC_HAVE_ITER_FILE_SPLICE_WRITE
# 5.10
+ LC_SRC_HAVE_BDI_DEBUG_STATS
LC_SRC_FSCRYPT_IS_NOKEY_NAME
LC_SRC_FSCRYPT_PREPARE_READDIR
LC_FSCRYPT_DUMMY_POLICY
# 5.10
+ LC_HAVE_BDI_DEBUG_STATS
LC_FSCRYPT_IS_NOKEY_NAME
LC_FSCRYPT_PREPARE_READDIR
sb->s_bdi->io_pages = 0;
#endif
sb->s_bdi->capabilities |= LL_BDI_CAP_FLAGS;
+#ifdef SB_I_CGROUPWB
+ sb->s_iflags |= SB_I_CGROUPWB;
+#endif
/* Call ll_debugfs_register_super() before lustre_process_log()
* so that "llite.*.*" params can be processed correctly.
RETURN(err);
} /* ll_fill_super */
+static void ll_bdi_device_unregister(struct backing_dev_info *bdi)
+{
+ if (bdi->dev == NULL)
+ return;
+
+#if defined(SB_I_CGROUPWB) && !defined(SB_I_PERSB_BDI)
+#ifdef HAVE_BDI_DEBUG_STATS
+ debugfs_remove(bdi->debug_stats);
+ debugfs_remove(bdi->debug_dir);
+#else
+ debugfs_remove_recursive(bdi->debug_dir);
+#endif
+ device_unregister(bdi->dev);
+ bdi->dev = NULL;
+#endif
+}
+
void ll_put_super(struct super_block *sb)
{
struct config_llog_instance cfg, params_cfg;
if (profilenm)
class_del_profile(profilenm);
+ ll_bdi_device_unregister(sb->s_bdi);
+
#ifndef HAVE_SUPER_SETUP_BDI_NAME
if (lsi->lsi_flags & LSI_BDI_INITIALIZED) {
bdi_destroy(&lsi->lsi_bdi);