[Ocfs2-commits] manish commits r1150 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Jun 18 13:54:53 CDT 2004


Author: manish
Date: 2004-06-18 12:54:51 -0500 (Fri, 18 Jun 2004)
New Revision: 1150

Modified:
   trunk/src/journal.c
   trunk/src/nm.c
   trunk/src/ocfs.h
   trunk/src/ocfs_compat.h
   trunk/src/volcfg.c
   trunk/src/vote.c
Log:
Get rid of work_struct/tq_struct #ifdefs


Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c	2004-06-18 17:30:17 UTC (rev 1149)
+++ trunk/src/journal.c	2004-06-18 17:54:51 UTC (rev 1150)
@@ -1583,11 +1583,7 @@
 	}
 
 	/* Flush all scheduled tasks */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	flush_scheduled_work ();
-#else
-	flush_scheduled_tasks ();
-#endif
+	flush_scheduled_work();
 	complete (&(commit->c_complete));
 	return 0;
 }

Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-06-18 17:30:17 UTC (rev 1149)
+++ trunk/src/nm.c	2004-06-18 17:54:51 UTC (rev 1150)
@@ -137,11 +137,7 @@
 
 finally:
 	/* Flush all scheduled tasks */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	flush_scheduled_work ();
-#else
-	flush_scheduled_tasks ();
-#endif
+	flush_scheduled_work();
 
 	if (OcfsIpcCtxt.send_sock) {
 		sock_release (OcfsIpcCtxt.send_sock);
@@ -168,11 +164,7 @@
 	ocfs_super *osb;
 	ocfs_vote_request_ctxt ctxt;
 	__u8 publish_sect[512];
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	struct work_struct ipc_wq;
-#else
-	struct tq_struct ipc_tq;
-#endif
 };
 
 void ocfs_process_vote_worker(void *val)
@@ -237,13 +229,8 @@
 	
 	sv->osb = osb;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	INIT_WORK (&sv->ipc_wq, ocfs_process_vote_worker, sv);
-	schedule_work (&sv->ipc_wq);
-#else
-	INIT_TQUEUE (&sv->ipc_tq, ocfs_process_vote_worker, sv);
-	schedule_task (&sv->ipc_tq);
-#endif
+	INIT_WORK(&sv->ipc_wq, ocfs_process_vote_worker, sv);
+	schedule_work(&sv->ipc_wq);
 
 bail:
 	/* if no error, then the workqueue should clear it? */
@@ -459,11 +446,7 @@
 	}
 
 	/* Flush all scheduled tasks */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	flush_scheduled_work ();
-#else
-	flush_scheduled_tasks ();
-#endif
+	flush_scheduled_work();
 
 	complete (&(osb->dlm_complete));
 eek:
@@ -1499,11 +1482,7 @@
 	}
 
 	/* Flush all scheduled tasks */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	flush_scheduled_work ();
-#else
-	flush_scheduled_tasks ();
-#endif
+	flush_scheduled_work();
 
 #warning   need a way to wait on all of these threads on dismount
 /*

Modified: trunk/src/ocfs.h
===================================================================
--- trunk/src/ocfs.h	2004-06-18 17:30:17 UTC (rev 1149)
+++ trunk/src/ocfs.h	2004-06-18 17:54:51 UTC (rev 1150)
@@ -901,21 +901,13 @@
 	__s32 msg_len;
 	__u8 msg[OCFS_MAX_DLM_PKT_SIZE];
 	int status;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	struct work_struct ipc_wq;
-#else
-	struct tq_struct ipc_tq;
-#endif
 }
 ocfs_recv_ctxt;
 
 typedef struct _ocfs_cfg_task
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	struct work_struct cfg_wq;
-#else
-	struct tq_struct cfg_tq;
-#endif
 	ocfs_super *osb;
 	__u64 lock_off;
 	__u8 *buffer;

Modified: trunk/src/ocfs_compat.h
===================================================================
--- trunk/src/ocfs_compat.h	2004-06-18 17:30:17 UTC (rev 1149)
+++ trunk/src/ocfs_compat.h	2004-06-18 17:54:51 UTC (rev 1150)
@@ -70,6 +70,11 @@
 #define io_schedule_timeout	schedule_timeout
 #define bdev_hardsect_size(b)	get_hardsect_size((b)->bd_dev);
 
+#define flush_scheduled_work	flush_scheduled_tasks
+#define work_struct		tq_struct
+#define INIT_WORK(w, f, d)	INIT_TQUEUE(w, f, d)
+#define schedule_work(w)	schedule_task(w)
+
 #ifdef HAVE_NPTL
 static inline void dequeue_signal_lock(struct task_struct *task,
 				       sigset_t *blocked, siginfo_t *info)

Modified: trunk/src/volcfg.c
===================================================================
--- trunk/src/volcfg.c	2004-06-18 17:30:17 UTC (rev 1149)
+++ trunk/src/volcfg.c	2004-06-18 17:54:51 UTC (rev 1150)
@@ -120,13 +120,8 @@
 	cfg_task = (ocfs_cfg_task *) arg;
 
 	/* initialize the task and submit it */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	INIT_WORK   (&(cfg_task->cfg_wq), ocfs_worker, cfg_task);
-	schedule_work (&cfg_task->cfg_wq);
-#else
-	INIT_TQUEUE (&(cfg_task->cfg_tq), ocfs_worker, cfg_task);
-	schedule_task (&cfg_task->cfg_tq);
-#endif
+	INIT_WORK(&cfg_task->cfg_wq, ocfs_worker, cfg_task);
+	schedule_work(&cfg_task->cfg_wq);
 
 	LOG_EXIT ();
 	return ;

Modified: trunk/src/vote.c
===================================================================
--- trunk/src/vote.c	2004-06-18 17:30:17 UTC (rev 1149)
+++ trunk/src/vote.c	2004-06-18 17:54:51 UTC (rev 1150)
@@ -109,11 +109,7 @@
 	LOG_ENTRY ();
 
 	/* Initialize the workitem with our worker routine and Q it. */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	INIT_WORK (&recv_ctxt->ipc_wq, ocfs_dlm_recv_msg, recv_ctxt);
-#else
-	INIT_TQUEUE (&recv_ctxt->ipc_tq, ocfs_dlm_recv_msg, recv_ctxt);
-#endif
 
 	memset (&sin, 0, sizeof (sin));
 	oldfs = get_fs ();
@@ -140,11 +136,7 @@
 			NIPQUAD (sin.sin_addr.s_addr));
 
 	if (status == 0)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-		schedule_work (&recv_ctxt->ipc_wq);
-#else
-		schedule_task (&recv_ctxt->ipc_tq);
-#endif
+		schedule_work(&recv_ctxt->ipc_wq);
 
 bail:
 	LOG_EXIT_STATUS (status);



More information about the Ocfs2-commits mailing list