DEVEL15-linux-2623-support-20071004

FIXES 70773

update for support for 2.6.23


(cherry picked from commit 127cebfacdaf84292fc1ecfd64c0e8d259aba474)
This commit is contained in:
Marc Dionne 2007-10-05 04:09:55 +00:00 committed by Derrick Brashear
parent 55b966e85c
commit 72f790f180
4 changed files with 59 additions and 1 deletions

View File

@ -597,6 +597,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
) )
LINUX_KERNEL_COMPILE_WORKS LINUX_KERNEL_COMPILE_WORKS
LINUX_HAVE_KMEM_CACHE_T
LINUX_KMEM_CACHE_CREATE_TAKES_DTOR
LINUX_CONFIG_H_EXISTS LINUX_CONFIG_H_EXISTS
LINUX_COMPLETION_H_EXISTS LINUX_COMPLETION_H_EXISTS
LINUX_DEFINES_FOR_EACH_PROCESS LINUX_DEFINES_FOR_EACH_PROCESS
@ -626,6 +628,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T
LINUX_AOP_WRITEBACK_CONTROL LINUX_AOP_WRITEBACK_CONTROL
LINUX_FS_STRUCT_FOP_HAS_FLOCK LINUX_FS_STRUCT_FOP_HAS_FLOCK
LINUX_FS_STRUCT_FOP_HAS_SENDFILE
LINUX_KERNEL_LINUX_SYSCALL_H LINUX_KERNEL_LINUX_SYSCALL_H
LINUX_KERNEL_LINUX_SEQ_FILE_H LINUX_KERNEL_LINUX_SEQ_FILE_H
LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG
@ -870,12 +873,21 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
if test "x$ac_cv_linux_fs_struct_fop_has_flock" = "xyes" ; then if test "x$ac_cv_linux_fs_struct_fop_has_flock" = "xyes" ; then
AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_FLOCK, 1, [define if your struct file_operations has flock]) AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_FLOCK, 1, [define if your struct file_operations has flock])
fi fi
if test "x$ac_cv_linux_fs_struct_fop_has_sendfile" = "xyes" ; then
AC_DEFINE(STRUCT_FILE_OPERATIONS_HAS_SENDFILE, 1, [define if your struct file_operations has sendfile])
fi
if test "x$ac_cv_linux_register_sysctl_table_noflag" = "xyes" ; then if test "x$ac_cv_linux_register_sysctl_table_noflag" = "xyes" ; then
AC_DEFINE(REGISTER_SYSCTL_TABLE_NOFLAG, 1, [define if register_sysctl_table has no insert_at head flag]) AC_DEFINE(REGISTER_SYSCTL_TABLE_NOFLAG, 1, [define if register_sysctl_table has no insert_at head flag])
fi fi
if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if tasklist_lock exported]) AC_DEFINE(EXPORTED_TASKLIST_LOCK, 1, [define if tasklist_lock exported])
fi fi
if test "x$ac_cv_linux_have_kmem_cache_t" = "xyes" ; then
AC_DEFINE(HAVE_KMEM_CACHE_T, 1, [define if kmem_cache_t exists])
fi
if test "x$ac_cv_linux_have_kmem_cache_t" = "xyes" ; then
AC_DEFINE(KMEM_CACHE_TAKES_DTOR, 1, [define if kmem_cache_create takes a destructor argument])
fi
if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" -o "x$ac_cv_linux_func_i_put_link_takes_cookie" = "xyes"; then if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" -o "x$ac_cv_linux_func_i_put_link_takes_cookie" = "xyes"; then
AC_DEFINE(USABLE_KERNEL_PAGE_SYMLINK_CACHE, 1, [define if your kernel has a usable symlink cache API]) AC_DEFINE(USABLE_KERNEL_PAGE_SYMLINK_CACHE, 1, [define if your kernel has a usable symlink cache API])
else else

View File

