Linux: bdi doesn't always have a name

The 'name' element of the backing_dev_info structure is new in
2.6.32 - add yet another configure test, and #ifdef to protect our
setting of it.

Change-Id: I0a3e411e571e05771619381bf621d299482c695b
Reviewed-on: http://gerrit.openafs.org/1341
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a9951410e1)
Reviewed-on: http://gerrit.openafs.org/1498
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
This commit is contained in:
Simon Wilkinson 2010-02-18 23:09:40 +00:00 committed by Derrick Brashear
parent c55f6dce58
commit ca99b18ab8
3 changed files with 17 additions and 0 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 <linux/backing-dev.h>],
[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])