Whamcloud - gitweb
LU-2675 build: assume __linux__ and __KERNEL__ 37/11437/5
authorJohn L. Hammond <john.hammond@intel.com>
Fri, 15 Aug 2014 14:45:09 +0000 (09:45 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 27 Aug 2014 20:59:42 +0000 (20:59 +0000)
Assume that __linux__is defined everywhere and that __KERNEL__ is
defined in most of lustre/.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ia04e7ed4c3ab3e8ca205e14eaa1824536aedd1e3
Reviewed-on: http://review.whamcloud.com/11437
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
155 files changed:
libcfs/include/libcfs/bitmap.h
libcfs/include/libcfs/err.h
libcfs/include/libcfs/libcfs.h
libcfs/include/libcfs/libcfs_cpu.h
libcfs/include/libcfs/libcfs_debug.h
libcfs/include/libcfs/libcfs_hash.h
libcfs/include/libcfs/libcfs_private.h
libcfs/include/libcfs/list.h
libcfs/include/libcfs/posix/libcfs.h
libcfs/include/libcfs/util/platform.h
libcfs/libcfs/tracefile.h
libcfs/libcfs/user-prim.c
lnet/include/lnet/api-support.h
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-types.h
lnet/include/lnet/lnet.h
lnet/klnds/socklnd/socklnd.h
lnet/utils/debug.c
lustre/fld/fld_cache.c
lustre/fld/fld_index.c
lustre/fld/fld_internal.h
lustre/fld/fld_request.c
lustre/fld/lproc_fld.c
lustre/include/cl_object.h
lustre/include/linux/lustre_debug.h
lustre/include/linux/lustre_dlm.h
lustre/include/linux/lustre_handles.h
lustre/include/linux/lustre_lib.h
lustre/include/linux/lustre_lite.h
lustre/include/linux/lustre_net.h
lustre/include/linux/lustre_quota.h
lustre/include/linux/lvfs.h
lustre/include/linux/obd.h
lustre/include/linux/obd_class.h
lustre/include/lprocfs_status.h
lustre/include/lustre/lustre_user.h
lustre/include/lustre_acl.h
lustre/include/lustre_capa.h
lustre/include/lustre_debug.h
lustre/include/lustre_dlm.h
lustre/include/lustre_handles.h
lustre/include/lustre_lib.h
lustre/include/lustre_lite.h
lustre/include/lustre_log.h
lustre/include/lustre_mdc.h
lustre/include/lustre_net.h
lustre/include/lustre_nrs_tbf.h
lustre/include/lustre_quota.h
lustre/include/lvfs.h
lustre/include/obd.h
lustre/include/obd_cache.h
lustre/include/obd_class.h
lustre/include/obd_support.h
lustre/ldlm/l_lock.c
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_flock.c
lustre/ldlm/ldlm_inodebits.c
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_plain.c
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_reint.c
lustre/mdc/mdc_request.c
lustre/mdt/mdt_internal.h
lustre/mgc/mgc_request.c
lustre/mgs/mgs_nids.c
lustre/obdclass/capa.c
lustre/obdclass/cl_io.c
lustre/obdclass/class_obd.c
lustre/obdclass/debug.c
lustre/obdclass/genops.c
lustre/obdclass/linux/linux-module.c
lustre/obdclass/llog.c
lustre/obdclass/llog_cat.c
lustre/obdclass/llog_obd.c
lustre/obdclass/llog_swab.c
lustre/obdclass/lprocfs_counters.c
lustre/obdclass/lprocfs_jobstats.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lprocfs_status_server.c
lustre/obdclass/lu_object.c
lustre/obdclass/lu_ref.c
lustre/obdclass/lustre_handles.c
lustre/obdclass/lustre_peer.c
lustre/obdclass/obd_config.c
lustre/obdclass/obdo.c
lustre/obdclass/statfs_pack.c
lustre/obdclass/uuid.c
lustre/obdecho/echo_client.c
lustre/obdecho/echo_internal.h
lustre/osc/osc_cl_internal.h
lustre/osc/osc_io.c
lustre/osc/osc_lock.c
lustre/osc/osc_quota.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_dynlocks.c
lustre/osd-ldiskfs/osd_iam.h
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_oi.h
lustre/ptlrpc/client.c
lustre/ptlrpc/connection.c
lustre/ptlrpc/errno.c
lustre/ptlrpc/events.c
lustre/ptlrpc/gss/gss_bulk.c
lustre/ptlrpc/gss/gss_cli_upcall.c
lustre/ptlrpc/gss/gss_generic_token.c
lustre/ptlrpc/gss/gss_keyring.c
lustre/ptlrpc/gss/gss_krb5_mech.c
lustre/ptlrpc/gss/gss_mech_switch.c
lustre/ptlrpc/gss/gss_null_mech.c
lustre/ptlrpc/gss/gss_pipefs.c
lustre/ptlrpc/gss/gss_sk_mech.c
lustre/ptlrpc/gss/gss_svc_upcall.c
lustre/ptlrpc/gss/lproc_gss.c
lustre/ptlrpc/gss/sec_gss.c
lustre/ptlrpc/import.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/llog_client.c
lustre/ptlrpc/llog_net.c
lustre/ptlrpc/llog_server.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/niobuf.c
lustre/ptlrpc/nrs.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_fifo.c
lustre/ptlrpc/nrs_tbf.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/pers.c
lustre/ptlrpc/pinger.c
lustre/ptlrpc/ptlrpc_internal.h
lustre/ptlrpc/ptlrpc_module.c
lustre/ptlrpc/ptlrpcd.c
lustre/ptlrpc/recover.c
lustre/ptlrpc/sec.c
lustre/ptlrpc/sec_bulk.c
lustre/ptlrpc/sec_config.c
lustre/ptlrpc/sec_ctx.c
lustre/ptlrpc/sec_gc.c
lustre/ptlrpc/sec_lproc.c
lustre/ptlrpc/sec_null.c
lustre/ptlrpc/sec_plain.c
lustre/ptlrpc/service.c
lustre/ptlrpc/wirehdr.c
lustre/ptlrpc/wiretest.c
lustre/tests/checkfiemap.c
lustre/utils/mount_utils_ldiskfs.c
lustre/utils/wiretest.c
snmp/lustre-snmp-trap.c
snmp/lustre-snmp-util.c

index c74726b..94fa75d 100644 (file)
 #ifndef _LIBCFS_BITMAP_H_
 #define _LIBCFS_BITMAP_H_
 
 #ifndef _LIBCFS_BITMAP_H_
 #define _LIBCFS_BITMAP_H_
 
-#if !defined(__linux__) || !defined(__KERNEL__)
+#ifndef __KERNEL__
 #define DIV_ROUND_UP(n, d)     (((n) + (d) - 1) / (d))
 #define BITS_TO_LONGS(nr)      DIV_ROUND_UP(nr, 8 * sizeof(long))
 
 #define DECLARE_BITMAP(name, bits) \
        unsigned long name[BITS_TO_LONGS(bits)]
 #define DIV_ROUND_UP(n, d)     (((n) + (d) - 1) / (d))
 #define BITS_TO_LONGS(nr)      DIV_ROUND_UP(nr, 8 * sizeof(long))
 
 #define DECLARE_BITMAP(name, bits) \
        unsigned long name[BITS_TO_LONGS(bits)]
-#endif
+#endif /* !__KERNEL__ */
 
 typedef struct {
        unsigned int  size;
 
 typedef struct {
        unsigned int  size;
index 3d24510..36e9dc6 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef LIBCFS_ERR_H_
 #define LIBCFS_ERR_H_
 
 #ifndef LIBCFS_ERR_H_
 #define LIBCFS_ERR_H_
 
-#if defined(__linux__) && defined(__KERNEL__)
+#ifdef __KERNEL__
 # include <linux/err.h>
 #else /* __KERNEL__ */
 
 # include <linux/err.h>
 #else /* __KERNEL__ */
 
index e8395f1..76117da 100644 (file)
 #ifndef __LIBCFS_LIBCFS_H__
 #define __LIBCFS_LIBCFS_H__
 
 #ifndef __LIBCFS_LIBCFS_H__
 #define __LIBCFS_LIBCFS_H__
 
-#if !__GNUC__
-#define __attribute__(x)
-#endif
-
 #include <libcfs/types.h>
 
 #include <libcfs/types.h>
 
-#if !defined(__KERNEL__)
-#include <libcfs/posix/libcfs.h>
-#elif defined(__linux__)
-#include <libcfs/linux/libcfs.h>
-#else
-#error Unsupported operating system.
-#endif
+#ifdef __KERNEL__
+# include <libcfs/linux/libcfs.h>
+#else /* __KERNEL__ */
+# include <libcfs/posix/libcfs.h>
+#endif /* !__KERNEL__ */
 
 #include "curproc.h"
 
 
 #include "curproc.h"
 
index 891fc21..9751069 100644 (file)
@@ -77,7 +77,7 @@
 
 #ifndef HAVE_LIBCFS_CPT
 
 
 #ifndef HAVE_LIBCFS_CPT
 
-#if !defined(__linux__) || !defined(__KERNEL__)
+#ifndef __KERNEL__
 typedef struct nodemask { DECLARE_BITMAP(bits, 1); } nodemask_t;
 typedef struct cpumask  { DECLARE_BITMAP(bits, 1); } cpumask_t;
 
 typedef struct nodemask { DECLARE_BITMAP(bits, 1); } nodemask_t;
 typedef struct cpumask  { DECLARE_BITMAP(bits, 1); } cpumask_t;
 
@@ -86,7 +86,7 @@ static __always_inline void __node_set(int node, nodemask_t *dstp)
 {
        set_bit(node, dstp->bits);
 }
 {
        set_bit(node, dstp->bits);
 }
-#endif
+#endif /* __KERNEL__ */
 
 struct cfs_cpt_table {
        /* # of CPU partitions */
 
 struct cfs_cpt_table {
        /* # of CPU partitions */
index 009e63a..745236e 100644 (file)
@@ -299,7 +299,6 @@ do {                                                                        \
        goto label;                                                     \
 } while (0)
 
        goto label;                                                     \
 } while (0)
 
-#if defined(__GNUC__)
 
 long libcfs_log_return(struct libcfs_debug_msg_data *, long rc);
 #if BITS_PER_LONG > 32
 
 long libcfs_log_return(struct libcfs_debug_msg_data *, long rc);
 #if BITS_PER_LONG > 32
@@ -334,9 +333,6 @@ do {                                                                        \
 } while (0)
 #endif /* BITS_PER_LONG > 32 */
 
 } while (0)
 #endif /* BITS_PER_LONG > 32 */
 
-#else
-# error "Unkown compiler"
-#endif /* __GNUC__ */
 
 #define ENTRY                                                           \
 ENTRY_NESTING;                                                          \
 
 #define ENTRY                                                           \
 ENTRY_NESTING;                                                          \
index 444053d..3104173 100644 (file)
  * we'll need to move the functions to archi specific headers.
  */
 
  * we'll need to move the functions to archi specific headers.
  */
 
-#if (defined __linux__ && defined __KERNEL__)
-#include <linux/hash.h>
-#else
+#ifdef __KERNEL__
+# include <linux/hash.h>
+#else /* __KERNEL__ */
 /* Fast hashing routine for a long.
    (C) 2002 William Lee Irwin III, IBM */
 
 /* Fast hashing routine for a long.
    (C) 2002 William Lee Irwin III, IBM */
 
-#if BITS_PER_LONG == 32
+# if BITS_PER_LONG == 32
 /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
 /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
-#define CFS_GOLDEN_RATIO_PRIME          CFS_GOLDEN_RATIO_PRIME_32
-#elif BITS_PER_LONG == 64
+#  define CFS_GOLDEN_RATIO_PRIME          CFS_GOLDEN_RATIO_PRIME_32
+# elif BITS_PER_LONG == 64
 /*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
 /*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
-#define CFS_GOLDEN_RATIO_PRIME          CFS_GOLDEN_RATIO_PRIME_64
-#else
-#error Define CFS_GOLDEN_RATIO_PRIME for your wordsize.
-#endif
+#  define CFS_GOLDEN_RATIO_PRIME          CFS_GOLDEN_RATIO_PRIME_64
+# else
+#  error Define CFS_GOLDEN_RATIO_PRIME for your wordsize.
+# endif /* BITS_PER_LONG == 64 */
 
 static inline unsigned long hash_long(unsigned long val, unsigned int bits)
 {
        unsigned long hash = val;
 
 
 static inline unsigned long hash_long(unsigned long val, unsigned int bits)
 {
        unsigned long hash = val;
 
-#if BITS_PER_LONG == 64
+# if BITS_PER_LONG == 64
        /*  Sigh, gcc can't optimise this alone like it does for 32 bits. */
        unsigned long n = hash;
        n <<= 18;
        /*  Sigh, gcc can't optimise this alone like it does for 32 bits. */
        unsigned long n = hash;
        n <<= 18;
@@ -98,23 +98,15 @@ static inline unsigned long hash_long(unsigned long val, unsigned int bits)
        hash += n;
        n <<= 2;
        hash += n;
        hash += n;
        n <<= 2;
        hash += n;
-#else
+# else /* BITS_PER_LONG == 64 */
        /* On some cpus multiply is faster, on others gcc will do shifts */
        hash *= CFS_GOLDEN_RATIO_PRIME;
        /* On some cpus multiply is faster, on others gcc will do shifts */
        hash *= CFS_GOLDEN_RATIO_PRIME;
-#endif
+# endif /* BITS_PER_LONG != 64 */
 
        /* High bits are more random, so use them. */
        return hash >> (BITS_PER_LONG - bits);
 }
 
        /* High bits are more random, so use them. */
        return hash >> (BITS_PER_LONG - bits);
 }
-#if 0
-static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
-{
-       return hash_long((unsigned long)ptr, bits);
-}
-#endif
-
-/* !(__linux__ && __KERNEL__) */
-#endif
+#endif /* !__KERNEL__ */
 
 /** disable debug */
 #define CFS_HASH_DEBUG_NONE         0
 
 /** disable debug */
 #define CFS_HASH_DEBUG_NONE         0
index 8245c5b..0673b40 100644 (file)
@@ -311,13 +311,8 @@ int libcfs_debug_cleanup(void);
  * build go below this comment. Actual compiler/compiler version
  * specific implementations come from the above header files
  */
  * build go below this comment. Actual compiler/compiler version
  * specific implementations come from the above header files
  */
-#ifdef __GNUC__
 #define likely(x)      __builtin_expect(!!(x), 1)
 #define unlikely(x)    __builtin_expect(!!(x), 0)
 #define likely(x)      __builtin_expect(!!(x), 1)
 #define unlikely(x)    __builtin_expect(!!(x), 0)
-#else
-#define likely(x)      (!!(x))
-#define unlikely(x)    (!!(x))
-#endif
 /* !__KERNEL__ */
 #endif
 
 /* !__KERNEL__ */
 #endif
 
index 6dca9ad..8419796 100644 (file)
 #ifndef __LIBCFS_LIST_H__
 #define __LIBCFS_LIST_H__
 
 #ifndef __LIBCFS_LIST_H__
 #define __LIBCFS_LIST_H__
 
-#if defined (__linux__) && defined(__KERNEL__)
-
-#include <linux/list.h>
-
-#else /* !defined (__linux__) || !defined(__KERNEL__) */
+#ifdef __KERNEL__
+# include <linux/list.h>
+#else /* __KERNEL__ */
 
 /*
  * Simple doubly linked list implementation.
 
 /*
  * Simple doubly linked list implementation.
@@ -443,7 +441,7 @@ static inline void hlist_add_after(struct hlist_node *n,
 
 /* @} */
 
 
 /* @} */
 
-#endif /* __linux__ && __KERNEL__ */
+#endif /* __KERNEL__ */
 
 #ifndef list_for_each_prev
 /**
 
 #ifndef list_for_each_prev
 /**
index d19d12f..6dec16b 100644 (file)
 #include <libcfs/user-tcpip.h>
 #include <libcfs/user-bitops.h>
 
 #include <libcfs/user-tcpip.h>
 #include <libcfs/user-bitops.h>
 
-# define do_gettimeofday(tv) gettimeofday(tv, NULL);
+#define do_gettimeofday(tv) gettimeofday(tv, NULL);
 typedef unsigned long long cfs_cycles_t;
 
 /* this goes in posix-fs.h */
 #include <sys/mount.h>
 
 typedef unsigned long long cfs_cycles_t;
 
 /* this goes in posix-fs.h */
 #include <sys/mount.h>
 
-#ifdef __linux__
 #include <mntent.h>
 #include <mntent.h>
-#endif
 
 #define fget(x) NULL
 #define fput(f) do {} while (0)
 
 
 #define fget(x) NULL
 #define fput(f) do {} while (0)
 
-#ifdef __linux__
 /* Userpace byte flipping */
 /* Userpace byte flipping */
-# include <endian.h>
-# include <byteswap.h>
-# define __swab16(x) bswap_16(x)
-# define __swab32(x) bswap_32(x)
-# define __swab64(x) bswap_64(x)
-# define __swab16s(x) do {*(x) = bswap_16(*(x));} while (0)
-# define __swab32s(x) do {*(x) = bswap_32(*(x));} while (0)
-# define __swab64s(x) do {*(x) = bswap_64(*(x));} while (0)
-# if __BYTE_ORDER == __LITTLE_ENDIAN
-#  define le16_to_cpu(x) (x)
-#  define cpu_to_le16(x) (x)
-#  define le32_to_cpu(x) (x)
-#  define cpu_to_le32(x) (x)
-#  define le64_to_cpu(x) (x)
-#  define cpu_to_le64(x) (x)
-
-#  define be16_to_cpu(x) bswap_16(x)
-#  define cpu_to_be16(x) bswap_16(x)
-#  define be32_to_cpu(x) bswap_32(x)
-#  define cpu_to_be32(x) bswap_32(x)
-#  define be64_to_cpu(x) (__u64)bswap_64(x)
-#  define cpu_to_be64(x) (__u64)bswap_64(x)
-# else
-#  if __BYTE_ORDER == __BIG_ENDIAN
-#   define le16_to_cpu(x) bswap_16(x)
-#   define cpu_to_le16(x) bswap_16(x)
-#   define le32_to_cpu(x) bswap_32(x)
-#   define cpu_to_le32(x) bswap_32(x)
-#   define le64_to_cpu(x) (__u64)bswap_64(x)
-#   define cpu_to_le64(x) (__u64)bswap_64(x)
-
-#   define be16_to_cpu(x) (x)
-#   define cpu_to_be16(x) (x)
-#   define be32_to_cpu(x) (x)
-#   define cpu_to_be32(x) (x)
-#   define be64_to_cpu(x) (x)
-#   define cpu_to_be64(x) (x)
-
-#  else
-#   error "Unknown byte order"
-#  endif /* __BIG_ENDIAN */
-# endif /* __LITTLE_ENDIAN */
-#endif
-
-# ifndef THREAD_SIZE /* x86_64 linux has THREAD_SIZE in userspace */
-#  define THREAD_SIZE 8192
-# else
-# endif
+#include <endian.h>
+#include <byteswap.h>
+#define __swab16(x) bswap_16(x)
+#define __swab32(x) bswap_32(x)
+#define __swab64(x) bswap_64(x)
+#define __swab16s(x) do {*(x) = bswap_16(*(x));} while (0)
+#define __swab32s(x) do {*(x) = bswap_32(*(x));} while (0)
+#define __swab64s(x) do {*(x) = bswap_64(*(x));} while (0)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define le16_to_cpu(x) (x)
+# define cpu_to_le16(x) (x)
+# define le32_to_cpu(x) (x)
+# define cpu_to_le32(x) (x)
+# define le64_to_cpu(x) (x)
+# define cpu_to_le64(x) (x)
+
+# define be16_to_cpu(x) bswap_16(x)
+# define cpu_to_be16(x) bswap_16(x)
+# define be32_to_cpu(x) bswap_32(x)
+# define cpu_to_be32(x) bswap_32(x)
+# define be64_to_cpu(x) ((__u64)bswap_64(x))
+# define cpu_to_be64(x) ((__u64)bswap_64(x))
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# define le16_to_cpu(x) bswap_16(x)
+# define cpu_to_le16(x) bswap_16(x)
+# define le32_to_cpu(x) bswap_32(x)
+# define cpu_to_le32(x) bswap_32(x)
+# define le64_to_cpu(x) ((__u64)bswap_64(x))
+# define cpu_to_le64(x) ((__u64)bswap_64(x))
+
+# define be16_to_cpu(x) (x)
+# define cpu_to_be16(x) (x)
+# define be32_to_cpu(x) (x)
+# define cpu_to_be32(x) (x)
+# define be64_to_cpu(x) (x)
+# define cpu_to_be64(x) (x)
+#else /*  __BYTE_ORDER == __BIG_ENDIAN */
+# error "Unknown byte order"
+#endif /* __BYTE_ORDER != __BIG_ENDIAN */
+
+#ifndef THREAD_SIZE /* x86_64 linux has THREAD_SIZE in userspace */
+# define THREAD_SIZE 8192
+#endif /* THREAD_SIZE */
 
 #define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0)
 #define CDEBUG_STACK() (0L)
 
 #define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0)
 #define CDEBUG_STACK() (0L)
index c2154e1..62aaf3f 100644 (file)
@@ -40,7 +40,6 @@
 #ifndef __LUSTRE_UTILS_PLATFORM_H
 #define __LUSTRE_UTILS_PLATFORM_H
 
 #ifndef __LUSTRE_UTILS_PLATFORM_H
 #define __LUSTRE_UTILS_PLATFORM_H
 
-#ifdef __linux__
 
 #ifdef HAVE_LIBREADLINE
 #define READLINE_LIBRARY
 
 #ifdef HAVE_LIBREADLINE
 #define READLINE_LIBRARY
@@ -73,29 +72,5 @@ typedef pthread_cond_t       l_cond_t;
 #define l_cond_wait(c, s)      pthread_cond_wait(c, s)
 #endif
 
 #define l_cond_wait(c, s)      pthread_cond_wait(c, s)
 #endif
 
-#else /* other platform */
-
-#ifdef HAVE_LIBREADLINE
-#define READLINE_LIBRARY
-#include <readline/readline.h>
-#endif /* HAVE_LIBREADLINE */
-#include <errno.h>
-#include <string.h>
-#if HAVE_LIBPTHREAD
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <pthread.h>
-
-typedef pthread_mutex_t        l_mutex_t;
-typedef pthread_cond_t l_cond_t;
-#define l_mutex_init(s)                pthread_mutex_init(s, NULL)
-#define l_mutex_lock(s)                pthread_mutex_lock(s)
-#define l_mutex_unlock(s)      pthread_mutex_unlock(s)
-#define l_cond_init(c)         pthread_cond_init(c, NULL)
-#define l_cond_broadcast(c)    pthread_cond_broadcast(c)
-#define l_cond_wait(c, s)      pthread_cond_wait(c, s)
-#endif /* HAVE_LIBPTHREAD */
-
-#endif /* __linux__  */
 
 #endif
 
 #endif
index 9ba2ff7..ca7f904 100644 (file)
 #include <libcfs/libcfs.h>
 
 #ifdef __KERNEL__
 #include <libcfs/libcfs.h>
 
 #ifdef __KERNEL__
-#if defined(__linux__)
-#include "linux/linux-tracefile.h"
-#else
-#error Unsupported operating system.
-#endif
-#else
-#include "posix/posix-tracefile.h"
-#endif
+# include "linux/linux-tracefile.h"
+#else /* __KERNEL__ */
+# include "posix/posix-tracefile.h"
+#endif /* !__KERNEL__ */
 /* trace file lock routines */
 
 #define TRACEFILE_NAME_SIZE 1024
 /* trace file lock routines */
 
 #define TRACEFILE_NAME_SIZE 1024
index a912c94..2066499 100644 (file)
@@ -362,7 +362,6 @@ void cfs_clear_sigpending(void)
         return;
 }
 
         return;
 }
 
-#ifdef __linux__
 
 /*
  * In glibc (NOT in Linux, so check above is not right), implement
 
 /*
  * In glibc (NOT in Linux, so check above is not right), implement
@@ -383,17 +382,6 @@ void *cfs_stack_trace_frame(struct cfs_stack_trace *trace, int frame_no)
                 return NULL;
 }
 
                 return NULL;
 }
 
-#else
-
-void cfs_stack_trace_fill(struct cfs_stack_trace *trace)
-{}
-void *cfs_stack_trace_frame(struct cfs_stack_trace *trace, int frame_no)
-{
-        return NULL;
-}
-
-/* __linux__ */
-#endif
 
 void lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
 {
 
 void lbug_with_loc(struct libcfs_debug_msg_data *msgdata)
 {
index 650435c..bdd4ff0 100644 (file)
 #ifndef __LNET_API_SUPPORT_H__
 #define __LNET_API_SUPPORT_H__
 
 #ifndef __LNET_API_SUPPORT_H__
 #define __LNET_API_SUPPORT_H__
 
-#if defined(__linux__)
 #include <lnet/linux/api-support.h>
 #include <lnet/linux/api-support.h>
-#else
-#error Unsupported Operating System
-#endif
 
 #include <libcfs/libcfs.h>
 #include <lnet/types.h>
 
 #include <libcfs/libcfs.h>
 #include <lnet/types.h>
index 49f3fa7..5c5a30d 100644 (file)
 #ifndef __LNET_LIB_LNET_H__
 #define __LNET_LIB_LNET_H__
 
 #ifndef __LNET_LIB_LNET_H__
 #define __LNET_LIB_LNET_H__
 
-#if defined(__linux__)
 #include <lnet/linux/lib-lnet.h>
 #include <lnet/linux/lib-lnet.h>
-#else
-#error Unsupported Operating System
-#endif
 
 #include <libcfs/libcfs.h>
 #include <lnet/types.h>
 
 #include <libcfs/libcfs.h>
 #include <lnet/types.h>
index f65d90c..21d2636 100644 (file)
 #ifndef __LNET_LIB_TYPES_H__
 #define __LNET_LIB_TYPES_H__
 
 #ifndef __LNET_LIB_TYPES_H__
 #define __LNET_LIB_TYPES_H__
 
-#if defined(__linux__)
 #include <lnet/linux/lib-types.h>
 #include <lnet/linux/lib-types.h>
-#else
-#error Unsupported Operating System
-#endif
 
 #include <libcfs/libcfs.h>
 #include <libcfs/list.h>
 
 #include <libcfs/libcfs.h>
 #include <libcfs/list.h>
index 8b07c24..85eb9d6 100644 (file)
  *
  * User application interface file
  */
  *
  * User application interface file
  */
-#if defined(__linux__)
 #include <lnet/linux/lnet.h>
 #include <lnet/linux/lnet.h>
-#else
-#error Unsupported Operating System
-#endif
 
 #include <lnet/types.h>
 #include <lnet/api.h>
 
 #include <lnet/types.h>
 #include <lnet/api.h>
index c67f717..a795a96 100644 (file)
 #define DEBUG_PORTAL_ALLOC
 #define DEBUG_SUBSYSTEM S_LND
 
 #define DEBUG_PORTAL_ALLOC
 #define DEBUG_SUBSYSTEM S_LND
 
-#if defined(__linux__)
 #include "socklnd_lib-linux.h"
 #include "socklnd_lib-linux.h"
-#else
-#error Unsupported Operating System
-#endif
 
 #include <libcfs/libcfs.h>
 #include <lnet/lnet.h>
 
 #include <libcfs/libcfs.h>
 #include <lnet/lnet.h>
index 8702818..b87b43c 100644 (file)
@@ -59,7 +59,6 @@ static int debug_mask = ~0;
 static const char *libcfs_debug_subsystems[] = LIBCFS_DEBUG_SUBSYS_NAMES;
 static const char *libcfs_debug_masks[] = LIBCFS_DEBUG_MASKS_NAMES;
 
 static const char *libcfs_debug_subsystems[] = LIBCFS_DEBUG_SUBSYS_NAMES;
 static const char *libcfs_debug_masks[] = LIBCFS_DEBUG_MASKS_NAMES;
 
-#ifdef __linux__
 
 #define DAEMON_CTL_NAME         "/proc/sys/lnet/daemon_file"
 #define SUBSYS_DEBUG_CTL_NAME   "/proc/sys/lnet/subsystem_debug"
 
 #define DAEMON_CTL_NAME         "/proc/sys/lnet/daemon_file"
 #define SUBSYS_DEBUG_CTL_NAME   "/proc/sys/lnet/subsystem_debug"
@@ -93,9 +92,6 @@ dbg_write_cmd(int fd, char *str, int len)
         return (rc == len ? 0 : 1);
 }
 
         return (rc == len ? 0 : 1);
 }
 
-#else
-#error - Unknown sysctl convention.
-#endif
 
 static int do_debug_mask(char *name, int enable)
 {
 
 static int do_debug_mask(char *name, int enable)
 {
index bb42482..9d8c52f 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_FLD
 
 
 #define DEBUG_SUBSYSTEM S_FLD
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/module.h>
-# include <linux/math64.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-# include <libcfs/list.h>
-#endif
-
+#include <libcfs/libcfs.h>
+#include <linux/module.h>
+#include <linux/math64.h>
 #include <obd_support.h>
 #include <lustre_fld.h>
 #include "fld_internal.h"
 #include <obd_support.h>
 #include <lustre_fld.h>
 #include "fld_internal.h"
index 48b00d0..0d04fc2 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_FLD
 
 
 #define DEBUG_SUBSYSTEM S_FLD
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/module.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
+#include <linux/module.h>
 #include <obd_support.h>
 #include <dt_object.h>
 #include <lustre_fid.h>
 #include <obd_support.h>
 #include <dt_object.h>
 #include <lustre_fid.h>
index 9267937..43b2f5b 100644 (file)
@@ -148,7 +148,6 @@ enum {
 
 extern struct lu_fld_hash fld_hash[];
 
 
 extern struct lu_fld_hash fld_hash[];
 
-#ifdef __KERNEL__
 
 #ifdef LPROCFS
 extern struct proc_dir_entry *fld_type_proc_dir;
 
 #ifdef LPROCFS
 extern struct proc_dir_entry *fld_type_proc_dir;
@@ -198,7 +197,6 @@ extern struct lprocfs_seq_vars fld_server_proc_list[];
 int fld_client_rpc(struct obd_export *exp,
                    struct lu_seq_range *range, __u32 fld_op,
                   struct ptlrpc_request **reqp);
 int fld_client_rpc(struct obd_export *exp,
                    struct lu_seq_range *range, __u32 fld_op,
                   struct ptlrpc_request **reqp);
-#endif /* __KERNEL__ */
 
 struct fld_cache *fld_cache_init(const char *name,
                                  int cache_size, int cache_threshold);
 
 struct fld_cache *fld_cache_init(const char *name,
                                  int cache_size, int cache_threshold);
index 832d1f8..33c5f97 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_FLD
 
 
 #define DEBUG_SUBSYSTEM S_FLD
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/module.h>
-# include <linux/math64.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-# include <libcfs/list.h>
-#endif
+#include <libcfs/libcfs.h>
+#include <linux/module.h>
+#include <linux/math64.h>
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
@@ -275,7 +270,7 @@ void fld_client_proc_fini(struct lu_client_fld *fld)
         }
         EXIT;
 }
         }
         EXIT;
 }
