diff --git a/acinclude.m4 b/acinclude.m4 index f5a36aa993..e7a5cc460c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -748,6 +748,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_DEFINES_PREV_TASK LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE LINUX_FS_STRUCT_SUPER_BLOCK_HAS_S_BDI + LINUX_STRUCT_BDI_HAS_NAME 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 abb15e6f14..7305736eb8 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -145,7 +145,9 @@ afs_read_super(struct super_block *sb, void *data, int silent) #if defined(HAVE_BDI_INIT) bdi_init(afs_backing_dev_info); #endif +#if defined(STRUCT_BDI_HAS_NAME) afs_backing_dev_info->name = "openafs"; +#endif afs_backing_dev_info->ra_pages = 0; #if defined (STRUCT_SUPER_BLOCK_HAS_S_BDI) sb->s_bdi = afs_backing_dev_info; diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index c3f1bf9d26..2677f04d02 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -1247,3 +1247,17 @@ _t.ctl_name = 0;], if test "x$ac_cv_linux_struct_ctl_table_has_ctl_name" = "xyes"; then AC_DEFINE([STRUCT_CTL_TABLE_HAS_CTL_NAME], 1, [define if struct ctl_table has a ctl_name member]) fi]) + +AC_DEFUN([LINUX_STRUCT_BDI_HAS_NAME], [ + AC_MSG_CHECKING([if struct backing_dev_info has name]) + AC_CACHE_VAL([ac_cv_linux_struct_bdi_has_name], [ + AC_TRY_KBUILD( +[#include ], +[struct backing_dev_info _bdi; +_bdi.name = NULL;], + ac_cv_linux_struct_bdi_has_name=yes, + ac_cv_linux_struct_bdi_has_name=no)]) + AC_MSG_RESULT($ac_cv_linux_struct_bdi_has_name) + if test "x$ac_cv_linux_struct_bdi_has_name" = "xyes"; then + AC_DEFINE([STRUCT_BDI_HAS_NAME], 1, [define if struct backing_dev_info has a name member]) + fi])