* [PATCH 21/30] blk_end_request: changing cciss (take 4)
@ 2007-12-11 22:50 Kiyoshi Ueda
2007-12-12 15:25 ` Miller, Mike (OS Dev)
2007-12-12 19:06 ` Miller, Mike (OS Dev)
0 siblings, 2 replies; 5+ messages in thread
From: Kiyoshi Ueda @ 2007-12-11 22:50 UTC (permalink / raw)
To: jens.axboe
Cc: linux-kernel, linux-scsi, linux-ide, dm-devel, j-nomura, k-ueda,
mike.miller
This patch converts cciss to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.
cciss is a little bit different from "normal" drivers.
cciss directly calls bio_endio() and disk_stat_add()
when completing request. But those can be replaced with
__end_that_request_first().
After the replacement, request completion procedures of
those drivers become like the following:
o end_that_request_first()
o add_disk_randomness()
o end_that_request_last()
This can be converted to blk_end_request() by following
the rule (a) mentioned in the patch subject
"[PATCH 01/30] blk_end_request: add new request completion interface".
Cc: Mike Miller <mike.miller@hp.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
---
drivers/block/cciss.c | 25 +++----------------------
1 files changed, 3 insertions(+), 22 deletions(-)
Index: 2.6.24-rc4/drivers/block/cciss.c
===================================================================
--- 2.6.24-rc4.orig/drivers/block/cciss.c
+++ 2.6.24-rc4/drivers/block/cciss.c
@@ -1187,17 +1187,6 @@ static int cciss_ioctl(struct inode *ino
}
}
-static inline void complete_buffers(struct bio *bio, int status)
-{
- while (bio) {
- struct bio *xbh = bio->bi_next;
-
- bio->bi_next = NULL;
- bio_endio(bio, status ? 0 : -EIO);
- bio = xbh;
- }
-}
-
static void cciss_check_queues(ctlr_info_t *h)
{
int start_queue = h->next_to_run;
@@ -1263,21 +1252,14 @@ static void cciss_softirq_done(struct re
pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);
}
- complete_buffers(rq->bio, (rq->errors == 0));
-
- if (blk_fs_request(rq)) {
- const int rw = rq_data_dir(rq);
-
- disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
- }
-
#ifdef CCISS_DEBUG
printk("Done with %p\n", rq);
#endif /* CCISS_DEBUG */
- add_disk_randomness(rq->rq_disk);
+ if (blk_end_request(rq, (rq->errors == 0) ? 0 : -EIO, blk_rq_bytes(rq)))
+ BUG();
+
spin_lock_irqsave(&h->lock, flags);
- end_that_request_last(rq, (rq->errors == 0));
cmd_free(h, cmd, 1);
cciss_check_queues(h);
spin_unlock_irqrestore(&h->lock, flags);
@@ -2544,7 +2526,6 @@ after_error_processing:
}
cmd->rq->data_len = 0;
cmd->rq->completion_data = cmd;
- blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE);
blk_complete_request(cmd->rq);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 21/30] blk_end_request: changing cciss (take 4)
2007-12-11 22:50 [PATCH 21/30] blk_end_request: changing cciss (take 4) Kiyoshi Ueda
@ 2007-12-12 15:25 ` Miller, Mike (OS Dev)
2007-12-12 17:27 ` Kiyoshi Ueda
2007-12-12 19:06 ` Miller, Mike (OS Dev)
1 sibling, 1 reply; 5+ messages in thread
From: Miller, Mike (OS Dev) @ 2007-12-12 15:25 UTC (permalink / raw)
To: Kiyoshi Ueda, jens.axboe
Cc: linux-kernel, linux-scsi, linux-ide, dm-devel, j-nomura
>
> This patch converts cciss to use blk_end_request interfaces.
> Related 'uptodate' arguments are converted to 'error'.
>
> cciss is a little bit different from "normal" drivers.
> cciss directly calls bio_endio() and disk_stat_add() when
> completing request. But those can be replaced with
> __end_that_request_first().
> After the replacement, request completion procedures of those
> drivers become like the following:
> o end_that_request_first()
> o add_disk_randomness()
> o end_that_request_last()
> This can be converted to blk_end_request() by following the
> rule (a) mentioned in the patch subject "[PATCH 01/30]
> blk_end_request: add new request completion interface".
>
> Cc: Mike Miller <mike.miller@hp.com>
> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
> ---
> drivers/block/cciss.c | 25 +++----------------------
> 1 files changed, 3 insertions(+), 22 deletions(-)
>
> Index: 2.6.24-rc4/drivers/block/cciss.c
> ===================================================================
> --- 2.6.24-rc4.orig/drivers/block/cciss.c
> +++ 2.6.24-rc4/drivers/block/cciss.c
> @@ -1187,17 +1187,6 @@ static int cciss_ioctl(struct inode *ino
> }
> }
>
> -static inline void complete_buffers(struct bio *bio, int status) -{
> - while (bio) {
> - struct bio *xbh = bio->bi_next;
> -
> - bio->bi_next = NULL;
> - bio_endio(bio, status ? 0 : -EIO);
> - bio = xbh;
> - }
> -}
> -
> static void cciss_check_queues(ctlr_info_t *h) {
> int start_queue = h->next_to_run; @@ -1263,21
> +1252,14 @@ static void cciss_softirq_done(struct re
> pci_unmap_page(h->pdev, temp64.val,
> cmd->SG[i].Len, ddir);
> }
>
> - complete_buffers(rq->bio, (rq->errors == 0));
> -
> - if (blk_fs_request(rq)) {
> - const int rw = rq_data_dir(rq);
> -
> - disk_stat_add(rq->rq_disk, sectors[rw],
> rq->nr_sectors);
> - }
> -
> #ifdef CCISS_DEBUG
> printk("Done with %p\n", rq);
> #endif /* CCISS_DEBUG */
>
> - add_disk_randomness(rq->rq_disk);
> + if (blk_end_request(rq, (rq->errors == 0) ? 0 : -EIO,
> blk_rq_bytes(rq)))
> + BUG();
> +
> spin_lock_irqsave(&h->lock, flags);
> - end_that_request_last(rq, (rq->errors == 0));
> cmd_free(h, cmd, 1);
> cciss_check_queues(h);
> spin_unlock_irqrestore(&h->lock, flags); @@ -2544,7
> +2526,6 @@ after_error_processing:
> }
> cmd->rq->data_len = 0;
> cmd->rq->completion_data = cmd;
> - blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE);
Why is this removed?
-- mikem
> blk_complete_request(cmd->rq);
> }
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 21/30] blk_end_request: changing cciss (take 4)
2007-12-12 15:25 ` Miller, Mike (OS Dev)
@ 2007-12-12 17:27 ` Kiyoshi Ueda
2007-12-12 19:08 ` Miller, Mike (OS Dev)
0 siblings, 1 reply; 5+ messages in thread
From: Kiyoshi Ueda @ 2007-12-12 17:27 UTC (permalink / raw)
To: Mike.Miller
Cc: jens.axboe, linux-kernel, linux-scsi, linux-ide, dm-devel,
j-nomura, k-ueda
Hi Mike,
On Wed, 12 Dec 2007 15:25:10 +0000, "Miller, Mike (OS Dev)" <Mike.Miller@hp.com> wrote:
> > Index: 2.6.24-rc4/drivers/block/cciss.c
> > ===================================================================
> > --- 2.6.24-rc4.orig/drivers/block/cciss.c
> > +++ 2.6.24-rc4/drivers/block/cciss.c
snip
> > +2526,6 @@ after_error_processing:
> > }
> > cmd->rq->data_len = 0;
> > cmd->rq->completion_data = cmd;
> > - blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE);
>
> Why is this removed?
Sorry for the less explanation.
Because it is done in __end_that_request_first() called from
blk_end_request().
I'll add the explanation to the patch description when I update
the patch.
Thanks,
Kiyoshi Ueda
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 21/30] blk_end_request: changing cciss (take 4)
2007-12-12 17:27 ` Kiyoshi Ueda
@ 2007-12-12 19:08 ` Miller, Mike (OS Dev)
0 siblings, 0 replies; 5+ messages in thread
From: Miller, Mike (OS Dev) @ 2007-12-12 19:08 UTC (permalink / raw)
To: Kiyoshi Ueda
Cc: jens.axboe, linux-kernel, linux-scsi, linux-ide, dm-devel, j-nomura
> >
> > Why is this removed?
>
> Sorry for the less explanation.
>
> Because it is done in __end_that_request_first() called from
> blk_end_request().
> I'll add the explanation to the patch description when I
> update the patch.
>
Thank you. I've Acked the patch.
-- mikem
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 21/30] blk_end_request: changing cciss (take 4)
2007-12-11 22:50 [PATCH 21/30] blk_end_request: changing cciss (take 4) Kiyoshi Ueda
2007-12-12 15:25 ` Miller, Mike (OS Dev)
@ 2007-12-12 19:06 ` Miller, Mike (OS Dev)
1 sibling, 0 replies; 5+ messages in thread
From: Miller, Mike (OS Dev) @ 2007-12-12 19:06 UTC (permalink / raw)
To: Kiyoshi Ueda, jens.axboe
Cc: linux-kernel, linux-scsi, linux-ide, dm-devel, j-nomura
> -----Original Message-----
> From: Kiyoshi Ueda [mailto:k-ueda@ct.jp.nec.com]
> Sent: Tuesday, December 11, 2007 4:50 PM
> To: jens.axboe@oracle.com
> Cc: linux-kernel@vger.kernel.org; linux-scsi@vger.kernel.org;
> linux-ide@vger.kernel.org; dm-devel@redhat.com;
> j-nomura@ce.jp.nec.com; k-ueda@ct.jp.nec.com; Miller, Mike (OS Dev)
> Subject: [PATCH 21/30] blk_end_request: changing cciss (take 4)
>
> This patch converts cciss to use blk_end_request interfaces.
> Related 'uptodate' arguments are converted to 'error'.
>
> cciss is a little bit different from "normal" drivers.
> cciss directly calls bio_endio() and disk_stat_add() when
> completing request. But those can be replaced with
> __end_that_request_first().
> After the replacement, request completion procedures of those
> drivers become like the following:
> o end_that_request_first()
> o add_disk_randomness()
> o end_that_request_last()
> This can be converted to blk_end_request() by following the
> rule (a) mentioned in the patch subject "[PATCH 01/30]
> blk_end_request: add new request completion interface".
>
> Cc: Mike Miller <mike.miller@hp.com>
> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Acked-by: Mike Miller <mike.miller@hp.com>
> ---
> drivers/block/cciss.c | 25 +++----------------------
> 1 files changed, 3 insertions(+), 22 deletions(-)
>
> Index: 2.6.24-rc4/drivers/block/cciss.c
> ===================================================================
> --- 2.6.24-rc4.orig/drivers/block/cciss.c
> +++ 2.6.24-rc4/drivers/block/cciss.c
> @@ -1187,17 +1187,6 @@ static int cciss_ioctl(struct inode *ino
> }
> }
>
> -static inline void complete_buffers(struct bio *bio, int status) -{
> - while (bio) {
> - struct bio *xbh = bio->bi_next;
> -
> - bio->bi_next = NULL;
> - bio_endio(bio, status ? 0 : -EIO);
> - bio = xbh;
> - }
> -}
> -
> static void cciss_check_queues(ctlr_info_t *h) {
> int start_queue = h->next_to_run; @@ -1263,21
> +1252,14 @@ static void cciss_softirq_done(struct re
> pci_unmap_page(h->pdev, temp64.val,
> cmd->SG[i].Len, ddir);
> }
>
> - complete_buffers(rq->bio, (rq->errors == 0));
> -
> - if (blk_fs_request(rq)) {
> - const int rw = rq_data_dir(rq);
> -
> - disk_stat_add(rq->rq_disk, sectors[rw],
> rq->nr_sectors);
> - }
> -
> #ifdef CCISS_DEBUG
> printk("Done with %p\n", rq);
> #endif /* CCISS_DEBUG */
>
> - add_disk_randomness(rq->rq_disk);
> + if (blk_end_request(rq, (rq->errors == 0) ? 0 : -EIO,
> blk_rq_bytes(rq)))
> + BUG();
> +
> spin_lock_irqsave(&h->lock, flags);
> - end_that_request_last(rq, (rq->errors == 0));
> cmd_free(h, cmd, 1);
> cciss_check_queues(h);
> spin_unlock_irqrestore(&h->lock, flags); @@ -2544,7
> +2526,6 @@ after_error_processing:
> }
> cmd->rq->data_len = 0;
> cmd->rq->completion_data = cmd;
> - blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE);
> blk_complete_request(cmd->rq);
> }
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-12-12 19:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-11 22:50 [PATCH 21/30] blk_end_request: changing cciss (take 4) Kiyoshi Ueda
2007-12-12 15:25 ` Miller, Mike (OS Dev)
2007-12-12 17:27 ` Kiyoshi Ueda
2007-12-12 19:08 ` Miller, Mike (OS Dev)
2007-12-12 19:06 ` Miller, Mike (OS Dev)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).