#ifndef _LIBCFS_BITMAP_H_
#define _LIBCFS_BITMAP_H_
+#include <linux/interrupt.h>
+#include <libcfs/libcfs_private.h>
+
struct cfs_bitmap {
unsigned int size;
unsigned long data[0];
#ifndef __LIBCFS_CURPROC_H__
#define __LIBCFS_CURPROC_H__
+/* check if task is running in compat mode.*/
+#define current_pid() (current->pid)
+#define current_comm() (current->comm)
+
typedef __u32 cfs_cap_t;
#define CFS_CAP_CHOWN 0
#define __LIBCFS_LIBCFS_H__
#include <uapi/linux/lnet/libcfs_ioctl.h>
-#include <libcfs/linux/libcfs.h>
#include <libcfs/libcfs_debug.h>
#include <libcfs/libcfs_private.h>
#include <libcfs/bitmap.h>
#define LNET_ACCEPTOR_MAX_RESERVED_PORT 1023
/*
- * Drop into debugger, if possible. Implementation is provided by platform.
- */
-
-void cfs_enter_debugger(void);
-
-/*
* Defined by platform
*/
int unshare_fs_struct(void);
return (char *)ptr - shift;
}
-#define container_of0(ptr, type, member) \
+#define container_of0(ptr, type, member) \
((type *)__container_of((ptr), offsetof(type, member)))
struct lnet_debugfs_symlink_def {
void lnet_insert_debugfs(struct ctl_table *table,
const struct lnet_debugfs_symlink_def *symlinks);
+/* helper for sysctl handlers */
+int lprocfs_call_handler(void *data, int write, loff_t *ppos,
+ void __user *buffer, size_t *lenp,
+ int (*handler)(void *data, int write, loff_t pos,
+ void __user *buffer, int len));
+
#endif /* _LIBCFS_LIBCFS_H_ */
#ifndef __LIBCFS_CPU_H__
#define __LIBCFS_CPU_H__
+#include <linux/slab.h>
+#include <libcfs/linux/linux-cpu.h>
+
#ifndef HAVE_LIBCFS_CPT
struct cfs_cpt_table {
#ifndef __LIBCFS_DEBUG_H__
#define __LIBCFS_DEBUG_H__
+#include <stdarg.h>
+#include <linux/limits.h>
#include <uapi/linux/lnet/libcfs_debug.h>
/*
#ifdef CDEBUG_ENABLED
+#if !defined(__x86_64__)
+# ifdef __ia64__
+# define CDEBUG_STACK() (THREAD_SIZE - \
+ ((unsigned long)__builtin_dwarf_cfa() & \
+ (THREAD_SIZE - 1)))
+# else
+# define CDEBUG_STACK() (THREAD_SIZE - \
+ ((unsigned long)__builtin_frame_address(0) & \
+ (THREAD_SIZE - 1)))
+# endif /* __ia64__ */
+
+#define __CHECK_STACK(msgdata, mask, cdls) \
+do { \
+ if (unlikely(CDEBUG_STACK() > libcfs_stack)) { \
+ LIBCFS_DEBUG_MSG_DATA_INIT(msgdata, D_WARNING, NULL); \
+ libcfs_stack = CDEBUG_STACK(); \
+ libcfs_debug_msg(msgdata, \
+ "maximum lustre stack %lu\n", \
+ CDEBUG_STACK()); \
+ (msgdata)->msg_mask = mask; \
+ (msgdata)->msg_cdls = cdls; \
+ dump_stack(); \
+ /*panic("LBUG");*/ \
+ } \
+} while (0)
+#define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls)
+#else /* __x86_64__ */
+#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while (0)
+#define CDEBUG_STACK() (0L)
+#endif /* __x86_64__ */
+
/**
* Filters out logging messages based on mask and subsystem.
*/
#ifndef __LIBCFS_PRIM_H__
#define __LIBCFS_PRIM_H__
+#include <linux/mm.h>
#include <linux/sched.h>
/*
# define DEBUG_SUBSYSTEM S_UNDEFINED
#endif
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+
#ifdef LIBCFS_DEBUG
/*
#ifndef __LIBCFS_TIME_H__
#define __LIBCFS_TIME_H__
+#include <libcfs/linux/linux-time.h>
+
/*
* generic time manipulation functions.
*/
-EXTRA_DIST = libcfs.h linux-misc.h linux-fs.h linux-mem.h linux-time.h linux-cpu.h \
+EXTRA_DIST = linux-misc.h linux-fs.h linux-mem.h linux-time.h linux-cpu.h \
linux-list.h linux-crypto.h
+++ /dev/null
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.gnu.org/licenses/gpl-2.0.html
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, 2017, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LIBCFS_LINUX_LIBCFS_H__
-#define __LIBCFS_LINUX_LIBCFS_H__
-
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <libcfs/libcfs.h> instead
-#endif
-
-#ifndef __KERNEL__
-#error This include is only for kernel use.
-#endif
-
-#include <linux/bitops.h>
-#include <linux/compiler.h>
-#include <linux/ctype.h>
-#include <linux/errno.h>
-#include <linux/file.h>
-#include <linux/fs.h>
-#include <linux/highmem.h>
-#include <linux/interrupt.h>
-#include <linux/kallsyms.h>
-#include <linux/kernel.h>
-#include <linux/kmod.h>
-#include <linux/kthread.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/mutex.h>
-#include <linux/notifier.h>
-#include <linux/random.h>
-#include <linux/rbtree.h>
-#include <linux/rwsem.h>
-#include <linux/scatterlist.h>
-#include <linux/sched.h>
-#ifdef HAVE_SCHED_HEADERS
-#include <linux/sched/signal.h>
-#include <linux/sched/mm.h>
-#endif
-#include <linux/signal.h>
-#include <linux/slab.h>
-#include <linux/smp.h>
-#include <linux/stat.h>
-#include <linux/string.h>
-#include <linux/time.h>
-#include <linux/timer.h>
-#include <linux/types.h>
-#include <linux/unistd.h>
-#include <linux/vmalloc.h>
-#include <net/sock.h>
-#include <linux/atomic.h>
-#include <asm/div64.h>
-#include <linux/timex.h>
-#include <linux/uaccess.h>
-#include <stdarg.h>
-
-#include <libcfs/linux/linux-cpu.h>
-#include <libcfs/linux/linux-time.h>
-#include <libcfs/linux/linux-mem.h>
-#include <libcfs/linux/linux-misc.h>
-#include <libcfs/linux/linux-fs.h>
-
-#if !defined(__x86_64__)
-# ifdef __ia64__
-# define CDEBUG_STACK() (THREAD_SIZE - \
- ((unsigned long)__builtin_dwarf_cfa() & \
- (THREAD_SIZE - 1)))
-# else
-# define CDEBUG_STACK() (THREAD_SIZE - \
- ((unsigned long)__builtin_frame_address(0) & \
- (THREAD_SIZE - 1)))
-# endif /* __ia64__ */
-
-#define __CHECK_STACK(msgdata, mask, cdls) \
-do { \
- if (unlikely(CDEBUG_STACK() > libcfs_stack)) { \
- LIBCFS_DEBUG_MSG_DATA_INIT(msgdata, D_WARNING, NULL); \
- libcfs_stack = CDEBUG_STACK(); \
- libcfs_debug_msg(msgdata, \
- "maximum lustre stack %lu\n", \
- CDEBUG_STACK()); \
- (msgdata)->msg_mask = mask; \
- (msgdata)->msg_cdls = cdls; \
- dump_stack(); \
- /*panic("LBUG");*/ \
- } \
-} while (0)
-#define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls)
-#else /* __x86_64__ */
-#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0)
-#define CDEBUG_STACK() (0L)
-#endif /* __x86_64__ */
-
-/**
- * Platform specific declarations for cfs_curproc API (libcfs/curproc.h)
- *
- * Implementation is in linux-curproc.c
- */
-#define CFS_CURPROC_COMM_MAX (sizeof ((struct task_struct *)0)->comm)
-
-/* helper for sysctl handlers */
-int lprocfs_call_handler(void *data, int write, loff_t *ppos,
- void __user *buffer, size_t *lenp,
- int (*handler)(void *data, int write,
- loff_t pos, void __user *buffer, int len));
-
-#ifndef WITH_WATCHDOG
-#define WITH_WATCHDOG
-#endif
-
-/*
- * Macros to access common characteristics of "current" UNIX process.
- */
-#define current_pid() (current->pid)
-#define current_comm() (current->comm)
-
-/* check if task is running in compat mode.*/
-int current_is_32bit(void);
-
-#endif /* _LINUX_LIBCFS_H */
#ifndef __LIBCFS_LINUX_CPU_H__
#define __LIBCFS_LINUX_CPU_H__
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <libcfs/libcfs.h> instead
-#endif
-
-#ifndef __KERNEL__
-#error This include is only for kernel use.
-#endif
-
#include <linux/cpu.h>
#include <linux/cpuset.h>
#include <linux/topology.h>
#ifndef __LIBCFS_LINUX_CFS_FS_H__
#define __LIBCFS_LINUX_CFS_FS_H__
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <libcfs/libcfs.h> instead
-#endif
-
-#ifndef __KERNEL__
-#error This include is only for kernel use.
-#endif
-
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/mount.h>
#ifndef __LIBCFS_LINUX_CFS_MEM_H__
#define __LIBCFS_LINUX_CFS_MEM_H__
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <libcfs/libcfs.h> instead
-#endif
-
-#ifndef __KERNEL__
-#error This include is only for kernel use.
-#endif
-
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#ifndef __LIBCFS_LINUX_MISC_H__
#define __LIBCFS_LINUX_MISC_H__
+#include <linux/mutex.h>
+#include <linux/user_namespace.h>
+
#ifdef HAVE_SYSCTL_CTLNAME
#define INIT_CTL_NAME .ctl_name = CTL_UNNUMBERED,
#define INIT_STRATEGY .strategy = &sysctl_intvec,
#ifndef __LIBCFS_LINUX_LINUX_TIME_H__
#define __LIBCFS_LINUX_LINUX_TIME_H__
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <libcfs/libcfs.h> instead
-#endif
-
-#ifndef __KERNEL__
-#error This include is only for kernel use.
-#endif
-
/* Portable time API */
/*
* time_t cfs_duration_sec (cfs_duration_t);
*/
+#include <linux/hrtimer.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
# define DEBUG_SUBSYSTEM S_LNET
+#include <linux/ctype.h>
#include <linux/kthread.h>
+#include <libcfs/linux/linux-misc.h>
#include <libcfs/libcfs.h>
#include "tracefile.h"
#define DEBUG_SUBSYSTEM S_LNET
+#include <libcfs/linux/linux-cpu.h>
#include <libcfs/libcfs.h>
/** Global CPU partition table */
#include <linux/cpu.h>
#include <linux/slab.h>
#include <linux/sched.h>
+#ifdef HAVE_SCHED_HEADERS
+#include <linux/sched/signal.h>
+#include <linux/sched/mm.h>
+#endif
#include <linux/moduleparam.h>
#include <linux/mmu_context.h>
* Author: Nathan Rutman <nathan.rutman@sun.com>
*/
+#include <linux/ctype.h>
#include <libcfs/libcfs.h>
+#include <libcfs/libcfs_string.h>
char *cfs_strrstr(const char *haystack, const char *needle)
{
#include <crypto/hash.h>
#include <linux/scatterlist.h>
+#include <linux/pagemap.h>
#include <libcfs/libcfs.h>
#include <libcfs/libcfs_crypto.h>
#include <libcfs/linux/linux-crypto.h>
*/
#include <linux/sched.h>
+#ifdef HAVE_SCHED_HEADERS
+#include <linux/sched/signal.h>
+#include <linux/sched/mm.h>
+#endif
#include <linux/fs_struct.h>
-
+#include <linux/pagemap.h>
#include <linux/compat.h>
#include <linux/thread_info.h>
}
EXPORT_SYMBOL(libcfs_debug_dumpstack);
-struct task_struct *libcfs_current(void)
-{
- CWARN("current task struct is %p\n", current);
- return current;
-}
-
static int panic_notifier(struct notifier_block *self, unsigned long unused1,
void *unused2)
{
#define DEBUG_SUBSYSTEM S_LNET
+#include <linux/fs.h>
#include <linux/miscdevice.h>
+#include <linux/uaccess.h>
#include <libcfs/libcfs.h>
static inline size_t libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
#include <linux/kernel.h>
#include <linux/fs_struct.h>
#include <linux/sched.h>
-
+#ifdef HAVE_SCHED_HEADERS
+#include <linux/sched/signal.h>
+#include <linux/sched/mm.h>
+#endif
#include <libcfs/libcfs.h>
#if defined(CONFIG_KGDB)
#define DEBUG_SUBSYSTEM S_LNET
#define LUSTRE_TRACEFILE_PRIVATE
+#include <linux/slab.h>
#include <libcfs/libcfs.h>
#include "tracefile.h"
#include <libcfs/libcfs.h>
#include <libcfs/libcfs_crypto.h>
+#include <libcfs/linux/linux-misc.h>
#include <lnet/lib-lnet.h>
#include "tracefile.h"
#define LUSTRE_TRACEFILE_PRIVATE
#include "tracefile.h"
+#include <linux/ctype.h>
+#include <linux/fs.h>
#include <linux/kthread.h>
+#include <linux/pagemap.h>
+#include <linux/uaccess.h>
+#include <libcfs/linux/linux-fs.h>
#include <libcfs/libcfs.h>
/* XXX move things up to the top, comment */
#include <libcfs/libcfs.h>
#include "tracefile.h"
+#ifndef WITH_WATCHDOG
+#define WITH_WATCHDOG
+#endif
+
struct lc_watchdog {
spinlock_t lcw_lock; /* check or change lcw_list */
int lcw_refcount; /* must hold lcw_pending_timers_lock */
#include <linux/kthread.h>
#include <linux/uio.h>
+#include <linux/semaphore.h>
#include <linux/types.h>
#include <uapi/linux/lnet/lnet-dlc.h>
#define DEBUG_SUBSYSTEM S_LND
-#include <libcfs/libcfs.h>
#include <lnet/lib-lnet.h>
#include <gni_pub.h>
#include <asm/page.h>
#include <linux/nmi.h>
+#include <linux/pagemap.h>
#include "gnilnd.h"
/* this is useful when needed to debug wire corruption. */
#define DEBUG_SUBSYSTEM S_LND
+#include <libcfs/linux/linux-misc.h>
+
#include "gnilnd.h"
#define GNILND_PEERSTATE_STRLEN 16
#define DEBUG_SUBSYSTEM S_LND
-#include <libcfs/libcfs.h>
+#include <libcfs/libcfs_time.h>
#include <lnet/lib-lnet.h>
#define IBLND_PEER_HASH_SIZE 101 /* # peer_ni lists */
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/module.h>
+#include <linux/pagemap.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/syscalls.h>
#include <net/sock.h>
#include <net/tcp.h>
-#include <libcfs/libcfs.h>
#include <lnet/lib-lnet.h>
#include <lnet/socklnd.h>
*/
#define DEBUG_SUBSYSTEM S_LNET
+
+#include <linux/ctype.h>
#include <linux/log2.h>
#include <linux/ktime.h>
#include <linux/moduleparam.h>
+#include <linux/uaccess.h>
#include <lnet/lib-lnet.h>
*/
#define DEBUG_SUBSYSTEM S_LNET
+
+#include <linux/ctype.h>
#include <linux/nsproxy.h>
#include <net/net_namespace.h>
#include <lnet/lib-lnet.h>
#define DEBUG_SUBSYSTEM S_LNET
+#include <linux/pagemap.h>
+
#include <lnet/lib-lnet.h>
#include <linux/nsproxy.h>
#include <net/net_namespace.h>
#define DEBUG_SUBSYSTEM S_LNET
+#include <linux/sched.h>
+#ifdef HAVE_SCHED_HEADERS
+#include <linux/sched/signal.h>
+#endif
+#include <linux/uaccess.h>
+
#include <lnet/lib-lnet.h>
#include <uapi/linux/lnet/lnet-dlc.h>
*/
#define DEBUG_SUBSYSTEM S_LNET
+
+#include <linux/uaccess.h>
+
+#include <libcfs/linux/linux-misc.h>
#include <libcfs/libcfs.h>
#include <lnet/lib-lnet.h>
* Author: Liang Zhen <liangzhen@clusterfs.com>
*/
-
#include <libcfs/libcfs.h>
#include <lnet/lib-lnet.h>
#include "console.h"
#ifndef __LST_CONSOLE_H__
#define __LST_CONSOLE_H__
+#include <linux/uaccess.h>
#include <libcfs/libcfs.h>
#include <lnet/lib-types.h>
#define DEBUG_SUBSYSTEM S_FID
#include <linux/module.h>
-#include <libcfs/libcfs.h>
#include <obd.h>
#include <obd_class.h>
#include <obd_support.h>
/*
* super-class definitions.
*/
+#include <linux/aio.h>
+#include <linux/fs.h>
+
#include <libcfs/libcfs.h>
#include <libcfs/libcfs_ptask.h>
#include <lu_object.h>
#include <linux/spinlock.h>
#include <linux/seq_file.h>
-#include <libcfs/libcfs.h>
+#include <libcfs/libcfs_time.h>
+#include <libcfs/linux/linux-misc.h>
#include <uapi/linux/lustre/lustre_idl.h>
struct lprocfs_vars {
#ifndef _LUSTRE_COMPAT_H
#define _LUSTRE_COMPAT_H
+#include <linux/aio.h>
+#include <linux/fs.h>
#include <linux/fs_struct.h>
#include <linux/namei.h>
#include <linux/pagemap.h>
#include <linux/bio.h>
#include <linux/xattr.h>
-#include <libcfs/libcfs.h>
+#include <libcfs/linux/linux-fs.h>
#include <lustre_patchless_compat.h>
#include <obd_support.h>
* @{
*/
+#ifdef HAVE_SCHED_HEADERS
+#include <linux/sched/signal.h>
+#include <linux/sched/mm.h>
+#endif
+
#include <libcfs/libcfs.h>
#include <uapi/linux/lustre/lustre_idl.h>
#include <uapi/linux/lustre/lustre_ver.h>
#ifndef _OBD_SUPPORT
#define _OBD_SUPPORT
-#ifndef __KERNEL__
-# error Userspace should not include obd_support.h.
-#endif /* !__KERNEL__ */
-
#include <linux/atomic.h>
+#include <linux/ctype.h>
#include <linux/highmem.h>
#include <linux/slab.h>
#include <linux/types.h>
#define DEBUG_SUBSYSTEM S_LDLM
#include <linux/kthread.h>
+#include <libcfs/linux/linux-mem.h>
#include <lustre_dlm.h>
#include <cl_object.h>
#include <obd_class.h>
#include <linux/pagemap.h>
#include <linux/mm.h>
#include <linux/version.h>
+#include <linux/security.h>
#include <linux/user_namespace.h>
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <linux/buffer_head.h> // for wait_on_buffer
#include <linux/pagevec.h>
*/
#include <linux/kernel.h>
+#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/stat.h>
* Author: Prakash Surya <surya1@llnl.gov>
* Author: Bobi Jam <bobijam.xu@intel.com>
*/
+#ifdef HAVE_SCHED_HEADERS
+#include <linux/sched/signal.h>
+#endif
#include "range_lock.h"
#include <uapi/linux/lustre/lustre_user.h>
*/
#define DEBUG_SUBSYSTEM S_LMV
-#include <linux/slab.h>
+
+#include <linux/file.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/user_namespace.h>
#define DEBUG_SUBSYSTEM S_MDS
+#include <linux/random.h>
+
#include <obd.h>
#include <obd_class.h>
#include <obd_support.h>
#define DEBUG_SUBSYSTEM S_LOV
+#include <linux/random.h>
+
#include "lov_cl_internal.h"
static inline struct lov_device *lov_object_dev(struct lov_object *obj)
#define DEBUG_SUBSYSTEM S_MDS
+#include <linux/kthread.h>
+
#include <obd_class.h>
#include <obd_support.h>
#include <lustre_mds.h>
#include <linux/uidgid.h>
#endif
+#include <libcfs/linux/linux-misc.h>
#include <obd_support.h>
#include <obd_class.h>
#include <lustre_net.h>
#define DEBUG_SUBSYSTEM S_CLASS
+#include <linux/file.h>
+
#include <obd_support.h>
#include <lustre_kernelcomm.h>
#include <linux/list.h>
#include <libcfs/libcfs.h>
#include <libcfs/libcfs_hash.h> /* hash_long() */
+#include <libcfs/linux/linux-mem.h>
#include <obd_class.h>
#include <obd_support.h>
#include <lustre_disk.h>
#define OAP_MAGIC 8675309
+#include <libcfs/linux/linux-mem.h>
#include <lustre_osc.h>
extern atomic_t osc_pool_req_count;
#define DEBUG_SUBSYSTEM S_OSC
-#include <libcfs/libcfs.h>
/* fid_build_reg_res_name() */
#include <lustre_fid.h>
#include <lustre_osc.h>
#define DEBUG_SUBSYSTEM S_OSC
-#include <libcfs/libcfs.h>
-
#include <lprocfs_status.h>
#include <lustre_debug.h>
#include <lustre_dlm.h>
#define DEBUG_SUBSYSTEM S_OSD
+#include <linux/kallsyms.h>
#include <linux/module.h>
#include <linux/user_namespace.h>
#ifdef HAVE_UIDGID_HEADER
#define DEBUG_SUBSYSTEM S_RPC
+#include <linux/delay.h>
#include <obd_support.h>
#include <obd_class.h>
#include <lustre_lib.h>
#ifndef PTLRPC_GSS_CRYPTO_H
#define PTLRPC_GSS_CRYPTO_H
+#include <linux/scatterlist.h>
+
#include "gss_internal.h"
struct gss_keyblock {
#define DEBUG_SUBSYSTEM S_SEC
-#include <libcfs/libcfs.h>
+#include <libcfs/linux/linux-mem.h>
#include <obd.h>
#include <obd_cksum.h>