]) # LC_BACKING_DEV_INFO_REMOVAL
#
-# LC_HAVE_BDI_CAP_MAP_COPY
-#
-# 3.20 removed mmap handling for backing devices since
-# it breaks on non-MMU systems. See kernel commit
-# b4caecd48005fbed3949dde6c1cb233142fd69e9
-#
-AC_DEFUN([LC_SRC_HAVE_BDI_CAP_MAP_COPY], [
- LB2_LINUX_TEST_SRC([bdi_cap_map_copy], [
- #include <linux/backing-dev.h>
- ],[
- struct backing_dev_info info;
-
- info.capabilities = BDI_CAP_MAP_COPY;
- ])
-]) # LC_HAVE_BDI_CAP_MAP_COPY
-AC_DEFUN([LC_HAVE_BDI_CAP_MAP_COPY], [
- AC_MSG_CHECKING([if have 'BDI_CAP_MAP_COPY'])
- LB2_LINUX_TEST_RESULT([bdi_cap_map_copy], [
- AC_DEFINE(HAVE_BDI_CAP_MAP_COPY, 1,
- [BDI_CAP_MAP_COPY exist])
- ])
-]) # LC_HAVE_BDI_CAP_MAP_COPY
-
-#
# LC_HAVE_PROJECT_QUOTA
#
# Kernel version v4.0-rc1-197-g847aac644e92
# 3.20
LC_SRC_BACKING_DEV_INFO_REMOVAL
- LC_SRC_HAVE_BDI_CAP_MAP_COPY
# 4.1.0
LC_SRC_IOV_ITER_RW
# 3.20
LC_BACKING_DEV_INFO_REMOVAL
- LC_HAVE_BDI_CAP_MAP_COPY
# 4.1.0
LC_IOV_ITER_RW
#include <linux/xattr.h>
#include <linux/workqueue.h>
#include <linux/blkdev.h>
+#include <linux/backing-dev.h>
#include <linux/slab.h>
#include <linux/security.h>
#include <libcfs/linux/linux-fs.h>
#endif
}
+/* until v3.19-rc5-3-gb4caecd48005 */
+#ifndef BDI_CAP_MAP_COPY
+#define BDI_CAP_MAP_COPY 0
+#endif
+
+/* from v4.1-rc2-56-g89e9b9e07a39, until v5.9-rc3-161-gf56753ac2a90 */
+#ifndef BDI_CAP_CGROUP_WRITEBACK
+#define BDI_CAP_CGROUP_WRITEBACK 0
+#endif
+
+/* from v5.9-rc3-161-gf56753ac2a90 */
+#ifndef BDI_CAP_WRITEBACK
+#define BDI_CAP_WRITEBACK 0
+#endif
+
+/* from v5.9-rc3-161-gf56753ac2a90 */
+#ifndef BDI_CAP_WRITEBACK_ACCT
+#define BDI_CAP_WRITEBACK_ACCT 0
+#endif
+
+#define LL_BDI_CAP_FLAGS (BDI_CAP_CGROUP_WRITEBACK | BDI_CAP_MAP_COPY | \
+ BDI_CAP_WRITEBACK | BDI_CAP_WRITEBACK_ACCT)
+
#ifndef FALLOC_FL_COLLAPSE_RANGE
#define FALLOC_FL_COLLAPSE_RANGE 0x08 /* remove a range of a file */
#endif
#define MAX_STRING_SIZE 128
#ifndef HAVE_SUPER_SETUP_BDI_NAME
-#ifndef HAVE_BDI_CAP_MAP_COPY
-# define BDI_CAP_MAP_COPY 0
-#endif
-
static int super_setup_bdi_name(struct super_block *sb, char *fmt, ...)
{
struct lustre_sb_info *lsi = s2lsi(sb);
#ifdef HAVE_BDI_IO_PAGES
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.
*/