Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147019
b: refs/heads/master
c: b12d4f8
h: refs/heads/master
i:
  147017: d54c202
  147015: c76cdad
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed May 11, 2009
1 parent f20410e commit c7f3594
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 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: 2d75ce084eec2a8154225c7e978191b364029003
refs/heads/master: b12d4f82c1a3cdcb2441c803a3368a9426f2f47f
18 changes: 12 additions & 6 deletions trunk/drivers/block/paride/pcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,12 @@ static void do_pcd_request(struct request_queue * q)
if (pcd_busy)
return;
while (1) {
pcd_req = elv_next_request(q);
if (!pcd_req)
return;
if (!pcd_req) {
pcd_req = elv_next_request(q);
if (!pcd_req)
return;
blkdev_dequeue_request(pcd_req);
}

if (rq_data_dir(pcd_req) == READ) {
struct pcd_unit *cd = pcd_req->rq_disk->private_data;
Expand All @@ -734,8 +737,10 @@ static void do_pcd_request(struct request_queue * q)
pcd_busy = 1;
ps_set_intr(do_pcd_read, NULL, 0, nice);
return;
} else
__blk_end_request_cur(pcd_req, -EIO);
} else {
__blk_end_request_all(pcd_req, -EIO);
pcd_req = NULL;
}
}
}

Expand All @@ -744,7 +749,8 @@ static inline void next_request(int err)
unsigned long saved_flags;

spin_lock_irqsave(&pcd_lock, saved_flags);
__blk_end_request_cur(pcd_req, err);
if (!__blk_end_request_cur(pcd_req, err))
pcd_req = NULL;
pcd_busy = 0;
do_pcd_request(pcd_queue);
spin_unlock_irqrestore(&pcd_lock, saved_flags);
Expand Down
14 changes: 9 additions & 5 deletions trunk/drivers/block/paride/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,14 @@ static void run_fsm(void)
pd_claimed = 0;
phase = NULL;
spin_lock_irqsave(&pd_lock, saved_flags);
__blk_end_request_cur(pd_req,
res == Ok ? 0 : -EIO);
pd_req = elv_next_request(pd_queue);
if (!pd_req)
stop = 1;
if (!__blk_end_request_cur(pd_req,
res == Ok ? 0 : -EIO)) {
pd_req = elv_next_request(pd_queue);
if (!pd_req)
stop = 1;
else
blkdev_dequeue_request(pd_req);
}
spin_unlock_irqrestore(&pd_lock, saved_flags);
if (stop)
return;
Expand Down Expand Up @@ -706,6 +709,7 @@ static void do_pd_request(struct request_queue * q)
pd_req = elv_next_request(q);
if (!pd_req)
return;
blkdev_dequeue_request(pd_req);

schedule_fsm();
}
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/block/paride/pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,20 +752,21 @@ static struct request_queue *pf_queue;

static void pf_end_request(int err)
{
if (pf_req) {
__blk_end_request_cur(pf_req, err);
if (pf_req && !__blk_end_request_cur(pf_req, err))
pf_req = NULL;
}
}

static void do_pf_request(struct request_queue * q)
{
if (pf_busy)
return;
repeat:
pf_req = elv_next_request(q);
if (!pf_req)
return;
if (!pf_req) {
pf_req = elv_next_request(q);
if (!pf_req)
return;
blkdev_dequeue_request(pf_req);
}

pf_current = pf_req->rq_disk->private_data;
pf_block = blk_rq_pos(pf_req);
Expand Down Expand Up @@ -806,7 +807,6 @@ static int pf_next_buf(void)
if (!pf_count) {
spin_lock_irqsave(&pf_spin_lock, saved_flags);
pf_end_request(0);
pf_req = elv_next_request(pf_queue);
spin_unlock_irqrestore(&pf_spin_lock, saved_flags);
if (!pf_req)
return 1;
Expand Down

0 comments on commit c7f3594

Please sign in to comment.