@ -269,7 +269,11 @@ afs_notify_change(struct dentry *dp, struct iattr *iattrp)
#if defined(STRUCT_SUPER_HAS_ALLOC_INODE) #if defined(STRUCT_SUPER_HAS_ALLOC_INODE)
#if defined(HAVE_KMEM_CACHE_T)
static kmem_cache_t *afs_inode_cachep; static kmem_cache_t *afs_inode_cachep;
#else
struct kmem_cache *afs_inode_cachep;
#endif
static struct inode * static struct inode *
afs_alloc_inode(struct super_block *sb) afs_alloc_inode(struct super_block *sb)
@ -294,7 +298,11 @@ afs_destroy_inode(struct inode *inode)
} }
static void static void
#if defined(HAVE_KMEM_CACHE_T)
init_once(void * foo, kmem_cache_t * cachep, unsigned long flags) init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
#else
init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
#endif
{ {
struct vcache *vcp = (struct vcache *) foo; struct vcache *vcp = (struct vcache *) foo;
@ -312,10 +320,17 @@ afs_init_inodecache(void)
#define SLAB_RECLAIM_ACCOUNT 0 #define SLAB_RECLAIM_ACCOUNT 0
#endif #endif
#if defined(KMEM_CACHE_TAKES_DTOR)
afs_inode_cachep = kmem_cache_create("afs_inode_cache", afs_inode_cachep = kmem_cache_create("afs_inode_cache",
sizeof(struct vcache), sizeof(struct vcache),
0, SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT, 0, SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT,
init_once, NULL); init_once, NULL);
#else
afs_inode_cachep = kmem_cache_create("afs_inode_cache",
sizeof(struct vcache),
0, SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT,
init_once);
#endif
if (afs_inode_cachep == NULL) if (afs_inode_cachep == NULL)
return -ENOMEM; return -ENOMEM;
return 0; return 0;

View File

@ -658,7 +658,7 @@ struct file_operations afs_file_fops = {
.mmap = afs_linux_mmap, .mmap = afs_linux_mmap,
.open = afs_linux_open, .open = afs_linux_open,
.flush = afs_linux_flush, .flush = afs_linux_flush,
#ifdef AFS_LINUX26_ENV #if defined(AFS_LINUX26_ENV) && defined(STRUCT_FILE_OPERATIONS_HAS_SENDFILE)
.sendfile = generic_file_sendfile, .sendfile = generic_file_sendfile,
#endif #endif
.release = afs_linux_release, .release = afs_linux_release,

View File

@ -871,3 +871,34 @@ fl_owner_t id;
ac_cv_linux_func_f_flush_takes_fl_owner_t=no)]) ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)]) AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
AC_MSG_CHECKING([whether kmem_cache_t exists])
AC_CACHE_VAL([ac_cv_linux_have_kmem_cache_t], [
AC_TRY_KBUILD(
[#include <linux/slab.h>],
[kmem_cache_t *k;],
ac_cv_linux_have_kmem_cache_t=yes,
ac_cv_linux_have_kmem_cache_t=no)])
AC_MSG_RESULT($ac_cv_linux_have_kmem_cache_t)])
AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
AC_MSG_CHECKING([whether kmem_cache_create takes a destructor argument])
AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_takes_dtor], [
AC_TRY_KBUILD(
[#include <linux/slab.h>],
[kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
ac_cv_linux_kmem_cache_create_takes_dtor=yes,
ac_cv_linux_kmem_cache_create_takes_dtor=no)])
AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_takes_dtor)])
AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SENDFILE], [
AC_MSG_CHECKING([for sendfile in struct file_operations])
AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_sendfile], [
AC_TRY_KBUILD(
[#include <linux/fs.h>],
[struct file_operations _fop;
_fop.sendfile(NULL, NULL, 0, 0, NULL);],
ac_cv_linux_fs_struct_fop_has_sendfile=yes,
ac_cv_linux_fs_struct_fop_has_sendfile=no)])
AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])