Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77624
b: refs/heads/master
c: ea6f06f
h: refs/heads/master
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Jens Axboe committed Jan 28, 2008
1 parent fb19a14 commit 91824cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 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: 3daeea29f9348263e0dda89a565074390475bdf8
refs/heads/master: ea6f06f416347448645e60294d92c0c19aba8589
36 changes: 7 additions & 29 deletions trunk/drivers/block/cpqarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ static void start_io(ctlr_info_t *h);

static inline void addQ(cmdlist_t **Qptr, cmdlist_t *c);
static inline cmdlist_t *removeQ(cmdlist_t **Qptr, cmdlist_t *c);
static inline void complete_buffers(struct bio *bio, int ok);
static inline void complete_command(cmdlist_t *cmd, int timeout);

static irqreturn_t do_ida_intr(int irq, void *dev_id);
Expand Down Expand Up @@ -980,26 +979,13 @@ static void start_io(ctlr_info_t *h)
}
}

static inline void complete_buffers(struct bio *bio, int ok)
{
struct bio *xbh;

while (bio) {
xbh = bio->bi_next;
bio->bi_next = NULL;

bio_endio(bio, ok ? 0 : -EIO);

bio = xbh;
}
}
/*
* Mark all buffers that cmd was responsible for
*/
static inline void complete_command(cmdlist_t *cmd, int timeout)
{
struct request *rq = cmd->rq;
int ok=1;
int error = 0;
int i, ddir;

if (cmd->req.hdr.rcode & RCODE_NONFATAL &&
Expand All @@ -1011,16 +997,17 @@ static inline void complete_command(cmdlist_t *cmd, int timeout)
if (cmd->req.hdr.rcode & RCODE_FATAL) {
printk(KERN_WARNING "Fatal error on ida/c%dd%d\n",
cmd->ctlr, cmd->hdr.unit);
ok = 0;
error = -EIO;
}
if (cmd->req.hdr.rcode & RCODE_INVREQ) {
printk(KERN_WARNING "Invalid request on ida/c%dd%d = (cmd=%x sect=%d cnt=%d sg=%d ret=%x)\n",
cmd->ctlr, cmd->hdr.unit, cmd->req.hdr.cmd,
cmd->req.hdr.blk, cmd->req.hdr.blk_cnt,
cmd->req.hdr.sg_cnt, cmd->req.hdr.rcode);
ok = 0;
error = -EIO;
}
if (timeout) ok = 0;
if (timeout)
error = -EIO;
/* unmap the DMA mapping for all the scatter gather elements */
if (cmd->req.hdr.cmd == IDA_READ)
ddir = PCI_DMA_FROMDEVICE;
Expand All @@ -1030,18 +1017,9 @@ static inline void complete_command(cmdlist_t *cmd, int timeout)
pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr,
cmd->req.sg[i].size, ddir);

complete_buffers(rq->bio, ok);

if (blk_fs_request(rq)) {
const int rw = rq_data_dir(rq);

disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
}

add_disk_randomness(rq->rq_disk);

DBGPX(printk("Done with %p\n", rq););
end_that_request_last(rq, ok ? 1 : -EIO);
if (__blk_end_request(rq, error, blk_rq_bytes(rq)))
BUG();
}

/*
Expand Down

0 comments on commit 91824cd

Please sign in to comment.