[Ocfs2-commits] mfasheh commits r1860 - trunk/fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Jan 27 20:24:45 CST 2005
Author: mfasheh
Date: 2005-01-27 20:24:43 -0600 (Thu, 27 Jan 2005)
New Revision: 1860
Modified:
trunk/fs/ocfs2/dlm/dlmfs.c
trunk/fs/ocfs2/dlm/dlmfs_compat.h
trunk/fs/ocfs2/dlm/userdlm.c
trunk/fs/ocfs2/dlm/userdlm.h
Log:
* make this stuff compile and run on 2.4
* use a new method for computing domain key
Modified: trunk/fs/ocfs2/dlm/dlmfs.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs.c 2005-01-28 01:21:26 UTC (rev 1859)
+++ trunk/fs/ocfs2/dlm/dlmfs.c 2005-01-28 02:24:43 UTC (rev 1860)
@@ -528,13 +528,14 @@
return -ENOMEM;
cleanup_inode = 1;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
user_dlm_worker = create_workqueue("user_dlm");
if (!user_dlm_worker) {
status = -ENOMEM;
goto bail;
}
cleanup_worker = 1;
-
+#endif
status = register_filesystem(&dlmfs_fs_type);
bail:
if (status) {
Modified: trunk/fs/ocfs2/dlm/dlmfs_compat.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmfs_compat.h 2005-01-28 01:21:26 UTC (rev 1859)
+++ trunk/fs/ocfs2/dlm/dlmfs_compat.h 2005-01-28 02:24:43 UTC (rev 1860)
@@ -6,6 +6,7 @@
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#include <linux/fs.h>
+#include <linux/tqueue.h>
#define simple_dir_operations dcache_dir_ops
#define simple_rmdir simple_unlink
@@ -15,6 +16,18 @@
struct dentry * simple_lookup(struct inode *dir, struct dentry *dentry);
int simple_statfs(struct super_block *sb, struct statfs *buf);
+#define work_struct tq_struct
+#define PREPARE_WORK(w, f, d) INIT_TQUEUE(w, f, d)
+#define queue_work(queue, t) schedule_task(t)
+
+#define init_waitqueue_head(foobar)
+
+#define destroy_workqueue(foobar)
+
+#define flush_workqueue(foobar) flush_scheduled_tasks()
+
+#else
+#include <linux/workqueue.h>
#endif
#endif /* DLMFS_COMPAT_H */
Modified: trunk/fs/ocfs2/dlm/userdlm.c
===================================================================
--- trunk/fs/ocfs2/dlm/userdlm.c 2005-01-28 01:21:26 UTC (rev 1859)
+++ trunk/fs/ocfs2/dlm/userdlm.c 2005-01-28 02:24:43 UTC (rev 1860)
@@ -33,7 +33,7 @@
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/version.h>
-#include <linux/workqueue.h>
+#include <linux/crc32.h>
#include "util.h"
@@ -457,6 +457,9 @@
user_dlm_inc_holders(lockres, level);
spin_unlock(&lockres->l_lock);
+ dprintk("lockres %s: Got %s lock!\n", lockres->l_name,
+ (level == LKM_EXMODE) ? "LKM_EXMODE" : "LKM_PRMODE");
+
status = 0;
bail:
return status;
@@ -572,8 +575,9 @@
return NULL;
}
+ dlm_key = crc32(0, name->name, name->len);
+
snprintf(domain, name->len + 1, "%.*s", name->len, name->name);
- memcpy(&dlm_key, domain, sizeof(dlm_key));
dlm = dlm_register_domain(domain, domain, dlm_key);
Modified: trunk/fs/ocfs2/dlm/userdlm.h
===================================================================
--- trunk/fs/ocfs2/dlm/userdlm.h 2005-01-28 01:21:26 UTC (rev 1859)
+++ trunk/fs/ocfs2/dlm/userdlm.h 2005-01-28 02:24:43 UTC (rev 1860)
@@ -31,8 +31,9 @@
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/version.h>
-#include <linux/workqueue.h>
+#include "dlmfs_compat.h"
+
#define DEBUG_TRACING
#define err_printk(str, args...) \
More information about the Ocfs2-commits
mailing list