]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: switch to evict_inode
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 11 Aug 2010 22:55:29 +0000 (18:55 -0400)
committerDerrick Brashear <shadow@dementia.org>
Tue, 14 Dec 2010 18:16:05 +0000 (10:16 -0800)
In 2.6.36, the delete_inode and clear_inode inode operations
are replaced by evict_inode.
Rename our current clear_inode to evict_inode, and add a few
things that were previously handled by the generic delete_inode.

This is required for 2.6.36.

Reviewed-on: http://gerrit.openafs.org/2544
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry-picked from commit fb01fbd7cd2d396df8a4605eaad9febc52ef3b61)

Reviewed-on: http://gerrit.openafs.org/2552
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e05b5937201ec313d2c8fa863f4dacec87ab687d)
Change-Id: I42a22dbea4f880f5c8bb1cd0904f1711b3a48292
Reviewed-on: http://gerrit.openafs.org/3517
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
acinclude.m4
src/afs/LINUX/osi_vfsops.c
src/cf/linux-test4.m4

index e7a5cc460c9d089452ef04fdb64684994274956b..dcf099cae6b7a4c8fca73ac43b4d094da535f3ea 100644 (file)
@@ -747,6 +747,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_DEFINES_FOR_EACH_PROCESS
                 LINUX_DEFINES_PREV_TASK
                 LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE
+                LINUX_FS_STRUCT_SUPER_HAS_EVICT_INODE
                 LINUX_FS_STRUCT_SUPER_BLOCK_HAS_S_BDI
                 LINUX_STRUCT_BDI_HAS_NAME
                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
@@ -910,6 +911,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_fs_struct_super_has_alloc_inode" = "xyes" ; then
                  AC_DEFINE(STRUCT_SUPER_HAS_ALLOC_INODE, 1, [define if your struct super_operations has alloc_inode])
                 fi
+                if test "x$ac_cv_linux_fs_struct_super_has_evict_inode" = "xyes" ; then
+                 AC_DEFINE(STRUCT_SUPER_OPERATIONS_HAS_EVICT_INODE, 1, [define if your struct super_operations has evict_inode])
+                fi
                 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
                  AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
                 fi
index 7305736eb8e26cccffbbff3cb390dc970cc921e3..fb69d39c83c58c3ec51a61540203f0b0a272b946 100644 (file)
@@ -340,6 +340,25 @@ afs_destroy_inodecache(void)
 }
 #endif
 
+#if defined(STRUCT_SUPER_OPERATIONS_HAS_EVICT_INODE)
+static void
+afs_evict_inode(struct inode *ip)
+{
+    struct vcache *vcp = VTOAFS(ip);
+
+    if (vcp->vlruq.prev || vcp->vlruq.next)
+       osi_Panic("inode freed while on LRU");
+    if (vcp->hnext)
+       osi_Panic("inode freed while still hashed");
+
+    truncate_inode_pages(&ip->i_data, 0);
+    end_writeback(ip);
+
+#if !defined(STRUCT_SUPER_HAS_ALLOC_INODE)
+    afs_osi_Free(ip->u.generic_ip, sizeof(struct vcache));
+#endif
+}
+#else
 static void
 afs_clear_inode(struct inode *ip)
 {
@@ -354,6 +373,7 @@ afs_clear_inode(struct inode *ip)
     afs_osi_Free(ip->u.generic_ip, sizeof(struct vcache));
 #endif
 }
+#endif
 
 /* afs_put_super
  * Called from unmount to release super_block. */
@@ -452,7 +472,11 @@ struct super_operations afs_sops = {
   .alloc_inode =       afs_alloc_inode,
   .destroy_inode =     afs_destroy_inode,
 #endif
+#if defined(STRUCT_SUPER_OPERATIONS_HAS_EVICT_INODE)
+  .evict_inode =       afs_evict_inode,
+#else
   .clear_inode =       afs_clear_inode,
+#endif
   .put_super =         afs_put_super,
   .statfs =            afs_statfs,
 #if !defined(AFS_LINUX24_ENV)
index 06df41d827f0e3913db0fa3f52a93efccb400a47..894593c2830185fbb0d1aa561436e4659d21ae30 100644 (file)
@@ -467,6 +467,18 @@ printk("%p\n", _super.alloc_inode);],
   AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
 
 
+AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_EVICT_INODE], [
+  AC_MSG_CHECKING([for evict_inode in struct super_operations])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_evict_inode], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct super_operations _super;
+printk("%p\n", _super.evict_inode);],
+      ac_cv_linux_fs_struct_super_has_evict_inode=yes,
+      ac_cv_linux_fs_struct_super_has_evict_inode=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_evict_inode)])
+
+
 AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
   AC_MSG_CHECKING([for 3rd argument in posix_lock_file found in new kernels])
   AC_CACHE_VAL([ac_cv_linux_kernel_posix_lock_file_wait_arg], [