Commit aa759ff3 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] paride cleanup and fixes (15/25)

Equivalent transformation:
	next_request() call expanded.
parent 7e396129
...@@ -212,16 +212,28 @@ static void ps_set_intr(void) ...@@ -212,16 +212,28 @@ static void ps_set_intr(void)
static struct pd_unit *pd_current; /* current request's drive */ static struct pd_unit *pd_current; /* current request's drive */
static PIA *pi_current; /* current request's PIA */ static PIA *pi_current; /* current request's PIA */
static struct request *pd_req; /* current request */ static struct request *pd_req; /* current request */
static struct request_queue *pd_queue;
static void run_fsm(void) static void run_fsm(void)
{ {
while (1) { while (1) {
enum action res; enum action res;
unsigned long saved_flags;
int stop = 0;
switch(res = phase()) { switch(res = phase()) {
case Ok: case Fail: case Ok: case Fail:
pi_unclaim(pi_current); pi_unclaim(pi_current);
next_request(res); spin_lock_irqsave(&pd_lock, saved_flags);
end_request(pd_req, res);
pd_req = elv_next_request(pd_queue);
if (!pd_req)
stop = 1;
spin_unlock_irqrestore(&pd_lock, saved_flags);
if (stop)
return;
phase = do_pd_io;
ps_set_intr();
return; return;
case Wait: case Wait:
pi_unclaim(pi_current); pi_unclaim(pi_current);
...@@ -703,8 +715,6 @@ static int pd_probe_drive(struct pd_unit *disk) ...@@ -703,8 +715,6 @@ static int pd_probe_drive(struct pd_unit *disk)
return pd_identify(disk); return pd_identify(disk);
} }
static struct request_queue *pd_queue;
static int pd_detect(void) static int pd_detect(void)
{ {
int k, unit; int k, unit;
...@@ -802,23 +812,6 @@ static int pd_next_buf(void) ...@@ -802,23 +812,6 @@ static int pd_next_buf(void)
return 0; return 0;
} }
static inline void next_request(int success)
{
unsigned long saved_flags;
spin_lock_irqsave(&pd_lock, saved_flags);
end_request(pd_req, success);
pd_req = elv_next_request(pd_queue);
if (!pd_req) {
spin_unlock_irqrestore(&pd_lock, saved_flags);
return;
}
spin_unlock_irqrestore(&pd_lock, saved_flags);
phase = do_pd_io;
ps_set_intr();
}
static enum action do_pd_io(void) static enum action do_pd_io(void)
{ {
pd_current = pd_req->rq_disk->private_data; pd_current = pd_req->rq_disk->private_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment