diff --git a/acinclude.m4 b/acinclude.m4 index 03a98547a2..275bc22c97 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -904,6 +904,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_DEFINES_FOR_EACH_PROCESS LINUX_DEFINES_PREV_TASK LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE + LINUX_STRUCT_SUPER_BLOCK_HAS_S_BDI LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 89f5612729..8f2b4012f4 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -108,6 +108,11 @@ afs_fill_super(struct super_block *sb, void *data, int silent) #if defined(HAVE_BDI_INIT) bdi_init(&afs_backing_dev_info); #endif +#if defined (STRUCT_SUPER_BLOCK_HAS_S_BDI) + sb->s_bdi = &afs_backing_dev_info; + /* The name specified here will appear in the flushing thread name - flush-afs */ + bdi_register(&afs_backing_dev_info, NULL, "afs"); +#endif #if !defined(AFS_NONFSTRANS) sb->s_export_op = &afs_export_ops; #endif diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 306587d426..6763f15583 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -1289,3 +1289,18 @@ AC_DEFUN([LINUX_KEYS_HAVE_SESSION_TO_PARENT], [ if test "x$ac_cv_linux_have_session_to_parent" = "xyes"; then AC_DEFINE([HAVE_SESSION_TO_PARENT], 1, [define if keyctl has the KEYCTL_SESSION_TO_PARENT function]) fi]) + +AC_DEFUN([LINUX_STRUCT_SUPER_BLOCK_HAS_S_BDI], [ + AC_MSG_CHECKING([if struct super_block has s_bdi]) + AC_CACHE_VAL([ac_cv_linux_struct_super_block_has_s_bdi], [ + AC_TRY_KBUILD( +[#include ], +[struct super_block _sb; +_sb.s_bdi= NULL;], + ac_cv_linux_struct_super_block_has_s_bdi=yes, + ac_cv_linux_struct_super_block_has_s_bdi=no)]) + AC_MSG_RESULT($ac_cv_linux_struct_super_block_has_s_bdi) + if test "x$ac_cv_linux_struct_super_block_has_s_bdi" = "xyes"; then + AC_DEFINE([STRUCT_SUPER_BLOCK_HAS_S_BDI], 1, [define if struct super_block has an s_bdi member]) + fi]) +