From: James Simmons Date: Tue, 2 Jul 2013 12:39:50 +0000 (-0400) Subject: LU-2800 autoconf: remove obsolete autoconf options X-Git-Tag: 2.4.52~14 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=0aec97df129d2c6263c66454ee9039cd5dbfdf85 LU-2800 autoconf: remove obsolete autoconf options This commit combines 53 previous commits that only remove tests and the corresponding dead code. The only exceptions are whitespace removal in lustre/autoconf/lustre-core.m4 and removal of dead code shrinking an if/else in lustre/llite/dir.c. Summary follows: autoconf: remove d_rehash_cond and __d_rehash tests - d_rehash_cond and __d_rehash were never exported in a mainline release. - A check of the RHEL6 and SLES11 SP2 sources shows they don't export them either. autoconf: remove LC_TASK_CLENV_STORE - LC_TASK_CLENV_STORE checks to see if task_struct->tux_info exists. - That was only the case on RHEL5, so we can drop it. The rest of the code is untouched since liblustre uses the same infrastructure. autoconf: remove filemap_populate, vm_ops->fault tests - filemap_populate and the vm_ops->fault have been deprecated or removed since v2.6.23. autoconf: remove LC_UMOUNTBEGIN_HAS_VFSMOUNT test - super_operations.umount_begin has taken a super_block since v2.6.26. autoconf: remove LC_CANCEL_DIRTY_PAGE test - cancel_dirty_page was added in v2.6.20 autoconf: remove crypto API checks - The block_cipher, hash_desc, and blkcipher_desc APIs have been added since v2.6.19. autoconf: remove LC_KERNEL_SPLICE_READ test - file_operations.splice_read has upstream since v2.6.23. autoconf: remove LC_KERNEL_SENDFILE test - file_operations.sendfile has been removed since v2.6.23. - RHEL4 versions had both APIs, but RHEL4 has been out of scope for some time. autoconf: remove LC_HAVE_EXPORTFS_H test - has been in the upstream kernel since v2.6.23. autoconf: remove unused LC_EXPORTFS_DECODE_FH test - exportfs_decode_fh has been upstream since v2.6.23. autoconf: remove unused LC_HAVE_MMTYPES_H test - has been upstream since v2.6.24. autoconf: remove LC_FH_TO_DENTRY test - export_operations.fh_to_dentry has been upstream since v2.6.24. autoconf: remove LC_EXPORT_BDI_INIT test - bdi_init has been in the upstream kernel since v2.6.24. autoconf: remove LC_PGMKWRITE_USE_VMFAULT test - vm_ops->page_mkwrite has taken a vm_fault pointer since v2.6.27. autoconf: remove LC_PGMKWRITE_COMPACT - The vm_operation_struct._pmkw variant of page_mkwrite never existed upstream. autoconf: remove LC_TRYLOCKPAGE test - trylock_page has been in the upstream kernel since v2.6.27. autoconf: remove unused LC_READ_INODE_IN_SBOPS test - super_operations->read_inode hasn't been in the upstream kernel since v2.6.26. autoconf: remove LC_EXPORT_INODE_PERMISSION test - inode_permission has been in the upstream kernel since v2.6.27. autoconf: remove LC_VFS_DQ_OFF test - vfs_dq_off was in the upstream kernel from v2.6.27..v2.6.33 - Commit 86097b23 (LU-2642 quota: update quota APIs) introduced support for the APIs used in v2.6.34. autoconf: remove LC_SB_HAS_QUOTA_ACTIVE test - sb_has_quota_active has been in the upstream kernel since v2.6.29. autoconf: remove LC_BDI_NAME test - backing_dev_info.name has been in the upstream kernel since v2.6.32. autoconf: remove LC_EXPORT_ADD_TO_PAGE_CACHE_LRU test - add_to_page_cache_lru has been in the upstream kernel since v2.6.30. - Also remove the now unused LC_PAGEVEC_LRU_ADD_FILE test. autoconf: remove LC_SB_ANY_QUOTA_ACTIVE test - sb_any_quota_active has been removed from the upstream kernel since v2.6.27. autoconf: remove LC_BLK_QUEUE_LOG_BLK_SIZE test - blk_queue_logical_block_size replaced blk_queue_hardsect_size in v2.6.31. autoconf: remove LC_VFS_INODE_NEWSIZE_OK test - inode_newsize_ok has been upstream since v2.6.32. autoconf: remove LC_CACHE_UPCALL test - cache_detail.cache_request was renamed to cache_detail.cache_upcall in v2.6.32. autoconf: remove LC_REQUEST_QUEUE_LIMITS test - request_queue.limits has been upstream since v2.6.32. autoconf: remove LC_EXPORT_BDI_REGISTER test - bdi_register has been upstream since v2.6.32. autoconf: remove LC_SB_BDI test - super_block.s_bdi was added to the upstream kernel in v2.6.32. autoconf: remove LC_BLK_QUEUE_MAX_SECTORS test - blk_queue_max_sectors was replaced with blk_queue_max_hw_sectors in v2.6.32. autoconf: remove LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE test - generic_error_remove_page has been upstream since v2.6.32. autoconf: remove LC_EXPORT_ACCESS_PROCESS_VM test - access_process_vm has been exported from the kernel since v2.6.24. autoconf: remove LC_SELINUX_IS_ENABLED test - selinux_is_enabled has been in the upstream kernel since v2.6.32. autoconf: remove LC_D_OBTAIN_ALIAS test - d_obtain_alias has been upstream since v2.6.28. autoconf: remove LC_WRITE_BEGIN_END test - address_space_operations.write_begin/end have been upstream since v2.6.29. autoconf: remove LC_DENTRY_OPEN_4ARGS test - dentry_open took 4 arguments between v2.6.29..v3.5. - The new 3 argument version is tested with LC_DENTRY_OPEN_USE_PATH. autoconf: remove LIBCFS_TASKLIST_LOCK test - tasklist_lock hasn't been exported since v2.6.18. autoconf: remove LIBCFS_DIGEST_SETKEY_FLAGS test - digest_alt.dia_setkey took 4 arguments from v2.6.18..v2.6.32. - The code protected by this test was made obsolete by the LIBCFS_STRUCT_SHASH_ALG test. autoconf: remove LIBCFS_KMEM_CACHE_DESTROY_INT test - kmem_cache_destroy has returned void since v2.6.19. autoconf: remove LIBCFS_3ARGS_INIT_WORK test - INIT_WORK has taken two arguments since v2.6.20. autoconf: remove LIBCFS_2ARGS_REGISTER_SYSCTL test - register_sysctl_table has taken one argument since v2.6.21. autoconf: remove LIBCFS_KMEM_CACHE_CREATE_DTOR tests - kmem_cache_create hasn't had a dtor argument since v2.6.22. autoconf: remove LC_REGISTER_SHRINKER test - register_shrinker has been upstream since v2.6.23. autoconf: remove LIBCFS_SCATTERLIST_SETPAGE test - sg_set_page has been upstream since v2.6.24. autoconf: remove LIBCFS_SCATTERLIST_INITTABLE test - sg_init_table has been upstream since v2.6.24. autoconf: remove unused LIBCFS_NETWORK_NAMESPACE test - init_net has been upstream since v2.6.24. autoconf: remove unused LIBCFS_SEM_COUNT test - semaphores haven't used an atomic since v2.6.25. autoconf: remove LIBCFS_CRED_WRAPPERS test - The cred wrappers have been upstream since v2.6.29. autoconf: remove LIBCFS_STRUCT_CRED_IN_TASK test - struct cred has been a member of task_struct since v2.6.29. autoconf: remove LIBCFS_STRUCT_SHASH_ALG test - struct shash_alg has been upstream since v2.6.29. autoconf: remove LIBCFS_FUNC_UNSHARE_FS_STRUCT test - unshare_fs_struct has been upstream since v2.6.30. autoconf: remove LIBCFS_HAVE_SET_MEMS_ALLOWED test - set_mems_allowed has been upstream since v2.6.31. We can remove the tests and dead code. Signed-off-by: Jeff Mahoney Signed-off-by: James Simmons Change-Id: I1e8c24bfc8e86169543ac41939d4d33317665b14 Reviewed-on: http://review.whamcloud.com/5505 Tested-by: Hudson Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: Alexey Shvetsov Reviewed-by: Oleg Drokin --- diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4 index 0f53b9a..de86a96 100644 --- a/libcfs/autoconf/lustre-libcfs.m4 +++ b/libcfs/autoconf/lustre-libcfs.m4 @@ -82,56 +82,6 @@ LB_LINUX_TRY_COMPILE([ EXTRA_KCFLAGS="$tmp_flags" ]) -# LIBCFS_TASKLIST_LOCK -# 2.6.18 remove tasklist_lock export -AC_DEFUN([LIBCFS_TASKLIST_LOCK], -[LB_CHECK_SYMBOL_EXPORT([tasklist_lock], -[kernel/fork.c],[ -AC_DEFINE(HAVE_TASKLIST_LOCK, 1, - [tasklist_lock exported]) -],[ -]) -]) - -# LIBCFS_DIGEST_SETKEY_FLAGS -# digest_alg.dia_setkey takes 4 args (2.6.18) -# -AC_DEFUN([LIBCFS_DIGEST_SETKEY_FLAGS], -[AC_MSG_CHECKING([if kernel dia_setkey takes 4 args]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - struct digest_alg alg; - - alg.dia_setkey(NULL, NULL, 0, NULL); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_DIGEST_SETKEY_FLAGS, 1, [kernel dia_setkey takes 4 args]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.19 API changes -# kmem_cache_destroy(cachep) return void instead of -# int -AC_DEFUN([LIBCFS_KMEM_CACHE_DESTROY_INT], -[AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - int i __attribute__ ((unused)); - i = kmem_cache_destroy(NULL); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1, - [kmem_cache_destroy(cachep) return int]) -],[ - AC_MSG_RESULT(NO) -]) -]) - # check cpumask_size (2.6.28) AC_DEFUN([LIBCFS_CPUMASK_SIZE], [AC_MSG_CHECKING([whether have cpumask_size()]) @@ -270,74 +220,6 @@ LB_LINUX_TRY_COMPILE([ ]) -# 2.6.20 API change INIT_WORK use 2 args and not -# store data inside -AC_DEFUN([LIBCFS_3ARGS_INIT_WORK], -[AC_MSG_CHECKING([check INIT_WORK want 3 args]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct work_struct work __attribute__ ((unused)); - - INIT_WORK(&work, NULL, NULL); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_3ARGS_INIT_WORK, 1, - [INIT_WORK use 3 args and store data inside]) -],[ - AC_MSG_RESULT(NO) -]) -]) - -# 2.6.21 api change. 'register_sysctl_table' use only one argument, -# instead of more old which need two. -AC_DEFUN([LIBCFS_2ARGS_REGISTER_SYSCTL], -[AC_MSG_CHECKING([check register_sysctl_table want 2 args]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - register_sysctl_table(NULL,0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_2ARGS_REGISTER_SYSCTL, 1, - [register_sysctl_table want 2 args]) -],[ - AC_MSG_RESULT(NO) -]) -]) - -# 2.6.23 lost dtor argument -AC_DEFUN([LIBCFS_KMEM_CACHE_CREATE_DTOR], -[AC_MSG_CHECKING([check kmem_cache_create has dtor argument]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - kmem_cache_create(NULL, 0, 0, 0, NULL, NULL); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KMEM_CACHE_CREATE_DTOR, 1, - [kmem_cache_create has dtor argument]) -],[ - AC_MSG_RESULT(NO) -]) -]) - -#2.6.23 has new shrinker API -AC_DEFUN([LC_REGISTER_SHRINKER], -[AC_MSG_CHECKING([if kernel has register_shrinker]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - register_shrinker(NULL); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_REGISTER_SHRINKER, 1, - [kernel has register_shrinker]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # 2.6.24 request not use real numbers for ctl_name AC_DEFUN([LIBCFS_SYSCTL_UNNUMBERED], [AC_MSG_CHECKING([for CTL_UNNUMBERED]) @@ -356,57 +238,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.24 lost scatterlist->page -AC_DEFUN([LIBCFS_SCATTERLIST_SETPAGE], -[AC_MSG_CHECKING([for exist sg_set_page]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - sg_set_page(NULL,NULL,0,0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SCATTERLIST_SETPAGE, 1, - [struct scatterlist has no page member]) -],[ - AC_MSG_RESULT(NO) -]) -]) - -# 2.6.24-rc1 sg_init_table -AC_DEFUN([LIBCFS_SCATTERLIST_INITTABLE], -[AC_MSG_CHECKING([for sg_init_table]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - sg_init_table(NULL,0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SCATTERLIST_INITTABLE, 1, - [scatterlist has sg_init_table]) -],[ - AC_MSG_RESULT(NO) -]) -]) - -# 2.6.24 -AC_DEFUN([LIBCFS_NETWORK_NAMESPACE], -[AC_MSG_CHECKING([for network stack has namespaces]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct net *net __attribute__ ((unused)); - net = &init_net; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_INIT_NET, 1, - [kernel is support network namespaces ]) -],[ - AC_MSG_RESULT(NO) -]) -]) - # # LIBCFS_FUNC_DUMP_TRACE # @@ -481,24 +312,6 @@ EXTRA_KCFLAGS="$tmp_flags" ]) -# 2.6.26 use int instead of atomic for sem.count -AC_DEFUN([LIBCFS_SEM_COUNT], -[AC_MSG_CHECKING([atomic sem.count]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct semaphore s __attribute__ ((unused)); - - atomic_read(&s.count); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SEM_COUNT_ATOMIC, 1, - [semaphore counter is atomic]) -],[ - AC_MSG_RESULT(NO) -]) -]) - # 2.6.27 have second argument to sock_map_fd AC_DEFUN([LIBCFS_SOCK_MAP_FD_2ARG], [AC_MSG_CHECKING([sock_map_fd have second argument]) @@ -515,89 +328,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# LIBCFS_CRED_WRAPPERS -# -# wrappers for task's credentials are in sles11 -# -AC_DEFUN([LIBCFS_CRED_WRAPPERS], -[AC_MSG_CHECKING([if kernel has wrappers for task's credentials]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - uid_t uid; - - uid = current_uid() + sizeof(uid); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_CRED_WRAPPERS, 1, [task's cred wrappers found]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LN_STRUCT_CRED_IN_TASK -# -# struct cred was introduced in 2.6.29 to streamline credentials in task struct -# -AC_DEFUN([LIBCFS_STRUCT_CRED_IN_TASK], -[AC_MSG_CHECKING([if kernel has struct cred]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct task_struct *tsk = NULL; - tsk->real_cred = NULL; -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_STRUCT_CRED, 1, [struct cred found]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# LIBCFS_STRUCT_SHASH_ALG -# struct shash_alg was introduced in 2.6.29 -# -AC_DEFUN([LIBCFS_STRUCT_SHASH_ALG], -[AC_MSG_CHECKING([if kernel has struct shash_alg]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - struct shash_alg foo; -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_STRUCT_SHASH_ALG, 1, [kernel has struct shash_alg]) -],[ - AC_MSG_RESULT([no]) -]) -]) - - -# -# LIBCFS_FUNC_UNSHARE_FS_STRUCT -# -# unshare_fs_struct was introduced in 2.6.30 to prevent others to directly -# mess with copy_fs_struct -# -AC_DEFUN([LIBCFS_FUNC_UNSHARE_FS_STRUCT], -[AC_MSG_CHECKING([if kernel defines unshare_fs_struct()]) -tmp_flags="$EXTRA_KCFLAGS" -EXTRA_KCFLAGS="-Werror" -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - unshare_fs_struct(); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_UNSHARE_FS_STRUCT, 1, [unshare_fs_struct found]) -],[ - AC_MSG_RESULT([no]) -]) -EXTRA_KCFLAGS="$tmp_flags" -]) - # # LIBCFS_HAVE_IS_COMPAT_TASK # @@ -648,27 +378,6 @@ AC_DEFUN([LIBCFS_HAVE_KEYTYPE_H], ]) # -# check set_mems_allowed -# 2.6.31 adds function set_mems_allowed in cpuset.h -# -AC_DEFUN([LIBCFS_HAVE_SET_MEMS_ALLOWED], -[AC_MSG_CHECKING([whether have set_mems_allowed()]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - nodemask_t mask; - - set_mems_allowed(mask); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SET_MEMS_ALLOWED, 1, [have set_mems_allowed()]) -],[ - AC_MSG_RESULT(NO) -]) -]) - - -# # RHEL6/2.6.32 want to have pointer to shrinker self pointer in handler function # AC_DEFUN([LC_SHRINKER_WANT_SHRINK_PTR], @@ -802,40 +511,17 @@ LIBCFS_CONFIG_PANIC_DUMPLOG LIBCFS_U64_LONG_LONG_LINUX # 2.6.18 -LIBCFS_TASKLIST_LOCK LIBCFS_HAVE_IS_COMPAT_TASK -LIBCFS_DIGEST_SETKEY_FLAGS -# 2.6.19 -LIBCFS_KMEM_CACHE_DESTROY_INT -# 2.6.20 -LIBCFS_3ARGS_INIT_WORK -# 2.6.21 -LIBCFS_2ARGS_REGISTER_SYSCTL -# 2.6.23 -LIBCFS_KMEM_CACHE_CREATE_DTOR -LC_REGISTER_SHRINKER # 2.6.24 LIBCFS_SYSCTL_UNNUMBERED -LIBCFS_SCATTERLIST_SETPAGE -LIBCFS_SCATTERLIST_INITTABLE -LIBCFS_NETWORK_NAMESPACE LIBCFS_FUNC_DUMP_TRACE LIBCFS_HAVE_KEYTYPE_H -# 2.6.26 -LIBCFS_SEM_COUNT -# 2.6.27 -LIBCFS_CRED_WRAPPERS # 2.6.28 LIBCFS_CPUMASK_SIZE # 2.6.29 -LIBCFS_STRUCT_CRED_IN_TASK LIBCFS_CPU_TOPOLOGY -LIBCFS_STRUCT_SHASH_ALG # 2.6.30 -LIBCFS_FUNC_UNSHARE_FS_STRUCT LIBCFS_SOCK_MAP_FD_2ARG -# 2.6.31 -LIBCFS_HAVE_SET_MEMS_ALLOWED # 2.6.32 LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK LC_SHRINKER_WANT_SHRINK_PTR diff --git a/libcfs/include/libcfs/linux/kp30.h b/libcfs/include/libcfs/linux/kp30.h index de4f27b..4e2efba 100644 --- a/libcfs/include/libcfs/linux/kp30.h +++ b/libcfs/include/libcfs/linux/kp30.h @@ -73,26 +73,8 @@ #include -#ifdef HAVE_3ARGS_INIT_WORK - -#define prepare_work(wq,cb,cbdata) \ -do { \ - INIT_WORK((wq), (void *)(cb), (void *)(cbdata)); \ -} while (0) - -#define cfs_get_work_data(type,field,data) (data) - -#else - -#define prepare_work(wq,cb,cbdata) \ -do { \ - INIT_WORK((wq), (void *)(cb)); \ -} while (0) - #define cfs_get_work_data(type,field,data) container_of(data,type,field) -#endif - #define cfs_num_online_cpus() num_online_cpus() #define wait_on_page wait_on_page_locked #define our_recalc_sigpending(current) recalc_sigpending() @@ -110,12 +92,6 @@ do { \ #define LASSERT_SEM_LOCKED(sem) LASSERT(down_trylock(sem) != 0) #define LASSERT_MUTEX_LOCKED(x) LASSERT(mutex_is_locked(x)) -#ifdef HAVE_SEM_COUNT_ATOMIC -#define SEM_COUNT(sem) (atomic_read(&(sem)->count)) -#else -#define SEM_COUNT(sem) ((sem)->count) -#endif - #define LIBCFS_PANIC(msg) panic(msg) /* ------------------------------------------------------------------- */ @@ -328,22 +304,6 @@ extern int lwt_snapshot (cfs_cycles_t *now, int *ncpu, int *total_size, #undef _LWORDSIZE -/* compat macroses */ -#ifndef HAVE_SCATTERLIST_SETPAGE -static inline void sg_set_page(struct scatterlist *sg, struct page *page, - unsigned int len, unsigned int offset) -{ - sg->page = page; - sg->offset = offset; - sg->length = len; -} - -static inline void sg_assign_page(struct scatterlist *sg, struct page *page) -{ - sg->page = page; -} -#endif - #define cfs_smp_processor_id() smp_processor_id() #ifndef get_cpu diff --git a/libcfs/include/libcfs/linux/libcfs.h b/libcfs/include/libcfs/linux/libcfs.h index dbf5369..c98dcdb 100644 --- a/libcfs/include/libcfs/linux/libcfs.h +++ b/libcfs/include/libcfs/linux/libcfs.h @@ -132,47 +132,4 @@ typedef long long_ptr_t; #define WITH_WATCHDOG #endif -#ifndef HAVE_STRUCT_CRED - -#define current_cred() (current) - -#define current_cred_xxx(xxx) \ -({ \ - current->xxx; \ -}) - -#ifndef HAVE_CRED_WRAPPERS - -#define current_uid() (current_cred_xxx(uid)) -#define current_gid() (current_cred_xxx(gid)) -#define current_euid() (current_cred_xxx(euid)) -#define current_egid() (current_cred_xxx(egid)) -#define current_suid() (current_cred_xxx(suid)) -#define current_sgid() (current_cred_xxx(sgid)) -#define current_fsuid() (current_cred_xxx(fsuid)) -#define current_fsgid() (current_cred_xxx(fsgid)) -#define current_cap() (current_cred_xxx(cap_effective)) - -#endif /* HAVE_LINUX_CRED_H */ - -#define current_user() (current_cred_xxx(user)) -#define current_user_ns() (current_cred_xxx(user)->user_ns) -#define current_security() (current_cred_xxx(security)) - -#define cred task_struct - -#define prepare_creds() (current) -#define commit_creds(a) - -#endif /* HAVE_STRUCT_CRED */ - -#ifndef HAVE_SCATTERLIST_INITTABLE -#define sg_init_table(sg, nents) memset(sg, 0, sizeof(*(sg))*(nents)) -#endif - -#ifndef HAVE_SCATTERLIST_SETPAGE -#define sg_set_page(sg, p, len, off) \ - sg_set_buf(sg, page_address(p) + ((off) & ~CFS_PAGE_MASK), len) -#endif - #endif /* _LINUX_LIBCFS_H */ diff --git a/libcfs/include/libcfs/linux/linux-mem.h b/libcfs/include/libcfs/linux/linux-mem.h index 0ece47d..43e4f5c 100644 --- a/libcfs/include/libcfs/linux/linux-mem.h +++ b/libcfs/include/libcfs/linux/linux-mem.h @@ -121,7 +121,6 @@ extern void *cfs_mem_cache_cpt_alloc(struct kmem_cache *cachep, # define shrink_param(sc, var) (var) #endif -#ifdef HAVE_REGISTER_SHRINKER typedef int (*shrinker_t)(SHRINKER_ARGS(sc, nr_to_scan, gfp_mask)); static inline @@ -150,6 +149,5 @@ void remove_shrinker(struct shrinker *shrinker) unregister_shrinker(shrinker); kfree(shrinker); } -#endif #endif /* __LINUX_CFS_MEM_H__ */ diff --git a/libcfs/include/libcfs/linux/linux-prim.h b/libcfs/include/libcfs/linux/linux-prim.h index 31298e1..b0bdb58 100644 --- a/libcfs/include/libcfs/linux/linux-prim.h +++ b/libcfs/include/libcfs/linux/linux-prim.h @@ -124,11 +124,7 @@ typedef struct miscdevice cfs_psdev_t; typedef struct ctl_table cfs_sysctl_table_t; typedef struct ctl_table_header cfs_sysctl_table_header_t; -#ifdef HAVE_2ARGS_REGISTER_SYSCTL -#define cfs_register_sysctl_table(t, a) register_sysctl_table(t, a) -#else #define cfs_register_sysctl_table(t, a) register_sysctl_table(t) -#endif #define cfs_unregister_sysctl_table(t) unregister_sysctl_table(t) #define DECLARE_PROC_HANDLER(name) \ diff --git a/libcfs/include/libcfs/linux/linux-tcpip.h b/libcfs/include/libcfs/linux/linux-tcpip.h index b358773..b79aac7 100644 --- a/libcfs/include/libcfs/linux/linux-tcpip.h +++ b/libcfs/include/libcfs/linux/linux-tcpip.h @@ -91,12 +91,4 @@ static inline wait_queue_head_t *cfs_sk_sleep(struct sock *sk) #else #define cfs_sk_sleep(sk) sk_sleep(sk) #endif - -#ifdef HAVE_INIT_NET -#define DEFAULT_NET (&init_net) -#else -/* some broken backports */ -#define DEFAULT_NET (NULL) -#endif - #endif diff --git a/libcfs/include/libcfs/winnt/kp30.h b/libcfs/include/libcfs/winnt/kp30.h index d1a88b6..2b71184 100644 --- a/libcfs/include/libcfs/winnt/kp30.h +++ b/libcfs/include/libcfs/winnt/kp30.h @@ -53,7 +53,6 @@ void libcfs_unregister_panic_notifier(); #define cfs_work_struct_t WORK_QUEUE_ITEM -#define cfs_prepare_work(tq, routine, contex) #define cfs_schedule_work(tq) #define cfs_get_work_data(type,field,data) (data) diff --git a/libcfs/libcfs/linux/linux-cpu.c b/libcfs/libcfs/linux/linux-cpu.c index 953cedd..99327ba 100644 --- a/libcfs/libcfs/linux/linux-cpu.c +++ b/libcfs/libcfs/linux/linux-cpu.c @@ -656,9 +656,7 @@ cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt) #else rc = set_cpus_allowed_ptr(cfs_current(), cpumask); #endif -#ifdef HAVE_SET_MEMS_ALLOWED set_mems_allowed(*nodemask); -#endif if (rc == 0) cfs_schedule(); /* switch to allowed CPU */ diff --git a/libcfs/libcfs/linux/linux-crypto-adler.c b/libcfs/libcfs/linux/linux-crypto-adler.c index 5b74389..5eec002 100644 --- a/libcfs/libcfs/linux/linux-crypto-adler.c +++ b/libcfs/libcfs/linux/linux-crypto-adler.c @@ -31,11 +31,7 @@ #include #include -#ifdef HAVE_STRUCT_SHASH_ALG #include -#else -#include -#endif #define CHKSUM_BLOCK_SIZE 1 @@ -56,7 +52,6 @@ static int adler32_cra_init(struct crypto_tfm *tfm) return 0; } -#ifdef HAVE_STRUCT_SHASH_ALG static int adler32_setkey(struct crypto_shash *hash, const u8 *key, unsigned int keylen) { @@ -134,86 +129,15 @@ static struct shash_alg alg = { .cra_init = adler32_cra_init, } }; -#else /* HAVE_STRUCT_SHASH_ALG */ -#ifdef HAVE_DIGEST_SETKEY_FLAGS -static int adler32_digest_setkey(struct crypto_tfm *tfm, const u8 *key, - unsigned int keylen, u32 *flags) -#else -static int adler32_digest_setkey(struct crypto_tfm *tfm, const u8 *key, - unsigned int keylen) -#endif -{ - u32 *mctx = crypto_tfm_ctx(tfm); - - if (keylen != sizeof(u32)) { - tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; - return -EINVAL; - } - *mctx = le32_to_cpup((__le32 *)key); - return 0; -} - -static void adler32_digest_init(struct crypto_tfm *tfm) -{ - u32 *mctx = crypto_tfm_ctx(tfm); - - *mctx = 0; - -} -static void adler32_digest_update(struct crypto_tfm *tfm, const u8 *data, - unsigned int len) -{ - u32 *crcp = crypto_tfm_ctx(tfm); - - *crcp = __adler32(*crcp, data, len); -} - -static void adler32_digest_final(struct crypto_tfm *tfm, u8 *out) -{ - u32 *chksum = crypto_tfm_ctx(tfm); - - *(__le32 *)out = cpu_to_le32p(chksum); -} - -static struct crypto_alg alg = { - .cra_name = "adler32", - .cra_flags = CRYPTO_ALG_TYPE_DIGEST, - .cra_driver_name = "adler32-zlib", - .cra_priority = 100, - .cra_blocksize = CHKSUM_BLOCK_SIZE, - .cra_ctxsize = sizeof(u32), - .cra_module = THIS_MODULE, - .cra_init = adler32_cra_init, - .cra_list = LIST_HEAD_INIT(alg.cra_list), - .cra_u = { - .digest = { - .dia_digestsize = CHKSUM_DIGEST_SIZE, - .dia_setkey = adler32_digest_setkey, - .dia_init = adler32_digest_init, - .dia_update = adler32_digest_update, - .dia_final = adler32_digest_final - } - } -}; -#endif /* HAVE_STRUCT_SHASH_ALG */ - int cfs_crypto_adler32_register(void) { -#ifdef HAVE_STRUCT_SHASH_ALG return crypto_register_shash(&alg); -#else - return crypto_register_alg(&alg); -#endif } EXPORT_SYMBOL(cfs_crypto_adler32_register); void cfs_crypto_adler32_unregister(void) { -#ifdef HAVE_STRUCT_SHASH_ALG crypto_unregister_shash(&alg); -#else - crypto_unregister_alg(&alg); -#endif } EXPORT_SYMBOL(cfs_crypto_adler32_unregister); diff --git a/libcfs/libcfs/linux/linux-crypto-crc32.c b/libcfs/libcfs/linux/linux-crypto-crc32.c index bc40867..83af630 100644 --- a/libcfs/libcfs/linux/linux-crypto-crc32.c +++ b/libcfs/libcfs/linux/linux-crypto-crc32.c @@ -31,11 +31,7 @@ #include #include -#ifdef HAVE_STRUCT_SHASH_ALG #include -#else -#include -#endif #define CHKSUM_BLOCK_SIZE 1 #define CHKSUM_DIGEST_SIZE 4 @@ -56,7 +52,6 @@ static int crc32_cra_init(struct crypto_tfm *tfm) } -#ifdef HAVE_STRUCT_SHASH_ALG /* * Setting the seed allows arbitrary accumulators and flexible XOR policy * If your algorithm starts with ~0, then XOR with ~0 before you set @@ -140,85 +135,15 @@ static struct shash_alg alg = { .cra_init = crc32_cra_init, } }; -#else /* HAVE_STRUCT_SHASH_ALG */ -#ifdef HAVE_DIGEST_SETKEY_FLAGS -static int crc32_digest_setkey(struct crypto_tfm *tfm, const u8 *key, - unsigned int keylen, unsigned int *flags) -#else -static int crc32_digest_setkey(struct crypto_tfm *tfm, const u8 *key, - unsigned int keylen) -#endif -{ - u32 *mctx = crypto_tfm_ctx(tfm); - - if (keylen != sizeof(u32)) { - tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; - return -EINVAL; - } - *mctx = le32_to_cpup((__le32 *)key); - return 0; -} - -static void crc32_digest_init(struct crypto_tfm *tfm) -{ - u32 *mctx = crypto_tfm_ctx(tfm); - - *mctx = 0; - -} -static void crc32_digest_update(struct crypto_tfm *tfm, const u8 *data, - unsigned int len) -{ - u32 *crcp = crypto_tfm_ctx(tfm); - - *crcp = __crc32_le(*crcp, data, len); -} - -static void crc32_digest_final(struct crypto_tfm *tfm, u8 *out) -{ - u32 *crcp = crypto_tfm_ctx(tfm); - - *(__le32 *)out = cpu_to_le32p(crcp); -} - -static struct crypto_alg alg = { - .cra_name = "crc32", - .cra_flags = CRYPTO_ALG_TYPE_DIGEST, - .cra_driver_name = "crc32-table", - .cra_priority = 100, - .cra_blocksize = CHKSUM_BLOCK_SIZE, - .cra_ctxsize = sizeof(u32), - .cra_module = THIS_MODULE, - .cra_init = crc32_cra_init, - .cra_list = LIST_HEAD_INIT(alg.cra_list), - .cra_u = { - .digest = { - .dia_digestsize = CHKSUM_DIGEST_SIZE, - .dia_setkey = crc32_digest_setkey, - .dia_init = crc32_digest_init, - .dia_update = crc32_digest_update, - .dia_final = crc32_digest_final - } - } -}; -#endif /* HAVE_STRUCT_SHASH_ALG */ int cfs_crypto_crc32_register(void) { -#ifdef HAVE_STRUCT_SHASH_ALG return crypto_register_shash(&alg); -#else - return crypto_register_alg(&alg); -#endif } EXPORT_SYMBOL(cfs_crypto_crc32_register); void cfs_crypto_crc32_unregister(void) { -#ifdef HAVE_STRUCT_SHASH_ALG crypto_unregister_shash(&alg); -#else - crypto_unregister_alg(&alg); -#endif } EXPORT_SYMBOL(cfs_crypto_crc32_unregister); diff --git a/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c b/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c index fc05af9..9a71100 100644 --- a/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c +++ b/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c @@ -29,11 +29,7 @@ * Author: Alexander Boyko */ #include -#ifdef HAVE_STRUCT_SHASH_ALG #include -#else -#include -#endif #include #include #include @@ -90,7 +86,6 @@ static int crc32_pclmul_cra_init(struct crypto_tfm *tfm) return 0; } -#ifdef HAVE_STRUCT_SHASH_ALG /* * Setting the seed allows arbitrary accumulators and flexible XOR policy * If your algorithm starts with ~0, then XOR with ~0 before you set @@ -176,68 +171,6 @@ static struct shash_alg alg = { .cra_init = crc32_pclmul_cra_init, } }; -#else /* HAVE_STRUCT_SHASH_ALG */ -#ifdef HAVE_DIGEST_SETKEY_FLAGS -static int crc32_digest_setkey(struct crypto_tfm *tfm, const u8 *key, - unsigned int keylen, unsigned int *flags) -#else -static int crc32_digest_setkey(struct crypto_tfm *tfm, const u8 *key, - unsigned int keylen) -#endif -{ - u32 *mctx = crypto_tfm_ctx(tfm); - - if (keylen != sizeof(u32)) { - tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; - return -EINVAL; - } - *mctx = le32_to_cpup((__le32 *)key); - return 0; -} - -static void crc32_digest_init(struct crypto_tfm *tfm) -{ - u32 *mctx = crypto_tfm_ctx(tfm); - - *mctx = 0; -} - -static void crc32_digest_update(struct crypto_tfm *tfm, const u8 *data, - unsigned int len) -{ - u32 *crcp = crypto_tfm_ctx(tfm); - - *crcp = crc32_pclmul_le(*crcp, data, len); -} - -static void crc32_digest_final(struct crypto_tfm *tfm, u8 *out) -{ - u32 *crcp = crypto_tfm_ctx(tfm); - - *(__le32 *)out = cpu_to_le32p(crcp); -} - -static struct crypto_alg alg = { - .cra_name = "crc32", - .cra_flags = CRYPTO_ALG_TYPE_DIGEST, - .cra_driver_name = "crc32-pclmul", - .cra_priority = 200, - .cra_blocksize = CHKSUM_BLOCK_SIZE, - .cra_ctxsize = sizeof(u32), - .cra_module = THIS_MODULE, - .cra_init = crc32_pclmul_cra_init, - .cra_list = LIST_HEAD_INIT(alg.cra_list), - .cra_u = { - .digest = { - .dia_digestsize = CHKSUM_DIGEST_SIZE, - .dia_setkey = crc32_digest_setkey, - .dia_init = crc32_digest_init, - .dia_update = crc32_digest_update, - .dia_final = crc32_digest_final - } - } -}; -#endif /* HAVE_STRUCT_SHASH_ALG */ #ifndef X86_FEATURE_PCLMULQDQ #define X86_FEATURE_PCLMULQDQ (4 * 32 + 1) /* PCLMULQDQ instruction */ @@ -251,18 +184,10 @@ int cfs_crypto_crc32_pclmul_register(void) "detected.\n"); return -ENODEV; } -#ifdef HAVE_STRUCT_SHASH_ALG return crypto_register_shash(&alg); -#else - return crypto_register_alg(&alg); -#endif } void cfs_crypto_crc32_pclmul_unregister(void) { -#ifdef HAVE_STRUCT_SHASH_ALG crypto_unregister_shash(&alg); -#else - crypto_unregister_alg(&alg); -#endif } diff --git a/libcfs/libcfs/linux/linux-crypto.c b/libcfs/libcfs/linux/linux-crypto.c index 7ae502f..62ca84b 100644 --- a/libcfs/libcfs/linux/linux-crypto.c +++ b/libcfs/libcfs/linux/linux-crypto.c @@ -36,73 +36,6 @@ */ static int cfs_crypto_hash_speeds[CFS_HASH_ALG_MAX]; - -#ifndef HAVE_STRUCT_HASH_DESC -/** 2.6.18 kernel have no crypto_hash function - * this part was copied from lustre_compat25.h */ -#define crypto_hash crypto_tfm -struct hash_desc { - struct crypto_hash *tfm; - unsigned int flags; -}; - -static inline -struct crypto_hash *crypto_alloc_hash(const char *alg, unsigned int type, - unsigned int mask) -{ - return crypto_alloc_tfm(alg, 0); -} - -static inline void crypto_free_hash(struct crypto_hash *tfm) -{ - crypto_free_tfm(tfm); -} - -static inline int crypto_hash_init(struct hash_desc *desc) -{ - crypto_digest_init(desc->tfm); - return 0; -} - -static inline int crypto_hash_update(struct hash_desc *desc, - struct scatterlist *sg, - unsigned int nbytes) -{ - if (desc->tfm->crt_digest.dit_update == NULL) - return -1; - - LASSERT(nbytes == sg->length); - crypto_digest_update(desc->tfm, sg, 1); - - return 0; -} - -static inline int crypto_hash_digest(struct hash_desc *desc, - struct scatterlist *sg, - unsigned int nbytes, unsigned char *out) -{ - crypto_hash_update(desc, sg, nbytes); - crypto_digest_final(desc->tfm, out); - return 0; -} - -static inline int crypto_hash_final(struct hash_desc *desc, unsigned char *out) -{ - crypto_digest_final(desc->tfm, out); - return 0; -} - -static inline struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm) -{ - return tfm; -} - -#define crypto_hash_setkey(tfm, key, keylen) \ - crypto_digest_setkey(tfm, key, keylen) -#define crypto_hash_digestsize(tfm) crypto_tfm_alg_digestsize(tfm) -#define crypto_hash_blocksize(tfm) crypto_tfm_alg_blocksize(tfm) -#endif - static int cfs_crypto_hash_alloc(unsigned char alg_id, const struct cfs_crypto_hash_type **type, struct hash_desc *desc, unsigned char *key, @@ -130,15 +63,6 @@ static int cfs_crypto_hash_alloc(unsigned char alg_id, desc->flags = 0; - /** Shash have different logic for initialization then digest - * shash: crypto_hash_setkey, crypto_hash_init - * digest: crypto_digest_init, crypto_digest_setkey - * Skip this function for digest, because we use shash logic at - * cfs_crypto_hash_alloc. - */ -#ifndef HAVE_STRUCT_SHASH_ALG - crypto_hash_init(desc); -#endif if (key != NULL) { err = crypto_hash_setkey(desc->tfm, key, key_len); } else if ((*type)->cht_key != 0) { @@ -157,11 +81,7 @@ static int cfs_crypto_hash_alloc(unsigned char alg_id, (crypto_hash_tfm(desc->tfm))->__crt_alg->cra_driver_name, cfs_crypto_hash_speeds[alg_id]); -#ifdef HAVE_STRUCT_SHASH_ALG return crypto_hash_init(desc); -#else - return 0; -#endif } int cfs_crypto_hash_digest(unsigned char alg_id, diff --git a/libcfs/libcfs/linux/linux-curproc.c b/libcfs/libcfs/linux/linux-curproc.c index dd5d6ce..75812eb 100644 --- a/libcfs/libcfs/linux/linux-curproc.c +++ b/libcfs/libcfs/linux/linux-curproc.c @@ -218,9 +218,6 @@ int cfs_curproc_is_32bit(void) static int cfs_access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write) { -#ifdef HAVE_ACCESS_PROCESS_VM - return access_process_vm(tsk, addr, buf, len, write); -#else /* Just copied from kernel for the kernels which doesn't * have access_process_vm() exported */ struct mm_struct *mm; @@ -267,7 +264,6 @@ static int cfs_access_process_vm(struct task_struct *tsk, unsigned long addr, mmput(mm); return buf - old_buf; -#endif /* HAVE_ACCESS_PROCESS_VM */ } /* Read the environment variable of current process specified by @key. */ diff --git a/libcfs/libcfs/watchdog.c b/libcfs/libcfs/watchdog.c index 0981a2c..a2bfbbe 100644 --- a/libcfs/libcfs/watchdog.c +++ b/libcfs/libcfs/watchdog.c @@ -104,11 +104,7 @@ static void lcw_dump(struct lc_watchdog *lcw) { ENTRY; -#if defined(HAVE_TASKLIST_LOCK) - read_lock(&tasklist_lock); -#else rcu_read_lock(); -#endif if (lcw->lcw_task == NULL) { LCONSOLE_WARN("Process " LPPID " was not found in the task " "list; watchdog callback may be incomplete\n", @@ -117,11 +113,7 @@ lcw_dump(struct lc_watchdog *lcw) libcfs_debug_dumpstack(lcw->lcw_task); } -#if defined(HAVE_TASKLIST_LOCK) - read_unlock(&tasklist_lock); -#else rcu_read_unlock(); -#endif EXIT; } diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 076c3c0..9ac1194 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -234,24 +234,6 @@ AC_DEFUN([LC_EXPORT_TRUNCATE_COMPLETE], [kernel export delete_from_page_cache])]) ]) -AC_DEFUN([LC_EXPORT_D_REHASH_COND], -[LB_CHECK_SYMBOL_EXPORT([d_rehash_cond], -[fs/dcache.c],[ -AC_DEFINE(HAVE_D_REHASH_COND, 1, - [d_rehash_cond is exported by the kernel]) -],[ -]) -]) - -AC_DEFUN([LC_EXPORT___D_REHASH], -[LB_CHECK_SYMBOL_EXPORT([__d_rehash], -[fs/dcache.c],[ -AC_DEFINE(HAVE___D_REHASH, 1, - [__d_rehash is exported by the kernel]) -],[ -]) -]) - # The actual symbol exported varies among architectures, so we need # to check many symbols (but only in the current architecture.) No # matter what symbol is exported, the kernel #defines node_to_cpumask @@ -275,25 +257,6 @@ AC_DEFUN([LC_EXPORT_NODE_TO_CPUMASK], ]) # -# -# between 2.6.5 - 2.6.22 filemap_populate is exported in some kernels -# -AC_DEFUN([LC_FILEMAP_POPULATE], -[AC_MSG_CHECKING([for exported filemap_populate]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - filemap_populate(NULL, 0, 0, __pgprot(0), 0, 0); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FILEMAP_POPULATE, 1, [Kernel exports filemap_populate]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# # added in 2.6.17 # AC_DEFUN([LC_BIT_SPINLOCK_H], @@ -408,14 +371,6 @@ AC_DEFUN([LC_CONFIG_GSS], fi ]) -AC_DEFUN([LC_TASK_CLENV_STORE], -[ - AC_MSG_CHECKING([if we can store cl_env in task_struct]) - if test x$have_task_clenv_store != xyes ; then - LC_TASK_CLENV_TUX_INFO - fi -]) - # 2.6.12 # ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock @@ -439,38 +394,6 @@ LB_LINUX_TRY_COMPILE([ EXTRA_KCFLAGS="$tmp_flags" ]) -# 2.6.18 - -# LC_UMOUNTBEGIN_HAS_VFSMOUNT -# 2.6.18~2.6.25 umount_begin has different parameters -AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT], -[AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block]) -tmp_flags="$EXTRA_KCFLAGS" -EXTRA_KCFLAGS="-Werror" -LB_LINUX_TRY_COMPILE([ - #include - - struct vfsmount; - static void cfg_umount_begin (struct vfsmount *v, int flags) - { - ; - } - - static struct super_operations cfg_super_operations = { - .umount_begin = cfg_umount_begin, - }; -],[ - cfg_super_operations.umount_begin(NULL,0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_UMOUNTBEGIN_VFSMOUNT, 1, - [Define umount_begin need second argument]) -],[ - AC_MSG_RESULT(no) -]) -EXTRA_KCFLAGS="$tmp_flags" -]) - #2.6.18 + RHEL5 (fc6) # @@ -533,33 +456,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.20 - -# LC_CANCEL_DIRTY_PAGE -# 2.6.20 introduced cancel_dirty_page instead of clear_page_dirty. -AC_DEFUN([LC_CANCEL_DIRTY_PAGE], - [AC_MSG_CHECKING([kernel has cancel_dirty_page]) - # the implementation of cancel_dirty_page in OFED 1.4.1's SLES10 SP2 - # backport is broken, so ignore it - if test -f $OFED_BACKPORT_PATH/linux/mm.h && - test "$(sed -ne '/^static inline void cancel_dirty_page(struct page \*page, unsigned int account_size)$/,/^}$/p' $OFED_BACKPORT_PATH/linux/mm.h | md5sum)" = "c518cb32d6394760c5bca14cb7538d3e -"; then - AC_MSG_RESULT(no) - else - LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - cancel_dirty_page(NULL, 0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CANCEL_DIRTY_PAGE, 1, - [kernel has cancel_dirty_page instead of clear_page_dirty]) -],[ - AC_MSG_RESULT(no) -]) - fi -]) - # raid5-zerocopy patch # @@ -605,61 +501,6 @@ LB_LINUX_TRY_COMPILE([ ]) # -# check for crypto API -# -AC_DEFUN([LC_ASYNC_BLOCK_CIPHER], -[AC_MSG_CHECKING([if kernel has block cipher support]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - struct crypto_blkcipher *tfm; - tfm = crypto_alloc_blkcipher("aes", 0, sizeof(tfm) ); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_ASYNC_BLOCK_CIPHER, 1, [kernel has block cipher support]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# check for struct hash_desc -# -AC_DEFUN([LC_STRUCT_HASH_DESC], -[AC_MSG_CHECKING([if kernel has struct hash_desc]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - struct hash_desc foo __attribute__ ((unused)); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# check for struct blkcipher_desc -# -AC_DEFUN([LC_STRUCT_BLKCIPHER_DESC], -[AC_MSG_CHECKING([if kernel has struct blkcipher_desc]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - struct blkcipher_desc foo __attribute__ ((unused)); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# # 2.6.19 check for FS_RENAME_DOES_D_MOVE flag # AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE], @@ -696,71 +537,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.23 change .sendfile to .splice_read -AC_DEFUN([LC_KERNEL_SPLICE_READ], -[AC_MSG_CHECKING([if kernel has .splice_read]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file_operations file; - - file.splice_read = NULL; -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_KERNEL_SPLICE_READ, 1, - [kernel has .slice_read]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.23 change .sendfile to .splice_read -# RHEL4 (-92 kernel) have both sendfile and .splice_read API -AC_DEFUN([LC_KERNEL_SENDFILE], -[AC_MSG_CHECKING([if kernel has .sendfile]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file_operations file; - - file.sendfile = NULL; -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_KERNEL_SENDFILE, 1, - [kernel has .sendfile]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.23 extract nfs export related data into exportfs.h -AC_DEFUN([LC_HAVE_EXPORTFS_H], -[LB_CHECK_FILE([$LINUX/include/linux/exportfs.h], [ - AC_DEFINE(HAVE_LINUX_EXPORTFS_H, 1, - [kernel has include/exportfs.h]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.23 has new page fault handling API -AC_DEFUN([LC_VM_OP_FAULT], -[AC_MSG_CHECKING([kernel has .fault in vm_operation_struct]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct vm_operations_struct op; - - op.fault = NULL; -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_VM_OP_FAULT, 1, - [kernel has .fault in vm_operation_struct]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # 2.6.23 add code to wait other users to complete before removing procfs entry AC_DEFUN([LC_PROCFS_USERS], [AC_MSG_CHECKING([if kernel has pde_users member in procfs entry struct]) @@ -791,28 +567,8 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.23 exports exportfs_decode_fh -AC_DEFUN([LC_EXPORTFS_DECODE_FH], -[LB_CHECK_SYMBOL_EXPORT([exportfs_decode_fh], -[fs/exportfs/expfs.c],[ - AC_DEFINE(HAVE_EXPORTFS_DECODE_FH, 1, - [exportfs_decode_fh has been export]) -],[ -]) -]) - # 2.6.24 -# 2.6.24 need linux/mm_types.h included -AC_DEFUN([LC_HAVE_MMTYPES_H], -[LB_CHECK_FILE([$LINUX/include/linux/mm_types.h], [ - AC_DEFINE(HAVE_LINUX_MMTYPES_H, 1, - [kernel has include/mm_types.h]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # 2.6.24 has bio_endio with 2 args AC_DEFUN([LC_BIO_ENDIO_2ARG], [AC_MSG_CHECKING([if kernel has bio_endio with 2 args]) @@ -829,25 +585,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.24 has new members in exports struct. -AC_DEFUN([LC_FH_TO_DENTRY], -[AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct]) -LB_LINUX_TRY_COMPILE([ - #include -#ifdef HAVE_LINUX_EXPORTFS_H - #include -#endif -],[ - do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry)); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FH_TO_DENTRY, 1, - [kernel has .fh_to_dentry member in export_operations struct]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # 2.6.24 removes long aged procfs entry -> deleted member AC_DEFUN([LC_PROCFS_DELETED], [AC_MSG_CHECKING([if kernel has deleted member in procfs entry struct]) @@ -866,16 +603,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.24 has bdi_init()/bdi_destroy() functions. -AC_DEFUN([LC_EXPORT_BDI_INIT], -[LB_CHECK_SYMBOL_EXPORT([bdi_init], -[mm/backing-dev.c],[ - AC_DEFINE(HAVE_BDI_INIT, 1, - [bdi_init/bdi_destroy functions are present]) -],[ -]) -]) - # 2.6.26 # 2.6.26 isn't export set_fs_pwd and change paramter in fs struct @@ -920,45 +647,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -AC_DEFUN([LC_PGMKWRITE_USE_VMFAULT], -[AC_MSG_CHECKING([kernel .page_mkwrite uses struct vm_fault *]) -tmp_flags="$EXTRA_KCFLAGS" -EXTRA_KCFLAGS="-Werror" -LB_LINUX_TRY_COMPILE([ - #include -],[ - ((struct vm_operations_struct *)0)->page_mkwrite((struct vm_area_struct *)0, (struct vm_fault *)0); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_PGMKWRITE_USE_VMFAULT, 1, - [kernel vm_operation_struct.page_mkwrite uses struct vm_fault * as second parameter]) -],[ - AC_MSG_RESULT([no]) -]) -EXTRA_KCFLAGS="$tmp_flags" -]) - -AC_DEFUN([LC_PGMKWRITE_COMPACT], -[AC_MSG_CHECKING([if kernel .page_mkwrite is located in vm_operation_struct._pmkw]) -tmp_flags="$EXTRA_KCFLAGS" -EXTRA_KCFLAGS="-Werror" -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct vm_operations_struct *vm_ops; - - vm_ops = NULL; - vm_ops->_pmkw.page_mkwrite(NULL, NULL); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_PGMKWRITE_COMPACT, 1, - [kernel .page_mkwrite is located in vm_operation_struct._pmkw]) -],[ - AC_MSG_RESULT([no]) -]) -EXTRA_KCFLAGS="$tmp_flags" -]) - AC_DEFUN([LC_INODE_PERMISION_2ARGS], [AC_MSG_CHECKING([inode_operations->permission has two args]) LB_LINUX_TRY_COMPILE([ @@ -977,49 +665,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.27 have new page locking API -AC_DEFUN([LC_TRYLOCKPAGE], -[AC_MSG_CHECKING([kernel uses trylock_page for page lock]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - trylock_page(NULL); -],[ - AC_DEFINE(HAVE_TRYLOCK_PAGE, 1, - [kernel uses trylock_page for page lock]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.27 removed the read_inode from super_operations. -AC_DEFUN([LC_READ_INODE_IN_SBOPS], -[AC_MSG_CHECKING([super_operations has a read_inode field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct super_operations *sop; - sop->read_inode(NULL); -],[ - AC_DEFINE(HAVE_READ_INODE_IN_SBOPS, 1, - [super_operations has a read_inode]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.27 has inode_permission instead of permisson -AC_DEFUN([LC_EXPORT_INODE_PERMISSION], -[LB_CHECK_SYMBOL_EXPORT([inode_permission], -[fs/namei.c],[ -AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1, - [inode_permission is exported by the kernel]) -],[ -]) -]) - # 2.6.27 use 5th parameter in quota_on for remount. AC_DEFUN([LC_QUOTA_ON_5ARGS], [AC_MSG_CHECKING([quota_on needs 5 parameters]) @@ -1056,21 +701,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.27 has vfs_dq_off inline function. -AC_DEFUN([LC_VFS_DQ_OFF], -[AC_MSG_CHECKING([vfs_dq_off is defined]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - vfs_dq_off(NULL, 0); -],[ - AC_DEFINE(HAVE_VFS_DQ_OFF, 1, [vfs_dq_off is defined]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # 2.6.34 has quotactl_ops->[sg]et_dqblk that take struct fs_disk_quota AC_DEFUN([LC_HAVE_DQUOT_FS_DISK_QUOTA], tmp_flags="$EXTRA_KCFLAGS" @@ -1163,66 +793,6 @@ AC_DEFUN([LC_HAVE_QUOTAIO_H], ]) ]) -# 2.6.27 sles11 has sb_any_quota_active -AC_DEFUN([LC_SB_ANY_QUOTA_ACTIVE], -[AC_MSG_CHECKING([Kernel has sb_any_quota_active]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - sb_any_quota_active(NULL); -],[ - AC_DEFINE(HAVE_SB_ANY_QUOTA_ACTIVE, 1, - [Kernel has a sb_any_quota_active]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.27 sles11 has sb_has_quota_active -AC_DEFUN([LC_SB_HAS_QUOTA_ACTIVE], -[AC_MSG_CHECKING([Kernel has sb_has_quota_active]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - sb_has_quota_active(NULL, 0); -],[ - AC_DEFINE(HAVE_SB_HAS_QUOTA_ACTIVE, 1, - [Kernel has a sb_has_quota_active]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.27 exported add_to_page_cache_lru. -AC_DEFUN([LC_EXPORT_ADD_TO_PAGE_CACHE_LRU], -[LB_CHECK_SYMBOL_EXPORT([add_to_page_cache_lru], -[mm/filemap.c],[ - AC_DEFINE(HAVE_ADD_TO_PAGE_CACHE_LRU, 1, - [add_to_page_cache_lru functions are present]) -],[ -]) -]) - -# -# 2.6.29 introduce sb_any_quota_loaded. -# -AC_DEFUN([LC_SB_ANY_QUOTA_LOADED], -[AC_MSG_CHECKING([Kernel has sb_any_quota_loaded]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - sb_any_quota_loaded(NULL); -],[ - AC_DEFINE(HAVE_SB_ANY_QUOTA_LOADED, 1, - [Kernel has a sb_any_quota_loaded]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # 2.6.30 x86 node_to_cpumask has been removed. must use cpumask_of_node AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE], [LB_CHECK_SYMBOL_EXPORT([node_to_cpumask_map], @@ -1233,136 +803,8 @@ AC_DEFUN([LC_EXPORT_CPUMASK_OF_NODE], ]) -# 2.6.31 replaces blk_queue_hardsect_size by blk_queue_logical_block_size function -AC_DEFUN([LC_BLK_QUEUE_LOG_BLK_SIZE], -[AC_MSG_CHECKING([if blk_queue_logical_block_size is defined]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - blk_queue_logical_block_size(NULL, 0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_LOG_BLK_SIZE, 1, - [blk_queue_logical_block_size is defined]) -],[ - AC_MSG_RESULT(no) -]) -]) - # 2.6.32 -# 2.6.32 introduced inode_newsize_ok -AC_DEFUN([LC_VFS_INODE_NEWSIZE_OK], -[AC_MSG_CHECKING([if inode_newsize_ok is defined]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - return inode_newsize_ok(NULL, 0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_VFS_INODE_NEWSIZE_OK, 1, - [inode_newsize_ok is defined]) -],[ - AC_MSG_RESULT(no) -]) -]) - -# 2.6.32 changes cache_detail's member cache_request to cache_upcall -# in kernel commit bc74b4f5e63a09fb78e245794a0de1e5a2716bbe -AC_DEFUN([LC_CACHE_UPCALL], -[AC_MSG_CHECKING([if cache_detail has cache_upcall field]) - LB_LINUX_TRY_COMPILE([ - #include - ],[ - struct cache_detail cd; - cd.cache_upcall = NULL; - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CACHE_UPCALL, 1, - [cache_detail has cache_upcall field]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -# 2.6.32 add a limits member in struct request_queue. -AC_DEFUN([LC_REQUEST_QUEUE_LIMITS], -[AC_MSG_CHECKING([if request_queue has a limits field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct request_queue rq; - rq.limits.io_min = 0; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_REQUEST_QUEUE_LIMITS, 1, - [request_queue has a limits field]) -],[ - AC_MSG_RESULT(no) -]) -]) - -# 2.6.32 has bdi_register() functions. -AC_DEFUN([LC_EXPORT_BDI_REGISTER], -[LB_CHECK_SYMBOL_EXPORT([bdi_register], -[mm/backing-dev.c],[ - AC_DEFINE(HAVE_BDI_REGISTER, 1, - [bdi_register function is present]) -],[ -]) -]) - -# 2.6.32 add s_bdi for super block -AC_DEFUN([LC_SB_BDI], -[AC_MSG_CHECKING([if super_block has s_bdi field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct super_block sb; - sb.s_bdi = NULL; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SB_BDI, 1, - [super_block has s_bdi field]) -],[ - AC_MSG_RESULT(no) -]) -]) - -# 2.6.27.15-2 SuSE 11 sp0 kernels lack the name field for BDI -AC_DEFUN([LC_BDI_NAME], -[AC_MSG_CHECKING([if backing_device_info has name field]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct backing_dev_info bdi; - bdi.name = NULL; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BDI_NAME, 1, - [backing_device_info has name field]) -],[ - AC_MSG_RESULT(no) -]) -]) - -# 2.6.32 removes blk_queue_max_sectors and add blk_queue_max_hw_sectors -# check blk_queue_max_sectors and use it until disappear. -AC_DEFUN([LC_BLK_QUEUE_MAX_SECTORS], -[AC_MSG_CHECKING([if blk_queue_max_sectors is defined]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - blk_queue_max_sectors(NULL, 0); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_MAX_SECTORS, 1, - [blk_queue_max_sectors is defined]) -],[ - AC_MSG_RESULT(no) -]) -]) - # 2.6.32 replaces 2 functions blk_queue_max_phys_segments and blk_queue_max_hw_segments by blk_queue_max_segments AC_DEFUN([LC_BLK_QUEUE_MAX_SEGMENTS], [AC_MSG_CHECKING([if blk_queue_max_segments is defined]) @@ -1394,16 +836,9 @@ EXTRA_KCFLAGS="-I$LINUX/fs" LB_LINUX_TRY_COMPILE([ #include #include - #ifdef HAVE_QUOTAIO_H - # include - int versions[] = V2_INITQVERSIONS_R1; - struct v2_disk_dqblk_r1 dqblk_r1; - #elif defined(HAVE_FS_QUOTA_QUOTAIO_H) + #if defined(HAVE_FS_QUOTA_QUOTAIO_H) # include struct v2r1_disk_dqblk dqblk_r1; - #elif defined(HAVE_FS_QUOTAIO_H) - # include - struct v2r1_disk_dqblk dqblk_r1; #else #include int ver = QFMT_VFS_V1; @@ -1433,66 +868,6 @@ AC_DEFUN([LC_SET_CPUS_ALLOWED], [set_cpus_allowed is exported by the kernel])], [AC_MSG_RESULT([no])] )]) -# 2.6.32 introduces selinux_is_enabled() -AC_DEFUN([LC_SELINUX_IS_ENABLED], -[AC_MSG_CHECKING([if selinux_is_enabled is available]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - selinux_is_enabled(); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_SELINUX_IS_ENABLED, 1, - [selinux_is_enabled is defined]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LC_D_OBTAIN_ALIAS -# starting from 2.6.28 kernel replaces d_alloc_anon() with -# d_obtain_alias() for getting anonymous dentries -# RHEL5(2.6.18) has d_obtain_alias but SLES11SP0(2.6.27) not -# -AC_DEFUN([LC_D_OBTAIN_ALIAS], -[AC_MSG_CHECKING([d_obtain_alias exist in kernel]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - d_obtain_alias(NULL); -],[ - AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1, - [d_obtain_alias exist in kernel]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# -# LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE -# -AC_DEFUN([LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE], - [LB_CHECK_SYMBOL_EXPORT( - [generic_error_remove_page], - [mm/truncate.c], - [AC_DEFINE(HAS_GENERIC_ERROR_REMOVE_PAGE, 1, - [kernel export generic_error_remove_page])], - []) - ] -) - -# 2.6.32 if kernel export access_process_vm(). -AC_DEFUN([LC_EXPORT_ACCESS_PROCESS_VM], - [LB_CHECK_SYMBOL_EXPORT([access_process_vm], - [mm/memory.c], - [AC_DEFINE(HAVE_ACCESS_PROCESS_VM, 1, - [access_process_vm function is present])], - []) - ] -) - # # 2.6.36 fs_struct.lock use spinlock instead of rwlock. # @@ -2244,24 +1619,17 @@ AC_DEFUN([LC_PROG_LINUX], # RHEL4 patches LC_EXPORT_TRUNCATE_COMPLETE - LC_EXPORT_D_REHASH_COND - LC_EXPORT___D_REHASH LC_EXPORT_NODE_TO_CPUMASK - LC_FILEMAP_POPULATE LC_BIT_SPINLOCK_H LC_CAPA_CRYPTO LC_CONFIG_RMTCLIENT LC_CONFIG_GSS - LC_TASK_CLENV_STORE # 2.6.12 LC_RW_TREE_LOCK - # 2.6.18 - LC_UMOUNTBEGIN_HAS_VFSMOUNT - #2.6.18 + RHEL5 (fc6) LC_LINUX_FIEMAP_H @@ -2269,80 +1637,41 @@ AC_DEFUN([LC_PROG_LINUX], LC_FILE_WRITEV LC_FILE_READV - # 2.6.20 - LC_CANCEL_DIRTY_PAGE - # raid5-zerocopy patch LC_PAGE_CONSTANT # 2.6.22 LC_INVALIDATE_BDEV_2ARG - LC_ASYNC_BLOCK_CIPHER - LC_STRUCT_HASH_DESC - LC_STRUCT_BLKCIPHER_DESC LC_FS_RENAME_DOES_D_MOVE # 2.6.23 LC_UNREGISTER_BLKDEV_RETURN_INT - LC_KERNEL_SPLICE_READ - LC_KERNEL_SENDFILE - LC_HAVE_EXPORTFS_H - LC_VM_OP_FAULT LC_PROCFS_USERS - LC_EXPORTFS_DECODE_FH # 2.6.24 - LC_HAVE_MMTYPES_H LC_BIO_ENDIO_2ARG - LC_FH_TO_DENTRY LC_PROCFS_DELETED - LC_EXPORT_BDI_INIT # 2.6.26 LC_FS_STRUCT_USE_PATH # 2.6.27 LC_SECURITY_PLUG # for SLES10 SP2 - LC_PGMKWRITE_USE_VMFAULT - LC_PGMKWRITE_COMPACT LC_INODE_PERMISION_2ARGS - LC_TRYLOCKPAGE - LC_READ_INODE_IN_SBOPS - LC_EXPORT_INODE_PERMISSION LC_QUOTA_ON_5ARGS LC_QUOTA_OFF_3ARGS - LC_VFS_DQ_OFF LC_LOCK_MAP_ACQUIRE # 2.6.27.15-2 sles11 LC_BI_HW_SEGMENTS LC_HAVE_QUOTAIO_H - LC_BDI_NAME - LC_SB_ANY_QUOTA_ACTIVE - LC_SB_HAS_QUOTA_ACTIVE - LC_EXPORT_ADD_TO_PAGE_CACHE_LRU - - # 2.6.29 - LC_SB_ANY_QUOTA_LOADED # 2.6.30 LC_EXPORT_CPUMASK_OF_NODE - # 2.6.31 - LC_BLK_QUEUE_LOG_BLK_SIZE - # 2.6.32 - LC_REQUEST_QUEUE_LIMITS - LC_EXPORT_BDI_REGISTER - LC_SB_BDI - LC_BLK_QUEUE_MAX_SECTORS LC_BLK_QUEUE_MAX_SEGMENTS LC_SET_CPUS_ALLOWED - LC_CACHE_UPCALL - LC_EXPORT_GENERIC_ERROR_REMOVE_PAGE - LC_SELINUX_IS_ENABLED - LC_EXPORT_ACCESS_PROCESS_VM - LC_VFS_INODE_NEWSIZE_OK # 2.6.34 LC_HAVE_DQUOT_FS_DISK_QUOTA @@ -2476,31 +1805,6 @@ if test x$enable_liblustre_acl = xyes ; then AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS) fi -# 2.6.29 change prepare/commit_write to write_begin/end -AC_DEFUN([LC_WRITE_BEGIN_END], -[AC_MSG_CHECKING([if kernel has .write_begin/end]) -LB_LINUX_TRY_COMPILE([ - #include - #include -#ifdef HAVE_LINUX_MMTYPES_H - #include -#endif -],[ - struct address_space_operations aops; - struct page *page; - - aops.write_begin = NULL; - aops.write_end = NULL; - page = grab_cache_page_write_begin(NULL, 0, 0); -], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_KERNEL_WRITE_BEGIN_END, 1, - [kernel has .write_begin/end]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # 2.6.29 blkdev_put has 2 arguments AC_DEFUN([LC_BLKDEV_PUT_2ARGS], [AC_MSG_CHECKING([blkdev_put needs 2 parameters]) @@ -2517,42 +1821,6 @@ LB_LINUX_TRY_COMPILE([ ]) ]) -# 2.6.29 dentry_open has 4 arguments -AC_DEFUN([LC_DENTRY_OPEN_4ARGS], -[AC_MSG_CHECKING([dentry_open needs 4 parameters]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - dentry_open(NULL, NULL, 0, NULL); -],[ - AC_DEFINE(HAVE_DENTRY_OPEN_4ARGS, 1, - [dentry_open needs 4 paramters]) - AC_MSG_RESULT([yes]) -],[ - AC_MSG_RESULT([no]) -]) -]) - -# 2.6.29 split file and anonymous page queues -AC_DEFUN([LC_PAGEVEC_LRU_ADD_FILE], -[AC_MSG_CHECKING([if kernel has .pagevec_lru_add_file]) -LB_LINUX_TRY_COMPILE([ - #include - #include -],[ - struct pagevec lru_pagevec; - - pagevec_init(&lru_pagevec, 0); - pagevec_lru_add_file(&lru_pagevec); -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_PAGEVEC_LRU_ADD_FILE, 1, - [kernel has .pagevec_lru_add_file]) -],[ - AC_MSG_RESULT([no]) -]) -]) - # # --enable-mpitest # @@ -2645,23 +1913,6 @@ if test x$enable_split != xno; then fi ]) -# RHEL5(2.6.18) has tux_info -AC_DEFUN([LC_TASK_CLENV_TUX_INFO], -[AC_MSG_CHECKING([tux_info]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct task_struct task; - &task.tux_info; -],[ - AC_MSG_RESULT([yes]) - AC_DEFINE(LL_TASK_CL_ENV, tux_info, [have tux_info]) - have_task_clenv_store='yes' -],[ - AC_MSG_RESULT([no]) -]) -]) - # # LC_LLITE_LLOOP_MODULE # lloop_llite.ko does not currently work with page sizes @@ -2845,11 +2096,7 @@ if test x$enable_pgstat_track = xyes ; then fi #2.6.29 - LC_WRITE_BEGIN_END - LC_D_OBTAIN_ALIAS LC_BLKDEV_PUT_2ARGS - LC_DENTRY_OPEN_4ARGS - LC_PAGEVEC_LRU_ADD_FILE ]) diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 27139fb..4e29e69 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -111,18 +111,8 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, #define module_init(a) late_initcall(a) #endif -#ifndef HAVE_TRYLOCK_PAGE -#define trylock_page(page) (!TestSetPageLocked(page)) -#endif - #define LTIME_S(time) (time.tv_sec) -#ifdef HAVE_EXPORT_INODE_PERMISSION -#define ll_permission(inode,mask,nd) inode_permission(inode,mask) -#else -#define ll_permission(inode,mask,nd) permission(inode,mask,nd) -#endif - #ifdef HAVE_GENERIC_PERMISSION_2ARGS # define ll_generic_permission(inode, mask, flags, check_acl) \ generic_permission(inode, mask) @@ -155,11 +145,7 @@ static inline struct file *ll_dentry_open(struct path *path, int flags, { mntget(path->mnt); dget(path->dentry); -# ifdef HAVE_DENTRY_OPEN_4ARGS return dentry_open(path->dentry, path->mnt, flags, cred); -# else - return dentry_open(path->dentry, path->mnt, flags); -# endif } #endif @@ -230,25 +216,8 @@ int ll_unregister_blkdev(unsigned int dev, const char *name) #define FS_RENAME_DOES_D_MOVE FS_ODD_RENAME #endif -#ifndef HAVE_D_OBTAIN_ALIAS -/* The old d_alloc_anon() didn't free the inode reference on error - * like d_obtain_alias(). Hide that difference/inconvenience here. */ -static inline struct dentry *d_obtain_alias(struct inode *inode) -{ - struct dentry *anon = d_alloc_anon(inode); - - if (anon == NULL) { - iput(inode); - anon = ERR_PTR(-ENOMEM); - } - - return anon; -} -#endif - /* add a lustre compatible layer for crypto API */ #include -#ifdef HAVE_ASYNC_BLOCK_CIPHER #define ll_crypto_hash crypto_hash #define ll_crypto_cipher crypto_blkcipher #define ll_crypto_alloc_hash(name, type, mask) crypto_alloc_hash(name, type, mask) @@ -313,132 +282,6 @@ unsigned int ll_crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm) #define ll_crypto_blkcipher_blocksize(tfm) crypto_blkcipher_blocksize(tfm) #define ll_crypto_free_hash(tfm) crypto_free_hash(tfm) #define ll_crypto_free_blkcipher(tfm) crypto_free_blkcipher(tfm) -#else /* HAVE_ASYNC_BLOCK_CIPHER */ -#include -#define ll_crypto_hash crypto_tfm -#define ll_crypto_cipher crypto_tfm -#ifndef HAVE_STRUCT_HASH_DESC -struct hash_desc { - struct ll_crypto_hash *tfm; - u32 flags; -}; -#endif -#ifndef HAVE_STRUCT_BLKCIPHER_DESC -struct blkcipher_desc { - struct ll_crypto_cipher *tfm; - void *info; - u32 flags; -}; -#endif -#define ll_crypto_blkcipher_setkey(tfm, key, keylen) \ - crypto_cipher_setkey(tfm, key, keylen) -#define ll_crypto_blkcipher_set_iv(tfm, src, len) \ - crypto_cipher_set_iv(tfm, src, len) -#define ll_crypto_blkcipher_get_iv(tfm, dst, len) \ - crypto_cipher_get_iv(tfm, dst, len) -#define ll_crypto_blkcipher_encrypt(desc, dst, src, bytes) \ - crypto_cipher_encrypt((desc)->tfm, dst, src, bytes) -#define ll_crypto_blkcipher_decrypt(desc, dst, src, bytes) \ - crypto_cipher_decrypt((desc)->tfm, dst, src, bytes) -#define ll_crypto_blkcipher_decrypt_iv(desc, dst, src, bytes) \ - crypto_cipher_decrypt_iv((desc)->tfm, dst, src, bytes, (desc)->info) -#define ll_crypto_blkcipher_encrypt_iv(desc, dst, src, bytes) \ - crypto_cipher_encrypt_iv((desc)->tfm, dst, src, bytes, (desc)->info) - -static inline -struct ll_crypto_cipher *ll_crypto_alloc_blkcipher(const char * algname, - u32 type, u32 mask) -{ - struct ll_crypto_cipher *rtn; - char buf[CRYPTO_MAX_ALG_NAME + 1]; - const char *pan = algname; - u32 flag = 0; - - if (strncmp("cbc(", algname, 4) == 0) - flag |= CRYPTO_TFM_MODE_CBC; - else if (strncmp("ecb(", algname, 4) == 0) - flag |= CRYPTO_TFM_MODE_ECB; - if (flag) { - char *vp = strnchr(algname, CRYPTO_MAX_ALG_NAME, ')'); - if (vp) { - memcpy(buf, algname + 4, vp - algname - 4); - buf[vp - algname - 4] = '\0'; - pan = buf; - } else { - flag = 0; - } - } - rtn = crypto_alloc_tfm(pan, flag); - return (rtn == NULL ? ERR_PTR(-ENOMEM) : rtn); -} - -static inline -struct ll_crypto_hash *ll_crypto_alloc_hash(const char *alg, u32 type, u32 mask) -{ - char buf[CRYPTO_MAX_ALG_NAME + 1]; - const char *pan = alg; - - if (strncmp("hmac(", alg, 5) == 0) { - char *vp = strnchr(alg, CRYPTO_MAX_ALG_NAME, ')'); - if (vp) { - memcpy(buf, alg+ 5, vp - alg- 5); - buf[vp - alg - 5] = 0x00; - pan = buf; - } - } - return crypto_alloc_tfm(pan, 0); -} -static inline int ll_crypto_hash_init(struct hash_desc *desc) -{ - crypto_digest_init(desc->tfm); return 0; -} -static inline int ll_crypto_hash_update(struct hash_desc *desc, - struct scatterlist *sg, - unsigned int nbytes) -{ - struct scatterlist *sl = sg; - unsigned int count; - /* - * This way is very weakness. We must ensure that - * the sum of sg[0..i]->length isn't greater than nbytes. - * In the upstream kernel the crypto_hash_update() also - * via the nbytes computed the count of sg[...]. - * The old style is more safely. but it gone. - */ - for (count = 0; nbytes > 0; count ++, sl ++) { - nbytes -= sl->length; - } - crypto_digest_update(desc->tfm, sg, count); return 0; -} -static inline int ll_crypto_hash_final(struct hash_desc *desc, u8 *out) -{ - crypto_digest_final(desc->tfm, out); return 0; -} -static inline int ll_crypto_hmac(struct crypto_tfm *tfm, - u8 *key, unsigned int *keylen, - struct scatterlist *sg, - unsigned int nbytes, - u8 *out) -{ - struct scatterlist *sl = sg; - int count; - for (count = 0; nbytes > 0; count ++, sl ++) { - nbytes -= sl->length; - } - crypto_hmac(tfm, key, keylen, sg, count, out); - return 0; -} - -#define ll_crypto_hash_setkey(tfm, key, keylen) crypto_digest_setkey(tfm, key, keylen) -#define ll_crypto_blkcipher_blocksize(tfm) crypto_tfm_alg_blocksize(tfm) -#define ll_crypto_blkcipher_ivsize(tfm) crypto_tfm_alg_ivsize(tfm) -#define ll_crypto_hash_digestsize(tfm) crypto_tfm_alg_digestsize(tfm) -#define ll_crypto_hash_blocksize(tfm) crypto_tfm_alg_blocksize(tfm) -#define ll_crypto_free_hash(tfm) crypto_free_tfm(tfm) -#define ll_crypto_free_blkcipher(tfm) crypto_free_tfm(tfm) -#define ll_crypto_tfm_alg_min_keysize crypto_tfm_alg_min_keysize -#define ll_crypto_tfm_alg_max_keysize crypto_tfm_alg_max_keysize -#endif /* HAVE_ASYNC_BLOCK_CIPHER */ #ifdef HAVE_SECURITY_PLUG #define ll_vfs_rmdir(dir,entry,mnt) vfs_rmdir(dir,entry,mnt) @@ -491,18 +334,6 @@ static inline int ll_crypto_hmac(struct crypto_tfm *tfm, #define SLAB_DESTROY_BY_RCU 0 #endif -#ifndef HAVE_SB_HAS_QUOTA_ACTIVE -#define sb_has_quota_active(sb, type) sb_has_quota_enabled(sb, type) -#endif - -#ifndef HAVE_SB_ANY_QUOTA_LOADED -# ifdef HAVE_SB_ANY_QUOTA_ACTIVE -# define sb_any_quota_loaded(sb) sb_any_quota_active(sb) -# else -# define sb_any_quota_loaded(sb) sb_any_quota_enabled(sb) -# endif -#endif - static inline int ll_quota_on(struct super_block *sb, int off, int ver, char *name, int remount) { @@ -548,22 +379,11 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) return -ENOSYS; } -#ifndef HAVE_BLK_QUEUE_LOG_BLK_SIZE /* added in 2.6.31 */ -#define blk_queue_logical_block_size(q, sz) blk_queue_hardsect_size(q, sz) -#endif - #ifndef HAVE_DQUOT_SUSPEND -#ifndef HAVE_VFS_DQ_OFF -# define ll_vfs_dq_init DQUOT_INIT -# define ll_vfs_dq_drop DQUOT_DROP -# define ll_vfs_dq_transfer DQUOT_TRANSFER -# define ll_vfs_dq_off(sb, remount) DQUOT_OFF(sb) -#else # define ll_vfs_dq_init vfs_dq_init # define ll_vfs_dq_drop vfs_dq_drop # define ll_vfs_dq_transfer vfs_dq_transfer # define ll_vfs_dq_off(sb, remount) vfs_dq_off(sb, remount) -#endif #else # define ll_vfs_dq_init dquot_initialize # define ll_vfs_dq_drop dquot_drop @@ -571,26 +391,10 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) # define ll_vfs_dq_off(sb, remount) dquot_suspend(sb, -1) #endif -#ifndef HAVE_BDI_INIT -#define bdi_init(bdi) 0 -#define bdi_destroy(bdi) do { } while (0) -#endif - -#ifdef HAVE_BLK_QUEUE_MAX_SECTORS /* removed in rhel6 */ -#define blk_queue_max_hw_sectors(q, sect) blk_queue_max_sectors(q, sect) -#endif - #ifndef HAVE_BLKDEV_GET_BY_DEV # define blkdev_get_by_dev(dev, mode, holder) open_by_devnum(dev, mode) #endif -#ifndef HAVE_REQUEST_QUEUE_LIMITS -#define queue_max_sectors(rq) ((rq)->max_sectors) -#define queue_max_hw_sectors(rq) ((rq)->max_hw_sectors) -#define queue_max_phys_segments(rq) ((rq)->max_phys_segments) -#define queue_max_hw_segments(rq) ((rq)->max_hw_segments) -#endif - #ifndef HAVE_BLK_QUEUE_MAX_SEGMENTS #define blk_queue_max_segments(rq, seg) \ do { blk_queue_max_phys_segments(rq, seg); \ @@ -633,28 +437,6 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) #define bio_hw_segments(q, bio) 0 #endif -#ifndef HAVE_PAGEVEC_LRU_ADD_FILE -#define pagevec_lru_add_file pagevec_lru_add -#endif - -#ifdef HAVE_ADD_TO_PAGE_CACHE_LRU -#define ll_pagevec_init(pv, cold) do {} while (0) -#define ll_pagevec_add(pv, pg) (0) -#define ll_pagevec_lru_add_file(pv) do {} while (0) -#else -#define add_to_page_cache_lru(pg, mapping, off, gfp) \ - add_to_page_cache(pg, mapping, off, gfp) -#define ll_pagevec_init(pv, cold) pagevec_init(pv, cold); -#define ll_pagevec_add(pv, pg) \ -({ \ - int __ret; \ - \ - page_cache_get(pg); \ - __ret = pagevec_add(pv, pg); \ -}) -#define ll_pagevec_lru_add_file(pv) pagevec_lru_add_file(pv) -#endif - #if !defined(HAVE_CPUMASK_OF_NODE) && defined(HAVE_NODE_TO_CPUMASK) # ifdef HAVE_OFED_CPUMASK_OF_NODE # undef cpumask_of_node @@ -695,13 +477,6 @@ static inline int ll_quota_off(struct super_block *sb, int off, int remount) # define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET) #endif -#ifndef HAVE_SELINUX_IS_ENABLED -static inline bool selinux_is_enabled(void) -{ - return 0; -} -#endif - #ifndef HAVE_LM_XXX_LOCK_MANAGER_OPS # define lm_compare_owner fl_compare_owner #endif diff --git a/lustre/include/linux/lustre_patchless_compat.h b/lustre/include/linux/lustre_patchless_compat.h index 880f6e5..1876f94 100644 --- a/lustre/include/linux/lustre_patchless_compat.h +++ b/lustre/include/linux/lustre_patchless_compat.h @@ -44,10 +44,6 @@ #include #include -#ifndef HAVE_CANCEL_DIRTY_PAGE /* 2.6.20 */ -#define cancel_dirty_page(page, size) clear_page_dirty(page) -#endif - #ifndef HAVE_DELETE_FROM_PAGE_CACHE /* 2.6.39 */ #ifndef HAVE_REMOVE_FROM_PAGE_CACHE /* 2.6.35 - 2.6.38 */ diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 9365383..dd7f7df 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -152,9 +152,6 @@ static int ll_dir_filler(void *_hash, struct page *page0) __u64 hash = *((__u64 *)_hash); struct page **page_pool; struct page *page; -#ifndef HAVE_ADD_TO_PAGE_CACHE_LRU - struct pagevec lru_pvec; -#endif struct lu_dirpage *dp; int max_pages = ll_i2sbi(inode)->ll_md_brw_size >> PAGE_CACHE_SHIFT; int nrdpgs = 0; /* number of pages read actually */ @@ -205,7 +202,6 @@ static int ll_dir_filler(void *_hash, struct page *page0) CDEBUG(D_VFSTRACE, "read %d/%d pages\n", nrdpgs, npages); - ll_pagevec_init(&lru_pvec, 0); for (i = 1; i < npages; i++) { unsigned long offset; int ret; @@ -228,17 +224,13 @@ static int ll_dir_filler(void *_hash, struct page *page0) prefetchw(&page->flags); ret = add_to_page_cache_lru(page, inode->i_mapping, offset, GFP_KERNEL); - if (ret == 0) { + if (ret == 0) unlock_page(page); - if (ll_pagevec_add(&lru_pvec, page) == 0) - ll_pagevec_lru_add_file(&lru_pvec); - } else { + else CDEBUG(D_VFSTRACE, "page %lu add to page cache failed:" " %d\n", offset, ret); - } page_cache_release(page); } - ll_pagevec_lru_add_file(&lru_pvec); if (page_pool != &page0) OBD_FREE(page_pool, sizeof(struct page *) * max_pages); diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 8777ba6..e0611c9 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1206,35 +1206,6 @@ static ssize_t ll_file_write(struct file *file, const char *buf, size_t count, } #endif - -#ifdef HAVE_KERNEL_SENDFILE -/* - * Send file content (through pagecache) somewhere with helper - */ -static ssize_t ll_file_sendfile(struct file *in_file, loff_t *ppos,size_t count, - read_actor_t actor, void *target) -{ - struct lu_env *env; - struct vvp_io_args *args; - ssize_t result; - int refcheck; - ENTRY; - - env = cl_env_get(&refcheck); - if (IS_ERR(env)) - RETURN(PTR_ERR(env)); - - args = vvp_env_args(env, IO_SENDFILE); - args->u.sendfile.via_target = target; - args->u.sendfile.via_actor = actor; - - result = ll_file_io_generic(env, args, in_file, CIT_READ, ppos, count); - cl_env_put(env, &refcheck); - RETURN(result); -} -#endif - -#ifdef HAVE_KERNEL_SPLICE_READ /* * Send file content (through pagecache) somewhere with helper */ @@ -1260,7 +1231,6 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos, cl_env_put(env, &refcheck); RETURN(result); } -#endif static int ll_lov_recreate(struct inode *inode, struct ost_id *oi, obd_count ost_idx) @@ -1891,8 +1861,8 @@ static int ll_swap_layouts(struct file *file1, struct file *file2, if (!S_ISREG(llss->inode2->i_mode)) GOTO(free, rc = -EINVAL); - if (ll_permission(llss->inode1, MAY_WRITE, NULL) || - ll_permission(llss->inode2, MAY_WRITE, NULL)) + if (inode_permission(llss->inode1, MAY_WRITE) || + inode_permission(llss->inode2, MAY_WRITE)) GOTO(free, rc = -EPERM); if (llss->inode2->i_sb != llss->inode1->i_sb) @@ -3043,12 +3013,7 @@ struct file_operations ll_file_operations = { .release = ll_file_release, .mmap = ll_file_mmap, .llseek = ll_file_seek, -#ifdef HAVE_KERNEL_SENDFILE - .sendfile = ll_file_sendfile, -#endif -#ifdef HAVE_KERNEL_SPLICE_READ .splice_read = ll_file_splice_read, -#endif .fsync = ll_fsync, .flush = ll_flush }; @@ -3063,12 +3028,7 @@ struct file_operations ll_file_operations_flock = { .release = ll_file_release, .mmap = ll_file_mmap, .llseek = ll_file_seek, -#ifdef HAVE_KERNEL_SENDFILE - .sendfile = ll_file_sendfile, -#endif -#ifdef HAVE_KERNEL_SPLICE_READ .splice_read = ll_file_splice_read, -#endif .fsync = ll_fsync, .flush = ll_flush, .flock = ll_file_flock, @@ -3086,12 +3046,7 @@ struct file_operations ll_file_operations_noflock = { .release = ll_file_release, .mmap = ll_file_mmap, .llseek = ll_file_seek, -#ifdef HAVE_KERNEL_SENDFILE - .sendfile = ll_file_sendfile, -#endif -#ifdef HAVE_KERNEL_SPLICE_READ .splice_read = ll_file_splice_read, -#endif .fsync = ll_fsync, .flush = ll_flush, .flock = ll_file_noflock, diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index f999167..8e139ab 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -847,11 +847,7 @@ void ll_delete_inode(struct inode *inode); int ll_iocontrol(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); int ll_flush_ctx(struct inode *inode); -#ifdef HAVE_UMOUNTBEGIN_VFSMOUNT -void ll_umount_begin(struct vfsmount *vfsmnt, int flags); -#else void ll_umount_begin(struct super_block *sb); -#endif int ll_remount_fs(struct super_block *sb, int *flags, char *data); #ifdef HAVE_SUPEROPS_USE_DENTRY int ll_show_options(struct seq_file *seq, struct dentry *dentry); @@ -943,19 +939,6 @@ struct vvp_io { * locked page returned from vvp_io */ struct page *ft_vmpage; -#ifndef HAVE_VM_OP_FAULT - struct vm_nopage_api { - /** - * Virtual address at which fault occurred. - */ - unsigned long ft_address; - /** - * Fault type, as to be supplied to - * filemap_nopage(). - */ - int *ft_type; - } nopage; -#else struct vm_fault_api { /** * kernel fault info @@ -966,7 +949,6 @@ struct vvp_io { */ unsigned int ft_flags; } fault; -#endif } fault; } u; /** diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 1a98966..ea33cda 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -973,17 +973,11 @@ void ll_lli_init(struct ll_inode_info *lli) static inline int ll_bdi_register(struct backing_dev_info *bdi) { -#ifdef HAVE_BDI_REGISTER static atomic_t ll_bdi_num = ATOMIC_INIT(0); -#ifdef HAVE_BDI_NAME bdi->name = "lustre"; -#endif return bdi_register(bdi, NULL, "lustre-%d", atomic_inc_return(&ll_bdi_num)); -#else - return 0; -#endif } int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) @@ -1028,9 +1022,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) if (err) GOTO(out_free, err); -#ifdef HAVE_SB_BDI sb->s_bdi = &lsi->lsi_bdi; -#endif /* Generate a string unique to this super, in case some joker tries to mount the same fs at two mount points. @@ -1378,50 +1370,6 @@ static int ll_setattr_ost(struct inode *inode, struct iattr *attr) return rc; } -#ifndef HAVE_VFS_INODE_NEWSIZE_OK -/** - * inode_newsize_ok - may this inode be truncated to a given size - * @inode: the inode to be truncated - * @offset: the new size to assign to the inode - * @Returns: 0 on success, -ve errno on failure - * - * inode_newsize_ok will check filesystem limits and ulimits to check that the - * new inode size is within limits. inode_newsize_ok will also send SIGXFSZ - * when necessary. Caller must not proceed with inode size change if failure is - * returned. @inode must be a file (not directory), with appropriate - * permissions to allow truncate (inode_newsize_ok does NOT check these - * conditions). - * - * inode_newsize_ok must be called with i_mutex held. - */ -int inode_newsize_ok(const struct inode *inode, loff_t offset) -{ - if (inode->i_size < offset) { - unsigned long limit; - - limit = rlimit(RLIMIT_FSIZE); - if (limit != RLIM_INFINITY && offset > limit) - goto out_sig; - if (offset > inode->i_sb->s_maxbytes) - goto out_big; - } else { - /* - * truncation of in-use swapfiles is disallowed - it would - * cause subsequent swapout to scribble on the now-freed - * blocks. - */ - if (IS_SWAPFILE(inode)) - return -ETXTBSY; - } - - return 0; -out_sig: - send_sig(SIGXFSZ, current, 0); -out_big: - return -EFBIG; -} -#endif - /* If this inode has objects allocated to it (lsm != NULL), then the OST * object(s) determine the file size and mtime. Otherwise, the MDS will * keep these values until such a time that objects are allocated for it. @@ -2047,26 +1995,13 @@ int ll_flush_ctx(struct inode *inode) } /* umount -f client means force down, don't save state */ -#ifdef HAVE_UMOUNTBEGIN_VFSMOUNT -void ll_umount_begin(struct vfsmount *vfsmnt, int flags) -{ - struct super_block *sb = vfsmnt->mnt_sb; -#else void ll_umount_begin(struct super_block *sb) { -#endif struct ll_sb_info *sbi = ll_s2sbi(sb); struct obd_device *obd; struct obd_ioctl_data *ioc_data; ENTRY; -#ifdef HAVE_UMOUNTBEGIN_VFSMOUNT - if (!(flags & MNT_FORCE)) { - EXIT; - return; - } -#endif - CDEBUG(D_VFSTRACE, "VFS Op: superblock %p count %d active %d\n", sb, sb->s_count, atomic_read(&sb->s_active)); @@ -2104,17 +2039,6 @@ void ll_umount_begin(struct super_block *sb) * schedule() and sleep one second if needed, and hope. */ cfs_schedule(); -#ifdef HAVE_UMOUNTBEGIN_VFSMOUNT - if (atomic_read(&vfsmnt->mnt_count) > 2) { - cfs_schedule_timeout_and_set_state(CFS_TASK_INTERRUPTIBLE, - cfs_time_seconds(1)); - if (atomic_read(&vfsmnt->mnt_count) > 2) - LCONSOLE_WARN("Mount still busy with %d refs! You " - "may try to umount it a bit later\n", - atomic_read(&vfsmnt->mnt_count)); - } -#endif - EXIT; } diff --git a/lustre/llite/llite_mmap.c b/lustre/llite/llite_mmap.c index a42cb46..d17697a 100644 --- a/lustre/llite/llite_mmap.c +++ b/lustre/llite/llite_mmap.c @@ -268,79 +268,6 @@ out: return result; } - -#ifndef HAVE_VM_OP_FAULT -/** - * Lustre implementation of a vm_operations_struct::nopage() method, called by - * VM to server page fault (both in kernel and user space). - * - * This function sets up CIT_FAULT cl_io that does the job. - * - * \param vma - is virtiual area struct related to page fault - * \param address - address when hit fault - * \param type - of fault - * - * \return allocated and filled _unlocked_ page for address - * \retval NOPAGE_SIGBUS if page not exist on this address - * \retval NOPAGE_OOM not have memory for allocate new page - */ -struct page *ll_nopage(struct vm_area_struct *vma, unsigned long address, - int *type) -{ - struct lu_env *env; - struct cl_env_nest nest; - struct cl_io *io; - struct page *page = NOPAGE_SIGBUS; - struct vvp_io *vio = NULL; - unsigned long ra_flags; - pgoff_t pg_offset; - int result; - const unsigned long writable = VM_SHARED|VM_WRITE; - cfs_sigset_t set; - ENTRY; - - pg_offset = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; - io = ll_fault_io_init(vma, &env, &nest, pg_offset, &ra_flags); - if (IS_ERR(io)) - return NOPAGE_SIGBUS; - - result = io->ci_result; - if (result < 0) - goto out_err; - - io->u.ci_fault.ft_writable = (vma->vm_flags&writable) == writable; - - vio = vvp_env_io(env); - vio->u.fault.ft_vma = vma; - vio->u.fault.nopage.ft_address = address; - vio->u.fault.nopage.ft_type = type; - vio->u.fault.ft_vmpage = NULL; - - set = cfs_block_sigsinv(sigmask(SIGKILL)|sigmask(SIGTERM)); - result = cl_io_loop(env, io); - cfs_restore_sigs(set); - - page = vio->u.fault.ft_vmpage; - if (result != 0 && page != NULL) { - page_cache_release(page); - page = NOPAGE_SIGBUS; - } - -out_err: - if (result == -ENOMEM) - page = NOPAGE_OOM; - - vma->vm_flags &= ~VM_RAND_READ; - vma->vm_flags |= ra_flags; - - cl_io_fini(env, io); - cl_env_nested_put(&nest, env); - - RETURN(page); -} - -#else - static inline int to_fault_error(int result) { switch(result) { @@ -455,38 +382,7 @@ restart: cfs_restore_sigs(set); return result; } -#endif - -#ifndef HAVE_PGMKWRITE_USE_VMFAULT -static int ll_page_mkwrite(struct vm_area_struct *vma, struct page *vmpage) -{ - int count = 0; - bool printed = false; - bool retry; - int result; - - do { - retry = false; - result = ll_page_mkwrite0(vma, vmpage, &retry); - - if (!printed && ++count > 16) { - CWARN("app(%s): the page %lu of file %lu is under heavy" - " contention.\n", - current->comm, page_index(vmpage), - vma->vm_file->f_dentry->d_inode->i_ino); - printed = true; - } - } while (retry); - if (result == 0) - unlock_page(vmpage); - else if (result == -ENODATA) - result = 0; /* kernel will know truncate has happened and - * retry */ - - return result; -} -#else static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) { int count = 0; @@ -529,7 +425,6 @@ static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) return result; } -#endif /** * To avoid cancel the locks covering mmapped region for lock cache pressure, @@ -562,23 +457,6 @@ static void ll_vm_close(struct vm_area_struct *vma) EXIT; } -#ifndef HAVE_VM_OP_FAULT -#ifndef HAVE_FILEMAP_POPULATE -static int (*filemap_populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); -#endif -static int ll_populate(struct vm_area_struct *area, unsigned long address, - unsigned long len, pgprot_t prot, unsigned long pgoff, - int nonblock) -{ - int rc = 0; - ENTRY; - - /* always set nonblock as true to avoid page read ahead */ - rc = filemap_populate(area, address, len, prot, pgoff, 1); - RETURN(rc); -} -#endif - /* return the user space pointer that maps to a file offset via a vma */ static inline unsigned long file_to_user(struct vm_area_struct *vma, __u64 byte) { @@ -605,17 +483,8 @@ int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last) } static struct vm_operations_struct ll_file_vm_ops = { -#ifndef HAVE_VM_OP_FAULT - .nopage = ll_nopage, - .populate = ll_populate, -#else .fault = ll_fault, -#endif -#ifndef HAVE_PGMKWRITE_COMPACT .page_mkwrite = ll_page_mkwrite, -#else - ._pmkw.page_mkwrite = ll_page_mkwrite, -#endif .open = ll_vm_open, .close = ll_vm_close, }; @@ -632,10 +501,6 @@ int ll_file_mmap(struct file *file, struct vm_area_struct * vma) ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_MAP, 1); rc = generic_file_mmap(file, vma); if (rc == 0) { -#if !defined(HAVE_FILEMAP_POPULATE) && !defined(HAVE_VM_OP_FAULT) - if (!filemap_populate) - filemap_populate = vma->vm_ops->populate; -#endif vma->vm_ops = &ll_file_vm_ops; vma->vm_ops->open(vma); /* update the inode's size and mtime */ diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c index fe1a90c..e23a44f 100644 --- a/lustre/llite/llite_nfs.c +++ b/lustre/llite/llite_nfs.c @@ -44,9 +44,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include #include "llite_internal.h" -#ifdef HAVE_LINUX_EXPORTFS_H #include -#endif __u32 get_uuid2int(const char *name, int len) { @@ -266,7 +264,6 @@ out: return rc; } -#ifdef HAVE_FH_TO_DENTRY static struct dentry *ll_fh_to_dentry(struct super_block *sb, struct fid *fid, int fh_len, int fh_type) { @@ -288,43 +285,6 @@ static struct dentry *ll_fh_to_parent(struct super_block *sb, struct fid *fid, RETURN(ll_iget_for_nfs(sb, &nfs_fid->lnf_parent, NULL)); } - -#else - -/* - * This length is counted as amount of __u32, - * It is composed of a fid and a mode - */ -static struct dentry *ll_decode_fh(struct super_block *sb, __u32 *fh, int fh_len, - int fh_type, - int (*acceptable)(void *, struct dentry *), - void *context) -{ - struct lustre_nfs_fid *nfs_fid = (void *)fh; - struct dentry *entry; - ENTRY; - - CDEBUG(D_INFO, "decoding for "DFID" fh_len=%d fh_type=%x\n", - PFID(&nfs_fid->lnf_child), fh_len, fh_type); - - if (fh_type != LUSTRE_NFS_FID) - RETURN(ERR_PTR(-EPROTO)); - - entry = sb->s_export_op->find_exported_dentry(sb, &nfs_fid->lnf_child, - &nfs_fid->lnf_parent, - acceptable, context); - RETURN(entry); -} - -static struct dentry *ll_get_dentry(struct super_block *sb, void *data) -{ - struct dentry *entry; - ENTRY; - - entry = ll_iget_for_nfs(sb, data, NULL); - RETURN(entry); -} -#endif static struct dentry *ll_get_parent(struct dentry *dchild) { struct ptlrpc_request *req = NULL; @@ -377,11 +337,6 @@ struct export_operations lustre_export_operations = { .get_parent = ll_get_parent, .encode_fh = ll_encode_fh, .get_name = ll_get_name, -#ifdef HAVE_FH_TO_DENTRY .fh_to_dentry = ll_fh_to_dentry, .fh_to_parent = ll_fh_to_parent, -#else - .get_dentry = ll_get_dentry, - .decode_fh = ll_decode_fh, -#endif }; diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c index 2d10dd5..a90b9dd 100644 --- a/lustre/llite/rw26.c +++ b/lustre/llite/rw26.c @@ -503,7 +503,6 @@ out: RETURN(tot_bytes ? : result); } -#if defined(HAVE_KERNEL_WRITE_BEGIN_END) || defined(MS_HAS_NEW_AOPS) static int ll_write_begin(struct file *file, struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata) @@ -541,7 +540,6 @@ static int ll_write_end(struct file *file, struct address_space *mapping, return rc ?: copied; } -#endif #ifdef CONFIG_MIGRATION int ll_migratepage(struct address_space *mapping, @@ -564,13 +562,8 @@ struct address_space_operations ll_aops = { .writepage = ll_writepage, .writepages = ll_writepages, .set_page_dirty = ll_set_page_dirty, -#ifdef HAVE_KERNEL_WRITE_BEGIN_END .write_begin = ll_write_begin, .write_end = ll_write_end, -#else - .prepare_write = ll_prepare_write, - .commit_write = ll_commit_write, -#endif .invalidatepage = ll_invalidatepage, .releasepage = (void *)ll_releasepage, #ifdef CONFIG_MIGRATION diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index 0908703..5a077a8 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -526,14 +526,6 @@ static int vvp_io_read_start(const struct lu_env *env, case IO_NORMAL: result = lustre_generic_file_read(file, cio, &pos); break; -#ifdef HAVE_KERNEL_SENDFILE - case IO_SENDFILE: - result = generic_file_sendfile(file, &pos, cnt, - vio->u.sendfile.cui_actor, - vio->u.sendfile.cui_target); - break; -#endif -#ifdef HAVE_KERNEL_SPLICE_READ case IO_SPLICE: result = generic_file_splice_read(file, &pos, vio->u.splice.cui_pipe, cnt, @@ -543,7 +535,6 @@ static int vvp_io_read_start(const struct lu_env *env, * buffers. */ io->ci_continue = 0; break; -#endif default: CERROR("Wrong IO type %u\n", vio->cui_io_subtype); LBUG(); @@ -620,33 +611,6 @@ static int vvp_io_write_start(const struct lu_env *env, RETURN(result); } -#ifndef HAVE_VM_OP_FAULT -static int vvp_io_kernel_fault(struct vvp_fault_io *cfio) -{ - struct page *vmpage; - - vmpage = filemap_nopage(cfio->ft_vma, cfio->nopage.ft_address, - cfio->nopage.ft_type); - - if (vmpage == NOPAGE_SIGBUS) { - CDEBUG(D_PAGE, "got addr %lu type %lx - SIGBUS\n", - cfio->nopage.ft_address,(long)cfio->nopage.ft_type); - return -EFAULT; - } else if (vmpage == NOPAGE_OOM) { - CDEBUG(D_PAGE, "got addr %lu type %lx - OOM\n", - cfio->nopage.ft_address, (long)cfio->nopage.ft_type); - return -ENOMEM; - } - - LL_CDEBUG_PAGE(D_PAGE, vmpage, "got addr %lu type %lx\n", - cfio->nopage.ft_address, (long)cfio->nopage.ft_type); - - cfio->ft_vmpage = vmpage; - lock_page(vmpage); - - return 0; -} -#else static int vvp_io_kernel_fault(struct vvp_fault_io *cfio) { struct vm_fault *vmf = cfio->fault.ft_vmf; @@ -682,8 +646,6 @@ static int vvp_io_kernel_fault(struct vvp_fault_io *cfio) return -EINVAL; } -#endif - static int vvp_io_fault_start(const struct lu_env *env, const struct cl_io_slice *ios) { @@ -835,9 +797,7 @@ out: /* return unlocked vmpage to avoid deadlocking */ if (vmpage != NULL) unlock_page(vmpage); -#ifdef HAVE_VM_OP_FAULT cfio->fault.ft_flags &= ~VM_FAULT_LOCKED; -#endif return result; } diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c index 0f2e189..d0f841e 100644 --- a/lustre/llite/xattr.c +++ b/lustre/llite/xattr.c @@ -37,9 +37,7 @@ #include #include #include -#ifdef HAVE_SELINUX_IS_ENABLED #include -#endif #define DEBUG_SUBSYSTEM S_LLITE diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 529c8f9..595cb89 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -66,31 +66,6 @@ #define ClearPageConstant(page) do {} while (0) #endif -#ifndef HAS_GENERIC_ERROR_REMOVE_PAGE -int generic_error_remove_page(struct address_space *mapping, struct page *page) -{ - if (mapping == NULL) - return -EINVAL; - - if (mapping != page->mapping) - return -EIO; - /* - * Only punch for normal data pages for now. - * Handling other types like directories would need more auditing. - */ - if (!S_ISREG(mapping->host->i_mode)) - return -EIO; - - if (page_mapped(page)) { - unmap_mapping_range(mapping, - (loff_t)page->index << PAGE_CACHE_SHIFT, - PAGE_CACHE_SIZE, 0); - } - truncate_complete_page(mapping, page); - return 0; -} -#endif - static int __osd_init_iobuf(struct osd_device *d, struct osd_iobuf *iobuf, int rw, int line, int pages) { diff --git a/lustre/ptlrpc/gss/gss_krb5_mech.c b/lustre/ptlrpc/gss/gss_krb5_mech.c index 181549f..7f9a0ab 100644 --- a/lustre/ptlrpc/gss/gss_krb5_mech.c +++ b/lustre/ptlrpc/gss/gss_krb5_mech.c @@ -576,8 +576,6 @@ out: return(ret); } -#ifdef HAVE_ASYNC_BLOCK_CIPHER - static inline int krb5_digest_hmac(struct ll_crypto_hash *tfm, rawobj_t *key, @@ -620,48 +618,6 @@ int krb5_digest_hmac(struct ll_crypto_hash *tfm, return ll_crypto_hash_final(&desc, cksum->data); } -#else /* ! HAVE_ASYNC_BLOCK_CIPHER */ - -static inline -int krb5_digest_hmac(struct ll_crypto_hash *tfm, - rawobj_t *key, - struct krb5_header *khdr, - int msgcnt, rawobj_t *msgs, - int iovcnt, lnet_kiov_t *iovs, - rawobj_t *cksum) -{ - struct scatterlist sg[1]; - __u32 keylen = key->len, i; - - crypto_hmac_init(tfm, key->data, &keylen); - - for (i = 0; i < msgcnt; i++) { - if (msgs[i].len == 0) - continue; - buf_to_sg(sg, (char *) msgs[i].data, msgs[i].len); - crypto_hmac_update(tfm, sg, 1); - } - - for (i = 0; i < iovcnt; i++) { - if (iovs[i].kiov_len == 0) - continue; - - sg_set_page(&sg[0], iovs[i].kiov_page, iovs[i].kiov_len, - iovs[i].kiov_offset); - crypto_hmac_update(tfm, sg, 1); - } - - if (khdr) { - buf_to_sg(sg, (char *) khdr, sizeof(*khdr)); - crypto_hmac_update(tfm, sg, 1); - } - - crypto_hmac_final(tfm, key->data, &keylen, cksum->data); - return 0; -} - -#endif /* HAVE_ASYNC_BLOCK_CIPHER */ - static inline int krb5_digest_norm(struct ll_crypto_hash *tfm, struct krb5_keyblock *kb, diff --git a/lustre/ptlrpc/gss/gss_svc_upcall.c b/lustre/ptlrpc/gss/gss_svc_upcall.c index e266f67..07ef7ba 100644 --- a/lustre/ptlrpc/gss/gss_svc_upcall.c +++ b/lustre/ptlrpc/gss/gss_svc_upcall.c @@ -177,12 +177,10 @@ static void rsi_request(struct cache_detail *cd, (*bpp)[-1] = '\n'; } -#ifdef HAVE_CACHE_UPCALL static int rsi_upcall(struct cache_detail *cd, struct cache_head *h) { return sunrpc_cache_pipe_upcall(cd, h, rsi_request); } -#endif static inline void __rsi_init(struct rsi *new, struct rsi *item) { @@ -355,11 +353,7 @@ static struct cache_detail rsi_cache = { .hash_table = rsi_table, .name = "auth.sptlrpc.init", .cache_put = rsi_put, -#ifdef HAVE_CACHE_UPCALL .cache_upcall = rsi_upcall, -#else - .cache_request = rsi_request, -#endif .cache_parse = rsi_parse, .match = rsi_match, .init = rsi_init,