-#else
+#else /* LPROCFS */
 static int fld_client_proc_init(struct lu_client_fld *fld)
 {
         return 0;
 static int fld_client_proc_init(struct lu_client_fld *fld)
 {
         return 0;
@@ -285,7 +280,7 @@ void fld_client_proc_fini(struct lu_client_fld *fld)
 {
         return;
 }
 {
         return;
 }
-#endif
+#endif /* !LPROCFS */
 
 EXPORT_SYMBOL(fld_client_proc_fini);
 
 
 EXPORT_SYMBOL(fld_client_proc_fini);
 
@@ -494,12 +489,12 @@ int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds,
        res.lsr_start = seq;
        fld_range_set_type(&res, flags);
 
        res.lsr_start = seq;
        fld_range_set_type(&res, flags);
 
-#if defined(__KERNEL__) && defined(HAVE_SERVER_SUPPORT)
+#ifdef HAVE_SERVER_SUPPORT
        if (target->ft_srv != NULL) {
                LASSERT(env != NULL);
                rc = fld_server_lookup(env, target->ft_srv, seq, &res);
        } else
        if (target->ft_srv != NULL) {
                LASSERT(env != NULL);
                rc = fld_server_lookup(env, target->ft_srv, seq, &res);
        } else
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
        {
                rc = fld_client_rpc(target->ft_exp, &res, FLD_QUERY, NULL);
        }
        {
                rc = fld_client_rpc(target->ft_exp, &res, FLD_QUERY, NULL);
        }
@@ -519,7 +514,6 @@ void fld_client_flush(struct lu_client_fld *fld)
 }
 EXPORT_SYMBOL(fld_client_flush);
 
 }
 EXPORT_SYMBOL(fld_client_flush);
 
-#ifdef __KERNEL__
 
 struct proc_dir_entry *fld_type_proc_dir;
 
 
 struct proc_dir_entry *fld_type_proc_dir;
 
@@ -533,7 +527,7 @@ static int __init fld_mod_init(void)
 
 #ifdef HAVE_SERVER_SUPPORT
        fld_server_mod_init();
 
 #ifdef HAVE_SERVER_SUPPORT
        fld_server_mod_init();
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
 
        return 0;
 }
 
        return 0;
 }
