*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*/
#ifndef __LIBCFS_LINUX_MISC_H__
#include <linux/mutex.h>
#include <linux/user_namespace.h>
#include <linux/uio.h>
+#include <linux/kallsyms.h>
#ifndef HAVE_IOV_ITER_TYPE
#ifdef HAVE_IOV_ITER_HAS_TYPE_MEMBER
int kstrtobool_from_user(const char __user *s, size_t count, bool *res);
#endif /* HAVE_KSTRTOBOOL_FROM_USER */
+#ifndef HAVE_MATCH_WILDCARD
+bool match_wildcard(const char *pattern, const char *str);
+#endif /* !HAVE_MATCH_WILDCARD */
+
#ifndef HAVE_KREF_READ
static inline int kref_read(const struct kref *kref)
{
#define sizeof_field(type, member) FIELD_SIZEOF(type, member)
#endif
+#ifndef HAVE_TASK_IS_RUNNING
+#define task_is_running(task) (task->state == TASK_RUNNING)
+#endif
+
+#ifdef HAVE_KALLSYMS_LOOKUP_NAME
+static inline void *cfs_kallsyms_lookup_name(const char *name)
+{
+ return (void *)kallsyms_lookup_name(name);
+}
+#else
+static inline void *cfs_kallsyms_lookup_name(const char *name)
+{
+ return NULL;
+}
+#endif
+
#endif /* __LIBCFS_LINUX_MISC_H__ */