Whamcloud - gitweb
- minor changes to run luster on 2.6
authoralex <alex>
Thu, 16 Oct 2003 17:56:09 +0000 (17:56 +0000)
committeralex <alex>
Thu, 16 Oct 2003 17:56:09 +0000 (17:56 +0000)
lustre/include/linux/lustre_compat25.h

index 01cdf57..eee421b 100644 (file)
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 
+/*
+ * OBD need working random driver, thus all our
+ * initialization routines must be called after device
+ * driver initialization
+ */
+#define module_init(a)     late_initcall(a)
+
 /* XXX our code should be using the 2.6 calls, not the other way around */
 #define TryLockPage(page)                TestSetPageLocked(page)
 #define filemap_fdatasync(mapping)       filemap_fdatawrite(mapping)
 
 #include <linux/writeback.h>
 
+static inline void lustre_daemonize_helper(void)
+{
+        LASSERT(current->signal != NULL);
+        current->signal->session = 1;
+        current->signal->pgrp = 1;
+        current->signal->tty = NULL;
+}
+
 #else /* 2.4.. */
 
 #define ll_vfs_create(a,b,c,d)              vfs_create(a,b,c)
@@ -111,6 +126,13 @@ static inline void __d_drop(struct dentry *dentry)
        INIT_LIST_HEAD(&dentry->d_hash);
 }
 
+static inline void lustre_daemonize_helper(void)
+{
+        current->session = 1;
+        current->pgrp = 1;
+        current->tty = NULL;
+}
+
 #endif /* end of 2.4 compat macros */
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))