@@ -542,7 +536,7 @@ static void __exit fld_mod_exit(void)
 {
 #ifdef HAVE_SERVER_SUPPORT
        fld_server_mod_exit();
 {
 #ifdef HAVE_SERVER_SUPPORT
        fld_server_mod_exit();
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
 
        if (fld_type_proc_dir != NULL && !IS_ERR(fld_type_proc_dir)) {
                lprocfs_remove(&fld_type_proc_dir);
 
        if (fld_type_proc_dir != NULL && !IS_ERR(fld_type_proc_dir)) {
                lprocfs_remove(&fld_type_proc_dir);
@@ -555,4 +549,3 @@ MODULE_DESCRIPTION("Lustre FLD");
 MODULE_LICENSE("GPL");
 
 cfs_module(mdd, LUSTRE_VERSION_STRING, fld_mod_init, fld_mod_exit);
 MODULE_LICENSE("GPL");
 
 cfs_module(mdd, LUSTRE_VERSION_STRING, fld_mod_init, fld_mod_exit);
-#endif /* __KERNEL__ */
index 873fa23..fd8ddf3 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_FLD
 
 
 #define DEBUG_SUBSYSTEM S_FLD
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/module.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
+#include <linux/module.h>
 #include <dt_object.h>
 #include <obd_support.h>
 #include <lustre_fld.h>
 #include <dt_object.h>
 #include <obd_support.h>
 #include <lustre_fld.h>
index 1c214a8..59791bf 100644 (file)
  */
 #include <libcfs/libcfs.h>
 #include <lu_object.h>
  */
 #include <libcfs/libcfs.h>
 #include <lu_object.h>
-
-#ifdef __KERNEL__
-# include <linux/mutex.h>
-# include <linux/radix-tree.h>
-#else
-# include <liblustre.h>
-#endif
+#include <linux/mutex.h>
+#include <linux/radix-tree.h>
 
 struct inode;
 
 
 struct inode;
 
index 5a43eba..bc334be 100644 (file)
 #error Do not #include this file directly. #include <lprocfs_status.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lprocfs_status.h> instead
 #endif
 
-#ifdef __KERNEL__
 #define LL_CDEBUG_PAGE(mask, page, fmt, arg...)                               \
         CDEBUG(mask, "page %p map %p index %lu flags %lx count %u priv %0lx: "\
                fmt, page, page->mapping, page->index, (long)page->flags,      \
                page_count(page), page_private(page), ## arg)
 #define LL_CDEBUG_PAGE(mask, page, fmt, arg...)                               \
         CDEBUG(mask, "page %p map %p index %lu flags %lx count %u priv %0lx: "\
                fmt, page, page->mapping, page->index, (long)page->flags,      \
                page_count(page), page_private(page), ## arg)
-#else
-#define LL_CDEBUG_PAGE(mask, page, fmt, arg...)                               \
-        CDEBUG(mask, "page %p index %lu priv %0lx: "\
-               fmt, page, page->index, page_private(page), ## arg)
-#endif
 
 #endif
 
 #endif
index ff4ddc4..4160dc9 100644 (file)
 #error Do not #include this file directly. #include <lprocfs_status.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lprocfs_status.h> instead
 #endif
 
-#ifdef __KERNEL__
-# include <linux/proc_fs.h>
-# include <asm/processor.h>
-# include <linux/bit_spinlock.h>
-#endif
+#include <linux/proc_fs.h>
+#include <asm/processor.h>
+#include <linux/bit_spinlock.h>
 
 #endif
 
 #endif
index 365010b..ecf1840 100644 (file)
@@ -39,7 +39,6 @@
 #error Do not #include this file directly. #include <lustre_handles.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lustre_handles.h> instead
 #endif
 
-#ifdef __KERNEL__
 #include <asm/types.h>
 #include <asm/atomic.h>
 #include <linux/list.h>
 #include <asm/types.h>
 #include <asm/atomic.h>
 #include <linux/list.h>
@@ -50,6 +49,5 @@
 #include <linux/rcupdate.h> /* for rcu_head{} */
 typedef struct rcu_head cfs_rcu_head_t;
 
 #include <linux/rcupdate.h> /* for rcu_head{} */
 typedef struct rcu_head cfs_rcu_head_t;
 
-#endif /* ifdef __KERNEL__ */
 
 #endif
 
 #endif
index 2110b3a..6a09018 100644 (file)
 #error Do not #include this file directly. #include <lustre_lib.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lustre_lib.h> instead
 #endif
 
-#ifndef __KERNEL__
-# include <string.h>
-# include <sys/types.h>
-#else
-# include <linux/rwsem.h>
-# include <linux/sched.h>
-# include <linux/signal.h>
-# include <linux/types.h>
-# include <linux/lustre_compat25.h>
-# include <linux/lustre_common.h>
-#endif
+#include <linux/rwsem.h>
+#include <linux/sched.h>
+#include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/lustre_compat25.h>
+#include <linux/lustre_common.h>
 
 #ifndef LP_POISON
 #if BITS_PER_LONG > 32
 
 #ifndef LP_POISON
 #if BITS_PER_LONG > 32
@@ -73,7 +68,6 @@
                            sigmask(SIGTERM) | sigmask(SIGQUIT) |               \
                            sigmask(SIGALRM))
 
                            sigmask(SIGTERM) | sigmask(SIGQUIT) |               \
                            sigmask(SIGALRM))
 
-#ifdef __KERNEL__
 /* initialize ost_lvb according to inode */
 static inline void inode_init_lvb(struct inode *inode, struct ost_lvb *lvb)
 {
 /* initialize ost_lvb according to inode */
 static inline void inode_init_lvb(struct inode *inode, struct ost_lvb *lvb)
 {
@@ -83,8 +77,5 @@ static inline void inode_init_lvb(struct inode *inode, struct ost_lvb *lvb)
         lvb->lvb_atime = LTIME_S(inode->i_atime);
         lvb->lvb_ctime = LTIME_S(inode->i_ctime);
 }
         lvb->lvb_atime = LTIME_S(inode->i_atime);
         lvb->lvb_ctime = LTIME_S(inode->i_ctime);
 }
-#else
-/* defined in liblustre/llite_lib.h */
-#endif
 
 #endif /* _LUSTRE_LIB_H */
 
 #endif /* _LUSTRE_LIB_H */
index 37bcd2f..6978c24 100644 (file)
 #error Do not #include this file directly. #include <lustre_lite.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lustre_lite.h> instead
 #endif
 
-#ifdef __KERNEL__
-
 #include <linux/version.h>
 #include <linux/version.h>
-
 #include <asm/statfs.h>
 #include <asm/statfs.h>
-
 #include <linux/fs.h>
 #include <linux/dcache.h>
 #include <linux/proc_fs.h>
 #include <linux/fs.h>
 #include <linux/dcache.h>
 #include <linux/proc_fs.h>
-
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre_ha.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre_ha.h>
-
 #include <linux/rbtree.h>
 #include <linux/lustre_compat25.h>
 #include <linux/lustre_common.h>
 #include <linux/rbtree.h>
 #include <linux/lustre_compat25.h>
 #include <linux/lustre_common.h>
@@ -98,8 +92,4 @@ enum {
          LPROC_LL_FILE_OPCODES
 };
 
          LPROC_LL_FILE_OPCODES
 };
 
-#else
-#include <lustre/lustre_idl.h>
-#endif /* __KERNEL__ */
-
 #endif
 #endif
index 7ec0a0d..6dbd3b5 100644 (file)
 #error Do not #include this file directly. #include <lustre_net.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lustre_net.h> instead
 #endif
 
-#ifdef __KERNEL__
 #include <linux/version.h>
 #include <linux/workqueue.h>
 #include <linux/version.h>
 #include <linux/workqueue.h>
-#endif
-
-/* XXX Liang: should be moved to other header instead of here */
-#ifndef WITH_GROUP_INFO
-#define WITH_GROUP_INFO
-#endif
 
 #endif
 
 #endif
index 9e6357a..421866b 100644 (file)
 #error Do not #include this file directly. #include <lustre_quota.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lustre_quota.h> instead
 #endif
 
-#ifdef __KERNEL__
 #include <linux/version.h>
 #include <linux/fs.h>
 #include <linux/quota.h>
 #include <linux/quotaops.h>
 #include <linux/version.h>
 #include <linux/fs.h>
 #include <linux/quota.h>
 #include <linux/quotaops.h>
-#endif
 
 #endif /* _LUSTRE_QUOTA_H */
 
 #endif /* _LUSTRE_QUOTA_H */
index f13bf58..d240ac4 100644 (file)
 #error Do not #include this file directly. #include <lvfs.h> instead
 #endif
 
 #error Do not #include this file directly. #include <lvfs.h> instead
 #endif
 
-#if defined __KERNEL__
 #include <linux/lustre_compat25.h>
 #include <linux/lustre_common.h>
 #include <linux/fs.h>
 #include <linux/lustre_compat25.h>
 #include <linux/lustre_common.h>
 #include <linux/fs.h>
-#else
-#include <liblustre.h>
-#endif
 
 #define OBD_RUN_CTXT_MAGIC     0xC0FFEEAA
 #define OBD_CTXT_DEBUG         /* development-only debugging */
 
 #define OBD_RUN_CTXT_MAGIC     0xC0FFEEAA
 #define OBD_CTXT_DEBUG         /* development-only debugging */
@@ -75,7 +71,6 @@ struct lvfs_run_ctxt {
 #define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0)
 #endif
 
 #define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0)
 #endif
 
-#ifdef __KERNEL__
 
 /* We need to hold the inode semaphore over the dcache lookup itself, or we
  * run the risk of entering the filesystem lookup path concurrently on SMP
 
 /* We need to hold the inode semaphore over the dcache lookup itself, or we
  * run the risk of entering the filesystem lookup path concurrently on SMP
@@ -104,6 +99,5 @@ static inline struct dentry *ll_lookup_one_len(const char *fid_name,
        return dchild;
 }
 
        return dchild;
 }
 
-#endif
 
 #endif
 
 #endif
index cfd0bf5..2b78cec 100644 (file)
 
 #include <obd_support.h>
 
 
 #include <obd_support.h>
 
-#ifdef __KERNEL__
-# include <linux/fs.h>
-# include <linux/list.h>
-# include <linux/sched.h>  /* for struct task_struct, for current.h */
-# include <linux/proc_fs.h>
-# include <linux/mount.h>
-# include <linux/lustre_intent.h>
-#endif
+#include <linux/fs.h>
+#include <linux/list.h>
+#include <linux/sched.h>  /* for struct task_struct, for current.h */
+#include <linux/proc_fs.h>
+#include <linux/mount.h>
+#include <linux/lustre_intent.h>
 
 struct ll_iattr {
        struct iattr    iattr;
        unsigned int    ia_attr_flags;
 };
 
 
 struct ll_iattr {
        struct iattr    iattr;
        unsigned int    ia_attr_flags;
 };
 
-#ifdef __KERNEL__
 #define CLIENT_OBD_LIST_LOCK_DEBUG 1
 #define CLIENT_OBD_LIST_LOCK_DEBUG 1
-#endif
 
 typedef struct {
        spinlock_t              lock;
 
 typedef struct {
        spinlock_t              lock;
@@ -123,7 +119,7 @@ static inline void client_obd_list_unlock(client_obd_lock_t *lock)
        spin_unlock(&lock->lock);
 }
 
        spin_unlock(&lock->lock);
 }
 
-#else /* ifdef CLIENT_OBD_LIST_LOCK_DEBUG */
+#else /* CLIENT_OBD_LIST_LOCK_DEBUG */
 static inline void client_obd_list_lock(client_obd_lock_t *lock)
 {
        spin_lock(&lock->lock);
 static inline void client_obd_list_lock(client_obd_lock_t *lock)
 {
        spin_lock(&lock->lock);
@@ -134,7 +130,7 @@ static inline void client_obd_list_unlock(client_obd_lock_t *lock)
        spin_unlock(&lock->lock);
 }
 
        spin_unlock(&lock->lock);
 }
 
-#endif /* ifdef CLIENT_OBD_LIST_LOCK_DEBUG */
+#endif /* !CLIENT_OBD_LIST_LOCK_DEBUG */
 
 static inline void client_obd_list_lock_init(client_obd_lock_t *lock)
 {
 
 static inline void client_obd_list_lock_init(client_obd_lock_t *lock)
 {
@@ -144,8 +140,8 @@ static inline void client_obd_list_lock_init(client_obd_lock_t *lock)
 static inline void client_obd_list_lock_done(client_obd_lock_t *lock)
 {}
 
 static inline void client_obd_list_lock_done(client_obd_lock_t *lock)
 {}
 
-#if defined(__KERNEL__) && !defined(HAVE_ADLER)
+#ifndef HAVE_ADLER
 /* zlib_adler() is an inline function defined in zutil.h */
 /* zlib_adler() is an inline function defined in zutil.h */
-#define HAVE_ADLER
-#endif
+# define HAVE_ADLER
+#endif /* !HAVE_ADLER */
 #endif /* __LINUX_OBD_H */
 #endif /* __LINUX_OBD_H */
index 60dfe3f..2c7588c 100644 (file)
 #error Do not #include this file directly. #include <obd_class.h> instead
 #endif
 
 #error Do not #include this file directly. #include <obd_class.h> instead
 #endif
 
-#ifndef __KERNEL__
-#include <sys/types.h>
-#include <libcfs/list.h>
-#else
 #include <asm/uaccess.h>
 #include <linux/types.h>
 #include <linux/fs.h>
 #include <linux/time.h>
 #include <linux/timer.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
 #include <linux/fs.h>
 #include <linux/time.h>
 #include <linux/timer.h>
-#endif
 
 /* obdo.c */
 
 /* obdo.c */
-#ifdef __KERNEL__
 void obdo_from_la(struct obdo *dst, const struct lu_attr *la, __u64 valid);
 void la_from_obdo(struct lu_attr *la, const struct obdo *dst, obd_flag valid);
 void obdo_refresh_inode(struct inode *dst, const struct obdo *src,
                        obd_flag valid);
 #define ll_inode_flags(inode)         (inode->i_flags)
 void obdo_from_la(struct obdo *dst, const struct lu_attr *la, __u64 valid);
 void la_from_obdo(struct lu_attr *la, const struct obdo *dst, obd_flag valid);
 void obdo_refresh_inode(struct inode *dst, const struct obdo *src,
                        obd_flag valid);
 #define ll_inode_flags(inode)         (inode->i_flags)
-#endif
-
 
 #endif /* __LINUX_OBD_CLASS_H */
 
 #endif /* __LINUX_OBD_CLASS_H */
index a72ae4b..de920dc 100644 (file)
 #ifndef _LPROCFS_SNMP_H
 #define _LPROCFS_SNMP_H
 
 #ifndef _LPROCFS_SNMP_H
 #define _LPROCFS_SNMP_H
 
-#if defined(__linux__)
 #include <linux/lprocfs_status.h>
 #include <linux/lprocfs_status.h>
-#else
-#error Unsupported operating system.
-#endif
 #include <lustre/lustre_idl.h>
 #include <libcfs/params_tree.h>
 
 #include <lustre/lustre_idl.h>
 #include <libcfs/params_tree.h>
 
@@ -178,9 +174,6 @@ struct lprocfs_counter {
 #define lc_sum_irq     lc_array_sum[1]
 
 struct lprocfs_percpu {
 #define lc_sum_irq     lc_array_sum[1]
 
 struct lprocfs_percpu {
-#ifndef __GNUC__
-       __s64                   pad;
-#endif
         struct lprocfs_counter lp_cntr[0];
 };
 
         struct lprocfs_counter lp_cntr[0];
 };
 
index 1b41dc3..e016d59 100644 (file)
 # include <stdio.h> /* snprintf() */
 #endif
 #include <lustre/ll_fiemap.h>
 # include <stdio.h> /* snprintf() */
 #endif
 #include <lustre/ll_fiemap.h>
-#if defined(__linux__)
 #include <linux/lustre_user.h>
 #include <linux/lustre_user.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #define LUSTRE_EOF 0xffffffffffffffffULL
 
 
 #define LUSTRE_EOF 0xffffffffffffffffULL
 
index fcca1fc..5cfb87b 100644 (file)
@@ -37,8 +37,6 @@
 #ifndef _LUSTRE_ACL_H
 #define _LUSTRE_ACL_H
 
 #ifndef _LUSTRE_ACL_H
 #define _LUSTRE_ACL_H
 
-#if defined(__linux__)
 #include <linux/lustre_acl.h>
 #include <linux/lustre_acl.h>
-#endif
 
 #endif
 
 #endif
index ac713d0..0b2118b 100644 (file)
@@ -49,9 +49,7 @@
 /*
  * capability
  */
 /*
  * capability
  */
-#ifdef __KERNEL__
 #include <linux/crypto.h>
 #include <linux/crypto.h>
-#endif
 #include <lustre/lustre_idl.h>
 
 #define CAPA_TIMEOUT 1800                /* sec, == 30 min */
 #include <lustre/lustre_idl.h>
 
 #define CAPA_TIMEOUT 1800                /* sec, == 30 min */
@@ -195,7 +193,6 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen);
 void capa_cpy(void *dst, struct obd_capa *ocapa);
 static inline struct obd_capa *alloc_capa(int site)
 {
 void capa_cpy(void *dst, struct obd_capa *ocapa);
 static inline struct obd_capa *alloc_capa(int site)
 {
-#ifdef __KERNEL__
         struct obd_capa *ocapa;
 
         if (unlikely(site != CAPA_SITE_CLIENT && site != CAPA_SITE_SERVER))
         struct obd_capa *ocapa;
 
         if (unlikely(site != CAPA_SITE_CLIENT && site != CAPA_SITE_SERVER))
@@ -215,9 +212,6 @@ static inline struct obd_capa *alloc_capa(int site)
                INIT_HLIST_NODE(&ocapa->u.tgt.c_hash);
 
        return ocapa;
                INIT_HLIST_NODE(&ocapa->u.tgt.c_hash);
 
        return ocapa;
-#else
-       return ERR_PTR(-EOPNOTSUPP);
-#endif
 }
 
 static inline struct obd_capa *capa_get(struct obd_capa *ocapa)
 }
 
 static inline struct obd_capa *capa_get(struct obd_capa *ocapa)
index a1a879c..0bfb7c6 100644 (file)
 #include <lustre_net.h>
 #include <obd.h>
 
 #include <lustre_net.h>
 #include <obd.h>
 
-#if defined(__linux__)
 #include <linux/lustre_debug.h>
 #include <linux/lustre_debug.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #define ASSERT_MAX_SIZE_MB 60000ULL
 #define ASSERT_PAGE_INDEX(index, OP)                                    \
 
 #define ASSERT_MAX_SIZE_MB 60000ULL
 #define ASSERT_PAGE_INDEX(index, OP)                                    \
index 74a62b8..2c7b079 100644 (file)
 #ifndef _LUSTRE_DLM_H__
 #define _LUSTRE_DLM_H__
 
 #ifndef _LUSTRE_DLM_H__
 #define _LUSTRE_DLM_H__
 
-#if defined(__linux__)
 #include <linux/lustre_dlm.h>
 #include <linux/lustre_dlm.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #include <lustre_lib.h>
 #include <lustre_net.h>
 
 #include <lustre_lib.h>
 #include <lustre_net.h>
index 5b6f30f..a3c16f6 100644 (file)
  * @{
  */
 
  * @{
  */
 
-#if defined(__linux__)
 #include <linux/lustre_handles.h>
 #include <linux/lustre_handles.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #include <libcfs/libcfs.h>
 
 
 #include <libcfs/libcfs.h>
 
-#ifndef __KERNEL__
-typedef struct {
-       int foo;
-} cfs_rcu_head_t;
-#endif
 
 struct portals_handle_ops {
        void (*hop_addref)(void *object);
 
 struct portals_handle_ops {
        void (*hop_addref)(void *object);
index f829172..d9c2816 100644 (file)
 #include <lustre/lustre_idl.h>
 #include <lustre_ver.h>
 #include <lustre_cfg.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_ver.h>
 #include <lustre_cfg.h>
-#if defined(__linux__)
 #include <linux/lustre_lib.h>
 #include <linux/lustre_lib.h>
-#else
-#error Unsupported operating system.
-#endif
 
 /* target.c */
 struct ptlrpc_request;
 
 /* target.c */
 struct ptlrpc_request;
@@ -245,7 +241,6 @@ struct l_wait_info {
 
 #define LWI_INTR(cb, data)  LWI_TIMEOUT_INTR(0, NULL, cb, data)
 
 
 #define LWI_INTR(cb, data)  LWI_TIMEOUT_INTR(0, NULL, cb, data)
 
-#ifdef __KERNEL__
 
 /*
  * wait for @condition to become true, but no longer than timeout, specified
 
 /*
  * wait for @condition to become true, but no longer than timeout, specified
@@ -334,53 +329,6 @@ do {                                                                           \
        remove_wait_queue(&wq, &__wait);                                       \
 } while (0)
 
        remove_wait_queue(&wq, &__wait);                                       \
 } while (0)
 
-#else /* !__KERNEL__ */
-
-#define __l_wait_event(wq, condition, info, ret, l_add_wait)            \
-do {                                                                    \
-        long __timeout = info->lwi_timeout;                             \
-        long __now;                                                     \
-        long __then = 0;                                                \
-        int  __timed_out = 0;                                           \
-        int  __interval = obd_timeout;                                  \
-                                                                        \
-        ret = 0;                                                        \
-        if (condition)                                                  \
-                break;                                                  \
-                                                                        \
-        if (__timeout != 0)                                             \
-                __then = time(NULL);                                    \
-                                                                        \
-        if (__timeout && __timeout < __interval)                        \
-                __interval = __timeout;                                 \
-        if (info->lwi_interval && info->lwi_interval < __interval)      \
-                __interval = info->lwi_interval;                        \
-                                                                        \
-        while (!(condition)) {                                          \
-                liblustre_wait_event(__interval);                       \
-                if (condition)                                          \
-                        break;                                          \
-                                                                        \
-                if (!__timed_out && info->lwi_timeout != 0) {           \
-                        __now = time(NULL);                             \
-                        __timeout -= __now - __then;                    \
-                        __then = __now;                                 \
-                                                                        \
-                        if (__timeout > 0)                              \
-                                continue;                               \
-                                                                        \
-                        __timeout = 0;                                  \
-                        __timed_out = 1;                                \
-                        if (info->lwi_on_timeout == NULL ||             \
-                            info->lwi_on_timeout(info->lwi_cb_data)) {  \
-                                ret = -ETIMEDOUT;                       \
-                                break;                                  \
-                        }                                               \
-                }                                                       \
-        }                                                               \
-} while (0)
-
-#endif /* __KERNEL__ */
 
 
 #define l_wait_event(wq, condition, info)                       \
 
 
 #define l_wait_event(wq, condition, info)                       \
@@ -431,12 +379,6 @@ do {                                                                    \
         l_wait_event_exclusive_head(wq, condition, &lwi);       \
 })
 
         l_wait_event_exclusive_head(wq, condition, &lwi);       \
 })
 
-#ifdef __KERNEL__
-#define LIBLUSTRE_CLIENT (0)
-#else
-#define LIBLUSTRE_CLIENT (1)
-#endif
-
 /** @} lib */
 
 #endif /* _LUSTRE_LIB_H */
 /** @} lib */
 
 #endif /* _LUSTRE_LIB_H */
index 666855a..f6c0d30 100644 (file)
  * @{
  */
 
  * @{
  */
 
-#if defined(__linux__)
 #include <linux/lustre_lite.h>
 #include <linux/lustre_lite.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #include <obd_class.h>
 #include <lustre_net.h>
 
 #include <obd_class.h>
 #include <lustre_net.h>
@@ -87,13 +83,6 @@ static inline void lustre_build_lock_params(int cmd, unsigned long open_flags,
         if (cmd == OBD_BRW_WRITE && (open_flags & O_APPEND)) {
                 params->lrp_policy.l_extent.start = 0;
                 params->lrp_policy.l_extent.end   = OBD_OBJECT_EOF;
         if (cmd == OBD_BRW_WRITE && (open_flags & O_APPEND)) {
                 params->lrp_policy.l_extent.start = 0;
                 params->lrp_policy.l_extent.end   = OBD_OBJECT_EOF;
-        } else if (LIBLUSTRE_CLIENT && (connect_flags & OBD_CONNECT_SRVLOCK)) {
-                /*
-                 * liblustre: OST-side locking for all non-O_APPEND
-                 * reads/writes.
-                 */
-                params->lrp_lock_mode = LCK_NL;
-                params->lrp_brw_flags = OBD_BRW_SRVLOCK;
         } else {
                 /*
                  * nothing special for the kernel. In the future llite may use
         } else {
                 /*
                  * nothing special for the kernel. In the future llite may use
index 3ea5be1..eb986f9 100644 (file)
  * @{
  */
 
  * @{
  */
 
-#if defined(__linux__)
 #include <linux/lustre_log.h>
 #include <linux/lustre_log.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #include <obd_class.h>
 #include <lustre/lustre_idl.h>
 
 #include <obd_class.h>
 #include <lustre/lustre_idl.h>
index 9067b6a..85f3f31 100644 (file)
  * @{
  */
 
  * @{
  */
 
-#ifdef __KERNEL__
-# include <linux/fs.h>
-# include <linux/dcache.h>
-# ifdef CONFIG_FS_POSIX_ACL
-#  include <linux/posix_acl_xattr.h>
-# endif /* CONFIG_FS_POSIX_ACL */
-# include <linux/lustre_intent.h>
-#endif /* __KERNEL__ */
+#include <linux/fs.h>
+#include <linux/dcache.h>
+#ifdef CONFIG_FS_POSIX_ACL
+# include <linux/posix_acl_xattr.h>
+#endif /* CONFIG_FS_POSIX_ACL */
+#include <linux/lustre_intent.h>
 #include <lustre_handles.h>
 #include <libcfs/libcfs.h>
 #include <obd_class.h>
 #include <lustre_handles.h>
 #include <libcfs/libcfs.h>
 #include <obd_class.h>
index 80541df..556284b 100644 (file)
  * @{
  */
 
  * @{
  */
 
-#if defined(__linux__)
 #include <linux/lustre_net.h>
 #include <linux/lustre_net.h>
-#else
-#error Unsupported operating system.
-#endif
-
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs.h>
-// #include <obd.h>
 #include <lnet/lnet.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_ha.h>
 #include <lnet/lnet.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_ha.h>
@@ -71,7 +65,6 @@
 #include <lprocfs_status.h>
 #include <lu_object.h>
 #include <lustre_req_layout.h>
 #include <lprocfs_status.h>
 #include <lu_object.h>
 #include <lustre_req_layout.h>
-
 #include <obd_support.h>
 #include <lustre_ver.h>
 
 #include <obd_support.h>
 #include <lustre_ver.h>
 
 #define OFD_MAX_BRW_SIZE       (1 << LNET_MTU_BITS)
 
 /* When PAGE_SIZE is a constant, we can check our arithmetic here with cpp! */
 #define OFD_MAX_BRW_SIZE       (1 << LNET_MTU_BITS)
 
 /* When PAGE_SIZE is a constant, we can check our arithmetic here with cpp! */
-#ifdef __KERNEL__
-# if ((PTLRPC_MAX_BRW_PAGES & (PTLRPC_MAX_BRW_PAGES - 1)) != 0)
-#  error "PTLRPC_MAX_BRW_PAGES isn't a power of two"
-# endif
-# if (PTLRPC_MAX_BRW_SIZE != (PTLRPC_MAX_BRW_PAGES * PAGE_CACHE_SIZE))
-#  error "PTLRPC_MAX_BRW_SIZE isn't PTLRPC_MAX_BRW_PAGES * PAGE_CACHE_SIZE"
-# endif
-# if (PTLRPC_MAX_BRW_SIZE > LNET_MTU * PTLRPC_BULK_OPS_COUNT)
-#  error "PTLRPC_MAX_BRW_SIZE too big"
-# endif
-# if (PTLRPC_MAX_BRW_PAGES > LNET_MAX_IOV * PTLRPC_BULK_OPS_COUNT)
-#  error "PTLRPC_MAX_BRW_PAGES too big"
-# endif
-#endif /* __KERNEL__ */
+#if ((PTLRPC_MAX_BRW_PAGES & (PTLRPC_MAX_BRW_PAGES - 1)) != 0)
+# error "PTLRPC_MAX_BRW_PAGES isn't a power of two"
+#endif
+#if (PTLRPC_MAX_BRW_SIZE != (PTLRPC_MAX_BRW_PAGES * PAGE_CACHE_SIZE))
+# error "PTLRPC_MAX_BRW_SIZE isn't PTLRPC_MAX_BRW_PAGES * PAGE_CACHE_SIZE"
+#endif
+#if (PTLRPC_MAX_BRW_SIZE > LNET_MTU * PTLRPC_BULK_OPS_COUNT)
+# error "PTLRPC_MAX_BRW_SIZE too big"
+#endif
+#if (PTLRPC_MAX_BRW_PAGES > LNET_MAX_IOV * PTLRPC_BULK_OPS_COUNT)
+# error "PTLRPC_MAX_BRW_PAGES too big"
+#endif
 
 #define PTLRPC_NTHRS_INIT      2
 
 
 #define PTLRPC_NTHRS_INIT      2
 
@@ -2303,16 +2294,12 @@ struct ptlrpc_bulk_desc {
        /** array of associated MDs */
        lnet_handle_md_t        bd_mds[PTLRPC_BULK_OPS_COUNT];
 
        /** array of associated MDs */
        lnet_handle_md_t        bd_mds[PTLRPC_BULK_OPS_COUNT];
 
-#if defined(__KERNEL__)
        /*
         * encrypt iov, size is either 0 or bd_iov_count.
         */
        lnet_kiov_t           *bd_enc_iov;
 
        lnet_kiov_t            bd_iov[0];
        /*
         * encrypt iov, size is either 0 or bd_iov_count.
         */
        lnet_kiov_t           *bd_enc_iov;
 
        lnet_kiov_t            bd_iov[0];
-#else
-       lnet_md_iovec_t        bd_iov[0];
-#endif
 };
 
 enum {
 };
 
 enum {
@@ -2671,10 +2658,6 @@ struct ptlrpc_service_part {
        spinlock_t                      scp_rep_lock __cfs_cacheline_aligned;
        /** all the active replies */
        struct list_head                scp_rep_active;
        spinlock_t                      scp_rep_lock __cfs_cacheline_aligned;
        /** all the active replies */
        struct list_head                scp_rep_active;
-#ifndef __KERNEL__
-       /** replies waiting for service */
-       struct list_head                scp_rep_queue;
-#endif
        /** List of free reply_states */
        struct list_head                scp_rep_idle;
        /** waitq to run, when adding stuff to srv_free_rs_list */
        /** List of free reply_states */
        struct list_head                scp_rep_idle;
        /** waitq to run, when adding stuff to srv_free_rs_list */
@@ -2737,25 +2720,6 @@ struct ptlrpcd_ctl {
          * Record the partner index to be processed next.
          */
         int                         pc_cursor;
          * Record the partner index to be processed next.
          */
         int                         pc_cursor;
-#ifndef __KERNEL__
-        /**
-         * Async rpcs flag to make sure that ptlrpcd_check() is called only
-         * once.
-         */
-        int                         pc_recurred;
-        /**
-         * Currently not used.
-         */
-        void                       *pc_callback;
-        /**
-         * User-space async rpcs callback.
-         */
-        void                       *pc_wait_callback;
-        /**
-         * User-space check idle rpcs callback.
-         */
-        void                       *pc_idle_callback;
-#endif
 };
 
 /* Bits for pc_flags */
 };
 
 /* Bits for pc_flags */
@@ -3114,13 +3078,8 @@ void ptlrpc_request_change_export(struct ptlrpc_request *req,
                                  struct obd_export *export);
 void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay);
 
                                  struct obd_export *export);
 void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay);
 
-#ifdef __KERNEL__
 int ptlrpc_hr_init(void);
 void ptlrpc_hr_fini(void);
 int ptlrpc_hr_init(void);
 void ptlrpc_hr_fini(void);
-#else
-# define ptlrpc_hr_init() (0)
-# define ptlrpc_hr_fini() do {} while(0)
-#endif
 
 /** @} */
 
 
 /** @} */
 
@@ -3481,13 +3440,8 @@ int ptlrpc_del_timeout_client(struct list_head *obd_list,
                               enum timeout_event event);
 struct ptlrpc_request * ptlrpc_prep_ping(struct obd_import *imp);
 int ptlrpc_obd_ping(struct obd_device *obd);
                               enum timeout_event event);
 struct ptlrpc_request * ptlrpc_prep_ping(struct obd_import *imp);
 int ptlrpc_obd_ping(struct obd_device *obd);
-#ifdef __KERNEL__
 void ping_evictor_start(void);
 void ping_evictor_stop(void);
 void ping_evictor_start(void);
 void ping_evictor_stop(void);
-#else
-#define ping_evictor_start()    do {} while (0)
-#define ping_evictor_stop()     do {} while (0)
-#endif
 void ptlrpc_pinger_ir_up(void);
 void ptlrpc_pinger_ir_down(void);
 /** @} */
 void ptlrpc_pinger_ir_up(void);
 void ptlrpc_pinger_ir_down(void);
 /** @} */
index 02ebfd4..df80599 100644 (file)
@@ -185,9 +185,7 @@ struct nrs_tbf_head {
        /**
         * Timer for next token.
         */
        /**
         * Timer for next token.
         */
-#if defined(__KERNEL__) && defined(__linux__)
        struct hrtimer                   th_timer;
        struct hrtimer                   th_timer;
-#endif
        /**
         * Deadline of the timer.
         */
        /**
         * Deadline of the timer.
         */
index 7c6121c..aa87843 100644 (file)
@@ -32,9 +32,7 @@
  *
  */
 
  *
  */
 
-#if defined(__linux__)
 #include <linux/lustre_quota.h>
 #include <linux/lustre_quota.h>
-#endif
 
 #include <dt_object.h>
 #include <lustre_fid.h>
 
 #include <dt_object.h>
 #include <lustre_fid.h>
index a1ae6de..e03840c 100644 (file)
 
 #include <libcfs/libcfs.h>
 
 
 #include <libcfs/libcfs.h>
 
-#if defined(__linux__)
 #include <linux/lvfs.h>
 #include <linux/lvfs.h>
-#else
-#error Unsupported operating system.
-#endif
 
 /* ptlrpc_sec_ctx.c */
 void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx);
 
 /* ptlrpc_sec_ctx.c */
 void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx);
index 1e39945..4303c3c 100644 (file)
 
 #ifndef __OBD_H
 #define __OBD_H
 
 #ifndef __OBD_H
 #define __OBD_H
-#ifndef __KERNEL__
-# error "userspace should not include <obd.h>"
-#endif
 
 
-#if defined(__linux__)
 #include <linux/obd.h>
 #include <linux/obd.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #include <lustre/lustre_idl.h>
 #include <lustre_lib.h>
 
 #include <lustre/lustre_idl.h>
 #include <lustre_lib.h>
index 626a514..c8249fb 100644 (file)
@@ -35,7 +35,5 @@
 #ifndef _OBD_CACHE_H__
 #define _OBD_CACHE_H__
 
 #ifndef _OBD_CACHE_H__
 #define _OBD_CACHE_H__
 
-#ifdef __KERNEL__
 
 #endif
 
 #endif
-#endif
index 12784c9..0154671 100644 (file)
@@ -36,9 +36,6 @@
 #ifndef __CLASS_OBD_H
 #define __CLASS_OBD_H
 
 #ifndef __CLASS_OBD_H
 #define __CLASS_OBD_H
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <lustre_import.h>
 
 #include <obd_support.h>
 #include <lustre_import.h>
 #include <lustre/lustre_idl.h>
 #include <lprocfs_status.h>
 
 #include <lustre/lustre_idl.h>
 #include <lprocfs_status.h>
 
-#if defined(__linux__)
 #include <linux/obd_class.h>
 #include <linux/obd_class.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #define OBD_STATFS_NODELAY      0x0001  /* requests should be send without delay
                                          * and resends for avoid deadlocks */
 
 #define OBD_STATFS_NODELAY      0x0001  /* requests should be send without delay
                                          * and resends for avoid deadlocks */
@@ -1943,10 +1936,6 @@ struct root_squash_info {
        struct rw_semaphore     rsi_sem;
 };
 
        struct rw_semaphore     rsi_sem;
 };
 
-#ifdef __KERNEL__
 int server_name2index(const char *svname, __u32 *idx, const char **endptr);
 int server_name2index(const char *svname, __u32 *idx, const char **endptr);
-#else
-# define server_name2index(name, idx, ptr)     do {} while (0)
-#endif
 
 #endif /* __LINUX_OBD_CLASS_H */
 
 #endif /* __LINUX_OBD_CLASS_H */
index 6213ddf..cf9a8f5 100644 (file)
 #include <libcfs/libcfs.h>
 #include <lprocfs_status.h>
 
 #include <libcfs/libcfs.h>
 #include <lprocfs_status.h>
 
-#if defined(__linux__)
 #include <linux/obd_support.h>
 #include <linux/obd_support.h>
-#else
-#error Unsupported operating system.
-#endif
 
 /* global variables */
 extern struct lprocfs_stats *obd_memory;
 
 /* global variables */
 extern struct lprocfs_stats *obd_memory;
index 904ad30..6f3f859 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
-#ifdef __KERNEL__
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <lustre_dlm.h>
 #include <lustre_lib.h>
 
 #include <lustre_dlm.h>
 #include <lustre_lib.h>
index f2aabd6..25a3319 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
-#ifndef __KERNEL__
-# include <liblustre.h>
-#else
-# include <libcfs/libcfs.h>
-#endif
 
 
+#include <libcfs/libcfs.h>
 #include <lustre_dlm.h>
 #include <obd_support.h>
 #include <obd.h>
 #include <lustre_dlm.h>
 #include <obd_support.h>
 #include <obd.h>
index 268617d..238d4be 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
-#ifdef __KERNEL__
 #include <lustre_dlm.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_lib.h>
 #include <libcfs/list.h>
 #include <lustre_dlm.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_lib.h>
 #include <libcfs/list.h>
-#else
-#include <liblustre.h>
-#include <obd_class.h>
-#endif
 
 #include "ldlm_internal.h"
 
 
 #include "ldlm_internal.h"
 
index b7dc3a9..a0a20bb 100644 (file)
@@ -52,9 +52,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <lustre_dlm.h>
 #include <obd_support.h>
 
 #include <lustre_dlm.h>
 #include <obd_support.h>
index 1c370e6..da8762c 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else
-# include <liblustre.h>
-#endif
+#include <libcfs/libcfs.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <lustre_dlm.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <lustre_dlm.h>
@@ -758,17 +754,9 @@ void target_client_add_cb(struct obd_device *obd, __u64 transno, void *cb_data,
 }
 EXPORT_SYMBOL(target_client_add_cb);
 
 }
 EXPORT_SYMBOL(target_client_add_cb);
 
-#ifdef __KERNEL__
 static void
 check_and_start_recovery_timer(struct obd_device *obd,
                                struct ptlrpc_request *req, int new_client);
 static void
 check_and_start_recovery_timer(struct obd_device *obd,
                                struct ptlrpc_request *req, int new_client);
-#else
-static inline void
-check_and_start_recovery_timer(struct obd_device *obd,
-                               struct ptlrpc_request *req, int new_client)
-{
-}
-#endif
 
 int target_handle_connect(struct ptlrpc_request *req)
 {
 
 int target_handle_connect(struct ptlrpc_request *req)
 {
@@ -1382,7 +1370,6 @@ static void target_exp_dequeue_req_replay(struct ptlrpc_request *req)
        spin_unlock(&req->rq_export->exp_lock);
 }
 
        spin_unlock(&req->rq_export->exp_lock);
 }
 
-#ifdef __KERNEL__
 static void target_finish_recovery(struct obd_device *obd)
 {
         ENTRY;
 static void target_finish_recovery(struct obd_device *obd)
 {
         ENTRY;
@@ -2171,7 +2158,6 @@ void target_recovery_init(struct lu_target *lut, svc_handler_t handler)
 }
 EXPORT_SYMBOL(target_recovery_init);
 
 }
 EXPORT_SYMBOL(target_recovery_init);
 
-#endif /* __KERNEL__ */
 
 static int target_process_req_flags(struct obd_device *obd,
                                     struct ptlrpc_request *req)
 
 static int target_process_req_flags(struct obd_device *obd,
                                     struct ptlrpc_request *req)
index 588a8a9..599666d 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-# include <linux/lustre_intent.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
+#include <linux/lustre_intent.h>
 #include <obd_class.h>
 #include "ldlm_internal.h"
 
 #include <obd_class.h>
 #include "ldlm_internal.h"
 
@@ -162,9 +157,7 @@ extern struct kmem_cache *ldlm_lock_slab;
 static ldlm_processing_policy ldlm_processing_policy_table[] = {
        [LDLM_PLAIN]    = ldlm_process_plain_lock,
        [LDLM_EXTENT]   = ldlm_process_extent_lock,
 static ldlm_processing_policy ldlm_processing_policy_table[] = {
        [LDLM_PLAIN]    = ldlm_process_plain_lock,
        [LDLM_EXTENT]   = ldlm_process_extent_lock,
-# ifdef __KERNEL__
        [LDLM_FLOCK]    = ldlm_process_flock_lock,
        [LDLM_FLOCK]    = ldlm_process_flock_lock,
-# endif
        [LDLM_IBITS]    = ldlm_process_inodebits_lock,
 };
 
        [LDLM_IBITS]    = ldlm_process_inodebits_lock,
 };
 
index 9562229..ad2f233 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
 #include <lustre_dlm.h>
 #include <obd_class.h>
 #include <libcfs/list.h>
 #include <lustre_dlm.h>
 #include <obd_class.h>
 #include <libcfs/list.h>
@@ -128,7 +123,7 @@ struct ldlm_bl_work_item {
         int                     blwi_mem_pressure;
 };
 
         int                     blwi_mem_pressure;
 };
 
-#if defined(HAVE_SERVER_SUPPORT) && defined(__KERNEL__)
+#ifdef HAVE_SERVER_SUPPORT
 
 /**
  * Protects both waiting_locks_list and expired_lock_thread.
 
 /**
  * Protects both waiting_locks_list and expired_lock_thread.
@@ -557,7 +552,7 @@ int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout)
 }
 EXPORT_SYMBOL(ldlm_refresh_waiting_lock);
 
 }
 EXPORT_SYMBOL(ldlm_refresh_waiting_lock);
 
-#else /* !HAVE_SERVER_SUPPORT ||  !__KERNEL__ */
+#else /* HAVE_SERVER_SUPPORT */
 
 int ldlm_del_waiting_lock(struct ldlm_lock *lock)
 {
 
 int ldlm_del_waiting_lock(struct ldlm_lock *lock)
 {
@@ -569,15 +564,7 @@ int ldlm_refresh_waiting_lock(struct ldlm_lock *lock, int timeout)
         RETURN(0);
 }
 
         RETURN(0);
 }
 
-# ifdef HAVE_SERVER_SUPPORT
-static int ldlm_add_waiting_lock(struct ldlm_lock *lock)
-{
-       LASSERT(ldlm_is_res_locked(lock) && !ldlm_is_cancel_on_block(lock));
-       RETURN(1);
-}
-
-# endif
-#endif /* HAVE_SERVER_SUPPORT && __KERNEL__ */
+#endif /* !HAVE_SERVER_SUPPORT */
 
 #ifdef HAVE_SERVER_SUPPORT
 
 
 #ifdef HAVE_SERVER_SUPPORT
 
@@ -594,7 +581,6 @@ static void ldlm_failed_ast(struct ldlm_lock *lock, int rc,
 
         if (obd_dump_on_timeout)
                 libcfs_debug_dumplog();
 
         if (obd_dump_on_timeout)
                 libcfs_debug_dumplog();
-#ifdef __KERNEL__
        spin_lock_bh(&waiting_locks_spinlock);
        if (__ldlm_del_waiting_lock(lock) == 0)
                /* the lock was not in any list, grab an extra ref before adding
        spin_lock_bh(&waiting_locks_spinlock);
        if (__ldlm_del_waiting_lock(lock) == 0)
                /* the lock was not in any list, grab an extra ref before adding
@@ -604,9 +590,6 @@ static void ldlm_failed_ast(struct ldlm_lock *lock, int rc,
                     &expired_lock_thread.elt_expired_locks);
        wake_up(&expired_lock_thread.elt_waitq);
        spin_unlock_bh(&waiting_locks_spinlock);
                     &expired_lock_thread.elt_expired_locks);
        wake_up(&expired_lock_thread.elt_waitq);
        spin_unlock_bh(&waiting_locks_spinlock);
-#else
-       class_fail_export(lock->l_export);
-#endif
 }
 
 /**
 }
 
 /**
@@ -1929,7 +1912,6 @@ static int ldlm_callback_reply(struct ptlrpc_request *req, int rc)
         return ptlrpc_reply(req);
 }
 
         return ptlrpc_reply(req);
 }
 
-#ifdef __KERNEL__
 static int __ldlm_bl_to_thread(struct ldlm_bl_work_item *blwi,
                               ldlm_cancel_flags_t cancel_flags)
 {
 static int __ldlm_bl_to_thread(struct ldlm_bl_work_item *blwi,
                               ldlm_cancel_flags_t cancel_flags)
 {
@@ -2024,27 +2006,18 @@ static int ldlm_bl_to_thread(struct ldlm_namespace *ns,
        }
 }
 
        }
 }
 
-#endif
 
 int ldlm_bl_to_thread_lock(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld,
                           struct ldlm_lock *lock)
 {
 
 int ldlm_bl_to_thread_lock(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld,
                           struct ldlm_lock *lock)
 {
-#ifdef __KERNEL__
        return ldlm_bl_to_thread(ns, ld, lock, NULL, 0, LCF_ASYNC);
        return ldlm_bl_to_thread(ns, ld, lock, NULL, 0, LCF_ASYNC);
-#else
-       return -ENOSYS;
-#endif
 }
 
 int ldlm_bl_to_thread_list(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld,
                           struct list_head *cancels, int count,
                           ldlm_cancel_flags_t cancel_flags)
 {
 }
 
 int ldlm_bl_to_thread_list(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld,
                           struct list_head *cancels, int count,
                           ldlm_cancel_flags_t cancel_flags)
 {
-#ifdef __KERNEL__
        return ldlm_bl_to_thread(ns, ld, NULL, cancels, count, cancel_flags);
        return ldlm_bl_to_thread(ns, ld, NULL, cancels, count, cancel_flags);
-#else
-       return -ENOSYS;
-#endif
 }
 
 /* Setinfo coming from Server (eg MDT) to Client (eg MDC)! */
 }
 
 /* Setinfo coming from Server (eg MDT) to Client (eg MDC)! */
@@ -2527,7 +2500,6 @@ void ldlm_revoke_export_locks(struct obd_export *exp)
 EXPORT_SYMBOL(ldlm_revoke_export_locks);
 #endif /* HAVE_SERVER_SUPPORT */
 
 EXPORT_SYMBOL(ldlm_revoke_export_locks);
 #endif /* HAVE_SERVER_SUPPORT */
 
-#ifdef __KERNEL__
 static struct ldlm_bl_work_item *ldlm_bl_get_work(struct ldlm_bl_pool *blp)
 {
        struct ldlm_bl_work_item *blwi = NULL;
 static struct ldlm_bl_work_item *ldlm_bl_get_work(struct ldlm_bl_pool *blp)
 {
        struct ldlm_bl_work_item *blwi = NULL;
@@ -2669,7 +2641,6 @@ static int ldlm_bl_thread_main(void *arg)
        RETURN(0);
 }
 
        RETURN(0);
 }
 
-#endif
 
 static int ldlm_setup(void);
 static int ldlm_cleanup(void);
 
 static int ldlm_setup(void);
 static int ldlm_cleanup(void);
@@ -2821,12 +2792,10 @@ static int ldlm_setup(void)
 {
        static struct ptlrpc_service_conf       conf;
        struct ldlm_bl_pool                    *blp = NULL;
 {
        static struct ptlrpc_service_conf       conf;
        struct ldlm_bl_pool                    *blp = NULL;
-#ifdef __KERNEL__
-# ifdef HAVE_SERVER_SUPPORT
+#ifdef HAVE_SERVER_SUPPORT
        struct task_struct *task;
        struct task_struct *task;
-# endif
+#endif /* HAVE_SERVER_SUPPORT */
        int i;
        int i;
-#endif
        int rc = 0;
 
         ENTRY;
        int rc = 0;
 
         ENTRY;
@@ -2842,7 +2811,7 @@ static int ldlm_setup(void)
         rc = ldlm_proc_setup();
         if (rc != 0)
                GOTO(out, rc);
         rc = ldlm_proc_setup();
         if (rc != 0)
                GOTO(out, rc);
-#endif
+#endif /* LPROCFS */
 
        memset(&conf, 0, sizeof(conf));
        conf = (typeof(conf)) {
 
        memset(&conf, 0, sizeof(conf));
        conf = (typeof(conf)) {
@@ -2924,7 +2893,7 @@ static int ldlm_setup(void)
                ldlm_state->ldlm_cancel_service = NULL;
                GOTO(out, rc);
        }
                ldlm_state->ldlm_cancel_service = NULL;
                GOTO(out, rc);
        }
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
 
        OBD_ALLOC(blp, sizeof(*blp));
        if (blp == NULL)
 
        OBD_ALLOC(blp, sizeof(*blp));
        if (blp == NULL)
@@ -2938,7 +2907,6 @@ static int ldlm_setup(void)
        atomic_set(&blp->blp_num_threads, 0);
        atomic_set(&blp->blp_busy_threads, 0);
 
        atomic_set(&blp->blp_num_threads, 0);
        atomic_set(&blp->blp_busy_threads, 0);
 
-#ifdef __KERNEL__
        if (ldlm_num_threads == 0) {
                blp->blp_min_threads = LDLM_NTHRS_INIT;
                blp->blp_max_threads = LDLM_NTHRS_MAX;
        if (ldlm_num_threads == 0) {
                blp->blp_min_threads = LDLM_NTHRS_INIT;
                blp->blp_max_threads = LDLM_NTHRS_MAX;
@@ -2954,7 +2922,7 @@ static int ldlm_setup(void)
                        GOTO(out, rc);
        }
 
                        GOTO(out, rc);
        }
 
-# ifdef HAVE_SERVER_SUPPORT
+#ifdef HAVE_SERVER_SUPPORT
        INIT_LIST_HEAD(&expired_lock_thread.elt_expired_locks);
        expired_lock_thread.elt_state = ELT_STOPPED;
        init_waitqueue_head(&expired_lock_thread.elt_waitq);
        INIT_LIST_HEAD(&expired_lock_thread.elt_expired_locks);
        expired_lock_thread.elt_state = ELT_STOPPED;
        init_waitqueue_head(&expired_lock_thread.elt_waitq);
@@ -2972,14 +2940,13 @@ static int ldlm_setup(void)
 
        wait_event(expired_lock_thread.elt_waitq,
                       expired_lock_thread.elt_state == ELT_READY);
 
        wait_event(expired_lock_thread.elt_waitq,
                       expired_lock_thread.elt_state == ELT_READY);
-# endif /* HAVE_SERVER_SUPPORT */
+#endif /* HAVE_SERVER_SUPPORT */
 
        rc = ldlm_pools_init();
        if (rc) {
                CERROR("Failed to initialize LDLM pools: %d\n", rc);
                GOTO(out, rc);
        }
 
        rc = ldlm_pools_init();
        if (rc) {
                CERROR("Failed to initialize LDLM pools: %d\n", rc);
                GOTO(out, rc);
        }
-#endif
        RETURN(0);
 
  out:
        RETURN(0);
 
  out:
@@ -2999,7 +2966,6 @@ static int ldlm_cleanup(void)
                 RETURN(-EBUSY);
         }
 
                 RETURN(-EBUSY);
         }
 
-#ifdef __KERNEL__
         ldlm_pools_fini();
 
        if (ldlm_state->ldlm_bl_pool != NULL) {
         ldlm_pools_fini();
 
        if (ldlm_state->ldlm_bl_pool != NULL) {
@@ -3020,27 +2986,24 @@ static int ldlm_cleanup(void)
 
                OBD_FREE(blp, sizeof(*blp));
        }
 
                OBD_FREE(blp, sizeof(*blp));
        }
-#endif /* __KERNEL__ */
 
        if (ldlm_state->ldlm_cb_service != NULL)
                ptlrpc_unregister_service(ldlm_state->ldlm_cb_service);
 
        if (ldlm_state->ldlm_cb_service != NULL)
                ptlrpc_unregister_service(ldlm_state->ldlm_cb_service);
-# ifdef HAVE_SERVER_SUPPORT
+#ifdef HAVE_SERVER_SUPPORT
        if (ldlm_state->ldlm_cancel_service != NULL)
                ptlrpc_unregister_service(ldlm_state->ldlm_cancel_service);
        if (ldlm_state->ldlm_cancel_service != NULL)
                ptlrpc_unregister_service(ldlm_state->ldlm_cancel_service);
-# endif
+#endif
 
 
-#ifdef __KERNEL__
        ldlm_proc_cleanup();
 
        ldlm_proc_cleanup();
 
-# ifdef HAVE_SERVER_SUPPORT
+#ifdef HAVE_SERVER_SUPPORT
        if (expired_lock_thread.elt_state != ELT_STOPPED) {
                expired_lock_thread.elt_state = ELT_TERMINATE;
                wake_up(&expired_lock_thread.elt_waitq);
                wait_event(expired_lock_thread.elt_waitq,
                               expired_lock_thread.elt_state == ELT_STOPPED);
        }
        if (expired_lock_thread.elt_state != ELT_STOPPED) {
                expired_lock_thread.elt_state = ELT_TERMINATE;
                wake_up(&expired_lock_thread.elt_waitq);
                wait_event(expired_lock_thread.elt_waitq,
                               expired_lock_thread.elt_state == ELT_STOPPED);
        }
-# endif
-#endif /* __KERNEL__ */
+#endif
 
         OBD_FREE(ldlm_state, sizeof(*ldlm_state));
         ldlm_state = NULL;
 
         OBD_FREE(ldlm_state, sizeof(*ldlm_state));
         ldlm_state = NULL;
@@ -3091,12 +3054,10 @@ void ldlm_exit(void)
        if (ldlm_refcount)
                CERROR("ldlm_refcount is %d in ldlm_exit!\n", ldlm_refcount);
        kmem_cache_destroy(ldlm_resource_slab);
        if (ldlm_refcount)
                CERROR("ldlm_refcount is %d in ldlm_exit!\n", ldlm_refcount);
        kmem_cache_destroy(ldlm_resource_slab);
-#ifdef __KERNEL__
        /* ldlm_lock_put() use RCU to call ldlm_lock_free, so need call
         * synchronize_rcu() to wait a grace period elapsed, so that
         * ldlm_lock_free() get a chance to be called. */
        synchronize_rcu();
        /* ldlm_lock_put() use RCU to call ldlm_lock_free, so need call
         * synchronize_rcu() to wait a grace period elapsed, so that
         * ldlm_lock_free() get a chance to be called. */
        synchronize_rcu();
-#endif
        kmem_cache_destroy(ldlm_lock_slab);
        kmem_cache_destroy(ldlm_interval_slab);
 }
        kmem_cache_destroy(ldlm_lock_slab);
        kmem_cache_destroy(ldlm_interval_slab);
 }
index 14a76b6..0cb91e6 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
-#ifdef __KERNEL__
 #include <lustre_dlm.h>
 #include <obd_support.h>
 #include <lustre_lib.h>
 #include <lustre_dlm.h>
 #include <obd_support.h>
 #include <lustre_lib.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include "ldlm_internal.h"
 
 
 #include "ldlm_internal.h"
 
index f3c620d..ef15628 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
 
 #define DEBUG_SUBSYSTEM S_LDLM
 
-#ifdef __KERNEL__
-# include <lustre_dlm.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <lustre_dlm.h>
 #include <cl_object.h>
 #include <cl_object.h>
-
 #include <obd_class.h>
 #include <obd_support.h>
 #include "ldlm_internal.h"
 #include <obd_class.h>
 #include <obd_support.h>
 #include "ldlm_internal.h"
  */
 #define LDLM_POOL_SLV_SHIFT (10)
 
  */
 #define LDLM_POOL_SLV_SHIFT (10)
 
-#ifdef __KERNEL__
 extern struct proc_dir_entry *ldlm_ns_proc_dir;
 extern struct proc_dir_entry *ldlm_ns_proc_dir;
-#endif
 
 static inline __u64 dru(__u64 val, __u32 shift, int round_up)
 {
 
 static inline __u64 dru(__u64 val, __u32 shift, int round_up)
 {
@@ -559,15 +551,10 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl,
        unused = ns->ns_nr_unused;
        spin_unlock(&ns->ns_lock);
 
        unused = ns->ns_nr_unused;
        spin_unlock(&ns->ns_lock);
 
-#ifdef __KERNEL__
        if (nr == 0)
                return (unused / 100) * sysctl_vfs_cache_pressure;
        else
                return ldlm_cancel_lru(ns, nr, LCF_ASYNC, LDLM_CANCEL_SHRINK);
        if (nr == 0)
                return (unused / 100) * sysctl_vfs_cache_pressure;
        else
                return ldlm_cancel_lru(ns, nr, LCF_ASYNC, LDLM_CANCEL_SHRINK);
-#else
-       return unused - (nr ? ldlm_cancel_lru(ns, nr, LCF_ASYNC,
-                                             LDLM_CANCEL_SHRINK) : 0);
-#endif
 }
 
 struct ldlm_pool_ops ldlm_srv_pool_ops = {
 }
 
 struct ldlm_pool_ops ldlm_srv_pool_ops = {
@@ -668,7 +655,6 @@ int ldlm_pool_setup(struct ldlm_pool *pl, int limit)
 }
 EXPORT_SYMBOL(ldlm_pool_setup);
 
 }
 EXPORT_SYMBOL(ldlm_pool_setup);
 
-#ifdef __KERNEL__
 static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
 {
        int granted, grant_rate, cancel_rate, grant_step;
 static int lprocfs_pool_state_seq_show(struct seq_file *m, void *unused)
 {
        int granted, grant_rate, cancel_rate, grant_step;
@@ -853,10 +839,6 @@ static void ldlm_pool_proc_fini(struct ldlm_pool *pl)
                 pl->pl_proc_dir = NULL;
         }
 }
                 pl->pl_proc_dir = NULL;
         }
 }
-#else /* !__KERNEL__*/
-#define ldlm_pool_proc_init(pl) (0)
-#define ldlm_pool_proc_fini(pl) while (0) {}
-#endif
 
 int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
                   int idx, ldlm_side_t client)
 
 int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
                   int idx, ldlm_side_t client)
@@ -1046,7 +1028,6 @@ __u32 ldlm_pool_get_lvf(struct ldlm_pool *pl)
 }
 EXPORT_SYMBOL(ldlm_pool_get_lvf);
 
 }
 EXPORT_SYMBOL(ldlm_pool_get_lvf);
 
-#ifdef __KERNEL__
 static unsigned int ldlm_pool_granted(struct ldlm_pool *pl)
 {
        return atomic_read(&pl->pl_granted);
 static unsigned int ldlm_pool_granted(struct ldlm_pool *pl)
 {
        return atomic_read(&pl->pl_granted);
@@ -1518,7 +1499,6 @@ void ldlm_pools_fini(void)
        ldlm_pools_thread_stop();
 }
 EXPORT_SYMBOL(ldlm_pools_fini);
        ldlm_pools_thread_stop();
 }
 EXPORT_SYMBOL(ldlm_pools_fini);
-#endif /* __KERNEL__ */
 
 #else /* !HAVE_LRU_RESIZE_SUPPORT */
 int ldlm_pool_setup(struct ldlm_pool *pl, int limit)
 
 #else /* !HAVE_LRU_RESIZE_SUPPORT */
 int ldlm_pool_setup(struct ldlm_pool *pl, int limit)
index 079edc8..486ec0c 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
-#ifndef __KERNEL__
-#include <signal.h>
-#include <liblustre.h>
-#endif
 
 #include <lustre_dlm.h>
 #include <obd_class.h>
 
 #include <lustre_dlm.h>
 #include <obd_class.h>
@@ -663,11 +659,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req,
                         LDLM_DEBUG(lock,"client-side enqueue, new policy data");
         }
 
                         LDLM_DEBUG(lock,"client-side enqueue, new policy data");
         }
 
-        if ((*flags) & LDLM_FL_AST_SENT ||
-            /* Cancel extent locks as soon as possible on a liblustre client,
-             * because it cannot handle asynchronous ASTs robustly (see
-             * bug 7311). */
-            (LIBLUSTRE_CLIENT && type == LDLM_EXTENT)) {
+       if ((*flags) & LDLM_FL_AST_SENT) {
                 lock_res_and_lock(lock);
                lock->l_flags |= LDLM_FL_CBPENDING | LDLM_FL_BL_AST;
                 unlock_res_and_lock(lock);
                 lock_res_and_lock(lock);
                lock->l_flags |= LDLM_FL_CBPENDING | LDLM_FL_BL_AST;
                 unlock_res_and_lock(lock);
@@ -971,14 +963,6 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
                ptlrpc_request_set_replen(req);
         }
 
                ptlrpc_request_set_replen(req);
         }
 
-        /*
-         * Liblustre client doesn't get extent locks, except for O_APPEND case
-         * where [0, OBD_OBJECT_EOF] lock is taken, or truncate, where
-         * [i_size, OBD_OBJECT_EOF] lock is taken.
-         */
-        LASSERT(ergo(LIBLUSTRE_CLIENT, einfo->ei_type != LDLM_EXTENT ||
-                     policy->l_extent.end == OBD_OBJECT_EOF));
-
         if (async) {
                 LASSERT(reqp != NULL);
                 RETURN(0);
         if (async) {
                 LASSERT(reqp != NULL);
                 RETURN(0);
@@ -1798,9 +1782,6 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
        int count, rc;
        ENTRY;
 
        int count, rc;
        ENTRY;
 
-#ifndef __KERNEL__
-       cancel_flags &= ~LCF_ASYNC; /* force to be sync in user space */
-#endif
        /* Just prepare the list of locks, do not actually cancel them yet.
         * Locks are cancelled later in a separate thread. */
        count = ldlm_prepare_lru_list(ns, &cancels, nr, 0, flags);
        /* Just prepare the list of locks, do not actually cancel them yet.
         * Locks are cancelled later in a separate thread. */
        count = ldlm_prepare_lru_list(ns, &cancels, nr, 0, flags);
index a275dbd..f0d1e66 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
-#ifdef __KERNEL__
-# include <lustre_dlm.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <lustre_dlm.h>
 #include <lustre_fid.h>
 #include <obd_class.h>
 #include "ldlm_internal.h"
 #include <lustre_fid.h>
 #include <obd_class.h>
 #include "ldlm_internal.h"
index 1769f3e..43e9944 100644 (file)
@@ -170,10 +170,8 @@ static inline int mdc_prep_elc_req(struct obd_export *exp,
 
 static inline unsigned long hash_x_index(__u64 hash, int hash64)
 {
 
 static inline unsigned long hash_x_index(__u64 hash, int hash64)
 {
-#ifdef __KERNEL__
        if (BITS_PER_LONG == 32 && hash64)
                hash >>= 32;
        if (BITS_PER_LONG == 32 && hash64)
                hash >>= 32;
-#endif
        /* save hash 0 with hash 1 */
        return ~0UL - (hash + !hash);
 }
        /* save hash 0 with hash 1 */
        return ~0UL - (hash + !hash);
 }
index 490204b..092ba2b 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_MDC
  */
 
 #define DEBUG_SUBSYSTEM S_MDC
-#ifndef __KERNEL__
-# include <fcntl.h>
-# include <liblustre.h>
-#endif
 #include <lustre_net.h>
 #include <lustre/lustre_idl.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre/lustre_idl.h>
 #include <obd_class.h>
 #include <lclient.h>
 #include "mdc_internal.h"
 
 #include <lclient.h>
 #include "mdc_internal.h"
 
-#ifndef __KERNEL__
-/* some liblustre hackings here */
-#ifndef O_DIRECTORY
-#define O_DIRECTORY     0
-#endif
-#endif
 
 static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid)
 {
 
 static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid)
 {
@@ -274,10 +264,6 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
                        if (op_data->op_bias & MDS_CREATE_VOLATILE)
                                cr_flags |= MDS_OPEN_VOLATILE;
                }
                        if (op_data->op_bias & MDS_CREATE_VOLATILE)
                                cr_flags |= MDS_OPEN_VOLATILE;
                }
-#ifndef __KERNEL__
-               /*XXX a hack for liblustre to set EA (LL_IOC_LOV_SETSTRIPE) */
-               rec->cr_fid2 = op_data->op_fid2;
-#endif
        }
 
        if (lmm) {
        }
 
        if (lmm) {
index 95201c4..848048c 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_MDC
 
 
 #define DEBUG_SUBSYSTEM S_MDC
 
-#ifdef __KERNEL__
-# include <linux/module.h>
-# include <linux/lustre_intent.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <linux/module.h>
+#include <linux/lustre_intent.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <lustre_dlm.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <lustre_dlm.h>
@@ -118,7 +113,6 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
 
         LASSERT(lock != NULL);
         lock_res_and_lock(lock);
 
         LASSERT(lock != NULL);
         lock_res_and_lock(lock);
-#ifdef __KERNEL__
        if (lock->l_resource->lr_lvb_inode &&
            lock->l_resource->lr_lvb_inode != data) {
                struct inode *old_inode = lock->l_resource->lr_lvb_inode;
        if (lock->l_resource->lr_lvb_inode &&
            lock->l_resource->lr_lvb_inode != data) {
                struct inode *old_inode = lock->l_resource->lr_lvb_inode;
@@ -129,7 +123,6 @@ int mdc_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
                         old_inode->i_state,
                         new_inode, new_inode->i_ino, new_inode->i_generation);
        }
                         old_inode->i_state,
                         new_inode, new_inode->i_ino, new_inode->i_generation);
        }
-#endif
        lock->l_resource->lr_lvb_inode = new_inode;
         if (bits)
                 *bits = lock->l_policy_data.l_inodebits.bits;
        lock->l_resource->lr_lvb_inode = new_inode;
         if (bits)
                 *bits = lock->l_policy_data.l_inodebits.bits;
index c9ddfa3..271792f 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_MDC
 
 
 #define DEBUG_SUBSYSTEM S_MDC
 
-#ifdef __KERNEL__
-# include <linux/module.h>
-# include <linux/kernel.h>
-#else
-# include <liblustre.h>
-#endif
+#include <linux/module.h>
+#include <linux/kernel.h>
 
 #include <obd_class.h>
 #include "mdc_internal.h"
 
 #include <obd_class.h>
 #include "mdc_internal.h"
index 9a38ea3..1699d29 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_MDC
 
 
 #define DEBUG_SUBSYSTEM S_MDC
 
-#ifdef __KERNEL__
-# include <linux/module.h>
-# include <linux/pagemap.h>
-# include <linux/miscdevice.h>
-# include <linux/init.h>
-# include <linux/utsname.h>
-#else
-# include <liblustre.h>
-#endif
+#include <linux/module.h>
+#include <linux/pagemap.h>
+#include <linux/miscdevice.h>
+#include <linux/init.h>
+#include <linux/utsname.h>
 
 #include <lustre_acl.h>
 #include <lustre_ioctl.h>
 
 #include <lustre_acl.h>
 #include <lustre_ioctl.h>
@@ -1156,7 +1152,6 @@ restart_bulk:
        RETURN(0);
 }
 
        RETURN(0);
 }
 
