mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Remove spl_invalidate_inodes()
This functionality is no longer required by ZFS, see commit zfsonlinux/zfs@7b3e34ba5a. Since there are no other consumers, and because it adds additional autoconf complexity which must be maintained the spl_invalidate_inodes() function has been removed. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue zfsonlinux/zfs#795
This commit is contained in:
parent
d4899f4747
commit
84dd1f4f15
@ -76,8 +76,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
|
||||
SPL_AC_5ARGS_PROC_HANDLER
|
||||
SPL_AC_KVASPRINTF
|
||||
SPL_AC_EXPORTED_RWSEM_IS_LOCKED
|
||||
SPL_AC_KERNEL_INVALIDATE_INODES
|
||||
SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES
|
||||
SPL_AC_KERNEL_FALLOCATE
|
||||
SPL_AC_SHRINK_DCACHE_MEMORY
|
||||
SPL_AC_SHRINK_ICACHE_MEMORY
|
||||
@ -2036,78 +2034,6 @@ AC_DEFUN([SPL_AC_EXPORTED_RWSEM_IS_LOCKED],
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.37 API compat,
|
||||
dnl # The function invalidate_inodes() is no longer exported by the kernel.
|
||||
dnl # The prototype however is still available which means it is safe
|
||||
dnl # to acquire the symbol's address using spl_kallsyms_lookup_name().
|
||||
dnl #
|
||||
dnl # The Proxmox VE kernel contains a patch which renames the function
|
||||
dnl # invalidate_inodes() to invalidate_inodes_check(). In the process
|
||||
dnl # it adds a 'check' argument and a '#define invalidate_inodes(x)'
|
||||
dnl # compatibility wrapper for legacy callers. Therefore, if either
|
||||
dnl # of these functions are exported invalidate_inodes() can be
|
||||
dnl # safely used.
|
||||
dnl #
|
||||
AC_DEFUN([SPL_AC_KERNEL_INVALIDATE_INODES], [
|
||||
AC_MSG_CHECKING([whether invalidate_inodes() is available])
|
||||
SPL_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
invalidate_inodes;
|
||||
], [invalidate_inodes], [], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INVALIDATE_INODES, 1,
|
||||
[invalidate_inodes() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether invalidate_inodes_check() is available])
|
||||
SPL_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/fs.h>
|
||||
#ifndef invalidate_inodes
|
||||
#error invalidate_inodes is not a macro
|
||||
#endif
|
||||
], [ ], [invalidate_inodes_check], [], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INVALIDATE_INODES_CHECK, 1,
|
||||
[invalidate_inodes_check() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.39 API compat,
|
||||
dnl # The function invalidate_inodes() now take 2 arguments. The second
|
||||
dnl # 'kill_dirty' argument describes how invalidate_inodes() should
|
||||
dnl # handle dirty inodes. Only when set will dirty inodes be discarded,
|
||||
dnl # otherwise they will be handled as busy.
|
||||
dnl #
|
||||
dnl # Unfortunately, we don't have access to the invalidate_inodes()
|
||||
dnl # prototype so it's not easy to check how many arguments it takes.
|
||||
dnl # However, this change was done for the benefit of invalidate_device()
|
||||
dnl # which also added an argument. The invalidate_device() symbol does
|
||||
dnl # exist in the development headers so if it takes two arguments we
|
||||
dnl # can fairly safely infer that invalidate_inodes() takes two arguments
|
||||
dnl # as well. See commit 93b270f76e7ef3b81001576860c2701931cdc78b.
|
||||
dnl #
|
||||
AC_DEFUN([SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES],
|
||||
[AC_MSG_CHECKING([whether invalidate_inodes() wants 2 args])
|
||||
SPL_LINUX_TRY_COMPILE([
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
return __invalidate_device(NULL, 0);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_INVALIDATE_INODES, 1,
|
||||
[invalidate_inodes() wants 2 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.xx API compat,
|
||||
dnl # There currently exists no exposed API to partially shrink the dcache.
|
||||
|
@ -44,34 +44,6 @@
|
||||
#define high_wmark_pages(z) (z->pages_high)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 2.6.37 API compat,
|
||||
* The function invalidate_inodes() is no longer exported by the kernel.
|
||||
* The prototype however is still available which means it is safe
|
||||
* to acquire the symbol's address using spl_kallsyms_lookup_name().
|
||||
*
|
||||
* 2.6.39 API compat,
|
||||
* As for 2.6.39 invalidate_inodes() was updated to take a second
|
||||
* argument which controls how dirty inodes should be handled.
|
||||
*/
|
||||
#if defined(HAVE_INVALIDATE_INODES) || defined(HAVE_INVALIDATE_INODES_CHECK)
|
||||
# ifdef HAVE_2ARGS_INVALIDATE_INODES
|
||||
# define spl_invalidate_inodes(sb, kd) invalidate_inodes(sb, kd)
|
||||
# else
|
||||
# define spl_invalidate_inodes(sb, kd) invalidate_inodes(sb)
|
||||
# endif /* HAVE_2ARGS_INVALIDATE_INODES */
|
||||
#else
|
||||
# ifdef HAVE_2ARGS_INVALIDATE_INODES
|
||||
typedef int (*invalidate_inodes_t)(struct super_block *sb, bool kd);
|
||||
extern invalidate_inodes_t invalidate_inodes_fn;
|
||||
# define spl_invalidate_inodes(sb, kd) invalidate_inodes_fn(sb, kd)
|
||||
# else
|
||||
typedef int (*invalidate_inodes_t)(struct super_block *sb);
|
||||
extern invalidate_inodes_t invalidate_inodes_fn;
|
||||
# define spl_invalidate_inodes(sb, kd) invalidate_inodes_fn(sb)
|
||||
# endif /* HAVE_2ARGS_INVALIDATE_INODES */
|
||||
#endif /* HAVE_INVALIDATE_INODES || HAVE_INVALIDATE_INODES_CHECK */
|
||||
|
||||
#if !defined(HAVE_SHRINK_CONTROL_STRUCT)
|
||||
struct shrink_control {
|
||||
gfp_t gfp_mask;
|
||||
|
@ -180,11 +180,6 @@ spl_global_page_state(spl_zone_stat_item_t item)
|
||||
#endif /* NEED_GET_ZONE_COUNTS */
|
||||
EXPORT_SYMBOL(spl_global_page_state);
|
||||
|
||||
#if !defined(HAVE_INVALIDATE_INODES) && !defined(HAVE_INVALIDATE_INODES_CHECK)
|
||||
invalidate_inodes_t invalidate_inodes_fn = SYMBOL_POISON;
|
||||
EXPORT_SYMBOL(invalidate_inodes_fn);
|
||||
#endif /* !HAVE_INVALIDATE_INODES && !HAVE_INVALIDATE_INODES_CHECK */
|
||||
|
||||
#ifndef HAVE_SHRINK_DCACHE_MEMORY
|
||||
shrink_dcache_memory_t shrink_dcache_memory_fn = SYMBOL_POISON;
|
||||
EXPORT_SYMBOL(shrink_dcache_memory_fn);
|
||||
@ -2376,15 +2371,6 @@ spl_kmem_init_kallsyms_lookup(void)
|
||||
*/
|
||||
spl_kmem_init_globals();
|
||||
|
||||
#if !defined(HAVE_INVALIDATE_INODES) && !defined(HAVE_INVALIDATE_INODES_CHECK)
|
||||
invalidate_inodes_fn = (invalidate_inodes_t)
|
||||
spl_kallsyms_lookup_name("invalidate_inodes");
|
||||
if (!invalidate_inodes_fn) {
|
||||
printk(KERN_ERR "Error: Unknown symbol invalidate_inodes\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
#endif /* !HAVE_INVALIDATE_INODES && !HAVE_INVALIDATE_INODES_CHECK */
|
||||
|
||||
#ifndef HAVE_SHRINK_DCACHE_MEMORY
|
||||
/* When shrink_dcache_memory_fn == NULL support is disabled */
|
||||
shrink_dcache_memory_fn = (shrink_dcache_memory_t)
|
||||
|
Loading…
Reference in New Issue
Block a user