]) # LIBCFS_CONFIG_PANIC_DUMPLOG
#
-# LIBCFS_U64_LONG_LONG_LINUX
-#
-# check kernel __u64 type
-#
-AC_DEFUN([LIBCFS_U64_LONG_LONG_LINUX], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
-LB_CHECK_COMPILE([if Linux kernel '__u64' is 'long long' type],
-kernel_u64_long_long, [
- #include <linux/types.h>
- #include <linux/stddef.h>
-],[
- unsigned long long *data;
- data = (__u64*)sizeof(data);
-],[
- AC_DEFINE(HAVE_KERN__U64_LONG_LONG, 1,
- [Linux kernel __u64 is long long type])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LIBCFS_U64_LONG_LONG_LINUX
-
-#
# LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
#
# 2.6.32-30.el6 adds a new 'walk_stack' field in 'struct stacktrace_ops'
==============================================================================])
LIBCFS_CONFIG_PANIC_DUMPLOG
-LIBCFS_U64_LONG_LONG_LINUX
# 2.6.32
LIBCFS_STACKTRACE_OPS_HAVE_WALK_STACK
LC_SHRINKER_WANT_SHRINK_PTR
endif
DIST_SUBDIRS = linux posix util darwin
+libcfsdir = $(includedir)/libcfs
+
+if UTILS
+libcfs_HEADERS = types.h
+endif
+
EXTRA_DIST = \
bitmap.h \
curproc.h \
list.h \
lucache.h \
params_tree.h \
+ types.h \
user-bitops.h \
user-crypto.h \
user-lock.h \
#define __attribute__(x)
#endif
+#include <libcfs/types.h>
+
#if !defined(__WINNT__) && !defined(__KERNEL__)
#include <libcfs/posix/libcfs.h>
#elif defined(__linux__)
/* 'f' ioctls are defined in lustre_ioctl.h and lustre_user.h except for: */
#define LIBCFS_IOC_DEBUG_MASK _IOWR('f', 250, long)
+#define IOCTL_LIBCFS_TYPE long
/* ioctls for manipulating snapshots 30- */
#define IOC_LIBCFS_TYPE 'e'
# define printf(format, b...) CDEBUG(D_OTHER, format , ## b)
# define time(a) CURRENT_TIME
-#define IOCTL_LIBCFS_TYPE long
-
-#ifdef __CYGWIN__
-# ifndef BITS_PER_LONG
-# if (~0UL) == 0xffffffffUL
-# define BITS_PER_LONG 32
-# else
-# define BITS_PER_LONG 64
-# endif
-# endif
-#endif
-
-#if BITS_PER_LONG > 32
-# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
-# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
-# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
-#else
-# define LI_POISON ((int)0x5a5a5a5a)
-# define LL_POISON ((long)0x5a5a5a5a)
-# define LP_POISON ((void *)(long)0x5a5a5a5a)
-#endif
-
-/* this is a bit chunky */
-
-#define _LWORDSIZE BITS_PER_LONG
-
-#if defined(HAVE_KERN__U64_LONG_LONG)
-# define LPU64 "%llu"
-# define LPD64 "%lld"
-# define LPX64 "%#llx"
-# define LPX64i "%llx"
-# define LPO64 "%#llo"
-# define LPF64 "L"
-#else
-# define LPU64 "%lu"
-# define LPD64 "%ld"
-# define LPX64 "%#lx"
-# define LPX64i "%lx"
-# define LPO64 "%#lo"
-# define LPF64 "l"
-#endif
-
-/*
- * long_ptr_t & ulong_ptr_t, same to "long" for gcc
- */
-# define LPLU "%lu"
-# define LPLD "%ld"
-# define LPLX "%#lx"
-
-/*
- * pid_t
- */
-# define LPPID "%d"
-
-#ifndef LPU64
-# error "No word size defined"
-#endif
-
-#undef _LWORDSIZE
-
#ifdef HAVE_SYSCTL_CTLNAME
#define INIT_CTL_NAME .ctl_name = CTL_UNNUMBERED,
#define INIT_STRATEGY .strategy = &sysctl_intvec,
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
-libcfsposixdir = $(includedir)/libcfs/posix
-
-if UTILS
-libcfsposix_HEADERS = posix-types.h
-endif
-
-EXTRA_DIST = libcfs.h posix-wordsize.h posix-types.h posix-crypto.h
\ No newline at end of file
+EXTRA_DIST = libcfs.h posix-crypto.h
#endif
#include <libcfs/list.h>
-#include <libcfs/posix/posix-types.h>
#include <libcfs/user-time.h>
#include <libcfs/user-prim.h>
#include <libcfs/user-mem.h>
#include <libcfs/user-lock.h>
#include <libcfs/user-tcpip.h>
-#include <libcfs/posix/posix-wordsize.h>
#include <libcfs/user-bitops.h>
# define do_gettimeofday(tv) gettimeofday(tv, NULL);
+++ /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.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/posix/posix-types.h
- *
- * Define the linux types we use for posix userspace.
- *
- * Author: Robert Read <rread@sun.com>
- */
-#ifndef _LUSTRE_POSIX_TYPES_H
-#define _LUSTRE_POSIX_TYPES_H
-
-#ifdef __linux__
-# include <linux/types.h>
-#endif
-#include <stdbool.h> /* for bool */
-
-#ifndef _LINUX_TYPES_H
-/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space
- */
-
-#ifndef HAVE___S8
-#define HAVE___S8
-typedef __signed__ char __s8;
-#endif
-#ifndef HAVE___U8
-#define HAVE___U8
-typedef unsigned char __u8;
-#endif
-
-#ifndef HAVE___S16
-#define HAVE___S16
-typedef __signed__ short __s16;
-#endif
-#ifndef HAVE___U16
-#define HAVE___U16
-typedef unsigned short __u16;
-#endif
-
-#ifndef HAVE___S32
-#define HAVE___S32
-typedef __signed__ int __s32;
-#endif
-#ifndef HAVE___U32
-#define HAVE___U32
-typedef unsigned int __u32;
-#endif
-
-/*
- * The kernel defines user space 64bit values as l64 on powerpc. We must
- * match that definition to avoid conflicting definition compile errors.
- */
-#if defined(__powerpc64__) && !defined(__KERNEL__)
-# ifndef HAVE___S64
-# define HAVE___S64
-typedef __signed__ long __s64;
-# endif
-# ifndef HAVE___U64
-# define HAVE___U64
-typedef unsigned long __u64;
-# endif
-#else /* !defined(__powerpc64__) || defined(__KERNEL__) */
-# ifndef HAVE___S64
-# define HAVE___S64
-typedef __signed__ long long __s64;
-# endif
-# ifndef HAVE___U64
-# define HAVE___U64
-typedef unsigned long long __u64;
-# endif
-#endif /* defined(__powerpc64__) && !defined(__KERNEL__) */
-#endif /* _LINUX_TYPES_H */
-
-/* long integer with size equal to pointer */
-typedef unsigned long ulong_ptr_t;
-typedef long long_ptr_t;
-
-/* Sparse annotations, copied from linux/compiler.h. */
-#define __user
-#define __kernel
-#define __safe
-#define __force
-#define __nocast
-#define __iomem
-#define __chk_user_ptr(x) ((void)0)
-#define __chk_io_ptr(x) ((void)0)
-#define __builtin_warning(x, y...) (1)
-#define __acquires(x)
-#define __releases(x)
-#define __acquire(x) ((void)0)
-#define __release(x) ((void)0)
-#define __cond_lock(x, c) (c)
-
-typedef unsigned long pgoff_t;
-
-#endif
+++ /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.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2011, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/posix/posix-wordsize.h
- *
- * Wordsize related defines for posix userspace.
- *
- * Author: Robert Read <rread@sun.com>
- */
-
-#ifndef __LIBCFS_LINUX_KP30_H__
-#define __LIBCFS_LINUX_KP30_H__
-
-#if defined(__CYGWIN__)
-# include <cygwin-ioctl.h>
-#endif
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif
-#ifndef _IOWR
-# include "ioctl.h"
-#endif
-
-# define CFS_MODULE_PARM(name, t, type, perm, desc)
-#define symbol_get(x) inter_module_get(#x)
-#define symbol_put(x) inter_module_put(#x)
-
-#ifdef __CYGWIN__
-# ifndef BITS_PER_LONG
-# if (~0UL) == 0xffffffffUL
-# define BITS_PER_LONG 32
-# else
-# define BITS_PER_LONG 64
-# endif
-# endif
-#else
-# define BITS_PER_LONG __WORDSIZE
-#endif
-
-#define IOCTL_LIBCFS_TYPE long
-
-#if BITS_PER_LONG > 32
-# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
-# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
-# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
-#else
-# define LI_POISON ((int)0x5a5a5a5a)
-# define LL_POISON ((long)0x5a5a5a5a)
-# define LP_POISON ((void *)(long)0x5a5a5a5a)
-#endif
-
-# define LPU64 "%llu"
-# define LPD64 "%lld"
-# define LPX64 "%#llx"
-# define LPX64i "%llx"
-# define LPO64 "%#llo"
-# define LPF64 "ll"
-
-/*
- * long_ptr_t & ulong_ptr_t, same to "long" for gcc
- */
-# define LPLU "%lu"
-# define LPLD "%ld"
-# define LPLX "%#lx"
-
-/*
- * pid_t
- */
-# define LPPID "%d"
-
-#endif
--- /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, 2014, Intel Corporation.
+ */
+#ifndef _LIBCFS_TYPES_H
+#define _LIBCFS_TYPES_H
+
+#include <linux/types.h>
+
+#ifndef __KERNEL__
+# include <limits.h> /* LONG_MAX */
+# include <stdbool.h> /* bool */
+#endif /* !__KERNEL__ */
+
+#if defined(_ASM_GENERIC_INT_L64_H)
+# define LPF64 "l"
+#elif defined(_ASM_GENERIC_INT_LL64_H)
+# define LPF64 "ll"
+#elif !defined(LPF64)
+# error "cannot define LPF64"
+#endif /* !LPF64 */
+
+#define LPU64 "%"LPF64"u"
+#define LPD64 "%"LPF64"d"
+#define LPX64 "%#"LPF64"x"
+#define LPX64i "%"LPF64"x"
+#define LPO64 "%#"LPF64"o"
+
+#define LPLU "%lu"
+#define LPLD "%ld"
+#define LPLX "%#lx"
+#define LPPID "%d"
+
+#ifndef BITS_PER_LONG
+# if LONG_MAX == 9223372036854775807
+# define BITS_PER_LONG 64
+# elif LONG_MAX == 2147483647
+# define BITS_PER_LONG 32
+# else /* LONG_MAX == 2147483647 */
+# error "cannot define BITS_PER_LONG"
+# endif /* LONG_MAX != 2147483647 */
+#endif /* !BITS_PER_LONG */
+
+#if BITS_PER_LONG == 64
+# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
+# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a)
+# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a)
+#elif BITS_PER_LONG == 32
+# define LI_POISON ((int)0x5a5a5a5a)
+# define LL_POISON ((long)0x5a5a5a5a)
+# define LP_POISON ((void *)(long)0x5a5a5a5a)
+#else /* BITS_PER_LONG == 32 */
+# error "cannot define L{I,L,P}_POISON"
+#endif /* BITS_PER_LONG != 32 */
+
+typedef unsigned long ulong_ptr_t;
+typedef long long_ptr_t;
+
+#endif /* _LIBCFS_TYPES_H */
#if !defined(__KERNEL__)
#include <stddef.h>
-#include <libcfs/posix/posix-types.h>
+#include <libcfs/types.h>
struct ll_fiemap_extent {
__u64 fe_logical; /* logical offset in bytes for the start of
* @{
*/
-#ifndef __KERNEL__
-#include <stdio.h>
-#include <libcfs/posix/posix-types.h>
+#include <libcfs/types.h>
+
+#ifdef __KERNEL__
+# include <linux/string.h> /* snprintf() */
+#else
+# include <stdio.h> /* snprintf() */
#endif
#include <lustre/ll_fiemap.h>
#if defined(__linux__)