-#ifdef __KERNEL__
 static void mdc_release_page(struct page *page, int remove)
 {
        if (remove) {
 static void mdc_release_page(struct page *page, int remove)
 {
        if (remove) {
@@ -1609,53 +1604,6 @@ fail:
        goto out_unlock;
 }
 
        goto out_unlock;
 }
 
-#else /* __KERNEL__ */
-
-static struct page
-*mdc_read_page_remote(struct obd_export *exp, const struct lmv_oinfo *lmo,
-                     const __u64 hash, struct obd_capa *oc)
-{
-       struct ptlrpc_request *req = NULL;
-       struct page *page;
-       int rc;
-
-       OBD_PAGE_ALLOC(page, 0);
-       if (page == NULL)
-               return ERR_PTR(-ENOMEM);
-
-       rc = mdc_getpage(exp, &lmo->lmo_fid, hash, oc, &page, 1, &req);
-       if (req != NULL)
-               ptlrpc_req_finished(req);
-
-       if (unlikely(rc)) {
-               OBD_PAGE_FREE(page);
-               return ERR_PTR(rc);
-       }
-       return page;
-}
-
-
-static int mdc_read_page(struct obd_export *exp, struct md_op_data *op_data,
-                       struct md_callback *cb_op, __u64 hash_offset,
-                       struct page **ppage)
-{
-       struct page *page;
-       struct lmv_oinfo *lmo;
-       int rc = 0;
-
-       /* No local cache for liblustre, always read entry remotely */
-       lmo = &op_data->op_mea1->lsm_md_oinfo[op_data->op_stripe_offset];
-       page = mdc_read_page_remote(exp, lmo, hash_offset,
-                                   op_data->op_capa1);
-       if (IS_ERR(page))
-               return PTR_ERR(page);
-
-       *ppage = page;
-
-       return rc;
-}
-
-#endif
 
 static int mdc_statfs(const struct lu_env *env,
                       struct obd_export *exp, struct obd_statfs *osfs,
 
 static int mdc_statfs(const struct lu_env *env,
                       struct obd_export *exp, struct obd_statfs *osfs,
@@ -3227,7 +3175,6 @@ int __init mdc_init(void)
                                   LUSTRE_MDC_NAME, NULL);
 }
 
                                   LUSTRE_MDC_NAME, NULL);
 }
 
-#ifdef __KERNEL__
 static void /*__exit*/ mdc_exit(void)
 {
         class_unregister_type(LUSTRE_MDC_NAME);
 static void /*__exit*/ mdc_exit(void)
 {
         class_unregister_type(LUSTRE_MDC_NAME);
@@ -3239,4 +3186,3 @@ MODULE_LICENSE("GPL");
 
 module_init(mdc_init);
 module_exit(mdc_exit);
 
 module_init(mdc_init);
 module_exit(mdc_exit);
-#endif
index fc9a7d3..6dfbe58 100644 (file)
@@ -48,7 +48,6 @@
 #ifndef _MDT_INTERNAL_H
 #define _MDT_INTERNAL_H
 
 #ifndef _MDT_INTERNAL_H
 #define _MDT_INTERNAL_H
 
-#if defined(__KERNEL__)
 
 #include <libcfs/lucache.h>
 #include <lustre_net.h>
 
 #include <libcfs/lucache.h>
 #include <lustre_net.h>
@@ -1095,5 +1094,4 @@ static inline char *mdt_obd_name(struct mdt_device *mdt)
 int mds_mod_init(void);
 void mds_mod_exit(void);
 
 int mds_mod_init(void);
 void mds_mod_exit(void);
 
-#endif /* __KERNEL__ */
 #endif /* _MDT_H */
 #endif /* _MDT_H */
index f279aa5..dbc381e 100644 (file)
@@ -2036,7 +2036,6 @@ int __init mgc_init(void)
                                   LUSTRE_MGC_NAME, NULL);
 }
 
                                   LUSTRE_MGC_NAME, NULL);
 }
 
-#ifdef __KERNEL__
 static void /*__exit*/ mgc_exit(void)
 {
         class_unregister_type(LUSTRE_MGC_NAME);
 static void /*__exit*/ mgc_exit(void)
 {
         class_unregister_type(LUSTRE_MGC_NAME);
@@ -2048,4 +2047,3 @@ MODULE_LICENSE("GPL");
 
 module_init(mgc_init);
 module_exit(mgc_exit);
 
 module_init(mgc_init);
 module_exit(mgc_exit);
-#endif
index 895ad98..54ce929 100644 (file)
@@ -43,9 +43,7 @@
 #define DEBUG_SUBSYSTEM S_MGS
 #define D_MGS D_CONFIG
 
 #define DEBUG_SUBSYSTEM S_MGS
 #define D_MGS D_CONFIG
 
-#ifdef __KERNEL__
 #include <linux/pagemap.h>
 #include <linux/pagemap.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index fa9d86a..fa2affd 100644 (file)
@@ -42,7 +42,6 @@
 
 #define DEBUG_SUBSYSTEM S_SEC
 
 
 #define DEBUG_SUBSYSTEM S_SEC
 
-#ifdef __KERNEL__
 #include <linux/version.h>
 #include <linux/fs.h>
 #include <asm/unistd.h>
 #include <linux/version.h>
 #include <linux/fs.h>
 #include <asm/unistd.h>
@@ -53,9 +52,6 @@
 #include <obd_class.h>
 #include <lustre_debug.h>
 #include <lustre/lustre_idl.h>
 #include <obd_class.h>
 #include <lustre_debug.h>
 #include <lustre/lustre_idl.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <libcfs/list.h>
 #include <lustre_capa.h>
 
 #include <libcfs/list.h>
 #include <lustre_capa.h>
@@ -65,7 +61,6 @@
 
 struct kmem_cache *capa_cachep;
 
 
 struct kmem_cache *capa_cachep;
 
-#ifdef __KERNEL__
 /* lock for capa hash/capa_list/fo_capa_keys */
 DEFINE_SPINLOCK(capa_lock);
 
 /* lock for capa hash/capa_list/fo_capa_keys */
 DEFINE_SPINLOCK(capa_lock);
 
@@ -74,7 +69,6 @@ struct list_head capa_list[CAPA_SITE_MAX];
 static struct capa_hmac_alg capa_hmac_algs[] = {
         DEF_CAPA_HMAC_ALG("sha1", SHA1, 20, 20),
 };
 static struct capa_hmac_alg capa_hmac_algs[] = {
         DEF_CAPA_HMAC_ALG("sha1", SHA1, 20, 20),
 };
-#endif
 /* capa count */
 int capa_count[CAPA_SITE_MAX] = { 0, };
 
 /* capa count */
 int capa_count[CAPA_SITE_MAX] = { 0, };
 
@@ -101,7 +95,6 @@ struct hlist_head *init_capa_hash(void)
 }
 EXPORT_SYMBOL(init_capa_hash);
 
 }
 EXPORT_SYMBOL(init_capa_hash);
 
-#ifdef __KERNEL__
 static inline int capa_on_server(struct obd_capa *ocapa)
 {
         return ocapa->c_site == CAPA_SITE_SERVER;
 static inline int capa_on_server(struct obd_capa *ocapa)
 {
         return ocapa->c_site == CAPA_SITE_SERVER;
@@ -387,7 +380,6 @@ out:
         return rc;
 }
 EXPORT_SYMBOL(capa_decrypt_id);
         return rc;
 }
 EXPORT_SYMBOL(capa_decrypt_id);
-#endif
 
 void capa_cpy(void *capa, struct obd_capa *ocapa)
 {
 
 void capa_cpy(void *capa, struct obd_capa *ocapa)
 {
index 8878ed8..3f572ee 100644 (file)
@@ -41,6 +41,7 @@
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
+#include <linux/sched.h>
 #include <obd_class.h>
 #include <obd_support.h>
 #include <lustre_fid.h>
 #include <obd_class.h>
 #include <obd_support.h>
 #include <lustre_fid.h>
@@ -1558,14 +1559,6 @@ void cl_req_attr_set(const struct lu_env *env, struct cl_req *req,
 }
 EXPORT_SYMBOL(cl_req_attr_set);
 
 }
 EXPORT_SYMBOL(cl_req_attr_set);
 
-/* XXX complete(), init_completion(), and wait_for_completion(), until they are
- * implemented in libcfs. */
-#ifdef __KERNEL__
-# include <linux/sched.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-#endif
-
 /**
  * Initialize synchronous io wait anchor, for transfer of \a nrpages pages.
  */
 /**
  * Initialize synchronous io wait anchor, for transfer of \a nrpages pages.
  */
@@ -1617,9 +1610,7 @@ int cl_sync_io_wait(const struct lu_env *env, struct cl_io *io,
 
        /* wait until cl_sync_io_note() has done wakeup */
        while (unlikely(atomic_read(&anchor->csi_barrier) != 0)) {
 
        /* wait until cl_sync_io_note() has done wakeup */
        while (unlikely(atomic_read(&anchor->csi_barrier) != 0)) {
-#ifdef __KERNEL__
                cpu_relax();
                cpu_relax();
-#endif
        }
 
        POISON(anchor, 0x5a, sizeof *anchor);
        }
 
        POISON(anchor, 0x5a, sizeof *anchor);
index afb0208..0fa08a5 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
-#ifndef __KERNEL__
-# include <liblustre.h>
-#else
-# include <asm/atomic.h>
-#endif
+#include <asm/atomic.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_ioctl.h>
 #include "llog_internal.h"
 
 #include <lustre_ioctl.h>
 #include "llog_internal.h"
 
-#ifndef __KERNEL__
-/* liblustre workaround */
-atomic_t libcfs_kmemory = {0};
-#endif
 
 struct obd_device *obd_devs[MAX_OBD_DEVICES];
 EXPORT_SYMBOL(obd_devs);
 
 struct obd_device *obd_devs[MAX_OBD_DEVICES];
 EXPORT_SYMBOL(obd_devs);
@@ -68,10 +60,7 @@ DEFINE_RWLOCK(obd_dev_lock);
 
 __u64 obd_max_pages = 0;
 __u64 obd_max_alloc = 0;
 
 __u64 obd_max_pages = 0;
 __u64 obd_max_alloc = 0;
-#ifndef __KERNEL__
-__u64 obd_alloc;
-__u64 obd_pages;
-#endif
+
 static DEFINE_SPINLOCK(obd_updatemax_lock);
 
 /* The following are visible and mutable through /proc/sys/lustre/. */
 static DEFINE_SPINLOCK(obd_updatemax_lock);
 
 /* The following are visible and mutable through /proc/sys/lustre/. */
@@ -435,11 +424,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
         RETURN(err);
 } /* class_handle_ioctl */
 
         RETURN(err);
 } /* class_handle_ioctl */
 
-#ifdef __KERNEL__
 extern struct miscdevice obd_psdev;
 extern struct miscdevice obd_psdev;
-#else
-struct miscdevice obd_psdev;
-#endif
 
 #define OBD_INIT_CHECK
 #ifdef OBD_INIT_CHECK
 
 #define OBD_INIT_CHECK
 #ifdef OBD_INIT_CHECK
@@ -517,19 +502,13 @@ static int obd_init_checks(void)
 extern int class_procfs_init(void);
 extern int class_procfs_clean(void);
 
 extern int class_procfs_init(void);
 extern int class_procfs_clean(void);
 
-#ifdef __KERNEL__
 static int __init init_obdclass(void)
 static int __init init_obdclass(void)
-#else
-int init_obdclass(void)
-#endif
 {
         int i, err;
 {
         int i, err;
-#ifdef __KERNEL__
         int lustre_register_fs(void);
 
         for (i = CAPA_SITE_CLIENT; i < CAPA_SITE_MAX; i++)
                INIT_LIST_HEAD(&capa_list[i]);
         int lustre_register_fs(void);
 
         for (i = CAPA_SITE_CLIENT; i < CAPA_SITE_MAX; i++)
                INIT_LIST_HEAD(&capa_list[i]);
-#endif
 
         LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n");
 
 
         LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n");
 
@@ -583,11 +562,9 @@ int init_obdclass(void)
         err = obd_init_caches();
         if (err)
                 return err;
         err = obd_init_caches();
         if (err)
                 return err;
-#ifdef __KERNEL__
         err = class_procfs_init();
         if (err)
                 return err;
         err = class_procfs_init();
         if (err)
                 return err;
-#endif
 
        err = lu_global_init();
        if (err)
 
        err = lu_global_init();
        if (err)
@@ -601,7 +578,7 @@ int init_obdclass(void)
        if (err != 0)
                return err;
 
        if (err != 0)
                return err;
 
-#if defined(__KERNEL__) && defined(HAVE_SERVER_SUPPORT)
+#ifdef HAVE_SERVER_SUPPORT
        err = dt_global_init();
        if (err != 0)
                return err;
        err = dt_global_init();
        if (err != 0)
                return err;
@@ -609,15 +586,13 @@ int init_obdclass(void)
        err = lu_ucred_global_init();
        if (err != 0)
                return err;
        err = lu_ucred_global_init();
        if (err != 0)
                return err;
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
 
        err = llog_info_init();
        if (err)
                return err;
 
 
        err = llog_info_init();
        if (err)
                return err;
 
-#ifdef __KERNEL__
         err = lustre_register_fs();
         err = lustre_register_fs();
-#endif
 
         return err;
 }
 
         return err;
 }
@@ -662,11 +637,10 @@ __u64 obd_pages_max(void)
        return ret;
 }
 EXPORT_SYMBOL(obd_pages_max);
        return ret;
 }
 EXPORT_SYMBOL(obd_pages_max);
-#endif
+#endif /* LPROCFS */
 
 /* liblustre doesn't call cleanup_obdclass, apparently.  we carry on in this
  * ifdef to the end of the file to cover module and versioning goo.*/
 
 /* liblustre doesn't call cleanup_obdclass, apparently.  we carry on in this
  * ifdef to the end of the file to cover module and versioning goo.*/
-#ifdef __KERNEL__
 static void cleanup_obdclass(void)
 {
         int lustre_unregister_fs(void);
 static void cleanup_obdclass(void)
 {
         int lustre_unregister_fs(void);
@@ -681,7 +655,7 @@ static void cleanup_obdclass(void)
 #ifdef HAVE_SERVER_SUPPORT
        lu_ucred_global_fini();
        dt_global_fini();
 #ifdef HAVE_SERVER_SUPPORT
        lu_ucred_global_fini();
        dt_global_fini();
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
        cl_global_fini();
        lu_capainfo_fini();
        lu_global_fini();
        cl_global_fini();
        lu_capainfo_fini();
        lu_global_fini();
@@ -717,4 +691,3 @@ MODULE_DESCRIPTION("Lustre Class Driver Build Version: " BUILD_VERSION);
 MODULE_LICENSE("GPL");
 
 cfs_module(obdclass, LUSTRE_VERSION_STRING, init_obdclass, cleanup_obdclass);
 MODULE_LICENSE("GPL");
 
 cfs_module(obdclass, LUSTRE_VERSION_STRING, init_obdclass, cleanup_obdclass);
-#endif
index 7d65547..9f9c0a4 100644 (file)
@@ -40,9 +40,6 @@
 
 #define DEBUG_SUBSYSTEM D_OTHER
 
 
 #define DEBUG_SUBSYSTEM D_OTHER
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <lustre_debug.h>
 
 #include <obd_support.h>
 #include <lustre_debug.h>
index 37757a8..f20f3b1 100644 (file)
@@ -40,9 +40,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_class.h>
 #include <lprocfs_status.h>
 
 #include <obd_class.h>
 #include <lprocfs_status.h>
 
@@ -1767,7 +1764,6 @@ void obd_zombie_barrier(void)
 }
 EXPORT_SYMBOL(obd_zombie_barrier);
 
 }
 EXPORT_SYMBOL(obd_zombie_barrier);
 
-#ifdef __KERNEL__
 
 /**
  * destroy zombie export/import thread.
 
 /**
  * destroy zombie export/import thread.
@@ -1798,34 +1794,13 @@ static int obd_zombie_impexp_thread(void *unused)
        RETURN(0);
 }
 
        RETURN(0);
 }
 
-#else /* ! KERNEL */
-
-static atomic_t zombie_recur = ATOMIC_INIT(0);
-static void *obd_zombie_impexp_work_cb;
-static void *obd_zombie_impexp_idle_cb;
-
-int obd_zombie_impexp_kill(void *arg)
-{
-        int rc = 0;
-
-       if (atomic_inc_return(&zombie_recur) == 1) {
-                obd_zombie_impexp_cull();
-                rc = 1;
-        }
-       atomic_dec(&zombie_recur);
-        return rc;
-}
-
-#endif
 
 /**
  * start destroy zombie import/export thread
  */
 int obd_zombie_impexp_init(void)
 {
 
 /**
  * start destroy zombie import/export thread
  */
 int obd_zombie_impexp_init(void)
 {
-#ifdef __KERNEL__
        struct task_struct *task;
        struct task_struct *task;
-#endif
 
        INIT_LIST_HEAD(&obd_zombie_imports);
 
 
        INIT_LIST_HEAD(&obd_zombie_imports);
 
@@ -1836,22 +1811,11 @@ int obd_zombie_impexp_init(void)
        init_waitqueue_head(&obd_zombie_waitq);
        obd_zombie_pid = 0;
 
        init_waitqueue_head(&obd_zombie_waitq);
        obd_zombie_pid = 0;
 
-#ifdef __KERNEL__
        task = kthread_run(obd_zombie_impexp_thread, NULL, "obd_zombid");
        if (IS_ERR(task))
                RETURN(PTR_ERR(task));
 
        wait_for_completion(&obd_zombie_start);
        task = kthread_run(obd_zombie_impexp_thread, NULL, "obd_zombid");
        if (IS_ERR(task))
                RETURN(PTR_ERR(task));
 
        wait_for_completion(&obd_zombie_start);
-#else
-
-        obd_zombie_impexp_work_cb =
-                liblustre_register_wait_callback("obd_zombi_impexp_kill",
-                                                 &obd_zombie_impexp_kill, NULL);
-
-        obd_zombie_impexp_idle_cb =
-                liblustre_register_idle_callback("obd_zombi_impexp_check",
-                                                 &obd_zombie_impexp_check, NULL);
-#endif
        RETURN(0);
 }
 /**
        RETURN(0);
 }
 /**
@@ -1861,12 +1825,7 @@ void obd_zombie_impexp_stop(void)
 {
        set_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags);
         obd_zombie_impexp_notify();
 {
        set_bit(OBD_ZOMBIE_STOP, &obd_zombie_flags);
         obd_zombie_impexp_notify();
-#ifdef __KERNEL__
        wait_for_completion(&obd_zombie_stop);
        wait_for_completion(&obd_zombie_stop);
-#else
-        liblustre_deregister_wait_callback(obd_zombie_impexp_work_cb);
-        liblustre_deregister_idle_callback(obd_zombie_impexp_idle_cb);
-#endif
 }
 
 /***** Kernel-userspace comm helpers *******/
 }
 
 /***** Kernel-userspace comm helpers *******/
