SPL_AC_KVASPRINTF
SPL_AC_3ARGS_FILE_FSYNC
SPL_AC_EXPORTED_RWSEM_IS_LOCKED
+ SPL_AC_KERNEL_INVALIDATE_INODES
])
AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
[rwsem_is_locked() acquires sem->wait_lock])],
[])
])
+
+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 #
+AC_DEFUN([SPL_AC_KERNEL_INVALIDATE_INODES], [
+ SPL_CHECK_SYMBOL_EXPORT(
+ [invalidate_inodes],
+ [],
+ [AC_DEFINE(HAVE_INVALIDATE_INODES, 1,
+ [invalidate_inodes() is available])],
+ [])
+])
fi
+
+ { $as_echo "$as_me:$LINENO: checking whether symbol invalidate_inodes is exported" >&5
+$as_echo_n "checking whether symbol invalidate_inodes is exported... " >&6; }
+ grep -q -E '[[:space:]]invalidate_inodes[[:space:]]' \
+ $LINUX_OBJ/Module*.symvers 2>/dev/null
+ rc=$?
+ if test $rc -ne 0; then
+ export=0
+ for file in ; do
+ grep -q -E "EXPORT_SYMBOL.*(invalidate_inodes)" \
+ "$LINUX_OBJ/$file" 2>/dev/null
+ rc=$?
+ if test $rc -eq 0; then
+ export=1
+ break;
+ fi
+ done
+ if test $export -eq 0; then
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INVALIDATE_INODES 1
+_ACEOF
+
+ fi
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INVALIDATE_INODES 1
+_ACEOF
+
+ fi
+
+
;;
user)
+ { $as_echo "$as_me:$LINENO: checking whether symbol invalidate_inodes is exported" >&5
+$as_echo_n "checking whether symbol invalidate_inodes is exported... " >&6; }
+ grep -q -E '[[:space:]]invalidate_inodes[[:space:]]' \
+ $LINUX_OBJ/Module*.symvers 2>/dev/null
+ rc=$?
+ if test $rc -ne 0; then
+ export=0
+ for file in ; do
+ grep -q -E "EXPORT_SYMBOL.*(invalidate_inodes)" \
+ "$LINUX_OBJ/$file" 2>/dev/null
+ rc=$?
+ if test $rc -eq 0; then
+ export=1
+ break;
+ fi
+ done
+ if test $export -eq 0; then
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INVALIDATE_INODES 1
+_ACEOF
+
+ fi
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INVALIDATE_INODES 1
+_ACEOF
+
+ fi
+
+
+
if test "x$AWK" != xgawk; then
#define _SPL_MM_COMPAT_H
#include <linux/mm.h>
+#include <linux/fs.h>
/*
* Linux 2.6.31 API Change.
#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().
+ */
+#ifndef HAVE_INVALIDATE_INODES
+typedef int (*invalidate_inodes_t)(struct super_block *sb);
+extern invalidate_inodes_t invalidate_inodes_fn;
+#define invalidate_inodes(sb) invalidate_inodes_fn(sb)
+#endif /* HAVE_INVALIDATE_INODES */
+
#endif /* SPL_MM_COMPAT_H */
#endif /* NEED_GET_ZONE_COUNTS */
EXPORT_SYMBOL(spl_global_page_state);
+#ifndef HAVE_INVALIDATE_INODES
+invalidate_inodes_t invalidate_inodes_fn = SYMBOL_POISON;
+EXPORT_SYMBOL(invalidate_inodes_fn);
+#endif /* HAVE_INVALIDATE_INODES */
+
pgcnt_t
spl_kmem_availrmem(void)
{
*/
spl_kmem_init_globals();
+#ifndef HAVE_INVALIDATE_INODES
+ 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 */
+
return 0;
}
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* invalidate_inodes() is available */
+#undef HAVE_INVALIDATE_INODES
+
/* kallsyms_lookup_name() is available */
#undef HAVE_KALLSYMS_LOOKUP_NAME