lkml.org 
[lkml]   [2004]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [patch] Real-Time Preemption, -RT-2.6.9-rc4-mm1-U7
From
Date
On Tue, 2004-10-19 at 21:04, Thomas Gleixner wrote:
> On Tue, 2004-10-19 at 20:00, Ingo Molnar wrote:
> > i have released the -U7 Real-Time Preemption patch:
>
> Another simple fix.

Another one using wait_for_completion_timeout(). No problems so far.

tglx


diff -urN 2.6.9-rc4-mm1-RT-U7/fs/lockd/clntlock.c 2.6.9-rc4-mm1-RT-U7-work/fs/lockd/clntlock.c
--- 2.6.9-rc4-mm1-RT-U7/fs/lockd/clntlock.c 2004-10-12 09:32:10.000000000 +0200
+++ 2.6.9-rc4-mm1-RT-U7-work/fs/lockd/clntlock.c 2004-10-19 21:26:14.000000000 +0200
@@ -6,6 +6,7 @@
* Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
*/

+#include <linux/completion.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/time.h>
@@ -32,7 +33,7 @@
*/
struct nlm_wait {
struct nlm_wait * b_next; /* linked list */
- wait_queue_head_t b_wait; /* where to wait on */
+ struct completion b_wait; /* where to wait on */
struct nlm_host * b_host;
struct file_lock * b_lock; /* local file lock */
unsigned short b_reclaim; /* got to reclaim lock */
@@ -53,7 +54,7 @@

block.b_host = host;
block.b_lock = fl;
- init_waitqueue_head(&block.b_wait);
+ init_completion(&block.b_wait);
block.b_status = NLM_LCK_BLOCKED;
block.b_next = nlm_blocked;
nlm_blocked = &block;
@@ -69,7 +70,8 @@
* a 1 minute timeout would do. See the comment before
* nlmclnt_lock for an explanation.
*/
- sleep_on_timeout(&block.b_wait, 30*HZ);
+
+ wait_for_completion_timeout(&block.b_wait, 30*HZ);

for (head = &nlm_blocked; *head; head = &(*head)->b_next) {
if (*head == &block) {
@@ -118,7 +120,7 @@
* wake up the caller.
*/
block->b_status = NLM_LCK_GRANTED;
- wake_up(&block->b_wait);
+ complete(&block->b_wait);

return nlm_granted;
}
@@ -233,7 +235,7 @@
for (block = nlm_blocked; block; block = block->b_next) {
if (block->b_host == host) {
block->b_status = NLM_LCK_DENIED_GRACE_PERIOD;
- wake_up(&block->b_wait);
+ complete(&block->b_wait);
}
}
\
 
 \ /
  Last update: 2005-03-22 14:07    [W:1.822 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site