X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libcfs%2Finclude%2Flibcfs%2Flinux%2Flibcfs.h;h=b154471d0ad67b09d6c271505da0c1c53d998d2c;hb=refs%2Fchanges%2F93%2F13793%2F4;hp=eb27038035de502609997a9ef5c79b53dbfdc0b0;hpb=6e3ec5812ebd1b5ecf7cae584f429b013ffe7431;p=fs%2Flustre-release.git diff --git a/libcfs/include/libcfs/linux/libcfs.h b/libcfs/include/libcfs/linux/libcfs.h index eb27038..b154471 100644 --- a/libcfs/include/libcfs/linux/libcfs.h +++ b/libcfs/include/libcfs/linux/libcfs.h @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,8 +24,10 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -47,14 +47,11 @@ #include +#include #include #include #include -#include #include -#include -#include -#include #include #ifdef HAVE_ASM_TYPES_H @@ -63,9 +60,8 @@ #include #include #include /* THREAD_SIZE */ - -#define CFS_THREAD_SIZE THREAD_SIZE -#define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5) +#include +#include #if !defined(__x86_64__) # ifdef __ia64__ @@ -78,33 +74,26 @@ (THREAD_SIZE - 1))) # endif /* __ia64__ */ -#define __CHECK_STACK(file, func, line) \ +#define __CHECK_STACK(msgdata, mask, cdls) \ do { \ - unsigned long _stack = CDEBUG_STACK(); \ - \ - if (_stack > 3*THREAD_SIZE/4 && _stack > libcfs_stack) { \ - libcfs_stack = _stack; \ - libcfs_debug_msg(NULL, DEBUG_SUBSYSTEM, D_WARNING, \ - file, func, line, \ - "maximum lustre stack %lu\n", _stack); \ + 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() __CHECK_STACK(__FILE__, __func__, __LINE__) +#define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls) #else /* __x86_64__ */ -#define CFS_CHECK_STACK() do { } while(0) +#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0) #define CDEBUG_STACK() (0L) #endif /* __x86_64__ */ -/* initial pid */ -#define LUSTRE_LNET_PID 12345 - -#define ENTRY_NESTING_SUPPORT (1) -#define ENTRY_NESTING do {;} while (0) -#define EXIT_NESTING do {;} while (0) -#define __current_nesting_level() (0) - /** * Platform specific declarations for cfs_curproc API (libcfs/curproc.h) * @@ -112,8 +101,13 @@ do { \ */ #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)); + #include -typedef kernel_cap_t cfs_kernel_cap_t; /* * No stack-back-tracing in Linux for now. @@ -121,12 +115,17 @@ typedef kernel_cap_t cfs_kernel_cap_t; struct cfs_stack_trace { }; -/* long integer with size equal to pointer */ -typedef unsigned long ulong_ptr_t; -typedef long long_ptr_t; - #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 */