Whamcloud - gitweb
LU-7243 misc: update Intel copyright messages 2015
[fs/lustre-release.git] / libcfs / include / libcfs / linux / libcfs.h
index 13bcd3a..c939ba1 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 #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 <libcfs/linux/linux-lock.h>
 #include <libcfs/linux/linux-fs.h>
-#include <libcfs/linux/linux-tcpip.h>
-#include <libcfs/linux/linux-bitops.h>
 #include <libcfs/linux/kp30.h>
 
 #ifdef HAVE_ASM_TYPES_H
@@ -64,6 +60,8 @@
 #include <asm/timex.h>
 #include <linux/sched.h> /* THREAD_SIZE */
 #include <linux/rbtree.h>
+#include <linux/bitops.h>
+#include <linux/capability.h>
 
 #if !defined(__x86_64__)
 # ifdef  __ia64__
@@ -96,14 +94,6 @@ do {                                                                    \
 #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)
  *
@@ -111,17 +101,23 @@ do {                                                                    \
  */
 #define CFS_CURPROC_COMM_MAX (sizeof ((struct task_struct *)0)->comm)
 
-#include <linux/capability.h>
+/* 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));
 
-/*
- * No stack-back-tracing in Linux for now.
- */
-struct cfs_stack_trace {
-};
+#ifndef HAVE_KSTRTOUL
+static inline int kstrtoul(const char *s, unsigned int base, unsigned long *res)
+{
+       char *end = (char *)s;
 
-/* long integer with size equal to pointer */
-typedef unsigned long ulong_ptr_t;
-typedef long long_ptr_t;
+       *res = simple_strtoul(s, &end, base);
+       if (end - s == 0)
+               return -EINVAL;
+       return 0;
+}
+#endif /* !HAVE_KSTRTOUL */
 
 #ifndef WITH_WATCHDOG
 #define WITH_WATCHDOG
@@ -131,7 +127,6 @@ typedef long long_ptr_t;
  * Macros to access common characteristics of "current" UNIX process.
  */
 #define current_pid()             (current->pid)
-#define current_umask()           (current->fs->umask)
 #define current_comm()            (current->comm)
 
 /* check if task is running in compat mode.*/