]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - fs/gfs2/daemon.c
[GFS2] Update copyright date to 2006
[linux-2.6.git] / fs / gfs2 / daemon.c
index 94317dc7e42cee58f28a42565255ba772c2593cc..9e7b9f296786dd47067e4061014840435a4e5f71 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
@@ -15,7 +15,6 @@
 #include <linux/kthread.h>
 #include <linux/delay.h>
 #include <linux/gfs2_ondisk.h>
-#include <asm/semaphore.h>
 
 #include "gfs2.h"
 #include "lm_interface.h"
@@ -45,7 +44,7 @@
 
 int gfs2_scand(void *data)
 {
-       struct gfs2_sbd *sdp = (struct gfs2_sbd *)data;
+       struct gfs2_sbd *sdp = data;
        unsigned long t;
 
        while (!kthread_should_stop()) {
@@ -67,20 +66,15 @@ int gfs2_scand(void *data)
 
 int gfs2_glockd(void *data)
 {
-       struct gfs2_sbd *sdp = (struct gfs2_sbd *)data;
-       DECLARE_WAITQUEUE(wait_chan, current);
+       struct gfs2_sbd *sdp = data;
 
        while (!kthread_should_stop()) {
                while (atomic_read(&sdp->sd_reclaim_count))
                        gfs2_reclaim_glock(sdp);
 
-               set_current_state(TASK_INTERRUPTIBLE);
-               add_wait_queue(&sdp->sd_reclaim_wq, &wait_chan);
-               if (!atomic_read(&sdp->sd_reclaim_count) &&
-                   !kthread_should_stop())
-                       schedule();
-               remove_wait_queue(&sdp->sd_reclaim_wq, &wait_chan);
-               set_current_state(TASK_RUNNING);
+               wait_event_interruptible(sdp->sd_reclaim_wq,
+                                        (atomic_read(&sdp->sd_reclaim_count) ||
+                                        kthread_should_stop()));
        }
 
        return 0;
@@ -94,7 +88,7 @@ int gfs2_glockd(void *data)
 
 int gfs2_recoverd(void *data)
 {
-       struct gfs2_sbd *sdp = (struct gfs2_sbd *)data;
+       struct gfs2_sbd *sdp = data;
        unsigned long t;
 
        while (!kthread_should_stop()) {
@@ -116,7 +110,7 @@ int gfs2_recoverd(void *data)
 
 int gfs2_logd(void *data)
 {
-       struct gfs2_sbd *sdp = (struct gfs2_sbd *)data;
+       struct gfs2_sbd *sdp = data;
        struct gfs2_holder ji_gh;
        unsigned long t;
 
@@ -129,7 +123,7 @@ int gfs2_logd(void *data)
                gfs2_ail1_empty(sdp, DIO_ALL);
 
                if (time_after_eq(jiffies, t)) {
-                       gfs2_log_flush(sdp);
+                       gfs2_log_flush(sdp, NULL);
                        sdp->sd_log_flush_time = jiffies;
                }
 
@@ -159,7 +153,7 @@ int gfs2_logd(void *data)
 
 int gfs2_quotad(void *data)
 {
-       struct gfs2_sbd *sdp = (struct gfs2_sbd *)data;
+       struct gfs2_sbd *sdp = data;
        unsigned long t;
        int error;
 
@@ -209,7 +203,7 @@ int gfs2_quotad(void *data)
 
 int gfs2_inoded(void *data)
 {
-       struct gfs2_sbd *sdp = (struct gfs2_sbd *)data;
+       struct gfs2_sbd *sdp = data;
        unsigned long t;
        int error;