index 0d7f656..04ec8c5 100644 (file)
@@ -42,7 +42,6 @@
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifdef __KERNEL__
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -66,9 +65,6 @@
 #include <asm/uaccess.h>
 #include <linux/miscdevice.h>
 #include <linux/seq_file.h>
 #include <asm/uaccess.h>
 #include <linux/miscdevice.h>
 #include <linux/seq_file.h>
-#else
-# include <liblustre.h>
-#endif
 
 #include <libcfs/libcfs.h>
 #include <obd_support.h>
 
 #include <libcfs/libcfs.h>
 #include <obd_support.h>
@@ -78,7 +74,6 @@
 #include <lustre_ioctl.h>
 #include <lustre_ver.h>
 #include <lustre/lustre_build_version.h>
 #include <lustre_ioctl.h>
 #include <lustre_ver.h>
 #include <lustre/lustre_build_version.h>
-#ifdef __KERNEL__
 
 int proc_version;
 
 
 int proc_version;
 
@@ -223,7 +218,6 @@ struct miscdevice obd_psdev = {
         .fops  = &obd_psdev_fops,
 };
 
         .fops  = &obd_psdev_fops,
 };
 
-#endif
 
 #ifdef LPROCFS
 static int obd_proc_version_seq_show(struct seq_file *m, void *v)
 
 #ifdef LPROCFS
 static int obd_proc_version_seq_show(struct seq_file *m, void *v)
@@ -340,7 +334,6 @@ struct lprocfs_seq_vars lprocfs_base[] = {
 #define lprocfs_base NULL
 #endif /* LPROCFS */
 
 #define lprocfs_base NULL
 #endif /* LPROCFS */
 
-#ifdef __KERNEL__
 static void *obd_device_list_seq_start(struct seq_file *p, loff_t *pos)
 {
         if (*pos >= class_devno_max())
 static void *obd_device_list_seq_start(struct seq_file *p, loff_t *pos)
 {
         if (*pos >= class_devno_max())
@@ -416,11 +409,9 @@ struct file_operations obd_device_list_fops = {
         .llseek  = seq_lseek,
         .release = seq_release,
 };
         .llseek  = seq_lseek,
         .release = seq_release,
 };
-#endif
 
 int class_procfs_init(void)
 {
 
 int class_procfs_init(void)
 {
-#ifdef __KERNEL__
        int rc;
        ENTRY;
 
        int rc;
        ENTRY;
 
@@ -431,13 +422,9 @@ int class_procfs_init(void)
                                &obd_device_list_fops, NULL);
        if (rc)
                CERROR("error adding /proc/fs/lustre/devices file\n");
                                &obd_device_list_fops, NULL);
        if (rc)
                CERROR("error adding /proc/fs/lustre/devices file\n");
-#else
-       ENTRY;
-#endif
        RETURN(0);
 }
 
        RETURN(0);
 }
 
-#ifdef __KERNEL__
 int class_procfs_clean(void)
 {
         ENTRY;
 int class_procfs_clean(void)
 {
         ENTRY;
@@ -446,4 +433,3 @@ int class_procfs_clean(void)
         }
         RETURN(0);
 }
         }
         RETURN(0);
 }
-#endif
index cd2166d..78ba445 100644 (file)
@@ -47,9 +47,6 @@
 
 #define DEBUG_SUBSYSTEM S_LOG
 
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 #include <lustre_log.h>
 
 #include <obd_class.h>
 #include <lustre_log.h>
@@ -418,7 +415,6 @@ out:
         return 0;
 }
 
         return 0;
 }
 
-#ifdef __KERNEL__
 static int llog_process_thread_daemonize(void *arg)
 {
        struct llog_process_info        *lpi = arg;
 static int llog_process_thread_daemonize(void *arg)
 {
        struct llog_process_info        *lpi = arg;
@@ -440,7 +436,6 @@ out:
        complete(&lpi->lpi_completion);
        return rc;
 }
        complete(&lpi->lpi_completion);
        return rc;
 }
-#endif
 
 int llog_process_or_fork(const struct lu_env *env,
                         struct llog_handle *loghandle,
 
 int llog_process_or_fork(const struct lu_env *env,
                         struct llog_handle *loghandle,
@@ -461,7 +456,6 @@ int llog_process_or_fork(const struct lu_env *env,
         lpi->lpi_cbdata    = data;
         lpi->lpi_catdata   = catdata;
 
         lpi->lpi_cbdata    = data;
         lpi->lpi_catdata   = catdata;
 
-#ifdef __KERNEL__
        if (fork) {
                struct task_struct *task;
 
        if (fork) {
                struct task_struct *task;
 
@@ -482,15 +476,9 @@ int llog_process_or_fork(const struct lu_env *env,
                lpi->lpi_env = env;
                llog_process_thread(lpi);
        }
                lpi->lpi_env = env;
                llog_process_thread(lpi);
        }
-#else
-       lpi->lpi_env = env;
-       llog_process_thread(lpi);
-#endif
        rc = lpi->lpi_rc;
 
        rc = lpi->lpi_rc;
 
-#ifdef __KERNEL__
 out_lpi:
 out_lpi:
-#endif
        OBD_FREE_PTR(lpi);
        RETURN(rc);
 }
        OBD_FREE_PTR(lpi);
        RETURN(rc);
 }
index 05d2f26..0d47c58 100644 (file)
@@ -48,9 +48,6 @@
 
 #define DEBUG_SUBSYSTEM S_LOG
 
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 
 
 #include <obd_class.h>
 
index a2dc63a..2761698 100644 (file)
@@ -36,9 +36,6 @@
 
 #define DEBUG_SUBSYSTEM S_LOG
 
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 #include <lustre_log.h>
 
 #include <obd_class.h>
 #include <lustre_log.h>
index 150921a..a647a4b 100644 (file)
@@ -42,9 +42,6 @@
 
 #define DEBUG_SUBSYSTEM S_LOG
 
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <lustre_log.h>
 
 
 #include <lustre_log.h>
 
index 51ce4ae..7e78335 100644 (file)
  *
  * Author: Andreas Dilger <andreas.dilger@intel.com>
  */
  *
  * Author: Andreas Dilger <andreas.dilger@intel.com>
  */
-#ifdef __KERNEL__
 #include <linux/module.h>
 #include <linux/module.h>
-#else
-#include <liblustre.h>
-#endif
 #include <lustre_lib.h>
 #include <lprocfs_status.h>
 
 #include <lustre_lib.h>
 #include <lprocfs_status.h>
 
index 05b378e..f0d2205 100644 (file)
@@ -30,9 +30,6 @@
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 #include <lprocfs_status.h>
 
 #include <obd_class.h>
 #include <lprocfs_status.h>
index 455934d..dce67d5 100644 (file)
@@ -40,9 +40,6 @@
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 #include <lprocfs_status.h>
 
 #include <obd_class.h>
 #include <lprocfs_status.h>
index 5abee4e..10e0cd3 100644 (file)
@@ -34,9 +34,6 @@
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 #include <lprocfs_status.h>
 
 #include <obd_class.h>
 #include <lprocfs_status.h>
index 567c4b4..eda5e9c 100644 (file)
 #define DEBUG_SUBSYSTEM S_CLASS
 
 #include <libcfs/libcfs.h>
 #define DEBUG_SUBSYSTEM S_CLASS
 
 #include <libcfs/libcfs.h>
-
-#ifdef __KERNEL__
-# include <linux/module.h>
-#endif
-
-/* hash_long() */
-#include <libcfs/libcfs_hash.h>
+#include <linux/module.h>
+#include <libcfs/libcfs_hash.h> /* hash_long() */
 #include <obd_class.h>
 #include <obd_support.h>
 #include <lustre_disk.h>
 #include <obd_class.h>
 #include <obd_support.h>
 #include <lustre_disk.h>
@@ -1941,7 +1936,6 @@ static void lu_site_stats_get(cfs_hash_t *hs,
         }
 }
 
         }
 }
 
-#ifdef __KERNEL__
 
 static unsigned long lu_cache_shrink_count(struct shrinker *sk,
                                           struct shrink_control *sc)
 
 static unsigned long lu_cache_shrink_count(struct shrinker *sk,
                                           struct shrink_control *sc)
@@ -2096,7 +2090,6 @@ void lu_context_keys_dump(void)
         }
 }
 EXPORT_SYMBOL(lu_context_keys_dump);
         }
 }
 EXPORT_SYMBOL(lu_context_keys_dump);
-#endif /* __KERNEL__ */
 
 /**
  * Initialization of global lu_* data.
 
 /**
  * Initialization of global lu_* data.
index 94ad740..5d2fc06 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <obd_support.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <obd_support.h>
@@ -296,7 +291,7 @@ void lu_ref_del_at(struct lu_ref *ref, struct lu_ref_link *link,
 }
 EXPORT_SYMBOL(lu_ref_del_at);
 
 }
 EXPORT_SYMBOL(lu_ref_del_at);
 
-#if defined(__KERNEL__) && defined(LPROCFS)
+#ifdef LPROCFS
 
 static void *lu_ref_seq_start(struct seq_file *seq, loff_t *pos)
 {
 
 static void *lu_ref_seq_start(struct seq_file *seq, loff_t *pos)
 {
@@ -420,7 +415,7 @@ static struct file_operations lu_ref_dump_fops = {
         .release = lu_ref_seq_release
 };
 
         .release = lu_ref_seq_release
 };
 
-#endif
+#endif /* LPROCFS */
 
 int lu_ref_global_init(void)
 {
 
 int lu_ref_global_init(void)
 {
@@ -433,23 +428,23 @@ int lu_ref_global_init(void)
        spin_lock_init(&lu_ref_refs_guard);
         result = lu_kmem_init(lu_ref_caches);
 
        spin_lock_init(&lu_ref_refs_guard);
         result = lu_kmem_init(lu_ref_caches);
 
-#if defined(__KERNEL__) && defined(LPROCFS)
+#ifdef LPROCFS
         if (result == 0) {
                 result = lprocfs_seq_create(proc_lustre_root, "lu_refs",
                                             0444, &lu_ref_dump_fops, NULL);
                 if (result)
                         lu_kmem_fini(lu_ref_caches);
         }
         if (result == 0) {
                 result = lprocfs_seq_create(proc_lustre_root, "lu_refs",
                                             0444, &lu_ref_dump_fops, NULL);
                 if (result)
                         lu_kmem_fini(lu_ref_caches);
         }
-#endif
+#endif /* LPROCFS */
 
         return result;
 }
 
 void lu_ref_global_fini(void)
 {
 
         return result;
 }
 
 void lu_ref_global_fini(void)
 {
-#if defined(__KERNEL__) && defined(LPROCFS)
+#ifdef LPROCFS
         lprocfs_remove_proc_entry("lu_refs", proc_lustre_root);
         lprocfs_remove_proc_entry("lu_refs", proc_lustre_root);
-#endif
+#endif /* LPROCFS */
         lu_kmem_fini(lu_ref_caches);
 }
 
         lu_kmem_fini(lu_ref_caches);
 }
 
index e4dc355..0827178 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <lustre_handles.h>
 #include <lustre_lib.h>
 
 
 #include <obd_support.h>
 #include <lustre_handles.h>
 #include <lustre_lib.h>
 
-#ifndef __KERNEL__
-# define list_add_rcu            list_add
-# define list_del_rcu            list_del
-# define list_for_each_rcu       list_for_each
-# define list_for_each_safe_rcu  list_for_each_safe
-# define list_for_each_entry_rcu list_for_each_entry
-# define rcu_read_lock()         spin_lock(&bucket->lock)
-# define rcu_read_unlock()       spin_unlock(&bucket->lock)
-#endif /* !__KERNEL__ */
 
 static __u64 handle_base;
 #define HANDLE_INCR 7
 
 static __u64 handle_base;
 #define HANDLE_INCR 7
index 46581a5..bce4efe 100644 (file)
@@ -36,9 +36,6 @@
 
 #define DEBUG_SUBSYSTEM S_RPC
 
 
 #define DEBUG_SUBSYSTEM S_RPC
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 #include <obd.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <obd.h>
 #include <obd_support.h>
 #include <obd_class.h>
index c080610..be27f65 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
-#ifdef __KERNEL__
 #include <obd_class.h>
 #include <linux/string.h>
 #include <lustre_disk.h>
 #include <obd_class.h>
 #include <linux/string.h>
 #include <lustre_disk.h>
-#else
-#include <liblustre.h>
-#include <string.h>
-#include <obd_class.h>
-#include <obd.h>
-#endif
 #include <lustre_ioctl.h>
 #include <lustre_log.h>
 #include <lprocfs_status.h>
 #include <lustre_ioctl.h>
 #include <lustre_log.h>
 #include <lprocfs_status.h>
@@ -1271,7 +1264,6 @@ EXPORT_SYMBOL(class_process_config);
 int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                              struct lustre_cfg *lcfg, void *data)
 {
 int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                              struct lustre_cfg *lcfg, void *data)
 {
-#ifdef __KERNEL__
         struct lprocfs_vars *var;
         char *key, *sval;
         int i, keylen, vallen;
         struct lprocfs_vars *var;
         char *key, *sval;
         int i, keylen, vallen;
@@ -1349,19 +1341,13 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
         if (!rc && skip)
                 rc = skip;
         RETURN(rc);
         if (!rc && skip)
                 rc = skip;
         RETURN(rc);
-#else
-        CDEBUG(D_CONFIG, "liblustre can't process params.\n");
-        /* Don't throw config error */
-        RETURN(0);
-#endif
 }
 EXPORT_SYMBOL(class_process_proc_param);
 }
 EXPORT_SYMBOL(class_process_proc_param);
-#endif
+#endif /* !HAVE_ONLY_PROCFS_SEQ */
 
 int class_process_proc_seq_param(char *prefix, struct lprocfs_seq_vars *lvars,
                                 struct lustre_cfg *lcfg, void *data)
 {
 
 int class_process_proc_seq_param(char *prefix, struct lprocfs_seq_vars *lvars,
                                 struct lustre_cfg *lcfg, void *data)
 {
-#ifdef __KERNEL__
        struct lprocfs_seq_vars *var;
        struct file fakefile;
        struct seq_file fake_seqfile;
        struct lprocfs_seq_vars *var;
        struct file fakefile;
        struct seq_file fake_seqfile;
@@ -1444,19 +1430,10 @@ int class_process_proc_seq_param(char *prefix, struct lprocfs_seq_vars *lvars,
        if (!rc && skip)
                rc = skip;
        RETURN(rc);
        if (!rc && skip)
                rc = skip;
        RETURN(rc);
-#else
-       CDEBUG(D_CONFIG, "liblustre can't process params.\n");
-       /* Don't throw config error */
-       RETURN(0);
-#endif
 }
 EXPORT_SYMBOL(class_process_proc_seq_param);
 
 }
 EXPORT_SYMBOL(class_process_proc_seq_param);
 
-#ifdef __KERNEL__
 extern int lustre_check_exclusion(struct super_block *sb, char *svname);
 extern int lustre_check_exclusion(struct super_block *sb, char *svname);
-#else
-#define lustre_check_exclusion(a,b)  0
-#endif
 
 /*
  * Supplemental functions for config logs, it allocates lustre_cfg
 
 /*
  * Supplemental functions for config logs, it allocates lustre_cfg
@@ -1599,7 +1576,7 @@ int class_config_llog_handler(const struct lu_env *env,
                         }
                 }
 
                         }
                 }
 
-#if defined(HAVE_SERVER_SUPPORT) && defined(__KERNEL__)
+#ifdef HAVE_SERVER_SUPPORT
                /* newer MDS replaces LOV/OSC with LOD/OSP */
                {
                        char *typename = lustre_cfg_string(lcfg, 1);
                /* newer MDS replaces LOV/OSC with LOD/OSP */
                {
                        char *typename = lustre_cfg_string(lcfg, 1);
@@ -1623,7 +1600,7 @@ int class_config_llog_handler(const struct lu_env *env,
                                strcpy(typename, LUSTRE_OSP_NAME);
                        }
                }
                                strcpy(typename, LUSTRE_OSP_NAME);
                        }
                }
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
 
                if (clli->cfg_flags & CFG_F_EXCLUDE) {
                        CDEBUG(D_CONFIG, "cmd: %x marked EXCLUDED\n",
 
                if (clli->cfg_flags & CFG_F_EXCLUDE) {
                        CDEBUG(D_CONFIG, "cmd: %x marked EXCLUDED\n",
index 7cf1ca0..4ac18b4 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-#include "../liblustre/llite_lib.h"
-#else
 #include <obd_class.h>
 #include <lustre/lustre_idl.h>
 #include <obd_class.h>
 #include <lustre/lustre_idl.h>
-#endif
 
 void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent)
 {
 
 void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent)
 {
@@ -121,10 +117,8 @@ EXPORT_SYMBOL(obdo_from_inode);
 
 void obdo_cpy_md(struct obdo *dst, const struct obdo *src, obd_flag valid)
 {
 
 void obdo_cpy_md(struct obdo *dst, const struct obdo *src, obd_flag valid)
 {
-#ifdef __KERNEL__
         CDEBUG(D_INODE, "src obdo "DOSTID" valid "LPX64", dst obdo "DOSTID"\n",
                POSTID(&src->o_oi), src->o_valid, POSTID(&dst->o_oi));
         CDEBUG(D_INODE, "src obdo "DOSTID" valid "LPX64", dst obdo "DOSTID"\n",
                POSTID(&src->o_oi), src->o_valid, POSTID(&dst->o_oi));
-#endif
         if (valid & OBD_MD_FLATIME)
                 dst->o_atime = src->o_atime;
         if (valid & OBD_MD_FLMTIME)
         if (valid & OBD_MD_FLATIME)
                 dst->o_atime = src->o_atime;
         if (valid & OBD_MD_FLMTIME)
index 7284f65..ba9c649 100644 (file)
@@ -40,9 +40,6 @@
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <lustre_export.h>
 #include <lustre_net.h>
 
 #include <lustre_export.h>
 #include <lustre_net.h>
index 40fb984..d3faea7 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
 
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#else
-# include <libcfs/libcfs.h>
-#endif
-
+#include <libcfs/libcfs.h>
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
 
-
 static inline __u32 consume(int nob, __u8 **ptr)
 {
        __u32 value;
 static inline __u32 consume(int nob, __u8 **ptr)
 {
        __u32 value;
index c7fcb5b..baccb17 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_ECHO
  */
 
 #define DEBUG_SUBSYSTEM S_ECHO
-#ifdef __KERNEL__
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_support.h>
 
 #include <obd.h>
 #include <obd_support.h>
@@ -3034,7 +3030,6 @@ void echo_client_exit(void)
         lu_kmem_fini(echo_caches);
 }
 
         lu_kmem_fini(echo_caches);
 }
 
-#ifdef __KERNEL__
 static int __init obdecho_init(void)
 {
         int rc;
 static int __init obdecho_init(void)
 {
         int rc;
@@ -3087,6 +3082,5 @@ MODULE_DESCRIPTION("Lustre Testing Echo OBD driver");
 MODULE_LICENSE("GPL");
 
 cfs_module(obdecho, LUSTRE_VERSION_STRING, obdecho_init, obdecho_exit);
 MODULE_LICENSE("GPL");
 
 cfs_module(obdecho, LUSTRE_VERSION_STRING, obdecho_init, obdecho_exit);
-#endif /* __KERNEL__ */
 
 /** @} echo_client */
 
 /** @} echo_client */
index fdaa43c..474c6dc 100644 (file)
 /* block size to use for data verification */
 #define OBD_ECHO_BLOCK_SIZE    (4<<10)
 
 /* block size to use for data verification */
 #define OBD_ECHO_BLOCK_SIZE    (4<<10)
 
-#ifdef __KERNEL__
-# ifdef HAVE_SERVER_SUPPORT
+#ifdef HAVE_SERVER_SUPPORT
 extern struct obd_ops echo_obd_ops;
 int echo_persistent_pages_init(void);
 void echo_persistent_pages_fini(void);
 extern struct obd_ops echo_obd_ops;
 int echo_persistent_pages_init(void);
 void echo_persistent_pages_fini(void);
-# endif
-#else /* ! __KERNEL__ */
-/* Kludge here, define some functions and macros needed by liblustre -jay */
-
-#define READ    0
-#define WRITE   1
-
-#endif /* ifdef __KERNEL__ */
+#endif /* HAVE_SERVER_SUPPORT */
 
 #endif
 
 #endif
index 3941910..724a70a 100644 (file)
 #ifndef OSC_CL_INTERNAL_H
 #define OSC_CL_INTERNAL_H
 
 #ifndef OSC_CL_INTERNAL_H
 #define OSC_CL_INTERNAL_H
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
 #include <obd.h>
 /* osc_build_res_name() */
 #include <cl_object.h>
 #include <obd.h>
 /* osc_build_res_name() */
 #include <cl_object.h>
index 0070308..f60b05b 100644 (file)
@@ -395,7 +395,6 @@ static int osc_async_upcall(void *a, int rc)
         return 0;
 }
 
         return 0;
 }
 
-#if defined(__KERNEL__)
 /**
  * Checks that there are no pages being written in the extent being truncated.
  */
 /**
  * Checks that there are no pages being written in the extent being truncated.
  */
@@ -412,11 +411,9 @@ static int trunc_check_cb(const struct lu_env *env, struct cl_io *io,
                CL_PAGE_DEBUG(D_ERROR, env, page, "exists " LPU64 "/%s.\n",
                                start, current->comm);
 
                CL_PAGE_DEBUG(D_ERROR, env, page, "exists " LPU64 "/%s.\n",
                                start, current->comm);
 
-#ifdef __linux__
        if (PageLocked(page->cp_vmpage))
                CDEBUG(D_CACHE, "page %p index %lu locked for %d.\n",
                       ops, osc_index(ops), oap->oap_cmd & OBD_BRW_RWMASK);
        if (PageLocked(page->cp_vmpage))
                CDEBUG(D_CACHE, "page %p index %lu locked for %d.\n",
                       ops, osc_index(ops), oap->oap_cmd & OBD_BRW_RWMASK);
-#endif
 
        return CLP_GANG_OKAY;
 }
 
        return CLP_GANG_OKAY;
 }
@@ -439,13 +436,6 @@ static void osc_trunc_check(const struct lu_env *env, struct cl_io *io,
                                start + partial, CL_PAGE_EOF,
                                trunc_check_cb, (void *)&size);
 }
                                start + partial, CL_PAGE_EOF,
                                trunc_check_cb, (void *)&size);
 }
-#else /* __KERNEL__ */
-static void osc_trunc_check(const struct lu_env *env, struct cl_io *io,
-                           struct osc_io *oio, __u64 size)
-{
-       return;
-}
-#endif
 
 static int osc_io_setattr_start(const struct lu_env *env,
                                 const struct cl_io_slice *slice)
 
 static int osc_io_setattr_start(const struct lu_env *env,
                                 const struct cl_io_slice *slice)
index 4f9fe7a..0f46193 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_OSC
 
 
 #define DEBUG_SUBSYSTEM S_OSC
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else
-# include <liblustre.h>
-#endif
+#include <libcfs/libcfs.h>
 /* fid_build_reg_res_name() */
 #include <lustre_fid.h>
 
 /* fid_build_reg_res_name() */
 #include <lustre_fid.h>
 
@@ -912,9 +908,7 @@ static int weigh_cb(const struct lu_env *env, struct cl_io *io,
        struct cl_page *page = ops->ops_cl.cpl_page;
 
        if (cl_page_is_vmlocked(env, page)
        struct cl_page *page = ops->ops_cl.cpl_page;
 
        if (cl_page_is_vmlocked(env, page)
-#if defined(__KERNEL__)
            || PageDirty(page->cp_vmpage) || PageWriteback(page->cp_vmpage)
            || PageDirty(page->cp_vmpage) || PageWriteback(page->cp_vmpage)
-#endif
           ) {
                (*(unsigned long *)cbdata)++;
                return CLP_GANG_ABORT;
           ) {
                (*(unsigned long *)cbdata)++;
                return CLP_GANG_ABORT;
index 31db149..be434d6 100644 (file)
@@ -27,9 +27,6 @@
  *
  * Code originally extracted from quota directory
  */
  *
  * Code originally extracted from quota directory
  */
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include "osc_internal.h"
 
 #include <obd.h>
 #include "osc_internal.h"
index cd84b54..7a05587 100644 (file)
@@ -38,9 +38,6 @@
 
 #include <libcfs/libcfs.h>
 
 
 #include <libcfs/libcfs.h>
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <lustre_dlm.h>
 #include <lustre_net.h>
 
 #include <lustre_dlm.h>
 #include <lustre_net.h>
@@ -1319,7 +1316,6 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
                          ergo(i == page_count - 1, poff == 0)),
                         "i: %d/%d pg: %p off: "LPU64", count: %u\n",
                         i, page_count, pg, pg->off, pg->count);
                          ergo(i == page_count - 1, poff == 0)),
                         "i: %d/%d pg: %p off: "LPU64", count: %u\n",
                         i, page_count, pg, pg->off, pg->count);
-#ifdef __linux__
                 LASSERTF(i == 0 || pg->off > pg_prev->off,
                          "i %d p_c %u pg %p [pri %lu ind %lu] off "LPU64
                          " prev_pg %p [pri %lu ind %lu] off "LPU64"\n",
                 LASSERTF(i == 0 || pg->off > pg_prev->off,
                          "i %d p_c %u pg %p [pri %lu ind %lu] off "LPU64
                          " prev_pg %p [pri %lu ind %lu] off "LPU64"\n",
@@ -1327,10 +1323,6 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,struct obdo *oa,
                          pg->pg, page_private(pg->pg), pg->pg->index, pg->off,
                          pg_prev->pg, page_private(pg_prev->pg),
                          pg_prev->pg->index, pg_prev->off);
                          pg->pg, page_private(pg->pg), pg->pg->index, pg->off,
                          pg_prev->pg, page_private(pg_prev->pg),
                          pg_prev->pg->index, pg_prev->off);
-#else
-                LASSERTF(i == 0 || pg->off > pg_prev->off,
-                         "i %d p_c %u\n", i, page_count);
-#endif
                 LASSERT((pga[0]->flag & OBD_BRW_SRVLOCK) ==
                         (pg->flag & OBD_BRW_SRVLOCK));
 
                 LASSERT((pga[0]->flag & OBD_BRW_SRVLOCK) ==
                         (pg->flag & OBD_BRW_SRVLOCK));
 
@@ -3333,7 +3325,6 @@ int __init osc_init(void)
        RETURN(rc);
 }
 
        RETURN(rc);
 }
 
-#ifdef __KERNEL__
 static void /*__exit*/ osc_exit(void)
 {
        class_unregister_type(LUSTRE_OSC_NAME);
 static void /*__exit*/ osc_exit(void)
 {
        class_unregister_type(LUSTRE_OSC_NAME);
@@ -3345,4 +3336,3 @@ MODULE_DESCRIPTION("Lustre Object Storage Client (OSC)");
 MODULE_LICENSE("GPL");
 
 cfs_module(osc, LUSTRE_VERSION_STRING, osc_init, osc_exit);
 MODULE_LICENSE("GPL");
 
 cfs_module(osc, LUSTRE_VERSION_STRING, osc_init, osc_exit);
-#endif
index 0e01a67..e14fab4 100644 (file)
@@ -26,7 +26,6 @@
  * in that lockspace
  *
  */
  * in that lockspace
  *
  */
-#ifdef __KERNEL__
 
 #include <linux/module.h>
 #include <linux/slab.h>
 
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -219,4 +218,3 @@ int dynlock_is_locked(struct dynlock *dl, unsigned long value)
        spin_unlock(&dl->dl_list_lock);
        return result;
 }
        spin_unlock(&dl->dl_list_lock);
        return result;
 }
-#endif
index 78a1ce5..bc1306b 100644 (file)
@@ -92,7 +92,6 @@ enum {
         DX_FMT_NAME_LEN    = 16,
 };
 
         DX_FMT_NAME_LEN    = 16,
 };
 
-#ifdef __KERNEL__
 
 /*
  * Debugging.
 
 /*
  * Debugging.
@@ -1131,7 +1130,6 @@ static inline int ldiskfs_check_dir_entry(const char * function,
 */
 
 /* __KERNEL__ */
 */
 
 /* __KERNEL__ */
-#endif
 
 /*
  * User level API. Copy exists in lustre/lustre/tests/iam_ut.c
 
 /*
  * User level API. Copy exists in lustre/lustre/tests/iam_ut.c
index b248e05..b3f15b5 100644 (file)
@@ -43,7 +43,6 @@
 #ifndef _OSD_INTERNAL_H
 #define _OSD_INTERNAL_H
 
 #ifndef _OSD_INTERNAL_H
 #define _OSD_INTERNAL_H
 
-#if defined(__KERNEL__)
 
 /* struct mutex */
 #include <linux/mutex.h>
 
 /* struct mutex */
 #include <linux/mutex.h>
@@ -1108,5 +1107,4 @@ void ldiskfs_dec_count(handle_t *handle, struct inode *inode);
 
 void osd_fini_iobuf(struct osd_device *d, struct osd_iobuf *iobuf);
 
 
 void osd_fini_iobuf(struct osd_device *d, struct osd_iobuf *iobuf);
 
