The request functions for cciss and cpqarray drivers do not update statistics upon request completion. This would normally be done in end_that_request_first(), but this function is not used by these drivers, so the number of sectors read/written (as reported in /proc/diskstat and consequently also by utilities like iostat) is always zero. The following patch adds correct statistics for both drivers. Signed-off-by: Petr Tesarik <[email protected]> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 6ffe2b2..235ecce 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -1298,6 +1298,12 @@ static void cciss_softirq_done(struct re pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir); } + if (blk_fs_request(rq)) { + const int rw = rq_data_dir(rq); + + disk_stat_add(rq->rq_disk, sectors[rw], bio_sectors(rq->bio)); + } + complete_buffers(rq->bio, rq->errors); #ifdef CCISS_DEBUG diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 570d2f0..902155d 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c @@ -998,6 +998,7 @@ static inline void complete_buffers(stru */ static inline void complete_command(cmdlist_t *cmd, int timeout) { + struct request *rq = cmd->rq; int ok=1; int i, ddir; @@ -1029,12 +1030,18 @@ static inline void complete_command(cmdl pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, cmd->req.sg[i].size, ddir); - complete_buffers(cmd->rq->bio, ok); + if (blk_fs_request(rq)) { + const int rw = rq_data_dir(rq); - add_disk_randomness(cmd->rq->rq_disk); + disk_stat_add(rq->rq_disk, sectors[rw], bio_sectors(rq->bio)); + } + + complete_buffers(rq->bio, ok); + + add_disk_randomness(rq->rq_disk); - DBGPX(printk("Done with %p\n", cmd->rq);); - end_that_request_last(cmd->rq, ok ? 1 : -EIO); + DBGPX(printk("Done with %p\n", rq);); + end_that_request_last(rq, ok ? 1 : -EIO); } /*
Attachment:
signature.asc
Description: Toto je =?iso-8859-2?Q?digit=E1ln=EC?= =?ISO-8859-1?Q?_podepsan=E1?= =?iso-8859-2?Q?_=E8=E1st?= =?ISO-8859-1?Q?_zpr=E1vy?=
- Follow-Ups:
- Prev by Date: Re: [RFC] Pushing device/driver binding decisions to userspace
- Next by Date: Re: [patch 1/5] Fix timeout bug in rtmutex in 2.6.18-rt
- Previous by thread: [PATCH 2.6.19-rc5-git2] EFI: calling efi_get_time during suspend
- Next by thread: Re: [PATCH] Update disk statistics for cciss and cpqarray devices
- Index(es):