Whamcloud - gitweb
- 2.6 fixes landed
[fs/lustre-release.git] / lustre / include / linux / lustre_compat25.h
index ed544ab..40620ac 100644 (file)
@@ -38,6 +38,7 @@
  * initialization routines must be called after device
  * driver initialization
  */
+#undef module_init
 #define module_init(a)     late_initcall(a)
 
 /* XXX our code should be using the 2.6 calls, not the other way around */
 static inline void lustre_daemonize_helper(void)
 {
         LASSERT(current->signal != NULL);
-        current->signal->session = 1;
-        current->signal->pgrp = 1;
-        current->signal->tty = NULL;
+        current->session = 1;
+        if (current->group_leader)
+                current->group_leader->__pgrp = 1;
+        else
+                CERROR("we aren't group leader\n");
+        current->tty = NULL;
 }
 
 #define  rb_node_s rb_node
@@ -78,6 +82,14 @@ static inline void lustre_daemonize_helper(void)
 typedef struct rb_root_s rb_root_t;
 typedef struct rb_node_s rb_node_t;
 
+#define smp_num_cpus    NR_CPUS
+
+#ifndef conditional_schedule
+#define conditional_schedule() cond_resched()
+#endif
+
+#include <linux/proc_fs.h>
+
 #else /* 2.4.. */
 
 #define ll_vfs_create(a,b,c,d)              vfs_create(a,b,c)
@@ -145,6 +157,11 @@ static inline void lustre_daemonize_helper(void)
 #define conditional_schedule() if (unlikely(need_resched())) schedule()
 #endif
 
+/* to find proc_dir_entry from inode. 2.6 has native one -bzzz */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
+#define PDE(ii)         ((ii)->u.generic_ip)
+#endif
+
 #endif /* end of 2.4 compat macros */
 
 #endif /* __KERNEL__ */