-#endif /* __KERNEL__ */
 #endif /* _OSD_INTERNAL_H */
 #endif /* _OSD_INTERNAL_H */
index 2e6848f..c9d727d 100644 (file)
@@ -49,7 +49,6 @@
 #ifndef _OSD_OI_H
 #define _OSD_OI_H
 
 #ifndef _OSD_OI_H
 #define _OSD_OI_H
 
-#if defined(__KERNEL__)
 
 /* struct rw_semaphore */
 #include <linux/rwsem.h>
 
 /* struct rw_semaphore */
 #include <linux/rwsem.h>
@@ -155,5 +154,4 @@ int  osd_oi_update(struct osd_thread_info *info, struct osd_device *osd,
 
 int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
                  const struct lu_fid *fid, enum oi_check_flags flags);
 
 int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
                  const struct lu_fid *fid, enum oi_check_flags flags);
-#endif /* __KERNEL__ */
 #endif /* _OSD_OI_H */
 #endif /* _OSD_OI_H */
index 6416e5f..8c2a833 100644 (file)
 /** Implementation of client-side PortalRPC interfaces */
 
 #define DEBUG_SUBSYSTEM S_RPC
 /** Implementation of client-side PortalRPC interfaces */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <errno.h>
-#include <signal.h>
-#include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
@@ -2419,12 +2414,10 @@ int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
          * unlinked before returning a req to the pool.
          */
         for (;;) {
          * unlinked before returning a req to the pool.
          */
         for (;;) {
-#ifdef __KERNEL__
                /* The wq argument is ignored by user-space wait_event macros */
                wait_queue_head_t *wq = (request->rq_set != NULL) ?
                                        &request->rq_set->set_waitq :
                                        &request->rq_reply_waitq;
                /* The wq argument is ignored by user-space wait_event macros */
                wait_queue_head_t *wq = (request->rq_set != NULL) ?
                                        &request->rq_set->set_waitq :
                                        &request->rq_reply_waitq;
-#endif
                 /* Network access will complete in finite time but the HUGE
                  * timeout lets us CWARN for visibility of sluggish NALs */
                 lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
                 /* Network access will complete in finite time but the HUGE
                  * timeout lets us CWARN for visibility of sluggish NALs */
                 lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
index d85fcf2..9f20b07 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifdef __KERNEL__
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include "ptlrpc_internal.h"
 
 
 #include "ptlrpc_internal.h"
 
index 83aab13..91c6188 100644 (file)
@@ -172,7 +172,6 @@ static int lustre_errno_hton_mapping[] = {
        [EKEYREJECTED]          = LUSTRE_EKEYREJECTED,
        [EOWNERDEAD]            = LUSTRE_EOWNERDEAD,
        [ENOTRECOVERABLE]       = LUSTRE_ENOTRECOVERABLE,
        [EKEYREJECTED]          = LUSTRE_EKEYREJECTED,
        [EOWNERDEAD]            = LUSTRE_EOWNERDEAD,
        [ENOTRECOVERABLE]       = LUSTRE_ENOTRECOVERABLE,
-#ifdef __KERNEL__
        [ERESTARTSYS]           = LUSTRE_ERESTARTSYS,
        [ERESTARTNOINTR]        = LUSTRE_ERESTARTNOINTR,
        [ERESTARTNOHAND]        = LUSTRE_ERESTARTNOHAND,
        [ERESTARTSYS]           = LUSTRE_ERESTARTSYS,
        [ERESTARTNOINTR]        = LUSTRE_ERESTARTNOINTR,
        [ERESTARTNOHAND]        = LUSTRE_ERESTARTNOHAND,
@@ -188,7 +187,6 @@ static int lustre_errno_hton_mapping[] = {
        [EJUKEBOX]              = LUSTRE_EJUKEBOX,
        [EIOCBQUEUED]           = LUSTRE_EIOCBQUEUED,
        [EIOCBRETRY]            = LUSTRE_EIOCBRETRY
        [EJUKEBOX]              = LUSTRE_EJUKEBOX,
        [EIOCBQUEUED]           = LUSTRE_EIOCBQUEUED,
        [EIOCBRETRY]            = LUSTRE_EIOCBRETRY
-#endif
 };
 
 static int lustre_errno_ntoh_mapping[] = {
 };
 
 static int lustre_errno_ntoh_mapping[] = {
@@ -321,7 +319,6 @@ static int lustre_errno_ntoh_mapping[] = {
        [LUSTRE_EKEYREJECTED]           = EKEYREJECTED,
        [LUSTRE_EOWNERDEAD]             = EOWNERDEAD,
        [LUSTRE_ENOTRECOVERABLE]        = ENOTRECOVERABLE,
        [LUSTRE_EKEYREJECTED]           = EKEYREJECTED,
        [LUSTRE_EOWNERDEAD]             = EOWNERDEAD,
        [LUSTRE_ENOTRECOVERABLE]        = ENOTRECOVERABLE,
-#ifdef __KERNEL__
        [LUSTRE_ERESTARTSYS]            = ERESTARTSYS,
        [LUSTRE_ERESTARTNOINTR]         = ERESTARTNOINTR,
        [LUSTRE_ERESTARTNOHAND]         = ERESTARTNOHAND,
        [LUSTRE_ERESTARTSYS]            = ERESTARTSYS,
        [LUSTRE_ERESTARTNOINTR]         = ERESTARTNOINTR,
        [LUSTRE_ERESTARTNOHAND]         = ERESTARTNOHAND,
@@ -337,7 +334,6 @@ static int lustre_errno_ntoh_mapping[] = {
        [LUSTRE_EJUKEBOX]               = EJUKEBOX,
        [LUSTRE_EIOCBQUEUED]            = EIOCBQUEUED,
        [LUSTRE_EIOCBRETRY]             = EIOCBRETRY
        [LUSTRE_EJUKEBOX]               = EJUKEBOX,
        [LUSTRE_EIOCBQUEUED]            = EIOCBQUEUED,
        [LUSTRE_EIOCBRETRY]             = EIOCBRETRY
-#endif
 };
 
 unsigned int lustre_errno_hton(unsigned int h)
 };
 
 unsigned int lustre_errno_hton(unsigned int h)
index 96e68d4..cd3fecb 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_RPC
 
 
 #define DEBUG_SUBSYSTEM S_RPC
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#else
-# include <libcfs/libcfs.h>
-# ifdef __mips64__
-#  include <linux/kernel.h>
-# endif
-#endif
-
+#include <libcfs/libcfs.h>
+#include <linux/kernel.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre_sec.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre_sec.h>
@@ -594,11 +587,7 @@ lnet_pid_t ptl_get_pid(void)
 {
         lnet_pid_t        pid;
 
 {
         lnet_pid_t        pid;
 
-#ifndef  __KERNEL__
-        pid = getpid();
-#else
         pid = LUSTRE_SRV_LNET_PID;
         pid = LUSTRE_SRV_LNET_PID;
-#endif
         return pid;
 }
 
         return pid;
 }
 
@@ -619,18 +608,11 @@ int ptlrpc_ni_init(void)
 
         /* CAVEAT EMPTOR: how we process portals events is _radically_
          * different depending on... */
 
         /* CAVEAT EMPTOR: how we process portals events is _radically_
          * different depending on... */
-#ifdef __KERNEL__
        /* kernel LNet calls our master callback when there are new event,
         * because we are guaranteed to get every event via callback,
         * so we just set EQ size to 0 to avoid overhread of serializing
         * enqueue/dequeue operations in LNet. */
        rc = LNetEQAlloc(0, ptlrpc_master_callback, &ptlrpc_eq_h);
        /* kernel LNet calls our master callback when there are new event,
         * because we are guaranteed to get every event via callback,
         * so we just set EQ size to 0 to avoid overhread of serializing
         * enqueue/dequeue operations in LNet. */
        rc = LNetEQAlloc(0, ptlrpc_master_callback, &ptlrpc_eq_h);
-#else
-        /* liblustre calls the master callback when it removes events from the
-         * event queue.  The event queue has to be big enough not to drop
-         * anything */
-        rc = LNetEQAlloc(10240, LNET_EQ_HANDLER_NONE, &ptlrpc_eq_h);
-#endif
         if (rc == 0)
                 return 0;
 
         if (rc == 0)
                 return 0;
 
@@ -640,163 +622,6 @@ int ptlrpc_ni_init(void)
        return rc;
 }
 
        return rc;
 }
 
-#ifndef __KERNEL__
-struct list_head liblustre_wait_callbacks;
-struct list_head liblustre_idle_callbacks;
-void *liblustre_services_callback;
-
-void *
-liblustre_register_waitidle_callback(struct list_head *callback_list,
-                                    const char *name,
-                                    int (*fn)(void *arg), void *arg)
-{
-        struct liblustre_wait_callback *llwc;
-
-        OBD_ALLOC(llwc, sizeof(*llwc));
-        LASSERT (llwc != NULL);
-
-        llwc->llwc_name = name;
-        llwc->llwc_fn = fn;
-        llwc->llwc_arg = arg;
-       list_add_tail(&llwc->llwc_list, callback_list);
-
-        return (llwc);
-}
-
-void
-liblustre_deregister_waitidle_callback (void *opaque)
-{
-       struct liblustre_wait_callback *llwc = opaque;
-
-       list_del(&llwc->llwc_list);
-       OBD_FREE(llwc, sizeof(*llwc));
-}
-
-void *
-liblustre_register_wait_callback (const char *name,
-                                  int (*fn)(void *arg), void *arg)
-{
-        return liblustre_register_waitidle_callback(&liblustre_wait_callbacks,
-                                                    name, fn, arg);
-}
-
-void
-liblustre_deregister_wait_callback (void *opaque)
-{
-        liblustre_deregister_waitidle_callback(opaque);
-}
-
-void *
-liblustre_register_idle_callback (const char *name,
-                                  int (*fn)(void *arg), void *arg)
-{
-        return liblustre_register_waitidle_callback(&liblustre_idle_callbacks,
-                                                    name, fn, arg);
-}
-
-void
-liblustre_deregister_idle_callback (void *opaque)
-{
-        liblustre_deregister_waitidle_callback(opaque);
-}
-
-int
-liblustre_check_events (int timeout)
-{
-        lnet_event_t ev;
-        int         rc;
-        int         i;
-        ENTRY;
-
-        rc = LNetEQPoll(&ptlrpc_eq_h, 1, timeout * 1000, &ev, &i);
-        if (rc == 0)
-                RETURN(0);
-
-        LASSERT (rc == -EOVERFLOW || rc == 1);
-
-        /* liblustre: no asynch callback so we can't afford to miss any
-         * events... */
-        if (rc == -EOVERFLOW) {
-                CERROR ("Dropped an event!!!\n");
-                abort();
-        }
-
-        ptlrpc_master_callback (&ev);
-        RETURN(1);
-}
-
-int liblustre_waiting = 0;
-
-int
-liblustre_wait_event (int timeout)
-{
-       struct list_head                     *tmp;
-        struct liblustre_wait_callback *llwc;
-        int                             found_something = 0;
-
-        /* single threaded recursion check... */
-        liblustre_waiting = 1;
-
-        for (;;) {
-                /* Deal with all pending events */
-                while (liblustre_check_events(0))
-                        found_something = 1;
-
-                /* Give all registered callbacks a bite at the cherry */
-               list_for_each(tmp, &liblustre_wait_callbacks) {
-                       llwc = list_entry(tmp,
-                                              struct liblustre_wait_callback,
-                                              llwc_list);
-
-                        if (llwc->llwc_fn(llwc->llwc_arg))
-                                found_something = 1;
-                }
-
-                if (found_something || timeout == 0)
-                        break;
-
-                /* Nothing so far, but I'm allowed to block... */
-                found_something = liblustre_check_events(timeout);
-                if (!found_something)           /* still nothing */
-                        break;                  /* I timed out */
-        }
-
-        liblustre_waiting = 0;
-
-        return found_something;
-}
-
-void
-liblustre_wait_idle(void)
-{
-        static int recursed = 0;
-       struct list_head                *tmp;
-       struct liblustre_wait_callback  *llwc;
-       int                              idle = 0;
-
-        LASSERT(!recursed);
-        recursed = 1;
-
-        do {
-                liblustre_wait_event(0);
-
-                idle = 1;
-
-               list_for_each(tmp, &liblustre_idle_callbacks) {
-                       llwc = list_entry(tmp, struct liblustre_wait_callback,
-                                         llwc_list);
-                        if (!llwc->llwc_fn(llwc->llwc_arg)) {
-                                idle = 0;
-                                break;
-                        }
-                }
-
-        } while (!idle);
-
-        recursed = 0;
-}
-
-#endif /* __KERNEL__ */
 
 int ptlrpc_init_portals(void)
 {
 
 int ptlrpc_init_portals(void)
 {
@@ -806,33 +631,17 @@ int ptlrpc_init_portals(void)
                 CERROR("network initialisation failed\n");
                return rc;
         }
                 CERROR("network initialisation failed\n");
                return rc;
         }
-#ifndef __KERNEL__
-       INIT_LIST_HEAD(&liblustre_wait_callbacks);
-       INIT_LIST_HEAD(&liblustre_idle_callbacks);
-
-        liblustre_services_callback =
-                liblustre_register_wait_callback("liblustre_check_services",
-                                                 &liblustre_check_services,
-                                                 NULL);
-       init_completion_module(liblustre_wait_event);
-#endif
         rc = ptlrpcd_addref();
         if (rc == 0)
                 return 0;
 
         CERROR("rpcd initialisation failed\n");
         rc = ptlrpcd_addref();
         if (rc == 0)
                 return 0;
 
         CERROR("rpcd initialisation failed\n");
-#ifndef __KERNEL__
-        liblustre_deregister_wait_callback(liblustre_services_callback);
-#endif
         ptlrpc_ni_fini();
         return rc;
 }
 
 void ptlrpc_exit_portals(void)
 {
         ptlrpc_ni_fini();
         return rc;
 }
 
 void ptlrpc_exit_portals(void)
 {
-#ifndef __KERNEL__
-        liblustre_deregister_wait_callback(liblustre_services_callback);
-#endif
         ptlrpcd_decref();
         ptlrpc_ni_fini();
 }
         ptlrpcd_decref();
         ptlrpc_ni_fini();
 }
index edc5928..1f0c06e 100644 (file)
@@ -37,7 +37,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -45,9 +44,6 @@
 #include <linux/fs.h>
 #include <linux/mutex.h>
 #include <linux/crypto.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
 #include <linux/crypto.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 35250c0..cb0695d 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/dcache.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/dcache.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 0c05df4..3c4e63b 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 3e943c0..e6ade3b 100644 (file)
@@ -39,7 +39,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -51,9 +50,6 @@
 #include <linux/key-type.h>
 #include <linux/mutex.h>
 #include <asm/atomic.h>
 #include <linux/key-type.h>
 #include <linux/mutex.h>
 #include <asm/atomic.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index e79ffdd..d286a71 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/crypto.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/crypto.h>
 #include <linux/mutex.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 608aa8c..8306b21 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/mutex.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index cdb120d..3021d7d 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/crypto.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/crypto.h>
 #include <linux/mutex.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index ed854b2..e532572 100644 (file)
@@ -47,7 +47,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -58,9 +57,6 @@
 #include <asm/atomic.h>
 struct rpc_clnt; /* for rpc_pipefs */
 #include <linux/sunrpc/rpc_pipe_fs.h>
 #include <asm/atomic.h>
 struct rpc_clnt; /* for rpc_pipefs */
 #include <linux/sunrpc/rpc_pipe_fs.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 590a839..df31b18 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/crypto.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/crypto.h>
 #include <linux/mutex.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 3e60767..44e91da 100644 (file)
@@ -48,7 +48,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -56,9 +55,6 @@
 #include <linux/hash.h>
 #include <linux/mutex.h>
 #include <linux/sunrpc/cache.h>
 #include <linux/hash.h>
 #include <linux/mutex.h>
 #include <linux/sunrpc/cache.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 06f219e..d05d35b 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/dcache.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/dcache.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index ccd5ff7..e337689 100644 (file)
@@ -47,7 +47,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
-#ifdef __KERNEL__
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
@@ -55,9 +54,6 @@
 #include <linux/fs.h>
 #include <linux/mutex.h>
 #include <asm/atomic.h>
 #include <linux/fs.h>
 #include <linux/mutex.h>
 #include <asm/atomic.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
index 901af6f..ae43f74 100644 (file)
@@ -39,9 +39,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <lustre_ha.h>
 
 #include <obd_support.h>
 #include <lustre_ha.h>
@@ -720,9 +717,6 @@ int ptlrpc_connect_import(struct obd_import *imp)
         request->rq_timeout = INITIAL_CONNECT_TIMEOUT;
         lustre_msg_set_timeout(request->rq_reqmsg, request->rq_timeout);
 
         request->rq_timeout = INITIAL_CONNECT_TIMEOUT;
         lustre_msg_set_timeout(request->rq_reqmsg, request->rq_timeout);
 
-#ifndef __KERNEL__
-        lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_LIBCLIENT);
-#endif
         lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_NEXT_VER);
 
         request->rq_no_resend = request->rq_no_delay = 1;
         lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_NEXT_VER);
 
         request->rq_no_resend = request->rq_no_delay = 1;
@@ -767,7 +761,6 @@ EXPORT_SYMBOL(ptlrpc_connect_import);
 
 static void ptlrpc_maybe_ping_import_soon(struct obd_import *imp)
 {
 
 static void ptlrpc_maybe_ping_import_soon(struct obd_import *imp)
 {
-#ifdef __KERNEL__
        int force_verify;
 
        spin_lock(&imp->imp_lock);
        int force_verify;
 
        spin_lock(&imp->imp_lock);
@@ -776,10 +769,6 @@ static void ptlrpc_maybe_ping_import_soon(struct obd_import *imp)
 
        if (force_verify)
                ptlrpc_pinger_wake_up();
 
        if (force_verify)
                ptlrpc_pinger_wake_up();
-#else
-        /* liblustre has no pinger thread, so we wakeup pinger anyway */
-       ptlrpc_pinger_wake_up();
-#endif
 }
 
 static int ptlrpc_busy_reconnect(int rc)
 }
 
 static int ptlrpc_busy_reconnect(int rc)
@@ -1069,13 +1058,8 @@ finish:
                           of macro arguments */
                        const char *older = "older than client. "
                                            "Consider upgrading server";
                           of macro arguments */
                        const char *older = "older than client. "
                                            "Consider upgrading server";
-#ifdef __KERNEL__
                        const char *newer = "newer than client. "
                                            "Consider recompiling application";
                        const char *newer = "newer than client. "
                                            "Consider recompiling application";
-#else
-                       const char *newer = "newer than client. "
-                                           "Consider upgrading client";
-#endif
 
                        LCONSOLE_WARN("Server %s version (%d.%d.%d.%d) "
                                      "is much %s (%s)\n",
 
                        LCONSOLE_WARN("Server %s version (%d.%d.%d.%d) "
                                      "is much %s (%s)\n",
@@ -1304,7 +1288,6 @@ static int signal_completed_replay(struct obd_import *imp)
        RETURN(0);
 }
 
        RETURN(0);
 }
 
-#ifdef __KERNEL__
 /**
  * In kernel code all import invalidation happens in its own
  * separate thread, so that whatever application happened to encounter
 /**
  * In kernel code all import invalidation happens in its own
  * separate thread, so that whatever application happened to encounter
@@ -1335,7 +1318,6 @@ static int ptlrpc_invalidate_import_thread(void *data)
         class_import_put(imp);
         RETURN(0);
 }
         class_import_put(imp);
         RETURN(0);
 }
-#endif
 
 /**
  * This is the state machine for client-side recovery on import.
 
 /**
  * This is the state machine for client-side recovery on import.
@@ -1385,7 +1367,6 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)
                imp->imp_vbr_failed = 0;
                spin_unlock(&imp->imp_lock);
 
                imp->imp_vbr_failed = 0;
                spin_unlock(&imp->imp_lock);
 
-#ifdef __KERNEL__
                {
                struct task_struct *task;
                /* bug 17802:  XXX client_disconnect_export vs connect request
                {
                struct task_struct *task;
                /* bug 17802:  XXX client_disconnect_export vs connect request
@@ -1404,11 +1385,6 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp)
                }
                RETURN(rc);
                }
                }
                RETURN(rc);
                }
-#else
-                ptlrpc_invalidate_import(imp);
-
-                IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER);
-#endif
         }
 
        if (imp->imp_state == LUSTRE_IMP_REPLAY) {
         }
 
        if (imp->imp_state == LUSTRE_IMP_REPLAY) {
index 4ecd9b5..6bfc1d2 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_RPC
 
 
 #define DEBUG_SUBSYSTEM S_RPC
 
-#ifdef __KERNEL__
 #include <linux/module.h>
 #include <linux/module.h>
-#else
-# include <liblustre.h>
-#endif
 
 /* LUSTRE_VERSION_CODE */
 #include <lustre_ver.h>
 
 /* LUSTRE_VERSION_CODE */
 #include <lustre_ver.h>
index cad3e24..2a30db5 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LOG
 
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifdef __KERNEL__
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs.h>
-#else
-#include <liblustre.h>
-#endif
 
 #include <obd_class.h>
 #include <lustre_log.h>
 
 #include <obd_class.h>
 #include <lustre_log.h>
index abb99ce..2b09b8d 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LOG
 
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifdef __KERNEL__
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs.h>
-#else
-#include <liblustre.h>
-#endif
 #include <obd_class.h>
 #include <lustre_log.h>
 
 #include <obd_class.h>
 #include <lustre_log.h>
 
index b4d81c3..1371aa7 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LOG
 
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
-
 #include <obd_class.h>
 #include <lu_target.h>
 #include <lustre_log.h>
 #include <lustre_net.h>
 
 #include <obd_class.h>
 #include <lu_target.h>
 #include <lustre_log.h>
 #include <lustre_net.h>
 
-#if defined(__KERNEL__) && defined(LUSTRE_LOG_SERVER)
 static int llog_origin_close(const struct lu_env *env, struct llog_handle *lgh)
 {
        if (lgh->lgh_hdr != NULL && lgh->lgh_hdr->llh_flags & LLOG_F_IS_CAT)
 static int llog_origin_close(const struct lu_env *env, struct llog_handle *lgh)
 {
        if (lgh->lgh_hdr != NULL && lgh->lgh_hdr->llh_flags & LLOG_F_IS_CAT)
@@ -350,38 +345,3 @@ int llog_origin_handle_close(struct ptlrpc_request *req)
        RETURN(0);
 }
 EXPORT_SYMBOL(llog_origin_handle_close);
        RETURN(0);
 }
 EXPORT_SYMBOL(llog_origin_handle_close);
-
-#else /* !__KERNEL__ */
-int llog_origin_handle_open(struct ptlrpc_request *req)
-{
-        LBUG();
-        return 0;
-}
-
-int llog_origin_handle_destroy(struct ptlrpc_request *req)
-{
-        LBUG();
-        return 0;
-}
-
-int llog_origin_handle_next_block(struct ptlrpc_request *req)
-{
-        LBUG();
-        return 0;
-}
-int llog_origin_handle_prev_block(struct ptlrpc_request *req)
-{
-        LBUG();
-        return 0;
-}
-int llog_origin_handle_read_header(struct ptlrpc_request *req)
-{
-        LBUG();
-        return 0;
-}
-int llog_origin_handle_close(struct ptlrpc_request *req)
-{
-        LBUG();
-        return 0;
-}
-#endif
index ce9f1df..2ce646b 100644 (file)
@@ -35,9 +35,6 @@
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <obd.h>
 
 #include <obd_support.h>
 #include <obd.h>
index c1b99c9..dedb574 100644 (file)
@@ -35,9 +35,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_support.h>
 #include <lustre_net.h>
 #include <lustre_lib.h>
 #include <obd_support.h>
 #include <lustre_net.h>
 #include <lustre_lib.h>
@@ -458,12 +455,10 @@ int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
                 RETURN(0);
 
         for (;;) {
                 RETURN(0);
 
         for (;;) {
-#ifdef __KERNEL__
                /* The wq argument is ignored by user-space wait_event macros */
                wait_queue_head_t *wq = (req->rq_set != NULL) ?
                                        &req->rq_set->set_waitq :
                                        &req->rq_reply_waitq;
                /* The wq argument is ignored by user-space wait_event macros */
                wait_queue_head_t *wq = (req->rq_set != NULL) ?
                                        &req->rq_set->set_waitq :
                                        &req->rq_reply_waitq;
-#endif
                 /* Network access will complete in finite time but the HUGE
                  * timeout lets us CWARN for visibility of sluggish NALs */
                 lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
                 /* Network access will complete in finite time but the HUGE
                  * timeout lets us CWARN for visibility of sluggish NALs */
                 lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
index a2df45d..3164f5b 100644 (file)
@@ -40,9 +40,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
@@ -1762,14 +1759,14 @@ out:
 
 /* ptlrpc/nrs_fifo.c */
 extern struct ptlrpc_nrs_pol_conf nrs_conf_fifo;
 
 /* ptlrpc/nrs_fifo.c */
 extern struct ptlrpc_nrs_pol_conf nrs_conf_fifo;
-#if defined HAVE_SERVER_SUPPORT && defined(__KERNEL__)
+#ifdef HAVE_SERVER_SUPPORT
 /* ptlrpc/nrs_crr.c */
 extern struct ptlrpc_nrs_pol_conf nrs_conf_crrn;
 /* ptlrpc/nrs_orr.c */
 extern struct ptlrpc_nrs_pol_conf nrs_conf_orr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_trr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_tbf;
 /* ptlrpc/nrs_crr.c */
 extern struct ptlrpc_nrs_pol_conf nrs_conf_crrn;
 /* ptlrpc/nrs_orr.c */
 extern struct ptlrpc_nrs_pol_conf nrs_conf_orr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_trr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_tbf;
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
 
 /**
  * Adds all policies that ship with the ptlrpc module, to NRS core's list of
 
 /**
  * Adds all policies that ship with the ptlrpc module, to NRS core's list of
@@ -1790,7 +1787,7 @@ int ptlrpc_nrs_init(void)
        if (rc != 0)
                GOTO(fail, rc);
 
        if (rc != 0)
                GOTO(fail, rc);
 
-#if defined HAVE_SERVER_SUPPORT && defined(__KERNEL__)
+#ifdef HAVE_SERVER_SUPPORT
        rc = ptlrpc_nrs_policy_register(&nrs_conf_crrn);
        if (rc != 0)
                GOTO(fail, rc);
        rc = ptlrpc_nrs_policy_register(&nrs_conf_crrn);
        if (rc != 0)
                GOTO(fail, rc);
@@ -1805,7 +1802,7 @@ int ptlrpc_nrs_init(void)
        rc = ptlrpc_nrs_policy_register(&nrs_conf_tbf);
        if (rc != 0)
                GOTO(fail, rc);
        rc = ptlrpc_nrs_policy_register(&nrs_conf_tbf);
        if (rc != 0)
                GOTO(fail, rc);
-#endif
+#endif /* HAVE_SERVER_SUPPORT */
 
        RETURN(rc);
 fail:
 
        RETURN(rc);
 fail:
index 1d3259d..bf16216 100644 (file)
@@ -41,9 +41,6 @@
 #ifdef HAVE_SERVER_SUPPORT
 
 #define DEBUG_SUBSYSTEM S_RPC
 #ifdef HAVE_SERVER_SUPPORT
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
index f407866..6b156da 100644 (file)
@@ -47,9 +47,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_support.h>
 #include <obd_class.h>
 #include <libcfs/libcfs.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <libcfs/libcfs.h>
index 63c7b38..3cad160 100644 (file)
@@ -38,9 +38,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_support.h>
 #include <obd_class.h>
 #include <libcfs/libcfs.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <libcfs/libcfs.h>
index 0383616..82cebfd 100644 (file)
@@ -43,9 +43,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <libcfs/libcfs.h>
 
 
 #include <libcfs/libcfs.h>
 
index 97b7bf4..4606bdf 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <errno.h>
-#include <signal.h>
-#include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
@@ -47,7 +42,6 @@
 
 #include "ptlrpc_internal.h"
 
 
 #include "ptlrpc_internal.h"
 
-#ifdef __KERNEL__
 
 void ptlrpc_fill_bulk_md(lnet_md_t *md, struct ptlrpc_bulk_desc *desc,
                         int mdidx)
 
 void ptlrpc_fill_bulk_md(lnet_md_t *md, struct ptlrpc_bulk_desc *desc,
                         int mdidx)
@@ -80,53 +74,3 @@ void ptlrpc_add_bulk_page(struct ptlrpc_bulk_desc *desc, struct page *page,
         desc->bd_iov_count++;
 }
 
         desc->bd_iov_count++;
 }
 
-#else /* !__KERNEL__ */
-
-void ptlrpc_fill_bulk_md(lnet_md_t *md, struct ptlrpc_bulk_desc *desc,
-                        int mdidx)
-{
-       LASSERT(mdidx < desc->bd_md_max_brw);
-       LASSERT(desc->bd_iov_count > mdidx * LNET_MAX_IOV);
-       LASSERT(!(md->options & (LNET_MD_IOVEC | LNET_MD_KIOV | LNET_MD_PHYS)));
-
-       if (desc->bd_iov_count == 1) {
-               md->start = desc->bd_iov[0].iov_base;
-               md->length = desc->bd_iov[0].iov_len;
-               return;
-       }
-
-       md->options |= LNET_MD_IOVEC;
-       md->start = &desc->bd_iov[mdidx * LNET_MAX_IOV];
-       md->length = min(LNET_MAX_IOV, desc->bd_iov_count - mdidx *
-                                      LNET_MAX_IOV);
-}
-
-static int can_merge_iovs(lnet_md_iovec_t *existing, lnet_md_iovec_t *candidate)
-{
-        if (existing->iov_base + existing->iov_len == candidate->iov_base)
-                return 1;
-#if 0
-        /* Enable this section to provide earlier evidence of fragmented bulk */
-        CERROR("Can't merge iovs %p for %x, %p for %x\n",
-               existing->iov_base, existing->iov_len,
-               candidate->iov_base, candidate->iov_len);
-#endif
-        return 0;
-}
-
-void ptlrpc_add_bulk_page(struct ptlrpc_bulk_desc *desc, struct page *page,
-                          int pageoffset, int len)
-{
-        lnet_md_iovec_t *iov = &desc->bd_iov[desc->bd_iov_count];
-
-        iov->iov_base = page->addr + pageoffset;
-        iov->iov_len = len;
-
-        if (desc->bd_iov_count > 0 && can_merge_iovs(iov - 1, iov)) {
-                (iov - 1)->iov_len += len;
-        } else {
-                desc->bd_iov_count++;
-        }
-}
-
-#endif /* !__KERNEL__ */
index 59bf8eb..6cf7d66 100644 (file)
  * Portal-RPC reconnection and replay operations, for use in recovery.
  */
 
  * Portal-RPC reconnection and replay operations, for use in recovery.
  */
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#else
 #define DEBUG_SUBSYSTEM S_RPC
 #define DEBUG_SUBSYSTEM S_RPC
-#endif
 
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
@@ -169,7 +165,6 @@ cfs_duration_t pinger_check_timeout(cfs_time_t time)
                                          cfs_time_current());
 }
 
                                          cfs_time_current());
 }
 
