EVMS o(1) compatibility fixes & set_tast_state cleanups

Paul P Komkoff Jr (i@stingr.net)
Fri, 5 Apr 2002 14:13:26 +0400


2 things.

1 - to make evms work with o(1) scheduler. replace ->nice assigmnemnts with
set_user_nice
2 - ->state assignments with set_{task,current}_state.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.231 -> 1.232
# drivers/evms/md_core.c 1.1 -> 1.2
# drivers/evms/ldev_mgr.c 1.1 -> 1.2
# drivers/evms/evms.c 1.1 -> 1.2
# drivers/evms/md_raid5.c 1.1 -> 1.2
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/05 stingray@stingr.net 1.232
# o(1) adoption
# --------------------------------------------
#
diff -Nru a/drivers/evms/evms.c b/drivers/evms/evms.c
--- a/drivers/evms/evms.c Fri Apr 5 14:05:49 2002
+++ b/drivers/evms/evms.c Fri Apr 5 14:05:49 2002
@@ -1301,7 +1301,7 @@
thread->tsk = current;

current->policy = SCHED_OTHER;
- current->nice = -20;
+ set_user_nice(current, -20);
unlock_kernel();

complete(thread->event);
@@ -1310,11 +1310,11 @@
DECLARE_WAITQUEUE(wait, current);

add_wait_queue(&thread->wqueue, &wait);
- set_task_state(current, TASK_INTERRUPTIBLE);
+ set_current_state(TASK_INTERRUPTIBLE);
if (!test_bit(EVMS_THREAD_WAKEUP, &thread->flags)) {
schedule();
}
- current->state = TASK_RUNNING;
+ set_current_state(TASK_RUNNING);
remove_wait_queue(&thread->wqueue, &wait);
clear_bit(EVMS_THREAD_WAKEUP, &thread->flags);

diff -Nru a/drivers/evms/ldev_mgr.c b/drivers/evms/ldev_mgr.c
--- a/drivers/evms/ldev_mgr.c Fri Apr 5 14:05:49 2002
+++ b/drivers/evms/ldev_mgr.c Fri Apr 5 14:05:49 2002
@@ -796,7 +796,7 @@
break;
schedule();
} while (atomic_read(&bh_cb->blks_allocated));
- tsk->state = TASK_RUNNING;
+ set_task_state(tsk, TASK_RUNNING);
remove_wait_queue(&bh_cb->cb_wait, &wait);
}

diff -Nru a/drivers/evms/md_core.c b/drivers/evms/md_core.c
--- a/drivers/evms/md_core.c Fri Apr 5 14:05:49 2002
+++ b/drivers/evms/md_core.c Fri Apr 5 14:05:49 2002
@@ -2677,7 +2677,7 @@
/*
* Resync has low priority.
*/
- current->nice = 19;
+ set_user_nice(current, 19);

is_mddev_idle(mddev); /* this also initializes IO event counters */
for (m = 0; m < SYNC_MARKS; m++) {
@@ -2756,16 +2756,16 @@
currspeed = (j-mddev->resync_mark_cnt)/2/((jiffies-mddev->resync_mark)/HZ +1) +1;

if (currspeed > sysctl_speed_limit_min) {
- current->nice = 19;
+ set_user_nice(current, 19);

if ((currspeed > sysctl_speed_limit_max) ||
!is_mddev_idle(mddev)) {
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
md_schedule_timeout(HZ/4);
goto repeat;
}
} else
- current->nice = -20;
+ set_user_nice(current, -20);
}
LOG_DEFAULT("md%d: sync done.\n",mdidx(mddev));
err = 0;
diff -Nru a/drivers/evms/md_raid5.c b/drivers/evms/md_raid5.c
--- a/drivers/evms/md_raid5.c Fri Apr 5 14:05:49 2002
+++ b/drivers/evms/md_raid5.c Fri Apr 5 14:05:49 2002
@@ -1262,7 +1262,7 @@
break;
schedule();
} while (atomic_read(&bh_cb->blks_allocated));
- tsk->state = TASK_RUNNING;
+ set_task_state(tsk, TASK_RUNNING);
remove_wait_queue(&bh_cb->cb_wait, &wait);
}

-- 
Paul P 'Stingray' Komkoff 'Greatest' Jr // (icq)23200764 // (irc)Spacebar
  PPKJ1-RIPE // (smtp)i@stingr.net // (http)stingr.net // (pgp)0xA4B4ECA4
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/