Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9042
b: refs/heads/master
c: 9564df1
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Sep 17, 2005
1 parent dcfbeab commit 5ad9db6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef402268f7c9ab1872cafa1e638eb78a75b7c18f
refs/heads/master: 9564df1ff3c61f41bdc54283715417ccdfb6782b
22 changes: 16 additions & 6 deletions trunk/drivers/block/paride/pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,14 @@ static int pf_ready(void)

static struct request_queue *pf_queue;

static void pf_end_request(int uptodate)
{
if (pf_req) {
end_request(pf_req, uptodate);
pf_req = NULL;
}
}

static void do_pf_request(request_queue_t * q)
{
if (pf_busy)
Expand All @@ -765,7 +773,7 @@ static void do_pf_request(request_queue_t * q)
pf_count = pf_req->current_nr_sectors;

if (pf_block + pf_count > get_capacity(pf_req->rq_disk)) {
end_request(pf_req, 0);
pf_end_request(0);
goto repeat;
}

Expand All @@ -780,7 +788,7 @@ static void do_pf_request(request_queue_t * q)
pi_do_claimed(pf_current->pi, do_pf_write);
else {
pf_busy = 0;
end_request(pf_req, 0);
pf_end_request(0);
goto repeat;
}
}
Expand All @@ -798,9 +806,11 @@ static int pf_next_buf(void)
if (!pf_count)
return 1;
spin_lock_irqsave(&pf_spin_lock, saved_flags);
end_request(pf_req, 1);
pf_count = pf_req->current_nr_sectors;
pf_buf = pf_req->buffer;
pf_end_request(1);
if (pf_req) {
pf_count = pf_req->current_nr_sectors;
pf_buf = pf_req->buffer;
}
spin_unlock_irqrestore(&pf_spin_lock, saved_flags);
return 1;
}
Expand All @@ -810,7 +820,7 @@ static inline void next_request(int success)
unsigned long saved_flags;

spin_lock_irqsave(&pf_spin_lock, saved_flags);
end_request(pf_req, success);
pf_end_request(success);
pf_busy = 0;
do_pf_request(pf_queue);
spin_unlock_irqrestore(&pf_spin_lock, saved_flags);
Expand Down

0 comments on commit 5ad9db6

Please sign in to comment.