Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3daeea29f9348263e0dda89a565074390475bdf8
Commit:     3daeea29f9348263e0dda89a565074390475bdf8
Parent:     5a330e39b13fe8d368d015338a4267129f502a55
Author:     Kiyoshi Ueda <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 11 17:50:03 2007 -0500
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 10:36:58 2008 +0100

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Kiyoshi Ueda <[EMAIL PROTECTED]>
    Signed-off-by: Jun'ichi Nomura <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 drivers/block/cciss.c |   25 +++----------------------
 1 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 509b649..ef50068 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1187,17 +1187,6 @@ static int cciss_ioctl(struct inode *inode, struct file 
*filep,
        }
 }
 
-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 request *rq)
                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);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to