Linux: 2.6.32 - Adapt to writeback changes
authorMarc Dionne <marc.c.dionne@gmail.com>
Thu, 17 Sep 2009 20:57:52 +0000 (16:57 -0400)
committerDerrick Brashear <shadow|account-1000005@unknown>
Sun, 4 Oct 2009 18:34:01 +0000 (11:34 -0700)
Adapt to the writeback changes in kernel 2.6.32
- Since we define our own backing_dev, it needs to be registered with
the writeback code and attached to the super_block.  Otherwise it
might get ignored when writeback is needed.
- Each backing_dev now gets its own kernel thread.  The name of the
thread is based on the registered name - the openafs one will appear
as "flush-afs".

Reviewed-on: http://gerrit.openafs.org/574
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

acinclude.m4
src/afs/LINUX/osi_vfsops.c
src/cf/linux-test4.m4

index 03a9854..275bc22 100644 (file)
@@ -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
index 89f5612..8f2b401 100644 (file)
@@ -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
index 306587d..6763f15 100644 (file)
@@ -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 <linux/fs.h>],
+[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])
+