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>
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
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
}
#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)
{
afs_osi_Free(ip->u.generic_ip, sizeof(struct vcache));
#endif
}
+#endif
/* afs_put_super
* Called from unmount to release super_block. */
.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)
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], [