Whamcloud - gitweb
b=17166 remove <2.6.9 compatibility code from HEAD
authorLiuYing <Emoly.Liu@sun.com>
Tue, 17 Aug 2010 03:40:49 +0000 (07:40 +0400)
committerMikhail Pershin <tappro@sun.com>
Tue, 17 Aug 2010 05:25:07 +0000 (09:25 +0400)
HEAD requires 2.6.9 and above, so we remove older code.
The majority of the remaining compatibility code is in libcfs and lnet.

i=andreas
i=isaac

18 files changed:
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/kp30.h
libcfs/include/libcfs/linux/linux-prim.h
libcfs/include/libcfs/linux/linux-tcpip.h
libcfs/include/libcfs/linux/linux-time.h
libcfs/include/libcfs/linux/portals_compat25.h
libcfs/include/libcfs/lltrace.h
libcfs/libcfs/linux/linux-curproc.c
libcfs/libcfs/linux/linux-debug.c
libcfs/libcfs/linux/linux-mem.c
libcfs/libcfs/linux/linux-tcpip.c
libcfs/libcfs/linux/linux-tracefile.c
lnet/klnds/qswlnd/qswlnd.h
lnet/klnds/socklnd/socklnd_lib-linux.c
lnet/klnds/socklnd/socklnd_lib-linux.h
lustre/include/liblustre.h
lustre/include/linux/lustre_compat25.h
lustre/llite/symlink.c

index c1ba576..6932513 100644 (file)
@@ -60,46 +60,6 @@ fi
 ])
 
 #
-# LIBCFS_STRUCT_PAGE_LIST
-#
-# 2.6.4 no longer has page->list
-#
-AC_DEFUN([LIBCFS_STRUCT_PAGE_LIST],
-[AC_MSG_CHECKING([if struct page has a list field])
-LB_LINUX_TRY_COMPILE([
-       #include <linux/mm.h>
-],[
-       struct page page;
-       &page.list;
-],[
-       AC_MSG_RESULT([yes])
-       AC_DEFINE(HAVE_PAGE_LIST, 1, [struct page has a list field])
-],[
-       AC_MSG_RESULT([no])
-])
-])
-
-#
-# LIBCFS_STRUCT_SIGHAND
-#
-# red hat 2.4 adds sighand to struct task_struct
-#
-AC_DEFUN([LIBCFS_STRUCT_SIGHAND],
-[AC_MSG_CHECKING([if task_struct has a sighand field])
-LB_LINUX_TRY_COMPILE([
-       #include <linux/sched.h>
-],[
-       struct task_struct p;
-       p.sighand = NULL;
-],[
-       AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
-       AC_MSG_RESULT([yes])
-],[
-       AC_MSG_RESULT([no])
-])
-])
-
-#
 # LIBCFS_FUNC_CPU_ONLINE
 #
 # cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
@@ -107,14 +67,14 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LIBCFS_FUNC_CPU_ONLINE],
 [AC_MSG_CHECKING([if kernel defines cpu_online()])
 LB_LINUX_TRY_COMPILE([
-       #include <linux/sched.h>
+       #include <linux/sched.h>
 ],[
-       cpu_online(0);
+       cpu_online(0);
 ],[
-       AC_MSG_RESULT([yes])
-       AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
+       AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
 ],[
-       AC_MSG_RESULT([no])
+       AC_MSG_RESULT([no])
 ])
 ])
 
@@ -138,25 +98,6 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
-# LIBCFS_TYPE_CPUMASK_T
-#
-# same goes for cpumask_t
-#
-AC_DEFUN([LIBCFS_TYPE_CPUMASK_T],
-[AC_MSG_CHECKING([if kernel defines cpumask_t])
-LB_LINUX_TRY_COMPILE([
-       #include <linux/sched.h>
-],[
-       return sizeof (cpumask_t);
-],[
-       AC_MSG_RESULT([yes])
-       AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
-],[
-       AC_MSG_RESULT([no])
-])
-])
-
-#
 # LIBCFS_FUNC_SHOW_TASK
 #
 # we export show_task(), but not all kernels have it (yet)