-#ifdef __KERNEL__
 
 static bool ir_up;
 
 
 static bool ir_up;
 
@@ -716,299 +711,3 @@ void ping_evictor_stop(void)
        wake_up(&pet_waitq);
 }
 EXPORT_SYMBOL(ping_evictor_stop);
        wake_up(&pet_waitq);
 }
 EXPORT_SYMBOL(ping_evictor_stop);
-#else /* !__KERNEL__ */
-
-/* XXX
- * the current implementation of pinger in liblustre is not optimized
- */
-
-#ifdef ENABLE_PINGER
-static struct pinger_data {
-        int             pd_recursion;
-        cfs_time_t      pd_this_ping;   /* jiffies */
-        cfs_time_t      pd_next_ping;   /* jiffies */
-        struct ptlrpc_request_set *pd_set;
-} pinger_args;
-
-static int pinger_check_rpcs(void *arg)
-{
-        cfs_time_t curtime = cfs_time_current();
-        struct ptlrpc_request *req;
-        struct ptlrpc_request_set *set;
-       struct list_head *iter;
-        struct obd_import *imp;
-        struct pinger_data *pd = &pinger_args;
-        int rc;
-
-        /* prevent recursion */
-        if (pd->pd_recursion++) {
-                CDEBUG(D_HA, "pinger: recursion! quit\n");
-                LASSERT(pd->pd_set);
-                pd->pd_recursion--;
-                return 0;
-        }
-
-        /* have we reached ping point? */
-        if (!pd->pd_set && cfs_time_before(curtime, pd->pd_next_ping)) {
-                pd->pd_recursion--;
-                return 0;
-        }
-
-        /* if we have rpc_set already, continue processing it */
-        if (pd->pd_set) {
-                LASSERT(pd->pd_this_ping);
-                set = pd->pd_set;
-                goto do_check_set;
-        }
-
-        pd->pd_this_ping = curtime;
-        pd->pd_set = ptlrpc_prep_set();
-        if (pd->pd_set == NULL)
-                goto out;
-        set = pd->pd_set;
-
-        /* add rpcs into set */
-       mutex_lock(&pinger_mutex);
-       list_for_each(iter, &pinger_imports) {
-               struct obd_import *imp = list_entry(iter, struct obd_import,
-                                                        imp_pinger_chain);
-                int generation, level;
-
-                if (cfs_time_aftereq(pd->pd_this_ping,
-                                     imp->imp_next_ping - 5 * CFS_TICK)) {
-                        /* Add a ping. */
-                       spin_lock(&imp->imp_lock);
-                       generation = imp->imp_generation;
-                       level = imp->imp_state;
-                       spin_unlock(&imp->imp_lock);
-
-                        if (level != LUSTRE_IMP_FULL) {
-                                CDEBUG(D_HA,
-                                       "not pinging %s (in recovery)\n",
-                                       obd2cli_tgt(imp->imp_obd));
-                                continue;
-                        }
-
-                        req = ptlrpc_request_alloc_pack(imp, &RQF_OBD_PING,
-                                                        LUSTRE_OBD_VERSION,
-                                                        OBD_PING);
-                        if (req == NULL) {
-                                CERROR("OOM trying to ping %s->%s\n",
-                                       imp->imp_obd->obd_uuid.uuid,
-                                       obd2cli_tgt(imp->imp_obd));
-                                break;
-                        }
-
-                        req->rq_no_resend = 1;
-                        ptlrpc_request_set_replen(req);
-                        req->rq_send_state = LUSTRE_IMP_FULL;
-                        ptlrpc_rqphase_move(req, RQ_PHASE_RPC);
-                        req->rq_import_generation = generation;
-                        ptlrpc_set_add_req(set, req);
-                } else {
-                        CDEBUG(D_INFO, "don't need to ping %s ("CFS_TIME_T
-                               " > "CFS_TIME_T")\n", obd2cli_tgt(imp->imp_obd),
-                               imp->imp_next_ping, pd->pd_this_ping);
-                }
-        }
-        pd->pd_this_ping = curtime;
-       mutex_unlock(&pinger_mutex);
-
-       /* Might be empty, that's OK. */
-       if (atomic_read(&set->set_remaining) == 0)
-               CDEBUG(D_RPCTRACE, "nothing to ping\n");
-
-       list_for_each(iter, &set->set_requests) {
-               struct ptlrpc_request *req =
-                       list_entry(iter, struct ptlrpc_request,
-                                  rq_set_chain);
-               DEBUG_REQ(D_RPCTRACE, req, "pinging %s->%s",
-                         req->rq_import->imp_obd->obd_uuid.uuid,
-                         obd2cli_tgt(req->rq_import->imp_obd));
-               (void)ptl_send_rpc(req, 0);
-       }
-
-do_check_set:
-        rc = ptlrpc_check_set(NULL, set);
-
-        /* not finished, and we are not expired, simply return */
-        if (!rc && cfs_time_before(curtime, cfs_time_add(pd->pd_this_ping,
-                                            cfs_time_seconds(PING_INTERVAL)))) {
-                CDEBUG(D_RPCTRACE, "not finished, but also not expired\n");
-                pd->pd_recursion--;
-                return 0;
-        }
-
-       /* Expire all the requests that didn't come back. */
-       mutex_lock(&pinger_mutex);
-       list_for_each(iter, &set->set_requests) {
-               req = list_entry(iter, struct ptlrpc_request,
-                                rq_set_chain);
-
-                if (req->rq_phase == RQ_PHASE_COMPLETE)
-                        continue;
-
-                CDEBUG(D_RPCTRACE, "Pinger initiate expire request(%p)\n",
-                       req);
-
-                /* This will also unregister reply. */
-                ptlrpc_expire_one_request(req, 0);
-
-               /* We're done with this req, let's finally move it to complete
-                * phase and take care of inflights. */
-               ptlrpc_rqphase_move(req, RQ_PHASE_COMPLETE);
-               imp = req->rq_import;
-               spin_lock(&imp->imp_lock);
-               if (!list_empty(&req->rq_list)) {
-                       list_del_init(&req->rq_list);
-                       atomic_dec(&imp->imp_inflight);
-               }
-               spin_unlock(&imp->imp_lock);
-               atomic_dec(&set->set_remaining);
-       }
-       mutex_unlock(&pinger_mutex);
-
-        ptlrpc_set_destroy(set);
-        pd->pd_set = NULL;
-
-out:
-        pd->pd_next_ping = cfs_time_add(pd->pd_this_ping,
-                                        cfs_time_seconds(PING_INTERVAL));
-        pd->pd_this_ping = 0; /* XXX for debug */
-
-        CDEBUG(D_INFO, "finished a round ping\n");
-        pd->pd_recursion--;
-        return 0;
-}
-
-static void *pinger_callback = NULL;
-#endif /* ENABLE_PINGER */
-
-int ptlrpc_start_pinger(void)
-{
-#ifdef ENABLE_PINGER
-        memset(&pinger_args, 0, sizeof(pinger_args));
-        pinger_callback = liblustre_register_wait_callback("pinger_check_rpcs",
-                                                           &pinger_check_rpcs,
-                                                           &pinger_args);
-#endif
-        return 0;
-}
-
-int ptlrpc_stop_pinger(void)
-{
-#ifdef ENABLE_PINGER
-        if (pinger_callback)
-                liblustre_deregister_wait_callback(pinger_callback);
-#endif
-        return 0;
-}
-
-void ptlrpc_pinger_sending_on_import(struct obd_import *imp)
-{
-#ifdef ENABLE_PINGER
-       mutex_lock(&pinger_mutex);
-        ptlrpc_update_next_ping(imp, 0);
-        if (pinger_args.pd_set == NULL &&
-            cfs_time_before(imp->imp_next_ping, pinger_args.pd_next_ping)) {
-                CDEBUG(D_HA, "set next ping to "CFS_TIME_T"(cur "CFS_TIME_T")\n",
-                        imp->imp_next_ping, cfs_time_current());
-                pinger_args.pd_next_ping = imp->imp_next_ping;
-        }
-       mutex_unlock(&pinger_mutex);
-#endif
-}
-
-void ptlrpc_pinger_commit_expected(struct obd_import *imp)
-{
-#ifdef ENABLE_PINGER
-       mutex_lock(&pinger_mutex);
-        ptlrpc_update_next_ping(imp, 1);
-        if (pinger_args.pd_set == NULL &&
-            cfs_time_before(imp->imp_next_ping, pinger_args.pd_next_ping)) {
-                CDEBUG(D_HA,"set next ping to "CFS_TIME_T"(cur "CFS_TIME_T")\n",
-                        imp->imp_next_ping, cfs_time_current());
-                pinger_args.pd_next_ping = imp->imp_next_ping;
-        }
-       mutex_unlock(&pinger_mutex);
-#endif
-}
-
-int ptlrpc_add_timeout_client(int time, enum timeout_event event,
-                             timeout_cb_t cb, void *data,
-                             struct list_head *obd_list)
-{
-       return 0;
-}
-
-int ptlrpc_del_timeout_client(struct list_head *obd_list,
-                             enum timeout_event event)
-{
-       return 0;
-}
-
-int ptlrpc_pinger_add_import(struct obd_import *imp)
-{
-       ENTRY;
-
-       if (!list_empty(&imp->imp_pinger_chain))
-               RETURN(-EALREADY);
-
-       CDEBUG(D_HA, "adding pingable import %s->%s\n",
-              imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
-       ptlrpc_pinger_sending_on_import(imp);
-
-       mutex_lock(&pinger_mutex);
-       list_add_tail(&imp->imp_pinger_chain, &pinger_imports);
-       class_import_get(imp);
-       mutex_unlock(&pinger_mutex);
-
-       RETURN(0);
-}
-
-int ptlrpc_pinger_del_import(struct obd_import *imp)
-{
-       ENTRY;
-
-       if (list_empty(&imp->imp_pinger_chain))
-               RETURN(-ENOENT);
-
-       mutex_lock(&pinger_mutex);
-       list_del_init(&imp->imp_pinger_chain);
-       CDEBUG(D_HA, "removing pingable import %s->%s\n",
-              imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
-       class_import_put(imp);
-       mutex_unlock(&pinger_mutex);
-       RETURN(0);
-}
-
-void ptlrpc_pinger_wake_up()
-{
-#ifdef ENABLE_PINGER
-        /* XXX force pinger to run, if needed */
-        struct obd_import *imp;
-        ENTRY;
-       list_for_each_entry(imp, &pinger_imports, imp_pinger_chain) {
-                CDEBUG(D_RPCTRACE, "checking import %s->%s\n",
-                       imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd));
-#ifdef ENABLE_LIBLUSTRE_RECOVERY
-                if (imp->imp_state == LUSTRE_IMP_DISCON &&
-                    !imp_is_deactive(imp))
-#else
-                /*XXX only recover for the initial connection */
-                if (!lustre_handle_is_used(&imp->imp_remote_handle) &&
-                    imp->imp_state == LUSTRE_IMP_DISCON &&
-                    !imp_is_deactive(imp))
-#endif
-                        ptlrpc_initiate_recovery(imp);
-                else if (imp->imp_state != LUSTRE_IMP_FULL)
-                        CDEBUG(D_HA, "Refused to recover import %s->%s "
-                                     "state %d, deactive %d\n",
-                                     imp->imp_obd->obd_uuid.uuid,
-                                     obd2cli_tgt(imp->imp_obd), imp->imp_state,
-                                     imp_is_deactive(imp));
-        }
-        EXIT;
-#endif
-}
-#endif /* !__KERNEL__ */
index 9d8bd46..76382c9 100644 (file)
@@ -247,11 +247,7 @@ void ptlrpc_pinger_sending_on_import(struct obd_import *imp);
 void ptlrpc_pinger_commit_expected(struct obd_import *imp);
 void ptlrpc_pinger_wake_up(void);
 void ptlrpc_ping_import_soon(struct obd_import *imp);
 void ptlrpc_pinger_commit_expected(struct obd_import *imp);
 void ptlrpc_pinger_wake_up(void);
 void ptlrpc_ping_import_soon(struct obd_import *imp);
-#ifdef __KERNEL__
 int ping_evictor_wake(struct obd_export *exp);
 int ping_evictor_wake(struct obd_export *exp);
-#else
-#define ping_evictor_wake(exp)     1
-#endif
 
 /* sec_null.c */
 int  sptlrpc_null_init(void);
 
 /* sec_null.c */
 int  sptlrpc_null_init(void);
@@ -297,10 +293,10 @@ static inline int ll_rpc_recoverable_error(int rc)
        return (rc == -ENOTCONN || rc == -ENODEV);
 }
 
        return (rc == -ENOTCONN || rc == -ENODEV);
 }
 
-#if defined HAVE_SERVER_SUPPORT && defined(__KERNEL__)
+#ifdef HAVE_SERVER_SUPPORT
 int tgt_mod_init(void);
 void tgt_mod_exit(void);
 int tgt_mod_init(void);
 void tgt_mod_exit(void);
-#else
+#else /* HAVE_SERVER_SUPPORT */
 static inline int tgt_mod_init(void)
 {
        return 0;
 static inline int tgt_mod_init(void)
 {
        return 0;
@@ -310,7 +306,7 @@ static inline void tgt_mod_exit(void)
 {
        return;
 }
 {
        return;
 }
-#endif
+#endif /* !HAVE_SERVER_SUPPORT */
 
 static inline void ptlrpc_reqset_put(struct ptlrpc_request_set *set)
 {
 
 static inline void ptlrpc_reqset_put(struct ptlrpc_request_set *set)
 {
index 8a9250d..7931e5d 100644 (file)
@@ -36,9 +36,6 @@
 
 #define DEBUG_SUBSYSTEM S_RPC
 
 
 #define DEBUG_SUBSYSTEM S_RPC
 
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
@@ -134,7 +131,6 @@ err_layout:
        return rc;
 }
 
        return rc;
 }
 
-#ifdef __KERNEL__
 static void __exit ptlrpc_exit(void)
 {
        ptlrpc_nrs_fini();
 static void __exit ptlrpc_exit(void)
 {
        ptlrpc_nrs_fini();
@@ -154,4 +150,3 @@ MODULE_DESCRIPTION("Lustre Request Processor and Lock Management");
 MODULE_LICENSE("GPL");
 
 cfs_module(ptlrpc, "1.0.0", ptlrpc_init, ptlrpc_exit);
 MODULE_LICENSE("GPL");
 
 cfs_module(ptlrpc, "1.0.0", ptlrpc_init, ptlrpc_exit);
-#endif
index a58f510..8f7fa9d 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_RPC
 
 
 #define DEBUG_SUBSYSTEM S_RPC
 
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else /* __KERNEL__ */
-# include <liblustre.h>
-# include <ctype.h>
-#endif
-
+#include <libcfs/libcfs.h>
 #include <lustre_net.h>
 #include <lustre_net.h>
-# include <lustre_lib.h>
-
+#include <lustre_lib.h>
 #include <lustre_ha.h>
 #include <obd_class.h>   /* for obd_zombie */
 #include <obd_support.h> /* for OBD_FAIL_CHECK */
 #include <lustre_ha.h>
 #include <obd_class.h>   /* for obd_zombie */
 #include <obd_support.h> /* for OBD_FAIL_CHECK */
@@ -81,7 +74,6 @@ struct ptlrpcd {
         struct ptlrpcd_ctl pd_threads[0];
 };
 
         struct ptlrpcd_ctl pd_threads[0];
 };
 
-#ifdef __KERNEL__
 static int max_ptlrpcds;
 CFS_MODULE_PARM(max_ptlrpcds, "i", int, 0644,
                 "Max ptlrpcd thread count to be started.");
 static int max_ptlrpcds;
 CFS_MODULE_PARM(max_ptlrpcds, "i", int, 0644,
                 "Max ptlrpcd thread count to be started.");
@@ -89,7 +81,6 @@ CFS_MODULE_PARM(max_ptlrpcds, "i", int, 0644,
 static int ptlrpcd_bind_policy = PDB_POLICY_PAIR;
 CFS_MODULE_PARM(ptlrpcd_bind_policy, "i", int, 0644,
                 "Ptlrpcd threads binding mode.");
 static int ptlrpcd_bind_policy = PDB_POLICY_PAIR;
 CFS_MODULE_PARM(ptlrpcd_bind_policy, "i", int, 0644,
                 "Ptlrpcd threads binding mode.");
-#endif
 static struct ptlrpcd *ptlrpcds;
 
 struct mutex ptlrpcd_mutex;
 static struct ptlrpcd *ptlrpcds;
 
 struct mutex ptlrpcd_mutex;
@@ -113,7 +104,6 @@ ptlrpcd_select_pc(struct ptlrpc_request *req, pdl_policy_t policy, int index)
         if (req != NULL && req->rq_send_state != LUSTRE_IMP_FULL)
                 return &ptlrpcds->pd_thread_rcv;
 
         if (req != NULL && req->rq_send_state != LUSTRE_IMP_FULL)
                 return &ptlrpcds->pd_thread_rcv;
 
-#ifdef __KERNEL__
        switch (policy) {
        case PDL_POLICY_SAME:
                idx = smp_processor_id() % ptlrpcds->pd_nthreads;
        switch (policy) {
        case PDL_POLICY_SAME:
                idx = smp_processor_id() % ptlrpcds->pd_nthreads;
@@ -144,7 +134,6 @@ ptlrpcd_select_pc(struct ptlrpc_request *req, pdl_policy_t policy, int index)
                 ptlrpcds->pd_index = idx;
                 break;
         }
                 ptlrpcds->pd_index = idx;
                 break;
         }
-#endif /* __KERNEL__ */
 
         return &ptlrpcds->pd_threads[idx];
 }
 
         return &ptlrpcds->pd_threads[idx];
 }
@@ -156,14 +145,12 @@ ptlrpcd_select_pc(struct ptlrpc_request *req, pdl_policy_t policy, int index)
 void ptlrpcd_add_rqset(struct ptlrpc_request_set *set)
 {
        struct list_head *tmp, *pos;
 void ptlrpcd_add_rqset(struct ptlrpc_request_set *set)
 {
        struct list_head *tmp, *pos;
-#ifdef __KERNEL__
         struct ptlrpcd_ctl *pc;
         struct ptlrpc_request_set *new;
         int count, i;
 
         pc = ptlrpcd_select_pc(NULL, PDL_POLICY_LOCAL, -1);
         new = pc->pc_set;
         struct ptlrpcd_ctl *pc;
         struct ptlrpc_request_set *new;
         int count, i;
 
         pc = ptlrpcd_select_pc(NULL, PDL_POLICY_LOCAL, -1);
         new = pc->pc_set;
-#endif
 
        list_for_each_safe(pos, tmp, &set->set_requests) {
                struct ptlrpc_request *req =
 
        list_for_each_safe(pos, tmp, &set->set_requests) {
                struct ptlrpc_request *req =
@@ -171,18 +158,10 @@ void ptlrpcd_add_rqset(struct ptlrpc_request_set *set)
                                   rq_set_chain);
 
                LASSERT(req->rq_phase == RQ_PHASE_NEW);
                                   rq_set_chain);
 
                LASSERT(req->rq_phase == RQ_PHASE_NEW);
-#ifdef __KERNEL__
                req->rq_set = new;
                req->rq_queued_time = cfs_time_current();
                req->rq_set = new;
                req->rq_queued_time = cfs_time_current();
-#else
-               list_del_init(&req->rq_set_chain);
-               req->rq_set = NULL;
-               ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
-               atomic_dec(&set->set_remaining);
-#endif
        }
 
        }
 
-#ifdef __KERNEL__
        spin_lock(&new->set_new_req_lock);
        list_splice_init(&set->set_requests, &new->set_new_requests);
        i = atomic_read(&set->set_remaining);
        spin_lock(&new->set_new_req_lock);
        list_splice_init(&set->set_requests, &new->set_new_requests);
        i = atomic_read(&set->set_remaining);
@@ -198,11 +177,9 @@ void ptlrpcd_add_rqset(struct ptlrpc_request_set *set)
                for (i = 0; i < pc->pc_npartners; i++)
                        wake_up(&pc->pc_partners[i]->pc_set->set_waitq);
        }
                for (i = 0; i < pc->pc_npartners; i++)
                        wake_up(&pc->pc_partners[i]->pc_set->set_waitq);
        }
-#endif
 }
 EXPORT_SYMBOL(ptlrpcd_add_rqset);
 
 }
 EXPORT_SYMBOL(ptlrpcd_add_rqset);
 
-#ifdef __KERNEL__
 /**
  * Return transferred RPCs count.
  */
 /**
  * Return transferred RPCs count.
  */
@@ -229,7 +206,6 @@ static int ptlrpcd_steal_rqset(struct ptlrpc_request_set *des,
        spin_unlock(&src->set_new_req_lock);
        return rc;
 }
        spin_unlock(&src->set_new_req_lock);
        return rc;
 }
-#endif
 
 /**
  * Requests that are added to the ptlrpcd queue are sent via
 
 /**
  * Requests that are added to the ptlrpcd queue are sent via
@@ -353,7 +329,6 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc)
                 */
                rc = atomic_read(&set->set_new_count);
 
                 */
                rc = atomic_read(&set->set_new_count);
 
-#ifdef __KERNEL__
                 /* If we have nothing to do, check whether we can take some
                  * work from our partner threads. */
                 if (rc == 0 && pc->pc_npartners > 0) {
                 /* If we have nothing to do, check whether we can take some
                  * work from our partner threads. */
                 if (rc == 0 && pc->pc_npartners > 0) {
@@ -389,13 +364,11 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc)
                                ptlrpc_reqset_put(ps);
                        } while (rc == 0 && pc->pc_cursor != first);
                }
                                ptlrpc_reqset_put(ps);
                        } while (rc == 0 && pc->pc_cursor != first);
                }
-#endif
        }
 
        RETURN(rc);
 }
 
        }
 
        RETURN(rc);
 }
 
-#ifdef __KERNEL__
 /**
  * Main ptlrpcd thread.
  * ptlrpc's code paths like to execute in process context, so we have this
 /**
  * Main ptlrpcd thread.
  * ptlrpc's code paths like to execute in process context, so we have this
@@ -630,52 +603,6 @@ static int ptlrpcd_bind(int index, int max)
         RETURN(rc);
 }
 
         RETURN(rc);
 }
 
-#else /* !__KERNEL__ */
-
-/**
- * In liblustre we do not have separate threads, so this function
- * is called from time to time all across common code to see
- * if something needs to be processed on ptlrpcd set.
- */
-int ptlrpcd_check_async_rpcs(void *arg)
-{
-        struct ptlrpcd_ctl *pc = arg;
-        int                 rc = 0;
-
-        /*
-         * Single threaded!!
-         */
-        pc->pc_recurred++;
-
-        if (pc->pc_recurred == 1) {
-                rc = lu_env_refill(&pc->pc_env);
-                if (rc == 0) {
-                        lu_context_enter(&pc->pc_env.le_ctx);
-                        rc = ptlrpcd_check(&pc->pc_env, pc);
-                        if (!rc)
-                                ptlrpc_expired_set(pc->pc_set);
-                        /*
-                         * XXX: send replay requests.
-                         */
-                       if (test_bit(LIOD_RECOVERY, &pc->pc_flags))
-                                rc = ptlrpcd_check(&pc->pc_env, pc);
-                        lu_context_exit(&pc->pc_env.le_ctx);
-                }
-        }
-
-        pc->pc_recurred--;
-        return rc;
-}
-
-int ptlrpcd_idle(void *arg)
-{
-       struct ptlrpcd_ctl *pc = arg;
-
-       return (atomic_read(&pc->pc_set->set_new_count) == 0 &&
-               atomic_read(&pc->pc_set->set_remaining) == 0);
-}
-
-#endif
 
 int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
 {
 
 int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
 {
@@ -700,15 +627,6 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
         if (pc->pc_set == NULL)
                 GOTO(out, rc = -ENOMEM);
 
         if (pc->pc_set == NULL)
                 GOTO(out, rc = -ENOMEM);
 
-#ifndef __KERNEL__
-        pc->pc_wait_callback =
-                liblustre_register_wait_callback("ptlrpcd_check_async_rpcs",
-                                                 &ptlrpcd_check_async_rpcs, pc);
-        pc->pc_idle_callback =
-                liblustre_register_idle_callback("ptlrpcd_check_idle_rpcs",
-                                                 &ptlrpcd_idle, pc);
-       RETURN(0);
-#else
         /*
          * So far only "client" ptlrpcd uses an environment. In the future,
          * ptlrpcd thread (or a thread-set) has to be given an argument,
         /*
          * So far only "client" ptlrpcd uses an environment. In the future,
          * ptlrpcd thread (or a thread-set) has to be given an argument,
@@ -747,7 +665,6 @@ out_set:
                ptlrpc_set_destroy(set);
        }
        clear_bit(LIOD_BIND, &pc->pc_flags);
                ptlrpc_set_destroy(set);
        }
        clear_bit(LIOD_BIND, &pc->pc_flags);
-#endif
 out:
        clear_bit(LIOD_START, &pc->pc_flags);
        RETURN(rc);
 out:
        clear_bit(LIOD_START, &pc->pc_flags);
        RETURN(rc);
@@ -781,12 +698,7 @@ void ptlrpcd_free(struct ptlrpcd_ctl *pc)
                goto out;
        }
 
                goto out;
        }
 
-#ifdef __KERNEL__
        wait_for_completion(&pc->pc_finishing);
        wait_for_completion(&pc->pc_finishing);
-#else
-       liblustre_deregister_wait_callback(pc->pc_wait_callback);
-       liblustre_deregister_idle_callback(pc->pc_idle_callback);
-#endif
        lu_context_fini(&pc->pc_env.le_ctx);
 
        spin_lock(&pc->pc_lock);
        lu_context_fini(&pc->pc_env.le_ctx);
 
        spin_lock(&pc->pc_lock);
@@ -800,7 +712,6 @@ void ptlrpcd_free(struct ptlrpcd_ctl *pc)
        clear_bit(LIOD_BIND, &pc->pc_flags);
 
 out:
        clear_bit(LIOD_BIND, &pc->pc_flags);
 
 out:
-#ifdef __KERNEL__
         if (pc->pc_npartners > 0) {
                 LASSERT(pc->pc_partners != NULL);
 
         if (pc->pc_npartners > 0) {
                 LASSERT(pc->pc_partners != NULL);
 
@@ -809,7 +720,6 @@ out:
                 pc->pc_partners = NULL;
         }
         pc->pc_npartners = 0;
                 pc->pc_partners = NULL;
         }
         pc->pc_npartners = 0;
-#endif
         EXIT;
 }
 
         EXIT;
 }
 
@@ -839,7 +749,6 @@ static int ptlrpcd_init(void)
        int     size, i = -1, j, rc = 0;
        ENTRY;
 
        int     size, i = -1, j, rc = 0;
        ENTRY;
 
-#ifdef __KERNEL__
         if (max_ptlrpcds > 0 && max_ptlrpcds < nthreads)
                 nthreads = max_ptlrpcds;
         if (nthreads < 2)
         if (max_ptlrpcds > 0 && max_ptlrpcds < nthreads)
                 nthreads = max_ptlrpcds;
         if (nthreads < 2)
@@ -848,9 +757,6 @@ static int ptlrpcd_init(void)
                 ptlrpcd_bind_policy = PDB_POLICY_PAIR;
         else if (nthreads % 2 != 0 && ptlrpcd_bind_policy == PDB_POLICY_PAIR)
                 nthreads &= ~1; /* make sure it is even */
                 ptlrpcd_bind_policy = PDB_POLICY_PAIR;
         else if (nthreads % 2 != 0 && ptlrpcd_bind_policy == PDB_POLICY_PAIR)
                 nthreads &= ~1; /* make sure it is even */
-#else
-        nthreads = 1;
-#endif
 
         size = offsetof(struct ptlrpcd, pd_threads[nthreads]);
         OBD_ALLOC(ptlrpcds, size);
 
         size = offsetof(struct ptlrpcd, pd_threads[nthreads]);
         OBD_ALLOC(ptlrpcds, size);
index 19b131b..70300b0 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifdef __KERNEL__
-# include <libcfs/libcfs.h>
-#else
-# include <liblustre.h>
-#endif
-
+#include <libcfs/libcfs.h>
 #include <obd_support.h>
 #include <lustre_ha.h>
 #include <lustre_net.h>
 #include <obd_support.h>
 #include <lustre_ha.h>
 #include <lustre_net.h>
index 0de9228..402167b 100644 (file)
 #define DEBUG_SUBSYSTEM S_SEC
 
 #include <libcfs/libcfs.h>
 #define DEBUG_SUBSYSTEM S_SEC
 
 #include <libcfs/libcfs.h>
-#ifndef __KERNEL__
-#include <liblustre.h>
-#include <libcfs/list.h>
-#else
 #include <linux/crypto.h>
 #include <linux/key.h>
 #include <linux/crypto.h>
 #include <linux/key.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
@@ -2411,14 +2406,10 @@ int sptlrpc_current_user_desc_size(void)
 {
         int ngroups;
 
 {
         int ngroups;
 
-#ifdef __KERNEL__
         ngroups = current_ngroups;
 
         if (ngroups > LUSTRE_MAX_GROUPS)
                 ngroups = LUSTRE_MAX_GROUPS;
         ngroups = current_ngroups;
 
         if (ngroups > LUSTRE_MAX_GROUPS)
                 ngroups = LUSTRE_MAX_GROUPS;
-#else
-        ngroups = 0;
-#endif
         return sptlrpc_user_desc_size(ngroups);
 }
 EXPORT_SYMBOL(sptlrpc_current_user_desc_size);
         return sptlrpc_user_desc_size(ngroups);
 }
 EXPORT_SYMBOL(sptlrpc_current_user_desc_size);
@@ -2436,14 +2427,12 @@ int sptlrpc_pack_user_desc(struct lustre_msg *msg, int offset)
        pud->pud_cap = cfs_curproc_cap_pack();
        pud->pud_ngroups = (msg->lm_buflens[offset] - sizeof(*pud)) / 4;
 
        pud->pud_cap = cfs_curproc_cap_pack();
        pud->pud_ngroups = (msg->lm_buflens[offset] - sizeof(*pud)) / 4;
 
-#ifdef __KERNEL__
        task_lock(current);
        if (pud->pud_ngroups > current_ngroups)
                pud->pud_ngroups = current_ngroups;
        memcpy(pud->pud_groups, current_cred()->group_info->blocks[0],
               pud->pud_ngroups * sizeof(__u32));
        task_unlock(current);
        task_lock(current);
        if (pud->pud_ngroups > current_ngroups)
                pud->pud_ngroups = current_ngroups;
        memcpy(pud->pud_groups, current_cred()->group_info->blocks[0],
               pud->pud_ngroups * sizeof(__u32));
        task_unlock(current);
-#endif
 
        return 0;
 }
 
        return 0;
 }
