aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/daemon.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-04-24 13:13:56 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-04-24 13:13:56 -0400
commitb800a1cb3940f216c4e5c963007a1f72fca0f15f (patch)
treee84f378c693e4e61de91f40af31ee24dafce3295 /fs/gfs2/daemon.c
parent61e085a88cb59232eb8ff5b446d70491c7bf2c68 (diff)
[GFS2] Tidy up daemon.c
As per Andrew Morton's comments, remove uneeded casts and use wait_event_interruptible() rather than open code the wait. Cc: Andrew Morton <akpm@osdl.org> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/daemon.c')
-rw-r--r--fs/gfs2/daemon.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/fs/gfs2/daemon.c b/fs/gfs2/daemon.c
index b3830b92d78c..c2b5d69044c6 100644
--- a/fs/gfs2/daemon.c
+++ b/fs/gfs2/daemon.c
@@ -45,7 +45,7 @@
45 45
46int gfs2_scand(void *data) 46int gfs2_scand(void *data)
47{ 47{
48 struct gfs2_sbd *sdp = (struct gfs2_sbd *)data; 48 struct gfs2_sbd *sdp = data;
49 unsigned long t; 49 unsigned long t;
50 50
51 while (!kthread_should_stop()) { 51 while (!kthread_should_stop()) {
@@ -67,20 +67,15 @@ int gfs2_scand(void *data)
67 67
68int gfs2_glockd(void *data) 68int gfs2_glockd(void *data)
69{ 69{
70 struct gfs2_sbd *sdp = (struct gfs2_sbd *)data; 70 struct gfs2_sbd *sdp = data;
71 DECLARE_WAITQUEUE(wait_chan, current);
72 71
73 while (!kthread_should_stop()) { 72 while (!kthread_should_stop()) {
74 while (atomic_read(&sdp->sd_reclaim_count)) 73 while (atomic_read(&sdp->sd_reclaim_count))
75 gfs2_reclaim_glock(sdp); 74 gfs2_reclaim_glock(sdp);
76 75
77 set_current_state(TASK_INTERRUPTIBLE); 76 wait_event_interruptible(sdp->sd_reclaim_wq,
78 add_wait_queue(&sdp->sd_reclaim_wq, &wait_chan); 77 (atomic_read(&sdp->sd_reclaim_count) ||
79 if (!atomic_read(&sdp->sd_reclaim_count) && 78 kthread_should_stop()));
80 !kthread_should_stop())
81 schedule();
82 remove_wait_queue(&sdp->sd_reclaim_wq, &wait_chan);
83 set_current_state(TASK_RUNNING);
84 } 79 }
85 80
86 return 0; 81 return 0;
@@ -94,7 +89,7 @@ int gfs2_glockd(void *data)
94 89
95int gfs2_recoverd(void *data) 90int gfs2_recoverd(void *data)
96{ 91{
97 struct gfs2_sbd *sdp = (struct gfs2_sbd *)data; 92 struct gfs2_sbd *sdp = data;
98 unsigned long t; 93 unsigned long t;
99 94
100 while (!kthread_should_stop()) { 95 while (!kthread_should_stop()) {
@@ -116,7 +111,7 @@ int gfs2_recoverd(void *data)
116 111
117int gfs2_logd(void *data) 112int gfs2_logd(void *data)
118{ 113{
119 struct gfs2_sbd *sdp = (struct gfs2_sbd *)data; 114 struct gfs2_sbd *sdp = data;
120 struct gfs2_holder ji_gh; 115 struct gfs2_holder ji_gh;
121 unsigned long t; 116 unsigned long t;
122 117
@@ -159,7 +154,7 @@ int gfs2_logd(void *data)
159 154
160int gfs2_quotad(void *data) 155int gfs2_quotad(void *data)
161{ 156{
162 struct gfs2_sbd *sdp = (struct gfs2_sbd *)data; 157 struct gfs2_sbd *sdp = data;
163 unsigned long t; 158 unsigned long t;
164 int error; 159 int error;
165 160
@@ -209,7 +204,7 @@ int gfs2_quotad(void *data)
209 204
210int gfs2_inoded(void *data) 205int gfs2_inoded(void *data)
211{ 206{
212 struct gfs2_sbd *sdp = (struct gfs2_sbd *)data; 207 struct gfs2_sbd *sdp = data;
213 unsigned long t; 208 unsigned long t;
214 int error; 209 int error;
215 210