@@ -688,11 +629,8 @@ AC_DEFUN([LIBCFS_PROG_LINUX],
 [
 LIBCFS_FUNC_CPU_ONLINE
 LIBCFS_TYPE_GFP_T
-LIBCFS_TYPE_CPUMASK_T
 LIBCFS_CONFIG_PANIC_DUMPLOG
 
-LIBCFS_STRUCT_PAGE_LIST
-LIBCFS_STRUCT_SIGHAND
 LIBCFS_FUNC_SHOW_TASK
 LIBCFS_U64_LONG_LONG
 LIBCFS_TASK_RCU
index ff7c36f..71d88c3 100644 (file)
 #ifdef HAVE_MM_INLINE
 # include <linux/mm_inline.h>
 #endif
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-# include <linux/kallsyms.h>
-# include <linux/moduleparam.h>
-#endif
+#include <linux/kallsyms.h>
+#include <linux/moduleparam.h>
 #include <linux/scatterlist.h>
 
 #include <libcfs/linux/portals_compat25.h>
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#define schedule_work schedule_task
-#define prepare_work(wq,cb,cbdata)                                            \
-do {                                                                          \
-        INIT_TQUEUE((wq), 0, 0);                                              \
-        PREPARE_TQUEUE((wq), (cb), (cbdata));                                 \
-} while (0)
-
-#define PageUptodate Page_Uptodate
-#define our_recalc_sigpending(current) recalc_sigpending(current)
-#define cfs_num_online_cpus() smp_num_cpus
-#define work_struct_t                   struct tq_struct
-#define cfs_get_work_data(type,field,data)   (data)
-#else
-
 #ifdef HAVE_3ARGS_INIT_WORK
 
 #define prepare_work(wq,cb,cbdata)                                            \
@@ -121,8 +104,6 @@ do {                                                                          \
 #define strtok(a,b) strpbrk(a, b)
 #define work_struct_t      struct work_struct
 
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */
-
 #ifdef CONFIG_SMP
 #define LASSERT_SPIN_LOCKED(lock) LASSERT(spin_is_locked(lock))
 #define LINVRNT_SPIN_LOCKED(lock) LINVRNT(spin_is_locked(lock))
@@ -142,18 +123,6 @@ do {                                                                          \
 
 /* ------------------------------------------------------------------- */
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-
-#define PORTAL_SYMBOL_REGISTER(x) inter_module_register(#x, THIS_MODULE, &x)
-#define PORTAL_SYMBOL_UNREGISTER(x) inter_module_unregister(#x)
-
-#define PORTAL_SYMBOL_GET(x) ((typeof(&x))inter_module_get(#x))
-#define PORTAL_SYMBOL_PUT(x) inter_module_put(#x)
-
-#define PORTAL_MODULE_USE       MOD_INC_USE_COUNT
-#define PORTAL_MODULE_UNUSE     MOD_DEC_USE_COUNT
-#else
-
 #define PORTAL_SYMBOL_REGISTER(x)
 #define PORTAL_SYMBOL_UNREGISTER(x)
 
@@ -163,26 +132,15 @@ do {                                                                          \
 #define PORTAL_MODULE_USE       try_module_get(THIS_MODULE)
 #define PORTAL_MODULE_UNUSE     module_put(THIS_MODULE)
 
-#endif
 
 /******************************************************************************/
 /* Module parameter support */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-# define CFS_MODULE_PARM(name, t, type, perm, desc) \
-        MODULE_PARM(name, t);\
-        MODULE_PARM_DESC(name, desc)
-
-#else
-# define CFS_MODULE_PARM(name, t, type, perm, desc) \
+#define CFS_MODULE_PARM(name, t, type, perm, desc) \
         module_param(name, type, perm);\
         MODULE_PARM_DESC(name, desc)
-#endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9))
-# define CFS_SYSFS_MODULE_PARM  0 /* no sysfs module parameters */
-#else
-# define CFS_SYSFS_MODULE_PARM  1 /* module parameters accessible via sysfs */
-#endif
+#define CFS_SYSFS_MODULE_PARM  1 /* module parameters accessible via sysfs */
+
 /******************************************************************************/
 
 #if (__GNUC__)
@@ -206,10 +164,6 @@ do {                                                                          \
 #else
 #define cfs_num_possible_cpus() num_possible_cpus()
 #endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#define i_size_read(a) ((a)->i_size)
-#endif
-
 
 /******************************************************************************/
 /* Light-weight trace
index 078b541..19fbca1 100644 (file)
@@ -143,13 +143,6 @@ LL_PROC_PROTO(name)                                     \
 /*
  * Symbol register
  */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#define cfs_symbol_register(s, p)       inter_module_register(s, THIS_MODULE, p)
-#define cfs_symbol_unregister(s)        inter_module_unregister(s)
-#define cfs_symbol_get(s)               inter_module_get(s)
-#define cfs_symbol_put(s)               inter_module_put(s)
-#define cfs_module_get()                MOD_INC_USE_COUNT
-#else
 #define cfs_symbol_register(s, p)       do {} while(0)
 #define cfs_symbol_unregister(s)        do {} while(0)
 #define cfs_symbol_get(s)               symbol_get(s)
@@ -159,7 +152,6 @@ LL_PROC_PROTO(name)                                     \
 #define __cfs_module_get(m)             __module_get(m)
 #define cfs_module_put(m)               module_put(m)
 #define cfs_module_refcount(m)          module_refcount(m)
-#endif
 
 typedef struct module cfs_module_t;
 
index 4aaf19f..f0b7666 100644 (file)
 
 typedef struct socket   cfs_socket_t;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,72))
-# define sk_allocation  allocation
-# define sk_data_ready  data_ready
-# define sk_write_space write_space
-# define sk_user_data   user_data
-# define sk_prot        prot
-# define sk_sndbuf      sndbuf
-# define sk_rcvbuf      rcvbuf
-# define sk_socket      socket
-# define sk_sleep       sleep
-#endif
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
-# define sk_wmem_queued wmem_queued
-# define sk_err         err
-# define sk_route_caps  route_caps
-#endif
-
 #define SOCK_SNDBUF(so)         ((so)->sk->sk_sndbuf)
 #define SOCK_TEST_NOSPACE(so)   test_bit(SOCK_NOSPACE, &(so)->flags)
 
index 5a59a58..43c1f34 100644 (file)
 
 #include <libcfs/linux/portals_compat25.h>
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-
-/*
- * old kernels---CURRENT_TIME is struct timeval
- */
-typedef struct timeval cfs_fs_time_t;
-
-static inline void cfs_fs_time_usec(cfs_fs_time_t *t, struct timeval *v)
-{
-        *v = *t;
-}
-
-static inline void cfs_fs_time_nsec(cfs_fs_time_t *t, struct timespec *s)
-{
-        s->tv_sec  = t->tv_sec;
-        s->tv_nsec = t->tv_usec * 1000;
-}
-
-/*
- * internal helper function used by cfs_fs_time_before*()
- */
-static inline unsigned long long __cfs_fs_time_flat(cfs_fs_time_t *t)
-{
-        return (unsigned long long)t->tv_sec * ONE_MILLION + t->tv_usec;
-}
-
-#define CURRENT_KERN_TIME        xtime
-
-#else
-/* (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) */
-
 /*
  * post 2.5 kernels.
  */
@@ -169,9 +138,6 @@ static inline unsigned long long __cfs_fs_time_flat(cfs_fs_time_t *t)
 
 #define CURRENT_KERN_TIME        CURRENT_TIME
 
-/* (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) */
-#endif
-
 /*
  * Generic kernel stuff
  */
@@ -181,12 +147,12 @@ typedef long cfs_duration_t;
 typedef cycles_t cfs_cycles_t;
 
 static inline int cfs_time_before(cfs_time_t t1, cfs_time_t t2)
-{       
+{
         return time_before(t1, t2);
 }
 
 static inline int cfs_time_beforeq(cfs_time_t t1, cfs_time_t t2)
-{       
+{
         return time_before_eq(t1, t2);
 }
 
@@ -277,8 +243,6 @@ static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s)
 #endif
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-
 #define cfs_time_current_64 get_jiffies_64
 
 static inline __u64 cfs_time_add_64(__u64 t, __u64 d)
@@ -302,13 +266,6 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2)
         return (__s64)t2 - (__s64)t1 >= 0;
 }
 
-#else
-#define cfs_time_current_64 cfs_time_current
-#define cfs_time_add_64     cfs_time_add
-#define cfs_time_shift_64   cfs_time_shift
-#define cfs_time_before_64  cfs_time_before
-#define cfs_time_beforeq_64 cfs_time_beforeq
-#endif
 
 /*
  * One jiffy
index 7f9671a..eeac81d 100644 (file)
 
 // XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved
 #if defined(SPINLOCK_DEBUG) && SPINLOCK_DEBUG
-# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) || defined(CONFIG_RH_2_4_20)
 #  define SIGNAL_MASK_ASSERT() \
    LASSERT(current->sighand->siglock.magic == SPINLOCK_MAGIC)
-# else
-#  define SIGNAL_MASK_ASSERT() \
-   LASSERT(current->sigmask_lock.magic == SPINLOCK_MAGIC)
-# endif
 #else
 # define SIGNAL_MASK_ASSERT()
 #endif
 // XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-
-# define SIGNAL_MASK_LOCK(task, flags)                                  \
+#define SIGNAL_MASK_LOCK(task, flags)                                  \
   spin_lock_irqsave(&task->sighand->siglock, flags)
-# define SIGNAL_MASK_UNLOCK(task, flags)                                \
+#define SIGNAL_MASK_UNLOCK(task, flags)                                \
   spin_unlock_irqrestore(&task->sighand->siglock, flags)
-# define USERMODEHELPER(path, argv, envp)                               \
+#define USERMODEHELPER(path, argv, envp)                               \
   call_usermodehelper(path, argv, envp, 1)
-# define RECALC_SIGPENDING         recalc_sigpending()
-# define CLEAR_SIGPENDING          clear_tsk_thread_flag(current,       \
-                                                         TIF_SIGPENDING)
+#define RECALC_SIGPENDING         recalc_sigpending()
+#define CLEAR_SIGPENDING          clear_tsk_thread_flag(current,       \
+                                                        TIF_SIGPENDING)
 # define CURRENT_SECONDS           get_seconds()
 # define smp_num_cpus              num_online_cpus()
 
+#define cfs_wait_event_interruptible(wq, condition, ret)               \
+        ret = wait_event_interruptible(wq, condition)
+#define cfs_wait_event_interruptible_exclusive(wq, condition, ret)     \
+        ret = wait_event_interruptible(wq, condition)
 
-#elif defined(CONFIG_RH_2_4_20) /* RH 2.4.x */
-
-# define SIGNAL_MASK_LOCK(task, flags)                                  \
-  spin_lock_irqsave(&task->sighand->siglock, flags)
-# define SIGNAL_MASK_UNLOCK(task, flags)                                \
-  spin_unlock_irqrestore(&task->sighand->siglock, flags)
-# define USERMODEHELPER(path, argv, envp)                               \
-  call_usermodehelper(path, argv, envp)
-# define RECALC_SIGPENDING         recalc_sigpending()
-# define CLEAR_SIGPENDING          (current->sigpending = 0)
-# define CURRENT_SECONDS           CURRENT_TIME
-# define wait_event_interruptible_exclusive(wq, condition)              \
-        wait_event_interruptible(wq, condition)
-
-#else /* 2.4.x */
-
-# define SIGNAL_MASK_LOCK(task, flags)                                  \
-  spin_lock_irqsave(&task->sigmask_lock, flags)
-# define SIGNAL_MASK_UNLOCK(task, flags)                                \
-  spin_unlock_irqrestore(&task->sigmask_lock, flags)
-# define USERMODEHELPER(path, argv, envp)                               \
-  call_usermodehelper(path, argv, envp)
-# define RECALC_SIGPENDING         recalc_sigpending(current)
-# define CLEAR_SIGPENDING          (current->sigpending = 0)
-# define CURRENT_SECONDS           CURRENT_TIME
-# define wait_event_interruptible_exclusive(wq, condition)              \
-        wait_event_interruptible(wq, condition)
-
-#endif
-
-# define cfs_wait_event_interruptible(wq, condition, ret)               \
-         ret = wait_event_interruptible(wq, condition)
-# define cfs_wait_event_interruptible_exclusive(wq, condition, ret)     \
-         ret = wait_event_interruptible(wq, condition)
-
-#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20))
-#define UML_PID(tsk) ((tsk)->thread.extern_pid)
-#elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#define UML_PID(tsk) ((tsk)->thread.mode.tt.extern_pid)
-#else
 #define UML_PID(tsk) ((tsk)->pid)
-#endif
 
-#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-# define THREAD_NAME(comm, len, fmt, a...)                              \
-        snprintf(comm, len,fmt"|%d", ## a, UML_PID(current))
-#else
-# define THREAD_NAME(comm, len, fmt, a...)                              \
+#define THREAD_NAME(comm, len, fmt, a...)                              \
         snprintf(comm, len, fmt, ## a)
-#endif
 
-#ifdef HAVE_PAGE_LIST
-/* 2.4 alloc_page users can use page->list */
-#define PAGE_LIST_ENTRY list
-#define PAGE_LIST(page) ((page)->list)
-#else
 /* 2.6 alloc_page users can use page->lru */
 #define PAGE_LIST_ENTRY lru
 #define PAGE_LIST(page) ((page)->lru)
-#endif
 
 #ifndef HAVE_CPU_ONLINE
 #define cfs_cpu_online(cpu) ((1<<cpu) & (cpu_online_map))
 #else
 #define cfs_cpu_online(cpu) cpu_online(cpu)
 #endif
-#ifndef HAVE_CPUMASK_T
-typedef unsigned long cfs_cpumask_t;
-#define cfs_cpu_set(cpu, map) set_bit(cpu, &(map))
-#define cpus_clear(map) memset(&(map), 0, sizeof(cfs_cpumask_t))
-#endif
 
 #ifndef __user
 #define __user
index c3802a7..3c8c296 100644 (file)
@@ -183,18 +183,8 @@ static inline void ltrace_add_processnames(char* fname)
          */
         nob += snprintf(cmdbuf+nob, LTRACE_MAX_NOB, "%02x:%06x:%d:%lu.%06lu ",
                         S_RPC >> 24, D_VFSTRACE, 0, tv.tv_sec, tv.tv_usec);
-
-        if (underuml && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))) {
-                nob += snprintf (cmdbuf+nob, LTRACE_MAX_NOB,
-                                 "(%s:%d:%s() %d | %d+%lu): ",
-                                 "lltrace.h", __LINE__, __FUNCTION__, 0, 0, 0L);
-        }
-        else {
-                nob += snprintf (cmdbuf+nob, LTRACE_MAX_NOB,
-                                 "(%s:%d:%s() %d+%lu): ",
-                                 "lltrace.h", __LINE__, __FUNCTION__, 0, 0L);
-        }
-
+        nob += snprintf (cmdbuf+nob, LTRACE_MAX_NOB, "(%s:%d:%s() %d+%lu): ",
+                         "lltrace.h", __LINE__, __FUNCTION__, 0, 0L);
         nob += snprintf(cmdbuf+nob, LTRACE_MAX_NOB, " %%p %%c\" >> %s", fname);
         system(cmdbuf);
 }
index 3a8bab7..cfa55b1 100644 (file)
@@ -94,28 +94,18 @@ int    cfs_curproc_groups_nr(void)
 {
         int nr;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
         task_lock(current);
         nr = current_cred()->group_info->ngroups;
         task_unlock(current);
-#else
-        nr = current->ngroups;
-#endif
         return nr;
 }
 
 void   cfs_curproc_groups_dump(gid_t *array, int size)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
         task_lock(current);
         size = min_t(int, size, current_cred()->group_info->ngroups);
         memcpy(array, current_cred()->group_info->blocks[0], size * sizeof(__u32));
         task_unlock(current);
-#else
-        LASSERT(size <= NGROUPS);
-        size = min_t(int, size, current->ngroups);
-        memcpy(array, current->groups, size * sizeof(__u32));
-#endif
 }
 
 
index c882f06..3c60f6e 100644 (file)
@@ -73,9 +73,7 @@
 
 #include "tracefile.h"
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
 #include <linux/kallsyms.h>
-#endif
 
 char lnet_upcall[1024] = "/usr/lib/lustre/lnet_upcall";
 char lnet_debug_log_upcall[1024] = "/usr/lib/lustre/lnet_debug_log_upcall";
index 5fba344..4d9637f 100644 (file)
@@ -45,16 +45,6 @@ static unsigned int cfs_alloc_flags_to_gfp(u_int32_t flags)
 {
        unsigned int mflags = 0;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-        if (flags & CFS_ALLOC_ATOMIC)
-                mflags |= __GFP_HIGH;
-        else if (flags & CFS_ALLOC_WAIT)
-                mflags |= __GFP_WAIT;
-        else
-                mflags |= (__GFP_HIGH | __GFP_WAIT);
-        if (flags & CFS_ALLOC_IO)
-                mflags |= __GFP_IO | __GFP_HIGHIO;
-#else
         if (flags & CFS_ALLOC_ATOMIC)
                 mflags |= __GFP_HIGH;
         else
@@ -63,7 +53,6 @@ static unsigned int cfs_alloc_flags_to_gfp(u_int32_t flags)
                 mflags |= __GFP_NOWARN;
         if (flags & CFS_ALLOC_IO)
                 mflags |= __GFP_IO;
-#endif
         if (flags & CFS_ALLOC_FS)
                 mflags |= __GFP_FS;
         if (flags & CFS_ALLOC_HIGH)
index db00d03..d623e2f 100644 (file)
 #include <linux/in.h>
 #include <linux/file.h>
 /* For sys_open & sys_close */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 #include <linux/syscalls.h>
-#else
-#include <linux/fs.h>
-#endif
 
 int
 libcfs_sock_ioctl(int cmd, unsigned long arg)
index 9b1eb53..0bbcac9 100644 (file)
@@ -197,13 +197,7 @@ cfs_set_ptldebug_header(struct ptldebug_header *header, int subsys, int mask,
        header->ph_stack = stack;
        header->ph_pid = current->pid;
        header->ph_line_num = line;
-#if defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20))
-       header->ph_extern_pid = current->thread.extern_pid;
-#elif defined(__arch_um__) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-       header->ph_extern_pid = current->thread.mode.tt.extern_pid;
-#else
        header->ph_extern_pid = 0;
-#endif
        return;
 }
 
index de2806f..d4a6964 100644 (file)
 #include <linux/string.h>
 #include <linux/stat.h>
 #include <linux/errno.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#include <linux/locks.h>        /* wait_on_buffer */
-#else
 #include <linux/buffer_head.h>  /* wait_on_buffer */
-#endif
 #include <linux/unistd.h>
 #include <net/sock.h>
 #include <linux/uio.h>
index 53c213f..6907ab2 100644 (file)
@@ -1086,12 +1086,7 @@ ksocknal_lib_setup_sock (struct socket *sock)
         return (0);
 }
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-struct tcp_opt *sock2tcp_opt(struct sock *sk)
-{
-        return &(sk->tp_pinfo.af_tcp);
-}
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
 #define sock2tcp_opt(sk) tcp_sk(sk)
 #else
 struct tcp_opt *sock2tcp_opt(struct sock *sk)
index 610c949..494ce8e 100644 (file)
 #include <linux/sysctl.h>
 #include <asm/uaccess.h>
 #include <asm/div64.h>
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-# include <linux/syscalls.h>
-#endif
+#include <linux/syscalls.h>
 
 #include <libcfs/libcfs.h>
 #include <libcfs/linux/portals_compat25.h>
@@ -91,13 +88,8 @@ static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
 #endif
 }
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,7))
-# define SOCKNAL_WSPACE(sk)       sk_stream_wspace(sk)
-# define SOCKNAL_MIN_WSPACE(sk)   sk_stream_min_wspace(sk)
-#else
-# define SOCKNAL_WSPACE(sk)     tcp_wspace(sk)
-# define SOCKNAL_MIN_WSPACE(sk) (((sk)->sk_sndbuf*8)/10)
-#endif
+#define SOCKNAL_WSPACE(sk)       sk_stream_wspace(sk)
+#define SOCKNAL_MIN_WSPACE(sk)   sk_stream_min_wspace(sk)
 
 #ifndef CONFIG_SMP
 static inline
