[
#include <linux/kernel.h>
#include <linux/module.h>
+
+#if defined(NEED_LOCKDEP_IS_HELD_DISCARD_CONST) \
+ && defined(CONFIG_LOCKDEP) \
+ && defined(lockdep_is_held)
+#undef lockdep_is_held
+ #define lockdep_is_held(lock) \
+ lock_is_held((struct lockdep_map *)&(lock)->dep_map)
+#endif
+
$1
int
main (void)
]) # LIBCFS_EXPORT_SAVE_STACK_TRACE_TSK
#
+# LIBCFS_LOCKDEP_IS_HELD
+#
+# Kernel v4.15-rc8-106-g08f36ff64234
+# lockdep: Make lockdep checking constant
+#
+AC_DEFUN([LIBCFS_LOCKDEP_IS_HELD], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if 'lockdep_is_held()' uses const argument],
+lockdep_is_held, [
+ #include <linux/lockdep.h>
+],[
+#ifdef CONFIG_LOCKDEP
+ const struct spinlock *lock = NULL;
+
+ lockdep_is_held(lock);
+#endif
+],[],[
+ AC_DEFINE(NEED_LOCKDEP_IS_HELD_DISCARD_CONST, 1,
+ [lockdep_is_held() argument is const])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LIBCFS_LOCKDEP_IS_HELD
+
+#
# LIBCFS_TIMER_SETUP
#
# Kernel version 4.15 commit e99e88a9d2b067465adaa9c111ada99a041bef9a
EXTRA_KCFLAGS="-Werror"
LB_CHECK_COMPILE([if page cache uses Xarray],
xarray_support, [
- #include <linux/radix-tree.h>
+ #include <linux/xarray.h>
],[
- radix_tree_exceptional_entry(NULL);
+ xa_is_value(NULL);
],[
- AC_DEFINE(HAVE_RADIX_TREE_EXCEPTIONAL_ENTRY, 1,
- [kernel lacks 'xa_is_value'])
+ AC_DEFINE(HAVE_XARRAY_SUPPORT, 1,
+ [kernel Xarray implementation lacks 'xa_is_value'])
])
EXTRA_KCFLAGS="$tmp_flags"
]) # LIBCFS_XARRAY_SUPPORT
LIBCFS_NEW_KERNEL_READ
LIBCFS_EXPORT_SAVE_STACK_TRACE_TSK
# 4.15
+LIBCFS_LOCKDEP_IS_HELD
LIBCFS_TIMER_SETUP
# 4.16
LIBCFS_WAIT_VAR_EVENT
*
* See Documentation/core-api/xarray.rst for how to use the XArray.
*/
-#ifdef HAVE_RADIX_TREE_EXCEPTIONAL_ENTRY
+#ifndef HAVE_XARRAY_SUPPORT
+
+#if defined(NEED_LOCKDEP_IS_HELD_DISCARD_CONST) \
+ && defined(CONFIG_LOCKDEP) \
+ && defined(lockdep_is_held)
+#undef lockdep_is_held
+ #define lockdep_is_held(lock) \
+ lock_is_held((struct lockdep_map *)&(lock)->dep_map)
+#endif
+
#include <linux/bug.h>
#include <linux/compiler.h>
#include <linux/gfp.h>
xas->xa_offset++;
return xa_entry(xas->xa, node, xas->xa_offset);
}
-#endif /* HAVE_RADIX_TREE_EXCEPTIONAL_ENTRY */
+#endif /* !HAVE_XARRAY_SUPPORT */
#endif /* _LINUX_XARRAY_H */
*
* at kernel verison 5.2-rc2
*/
-#ifdef HAVE_RADIX_TREE_EXCEPTIONAL_ENTRY
+#ifndef HAVE_XARRAY_SUPPORT
#include <linux/bitmap.h>
#include <linux/export.h>
#include <linux/list.h>
xa_dump_entry(entry, 0, shift);
}
#endif
-#endif /* HAVE_RADIX_TREE_EXCEPTIONAL_ENTRY */
+#endif /* !HAVE_XARRAY_SUPPORT */
* Author: Eric Barton <eric@bartonsoftware.com>
*/
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+#if defined(NEED_LOCKDEP_IS_HELD_DISCARD_CONST) \
+ && defined(CONFIG_LOCKDEP) \
+ && defined(lockdep_is_held)
+#undef lockdep_is_held
+ #define lockdep_is_held(lock) \
+ lock_is_held((struct lockdep_map *)&(lock)->dep_map)
+#endif
+
#ifdef HAVE_COMPAT_RDMA
#include <linux/compat-2.6.h>
#endif
-#include <linux/module.h>
-#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/mm.h>
#include <linux/string.h>
* the page cache interaction. Lets keep xa_is_value() separate
* in old kernels for Xarray support and page cache handling.
*/
-#ifdef HAVE_RADIX_TREE_EXCEPTIONAL_ENTRY
+#ifndef HAVE_XARRAY_SUPPORT
static inline bool ll_xa_is_value(void *entry)
{
return radix_tree_exceptional_entry(entry);
skip "ldiskfs module has not been loaded"
fi
+ if grep -q "CONFIG_DEBUG_LOCK_ALLOC=y" /boot/config-$(uname -r); then
+ skip "test is not compatible with CONFIG_DEBUG_LOCK_ALLOC=y"
+ fi
+
echo "$inode_slab ldiskfs inodes per page"
[ "${inode_slab%.*}" -ge "3" ] && return 0