#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-prim.h>
#include <linux/types.h>
#include <asm/timex.h>
#include <linux/sched.h> /* THREAD_SIZE */
+#include <linux/rbtree.h>
#define CFS_THREAD_SIZE THREAD_SIZE
#define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5)
#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(); \
- (msgdata)->msg_mask = D_WARNING; \
- (msgdata)->msg_cdls = NULL; \
libcfs_debug_msg(msgdata, \
"maximum lustre stack %lu\n", \
CDEBUG_STACK()); \
#endif /* HAVE_STRUCT_CRED */
+#ifndef HAVE_SCATTERLIST_INITTABLE
+#define sg_init_table(sg, nents) memset(sg, 0, sizeof(*(sg))*(nents))
+#endif
+
+#ifndef HAVE_SCATTERLIST_SETPAGE
+#define sg_set_page(sg, p, len, off) \
+ sg_set_buf(sg, page_address(p) + ((off) & ~CFS_PAGE_MASK), len)
+#endif
+
#endif /* _LINUX_LIBCFS_H */