[Ocfs2-commits] jlbec commits r1084 - branches/format-changes/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Sun Jun 13 21:50:53 CDT 2004
Author: jlbec
Date: 2004-06-13 20:50:51 -0500 (Sun, 13 Jun 2004)
New Revision: 1084
Modified:
branches/format-changes/src/hash.c
branches/format-changes/src/ocfs_compat.h
Log:
o Make io_schedule compat to schedule on all < 2.6
o Make schedule_timeout be io_schedule_timeout in w_o_b_modified()
Modified: branches/format-changes/src/hash.c
===================================================================
--- branches/format-changes/src/hash.c 2004-06-14 01:36:53 UTC (rev 1083)
+++ branches/format-changes/src/hash.c 2004-06-14 01:50:51 UTC (rev 1084)
@@ -559,6 +559,24 @@
#define BUFFER_MODIFIED_TIMEOUT (10*HZ)
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+static inline void ocfs_kick_disk(struct buffer_head *bh)
+{
+ struct block_device *bd;
+
+ smp_mb();
+ bd = bh->b_bdev;
+ if (bd)
+ blk_run_address_space(bd->bd_inode->i_mapping);
+}
+#else
+static inline void ocfs_kick_disk(struct buffer_head *bh)
+{
+ run_task_queue(&tq_disk);
+}
+#endif
+
void wait_on_buffer_modified(struct buffer_head * bh)
{
int do_timeout = 1;
@@ -574,26 +592,14 @@
if (!buffer_modified(bh) ||
sem->s_pid == current->pid)
break;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- {
- struct block_device *bd;
- smp_mb();
- bd = bh->b_bdev;
- if (bd)
- blk_run_address_space(bd->bd_inode->i_mapping);
- }
-#else
- run_task_queue(&tq_disk);
-#endif
+ ocfs_kick_disk(bh);
if (!do_timeout) {
set_task_state(tsk, TASK_UNINTERRUPTIBLE);
-#warning io_schedule not exported on EL3
- //io_schedule();
- schedule();
+ io_schedule();
} else {
do_timeout = 0;
set_task_state(tsk, TASK_INTERRUPTIBLE);
- schedule_timeout(BUFFER_MODIFIED_TIMEOUT);
+ io_schedule_timeout(BUFFER_MODIFIED_TIMEOUT);
if (buffer_modified(bh) &&
sem->s_pid != current->pid && sem->s_pid != 0) {
#ifdef BH_SEM_DEBUG
Modified: branches/format-changes/src/ocfs_compat.h
===================================================================
--- branches/format-changes/src/ocfs_compat.h 2004-06-14 01:36:53 UTC (rev 1083)
+++ branches/format-changes/src/ocfs_compat.h 2004-06-14 01:50:51 UTC (rev 1084)
@@ -61,9 +61,8 @@
#define unlock_page(p) UnlockPage(p)
#endif
-#if !defined(RED_HAT_LINUX_KERNEL) || LINUX_VERSION_CODE < KERNEL_VERSION(2,4,21)
-#define io_schedule schedule
-#endif
+#define io_schedule schedule
+#define io_schedule_timeout schedule_timeout
#ifdef HAVE_NPTL
static inline void dequeue_signal_lock(struct task_struct *task,
More information about the Ocfs2-commits
mailing list