index b77e256..89ee6c5 100644 (file)
@@ -65,9 +65,9 @@ typedef unsigned short cfs_umode_t;
 
 #endif
 
-/* always adopt 2.5 definitions */
+/* always adopt 2.6.9 definitions */
 #define KERNEL_VERSION(a,b,c) ((a)*100+(b)*10+c)
-#define LINUX_VERSION_CODE KERNEL_VERSION(2,6,5)
+#define LINUX_VERSION_CODE KERNEL_VERSION(2,6,9)
 
 #ifndef page_private
 #define page_private(page) ((page)->private)
index 5f0a199..6498202 100644 (file)
@@ -303,11 +303,7 @@ static inline int mapping_has_pages(struct address_space *mapping)
 #define ll_vfs_symlink(dir, dentry, mnt, path, mode) \
                        vfs_symlink(dir, dentry, path)
 #endif
-#endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7))
-#define ll_set_dflags(dentry, flags) do { dentry->d_vfs_flags |= flags; } while(0)
-#else
 #define ll_set_dflags(dentry, flags) do { \
                 cfs_spin_lock(&dentry->d_lock); \
                 dentry->d_flags |= flags; \
index fcf2eb5..b63b0d0 100644 (file)
@@ -178,9 +178,6 @@ static LL_FOLLOW_LINK_RETURN_TYPE ll_follow_link(struct dentry *dentry,
                 GOTO(out, rc);
         }
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8))
-        rc = vfs_follow_link(nd, symname);
-#else
 #ifdef HAVE_COOKIE_FOLLOW_LINK
         nd_set_link(nd, symname);
         /* @symname may contain a pointer to the request message buffer,
@@ -196,7 +193,6 @@ static LL_FOLLOW_LINK_RETURN_TYPE ll_follow_link(struct dentry *dentry,
         nd_set_link(nd, symname);
         RETURN(0);
 #endif
-#endif
 out:
         ptlrpc_req_finished(request);
 #ifdef HAVE_COOKIE_FOLLOW_LINK