]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: bdi doesn't always have a name
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Thu, 18 Feb 2010 23:09:40 +0000 (23:09 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 3 Mar 2010 16:26:47 +0000 (08:26 -0800)
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 a9951410e1cb1a713f9d26a24d6b3cf485f94ac6)
Reviewed-on: http://gerrit.openafs.org/1498
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
acinclude.m4
src/afs/LINUX/osi_vfsops.c
src/cf/linux-test4.m4

index f5a36aa9933712ddba33c5c808f27f29a61cd59d..e7a5cc460c9d089452ef04fdb64684994274956b 100644 (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
index abb15e6f144caff23da0f1620691f1bdd35a8b35..7305736eb8e26cccffbbff3cb390dc970cc921e3 100644 (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;
index c3f1bf9d26a5f8c05c20cab521fd46cfc250a604..2677f04d02f5113e4404bddf57c68a662ce1c93b 100644 (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])