index 578715c..1ddc335 100644 (file)
@@ -57,7 +57,6 @@
  * bulk encryption page pools           *
  ****************************************/
 
  * bulk encryption page pools           *
  ****************************************/
 
-#ifdef __KERNEL__
 
 #define PTRS_PER_PAGE   (PAGE_CACHE_SIZE / sizeof(void *))
 #define PAGES_PER_POOL  (PTRS_PER_PAGE)
 
 #define PTRS_PER_PAGE   (PAGE_CACHE_SIZE / sizeof(void *))
 #define PAGES_PER_POOL  (PTRS_PER_PAGE)
@@ -812,26 +811,6 @@ void sptlrpc_enc_pool_fini(void)
        }
 }
 
        }
 }
 
-#else /* !__KERNEL__ */
-
-int sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc)
-{
-        return 0;
-}
-
-void sptlrpc_enc_pool_put_pages(struct ptlrpc_bulk_desc *desc)
-{
-}
-
-int sptlrpc_enc_pool_init(void)
-{
-        return 0;
-}
-
-void sptlrpc_enc_pool_fini(void)
-{
-}
-#endif
 
 static int cfs_hash_alg_id[] = {
        [BULK_HASH_ALG_NULL]    = CFS_HASH_ALG_NULL,
 
 static int cfs_hash_alg_id[] = {
        [BULK_HASH_ALG_NULL]    = CFS_HASH_ALG_NULL,
@@ -920,14 +899,9 @@ int sptlrpc_get_bulk_checksum(struct ptlrpc_bulk_desc *desc, __u8 alg,
        hashsize = cfs_crypto_hash_digestsize(cfs_hash_alg_id[alg]);
 
        for (i = 0; i < desc->bd_iov_count; i++) {
        hashsize = cfs_crypto_hash_digestsize(cfs_hash_alg_id[alg]);
 
        for (i = 0; i < desc->bd_iov_count; i++) {
-#ifdef __KERNEL__
                cfs_crypto_hash_update_page(hdesc, desc->bd_iov[i].kiov_page,
                                  desc->bd_iov[i].kiov_offset & ~CFS_PAGE_MASK,
                                  desc->bd_iov[i].kiov_len);
                cfs_crypto_hash_update_page(hdesc, desc->bd_iov[i].kiov_page,
                                  desc->bd_iov[i].kiov_offset & ~CFS_PAGE_MASK,
                                  desc->bd_iov[i].kiov_len);
-#else
-               cfs_crypto_hash_update(hdesc, desc->bd_iov[i].iov_base,
-                                 desc->bd_iov[i].iov_len);
-#endif
        }
 
        if (hashsize > buflen) {
        }
 
        if (hashsize > buflen) {
index b18b1f6..58703e0 100644 (file)
 #define DEBUG_SUBSYSTEM S_SEC
 
 #include <libcfs/libcfs.h>
 #define DEBUG_SUBSYSTEM S_SEC
 
 #include <libcfs/libcfs.h>
-#ifndef __KERNEL__
-#include <liblustre.h>
-#include <libcfs/list.h>
-#else
 #include <linux/crypto.h>
 #include <linux/key.h>
 #include <linux/crypto.h>
 #include <linux/key.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
@@ -938,7 +933,6 @@ void sptlrpc_conf_client_adapt(struct obd_device *obd)
 }
 EXPORT_SYMBOL(sptlrpc_conf_client_adapt);
 
 }
 EXPORT_SYMBOL(sptlrpc_conf_client_adapt);
 
-#ifdef __KERNEL__
 
 static void rule2string(struct sptlrpc_rule *r, char *buf, int buflen)
 {
 
 static void rule2string(struct sptlrpc_rule *r, char *buf, int buflen)
 {
@@ -1151,7 +1145,6 @@ out_pop:
        RETURN(rc);
 }
 
        RETURN(rc);
 }
 
-#endif /* __KRENEL__ */
 
 /**
  * called by target devices, extract sptlrpc rules which applies to
 
 /**
  * called by target devices, extract sptlrpc rules which applies to
@@ -1188,7 +1181,6 @@ int sptlrpc_conf_target_get_rules(struct obd_device *obd,
                 GOTO(out, rc);
         }
 
                 GOTO(out, rc);
         }
 
-#ifdef __KERNEL__
         if (conf->sc_updated  == 0) {
                 /*
                  * always read from local copy. here another option is
         if (conf->sc_updated  == 0) {
                 /*
                  * always read from local copy. here another option is
@@ -1208,7 +1200,6 @@ int sptlrpc_conf_target_get_rules(struct obd_device *obd,
                 else
                         CDEBUG(D_SEC, "unchanged, skip updating local copy\n");
         }
                 else
                         CDEBUG(D_SEC, "unchanged, skip updating local copy\n");
         }
-#endif
 
         /* extract rule set for this target */
         conf_tgt = sptlrpc_conf_get_tgt(conf, obd->obd_name, 0);
 
         /* extract rule set for this target */
         conf_tgt = sptlrpc_conf_get_tgt(conf, obd->obd_name, 0);
index 431f4b3..c04020a 100644 (file)
@@ -20,7 +20,6 @@
  *
  * GPL HEADER END
  */
  *
  * GPL HEADER END
  */
-#ifdef __KERNEL__
 
 #define DEBUG_SUBSYSTEM S_FILTER
 
 
 #define DEBUG_SUBSYSTEM S_FILTER
 
@@ -123,4 +122,3 @@ put_old:
        dput(dchild_old);
        RETURN(err);
 }
        dput(dchild_old);
        RETURN(err);
 }
-#endif /* __KERNEL__ */
index c01dce0..af3ee85 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_SEC
 
 
 #define DEBUG_SUBSYSTEM S_SEC
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#else
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs.h>
-#endif
 
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
@@ -53,7 +49,6 @@
 
 #define SEC_GC_INTERVAL (30 * 60)
 
 
 #define SEC_GC_INTERVAL (30 * 60)
 
-#ifdef __KERNEL__
 
 static struct mutex sec_gc_mutex;
 static spinlock_t sec_gc_list_lock;
 
 static struct mutex sec_gc_mutex;
 static spinlock_t sec_gc_list_lock;
@@ -257,20 +252,3 @@ void sptlrpc_gc_fini(void)
                     thread_is_stopped(&sec_gc_thread), &lwi);
 }
 
                     thread_is_stopped(&sec_gc_thread), &lwi);
 }
 
-#else /* !__KERNEL__ */
-
-void sptlrpc_gc_add_sec(struct ptlrpc_sec *sec)
-{
-}
-void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec)
-{
-}
-int sptlrpc_gc_init(void)
-{
-        return 0;
-}
-void sptlrpc_gc_fini(void)
-{
-}
-
-#endif /* __KERNEL__ */
index 8260de5..9416f28 100644 (file)
 #define DEBUG_SUBSYSTEM S_SEC
 
 #include <libcfs/libcfs.h>
 #define DEBUG_SUBSYSTEM S_SEC
 
 #include <libcfs/libcfs.h>
-#ifndef __KERNEL__
-#include <liblustre.h>
-#include <libcfs/list.h>
-#else
 #include <linux/crypto.h>
 #include <linux/crypto.h>
-#endif
 
 #include <obd.h>
 #include <obd_class.h>
 
 #include <obd.h>
 #include <obd_class.h>
@@ -56,7 +51,6 @@
 
 #include "ptlrpc_internal.h"
 
 
 #include "ptlrpc_internal.h"
 
-#ifdef __KERNEL__
 
 struct proc_dir_entry *sptlrpc_proc_root = NULL;
 EXPORT_SYMBOL(sptlrpc_proc_root);
 
 struct proc_dir_entry *sptlrpc_proc_root = NULL;
 EXPORT_SYMBOL(sptlrpc_proc_root);
@@ -205,20 +199,3 @@ void sptlrpc_lproc_fini(void)
         }
 }
 
         }
 }
 
-#else /* !__KERNEL__ */
-
-int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
-{
-        return 0;
-}
-
-int sptlrpc_lproc_init(void)
-{
-        return 0;
-}
-
-void sptlrpc_lproc_fini(void)
-{
-}
-
-#endif
index 958fecd..ee9a093 100644 (file)
@@ -40,9 +40,6 @@
 
 #define DEBUG_SUBSYSTEM S_SEC
 
 
 #define DEBUG_SUBSYSTEM S_SEC
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <obd_cksum.h>
 
 #include <obd_support.h>
 #include <obd_cksum.h>
index b57f28a..4ed546a 100644 (file)
@@ -40,9 +40,6 @@
 
 #define DEBUG_SUBSYSTEM S_SEC
 
 
 #define DEBUG_SUBSYSTEM S_SEC
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 
 #include <obd_support.h>
 #include <obd_cksum.h>
 
 #include <obd_support.h>
 #include <obd_cksum.h>
@@ -155,7 +152,6 @@ static int plain_verify_bulk_csum(struct ptlrpc_bulk_desc *desc,
         return 0;
 }
 
         return 0;
 }
 
-#ifdef __KERNEL__
 static void corrupt_bulk_data(struct ptlrpc_bulk_desc *desc)
 {
        char           *ptr;
 static void corrupt_bulk_data(struct ptlrpc_bulk_desc *desc)
 {
        char           *ptr;
@@ -172,20 +168,6 @@ static void corrupt_bulk_data(struct ptlrpc_bulk_desc *desc)
                return;
        }
 }
                return;
        }
 }
-#else
-static void corrupt_bulk_data(struct ptlrpc_bulk_desc *desc)
-{
-        unsigned int    i;
-
-        for (i = 0; i < desc->bd_iov_count; i++) {
-                if (desc->bd_iov[i].iov_len == 0)
-                        continue;
-
-                ((char *)desc->bd_iov[i].iov_base)[i] ^= 0x1;
-                return;
-        }
-}
-#endif /* __KERNEL__ */
 
 /****************************************
  * cli_ctx apis                         *
 
 /****************************************
  * cli_ctx apis                         *
@@ -355,9 +337,7 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
         struct ptlrpc_bulk_sec_desc *bsdv;
         struct plain_bulk_token     *tokenv;
         int                          rc;
         struct ptlrpc_bulk_sec_desc *bsdv;
         struct plain_bulk_token     *tokenv;
         int                          rc;
-#ifdef __KERNEL__
         int                          i, nob;
         int                          i, nob;
-#endif
 
         LASSERT(req->rq_pack_bulk);
         LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
 
         LASSERT(req->rq_pack_bulk);
         LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
@@ -372,7 +352,6 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
                 return 0;
         }
 
                 return 0;
         }
 
-#ifdef __KERNEL__
         /* fix the actual data size */
         for (i = 0, nob = 0; i < desc->bd_iov_count; i++) {
                 if (desc->bd_iov[i].kiov_len + nob > desc->bd_nob_transferred) {
         /* fix the actual data size */
         for (i = 0, nob = 0; i < desc->bd_iov_count; i++) {
                 if (desc->bd_iov[i].kiov_len + nob > desc->bd_nob_transferred) {
@@ -381,7 +360,6 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
                 }
                 nob += desc->bd_iov[i].kiov_len;
         }
                 }
                 nob += desc->bd_iov[i].kiov_len;
         }
-#endif
 
         rc = plain_verify_bulk_csum(desc, req->rq_flvr.u_bulk.hash.hash_alg,
                                     tokenv);
 
         rc = plain_verify_bulk_csum(desc, req->rq_flvr.u_bulk.hash.hash_alg,
                                     tokenv);
index b7918e1..71e4804 100644 (file)
@@ -35,9 +35,6 @@
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
@@ -204,7 +201,6 @@ ptlrpc_save_lock(struct ptlrpc_request *req,
 }
 EXPORT_SYMBOL(ptlrpc_save_lock);
 
 }
 EXPORT_SYMBOL(ptlrpc_save_lock);
 
-#ifdef __KERNEL__
 
 struct ptlrpc_hr_partition;
 
 
 struct ptlrpc_hr_partition;
 
@@ -365,14 +361,6 @@ static void rs_batch_fini(struct rs_batch *b)
 
 #define DECLARE_RS_BATCH(b)     struct rs_batch b
 
 
 #define DECLARE_RS_BATCH(b)     struct rs_batch b
 
-#else /* __KERNEL__ */
-
-#define rs_batch_init(b)        do{}while(0)
-#define rs_batch_fini(b)        do{}while(0)
-#define rs_batch_add(b, r)      ptlrpc_schedule_difficult_reply(r)
-#define DECLARE_RS_BATCH(b)
-
-#endif /* __KERNEL__ */
 
 /**
  * Put reply state into a queue for processing because we received
 
 /**
  * Put reply state into a queue for processing because we received
@@ -380,7 +368,6 @@ static void rs_batch_fini(struct rs_batch *b)
  */
 void ptlrpc_dispatch_difficult_reply(struct ptlrpc_reply_state *rs)
 {
  */
 void ptlrpc_dispatch_difficult_reply(struct ptlrpc_reply_state *rs)
 {
-#ifdef __KERNEL__
        struct ptlrpc_hr_thread *hrt;
        ENTRY;
 
        struct ptlrpc_hr_thread *hrt;
        ENTRY;
 
@@ -394,9 +381,6 @@ void ptlrpc_dispatch_difficult_reply(struct ptlrpc_reply_state *rs)
 
        wake_up(&hrt->hrt_waitq);
        EXIT;
 
        wake_up(&hrt->hrt_waitq);
        EXIT;
-#else
-       list_add_tail(&rs->rs_list, &rs->rs_svcpt->scp_rep_queue);
-#endif
 }
 
 void
 }
 
 void
@@ -511,7 +495,6 @@ static void
 ptlrpc_server_nthreads_check(struct ptlrpc_service *svc,
                             struct ptlrpc_service_conf *conf)
 {
 ptlrpc_server_nthreads_check(struct ptlrpc_service *svc,
                             struct ptlrpc_service_conf *conf)
 {
-#ifdef __KERNEL__
        struct ptlrpc_service_thr_conf  *tc = &conf->psc_thr;
        unsigned                        init;
        unsigned                        total;
        struct ptlrpc_service_thr_conf  *tc = &conf->psc_thr;
        unsigned                        init;
        unsigned                        total;
@@ -608,7 +591,6 @@ ptlrpc_server_nthreads_check(struct ptlrpc_service *svc,
                       svc->srv_name, nthrs * svc->srv_ncpts,
                       tc->tc_nthrs_max);
        }
                       svc->srv_name, nthrs * svc->srv_ncpts,
                       tc->tc_nthrs_max);
        }
-#endif
 }
 
 /**
 }
 
 /**
@@ -642,9 +624,6 @@ ptlrpc_service_part_init(struct ptlrpc_service *svc,
        /* reply states */
        spin_lock_init(&svcpt->scp_rep_lock);
        INIT_LIST_HEAD(&svcpt->scp_rep_active);
        /* reply states */
        spin_lock_init(&svcpt->scp_rep_lock);
        INIT_LIST_HEAD(&svcpt->scp_rep_active);
-#ifndef __KERNEL__
-       INIT_LIST_HEAD(&svcpt->scp_rep_queue);
-#endif
        INIT_LIST_HEAD(&svcpt->scp_rep_idle);
        init_waitqueue_head(&svcpt->scp_rep_waitq);
        atomic_set(&svcpt->scp_nreps_difficult, 0);
        INIT_LIST_HEAD(&svcpt->scp_rep_idle);
        init_waitqueue_head(&svcpt->scp_rep_waitq);
        atomic_set(&svcpt->scp_nreps_difficult, 0);
@@ -837,14 +816,12 @@ ptlrpc_register_service(struct ptlrpc_service_conf *conf,
        CDEBUG(D_NET, "%s: Started, listening on portal %d\n",
               service->srv_name, service->srv_req_portal);
 
        CDEBUG(D_NET, "%s: Started, listening on portal %d\n",
               service->srv_name, service->srv_req_portal);
 
-#ifdef __KERNEL__
        rc = ptlrpc_start_threads(service);
        if (rc != 0) {
                CERROR("Failed to start threads for service %s: %d\n",
                       service->srv_name, rc);
                GOTO(failed, rc);
        }
        rc = ptlrpc_start_threads(service);
        if (rc != 0) {
                CERROR("Failed to start threads for service %s: %d\n",
                       service->srv_name, rc);
                GOTO(failed, rc);
        }
-#endif
 
        RETURN(service);
 failed:
 
        RETURN(service);
 failed:
@@ -1749,10 +1726,6 @@ static bool ptlrpc_server_allow_normal(struct ptlrpc_service_part *svcpt,
                                       bool force)
 {
        int running = svcpt->scp_nthrs_running;
                                       bool force)
 {
        int running = svcpt->scp_nthrs_running;
-#ifndef __KERNEL__
-       if (1) /* always allow to handle normal request for liblustre */
-               return true;
-#endif
        if (unlikely(svcpt->scp_service->srv_req_portal == MDS_REQUEST_PORTAL &&
                     CFS_FAIL_PRECHECK(OBD_FAIL_PTLRPC_CANCEL_RESEND))) {
                /* leave just 1 thread for normal RPCs */
        if (unlikely(svcpt->scp_service->srv_req_portal == MDS_REQUEST_PORTAL &&
                     CFS_FAIL_PRECHECK(OBD_FAIL_PTLRPC_CANCEL_RESEND))) {
                /* leave just 1 thread for normal RPCs */
@@ -1810,13 +1783,6 @@ ptlrpc_server_request_get(struct ptlrpc_service_part *svcpt, bool force)
        ENTRY;
 
        spin_lock(&svcpt->scp_req_lock);
        ENTRY;
 
        spin_lock(&svcpt->scp_req_lock);
-#ifndef __KERNEL__
-       /* !@%$# liblustre only has 1 thread */
-       if (atomic_read(&svcpt->scp_nreps_difficult) != 0) {
-               spin_unlock(&svcpt->scp_req_lock);
-               RETURN(NULL);
-       }
-#endif
 
        if (ptlrpc_server_high_pending(svcpt, force)) {
                req = ptlrpc_nrs_req_get_nolock(svcpt, true, force);
 
        if (ptlrpc_server_high_pending(svcpt, force)) {
                req = ptlrpc_nrs_req_get_nolock(svcpt, true, force);
@@ -2270,81 +2236,6 @@ ptlrpc_handle_rs(struct ptlrpc_reply_state *rs)
        RETURN(1);
 }
 
        RETURN(1);
 }
 
-#ifndef __KERNEL__
-
-/**
- * Check whether given service has a reply available for processing
- * and process it.
- *
- * \param svc a ptlrpc service
- * \retval 0 no replies processed
- * \retval 1 one reply processed
- */
-static int
-ptlrpc_server_handle_reply(struct ptlrpc_service_part *svcpt)
-{
-       struct ptlrpc_reply_state *rs = NULL;
-       ENTRY;
-
-       spin_lock(&svcpt->scp_rep_lock);
-       if (!list_empty(&svcpt->scp_rep_queue)) {
-               rs = list_entry(svcpt->scp_rep_queue.prev,
-                                   struct ptlrpc_reply_state,
-                                   rs_list);
-               list_del_init(&rs->rs_list);
-       }
-       spin_unlock(&svcpt->scp_rep_lock);
-       if (rs != NULL)
-               ptlrpc_handle_rs(rs);
-       RETURN(rs != NULL);
-}
-
-/* FIXME make use of timeout later */
-int
-liblustre_check_services (void *arg)
-{
-       int  did_something = 0;
-       int  rc;
-       struct list_head *tmp, *nxt;
-       ENTRY;
-
-       /* I'm relying on being single threaded, not to have to lock
-        * ptlrpc_all_services etc */
-       list_for_each_safe(tmp, nxt, &ptlrpc_all_services) {
-               struct ptlrpc_service *svc =
-                       list_entry(tmp, struct ptlrpc_service, srv_list);
-               struct ptlrpc_service_part *svcpt;
-
-               LASSERT(svc->srv_ncpts == 1);
-               svcpt = svc->srv_parts[0];
-
-               if (svcpt->scp_nthrs_running != 0)     /* I've recursed */
-                       continue;
-
-               /* service threads can block for bulk, so this limits us
-                * (arbitrarily) to recursing 1 stack frame per service.
-                * Note that the problem with recursion is that we have to
-                * unwind completely before our caller can resume. */
-
-               svcpt->scp_nthrs_running++;
-
-               do {
-                       rc = ptlrpc_server_handle_req_in(svcpt, NULL);
-                       rc |= ptlrpc_server_handle_reply(svcpt);
-                       rc |= ptlrpc_at_check_timed(svcpt);
-                       rc |= ptlrpc_server_handle_request(svcpt, NULL);
-                       rc |= (ptlrpc_server_post_idle_rqbds(svcpt) > 0);
-                       did_something |= rc;
-               } while (rc);
-
-               svcpt->scp_nthrs_running--;
-       }
-
-       RETURN(did_something);
-}
-#define ptlrpc_stop_all_threads(s) do {} while (0)
-
-#else /* __KERNEL__ */
 
 static void
 ptlrpc_check_rqbd_pool(struct ptlrpc_service_part *svcpt)
 
 static void
 ptlrpc_check_rqbd_pool(struct ptlrpc_service_part *svcpt)
@@ -2479,9 +2370,7 @@ static int ptlrpc_main(void *arg)
        struct ptlrpc_service_part      *svcpt = thread->t_svcpt;
        struct ptlrpc_service           *svc = svcpt->scp_service;
        struct ptlrpc_reply_state       *rs;
        struct ptlrpc_service_part      *svcpt = thread->t_svcpt;
        struct ptlrpc_service           *svc = svcpt->scp_service;
        struct ptlrpc_reply_state       *rs;
-#ifdef WITH_GROUP_INFO
        struct group_info *ginfo = NULL;
        struct group_info *ginfo = NULL;
-#endif
        struct lu_env *env;
        int counter = 0, rc = 0;
        ENTRY;
        struct lu_env *env;
        int counter = 0, rc = 0;
        ENTRY;
@@ -2498,7 +2387,6 @@ static int ptlrpc_main(void *arg)
                      svc->srv_name, thread->t_name, svcpt->scp_cpt);
        }
 
                      svc->srv_name, thread->t_name, svcpt->scp_cpt);
        }
 
-#ifdef WITH_GROUP_INFO
        ginfo = groups_alloc(0);
        if (!ginfo) {
                rc = -ENOMEM;
        ginfo = groups_alloc(0);
        if (!ginfo) {
                rc = -ENOMEM;
@@ -2507,7 +2395,6 @@ static int ptlrpc_main(void *arg)
 
        set_current_groups(ginfo);
        put_group_info(ginfo);
 
        set_current_groups(ginfo);
        put_group_info(ginfo);
-#endif
 
        if (svc->srv_ops.so_thr_init != NULL) {
                rc = svc->srv_ops.so_thr_init(thread);
 
        if (svc->srv_ops.so_thr_init != NULL) {
                rc = svc->srv_ops.so_thr_init(thread);
@@ -3062,7 +2949,6 @@ void ptlrpc_hr_fini(void)
        ptlrpc_hr.hr_partitions = NULL;
 }
 
        ptlrpc_hr.hr_partitions = NULL;
 }
 
-#endif /* __KERNEL__ */
 
 /**
  * Wait until all already scheduled replies are processed.
 
 /**
  * Wait until all already scheduled replies are processed.
index fe76629..7649bb4 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 
-#ifdef __KERNEL__
-# ifdef CONFIG_FS_POSIX_ACL
-#  include <linux/fs.h>
-#  include <linux/posix_acl_xattr.h>
-# endif
-#endif
+#ifdef CONFIG_FS_POSIX_ACL
+# include <linux/fs.h>
+# include <linux/posix_acl_xattr.h>
+#endif /* CONFIG_FS_POSIX_ACL */
 
 #include <obd_support.h>
 #include <obd_class.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
index 4e3d903..1a70959 100644 (file)
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-#ifndef __KERNEL__
-# include <liblustre.h>
-#endif
 
 
-#ifdef __KERNEL__
-# ifdef CONFIG_FS_POSIX_ACL
-#  include <linux/fs.h>
-#  include <linux/posix_acl_xattr.h>
-# endif
-#endif
+#ifdef CONFIG_FS_POSIX_ACL
+# include <linux/fs.h>
+# include <linux/posix_acl_xattr.h>
+#endif /* CONFIG_FS_POSIX_ACL */
 
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre/lustre_lfsck_user.h>
 #include <lustre_disk.h>
 
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 #include <lustre/lustre_lfsck_user.h>
 #include <lustre_disk.h>
-
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux t 2.6.32-358.18.1.el6.lustre.x86_64 #1 SMP Mon Sep 2 15:21:03 CDT 2013 x8
-         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)  */
+         * running on Linux t 2.6.32-431.5.1.el6.lustre.x86_64 #1 SMP Wed Feb 12 11:01:08 CST 2014 x8
+         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)  */
 
 
        /* Constants... */
 
 
        /* Constants... */
index b28beb6..cfb6445 100644 (file)
 # include <linux/fiemap.h>
 #endif
 
 # include <linux/fiemap.h>
 #endif
 
-#ifdef __linux__
-# ifndef FS_IOC_FIEMAP
-#  define FS_IOC_FIEMAP (_IOWR('f', 11, struct fiemap))
-# endif
+#ifndef FS_IOC_FIEMAP
+# define FS_IOC_FIEMAP (_IOWR('f', 11, struct fiemap))
 #endif
 
 #define ONEMB 1048576
 #endif
 
 #define ONEMB 1048576
index 6df4e45..0eb2ed8 100644 (file)
@@ -66,7 +66,6 @@
 #include <limits.h>
 #include <ctype.h>
 
 #include <limits.h>
 #include <ctype.h>
 
-#ifdef __linux__
 /* libcfs.h is not really needed here, but on SLES10/PPC, fs.h includes idr.h
  * which requires BITS_PER_LONG to be defined */
 #include <libcfs/libcfs.h>
 /* libcfs.h is not really needed here, but on SLES10/PPC, fs.h includes idr.h
  * which requires BITS_PER_LONG to be defined */
 #include <libcfs/libcfs.h>
@@ -74,7 +73,6 @@
 #include <linux/fs.h> /* for BLKGETSIZE64 */
 #endif
 #include <linux/version.h>
 #include <linux/fs.h> /* for BLKGETSIZE64 */
 #endif
 #include <linux/version.h>
-#endif
 #include <lustre_disk.h>
 #include <lustre_param.h>
 #include <lnet/lnetctl.h>
 #include <lustre_disk.h>
 #include <lustre_param.h>
 #include <lnet/lnetctl.h>
index ba7a1ab..248ccc6 100644 (file)
@@ -62,8 +62,8 @@ void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
 {
         /* Wire protocol assertions generated by 'wirecheck'
          * (make -C lustre/utils newwiretest)
-         * running on Linux t 2.6.32-358.18.1.el6.lustre.x86_64 #1 SMP Mon Sep 2 15:21:03 CDT 2013 x8
-         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)  */
+         * running on Linux t 2.6.32-431.5.1.el6.lustre.x86_64 #1 SMP Wed Feb 12 11:01:08 CST 2014 x8
+         * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)  */
 
 
        /* Constants... */
 
 
        /* Constants... */
index 04b5bb1..2c1a20d 100644 (file)
@@ -49,9 +49,7 @@
  */ 
 
 #include <sys/types.h>
  */ 
 
 #include <sys/types.h>
-#if defined (__linux__)
 #include <sys/vfs.h>
 #include <sys/vfs.h>
-#endif
 #include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>
index 70d5ecd..5f88c6a 100644 (file)
@@ -49,9 +49,7 @@
  */ 
 
 #include <sys/types.h>
  */ 
 
 #include <sys/types.h>
-#if defined (__linux__)
 #include <sys/vfs.h>
 #include <sys/vfs.h>
-#endif
 #include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>