Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b8286239ddaf2632cec65c01e68a403ac4c3d079
Commit:     b8286239ddaf2632cec65c01e68a403ac4c3d079
Parent:     5450d3e1d68f10be087f0855d8bad5458b50ecbe
Author:     Kiyoshi Ueda <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 11 17:53:24 2007 -0500
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 10:37:15 2008 +0100

    blk_end_request: cleanup of request completion (take 4)
    
    This patch merges complete_request() into end_that_request_last()
    for cleanup.
    
    complete_request() was introduced by earlier part of this patch-set,
    not to break the existing users of end_that_request_last().
    
    Since all users are converted to blk_end_request interfaces and
    end_that_request_last() is no longer exported, the code can be
    merged to end_that_request_last().
    
    Cc: Boaz Harrosh <[EMAIL PROTECTED]>
    Signed-off-by: Kiyoshi Ueda <[EMAIL PROTECTED]>
    Signed-off-by: Jun'ichi Nomura <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 block/ll_rw_blk.c |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index f5e091b..4bf95b6 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3638,6 +3638,12 @@ static void end_that_request_last(struct request *req, 
int error)
 {
        struct gendisk *disk = req->rq_disk;
 
+       if (blk_rq_tagged(req))
+               blk_queue_end_tag(req->q, req);
+
+       if (blk_queued_rq(req))
+               blkdev_dequeue_request(req);
+
        if (unlikely(laptop_mode) && blk_fs_request(req))
                laptop_io_completion();
 
@@ -3655,10 +3661,15 @@ static void end_that_request_last(struct request *req, 
int error)
                disk_round_stats(disk);
                disk->in_flight--;
        }
+
        if (req->end_io)
                req->end_io(req, error);
-       else
+       else {
+               if (blk_bidi_rq(req))
+                       __blk_put_request(req->next_rq->q, req->next_rq);
+
                __blk_put_request(req->q, req);
+       }
 }
 
 static inline void __end_request(struct request *rq, int uptodate,
@@ -3759,20 +3770,6 @@ void end_request(struct request *req, int uptodate)
 }
 EXPORT_SYMBOL(end_request);
 
-static void complete_request(struct request *rq, int error)
-{
-       if (blk_rq_tagged(rq))
-               blk_queue_end_tag(rq->q, rq);
-
-       if (blk_queued_rq(rq))
-               blkdev_dequeue_request(rq);
-
-       if (blk_bidi_rq(rq) && !rq->end_io)
-               __blk_put_request(rq->next_rq->q, rq->next_rq);
-
-       end_that_request_last(rq, error);
-}
-
 /**
  * blk_end_io - Generic end_io function to complete a request.
  * @rq:           the request being processed
@@ -3815,7 +3812,7 @@ static int blk_end_io(struct request *rq, int error, int 
nr_bytes,
        add_disk_randomness(rq->rq_disk);
 
        spin_lock_irqsave(q->queue_lock, flags);
-       complete_request(rq, error);
+       end_that_request_last(rq, error);
        spin_unlock_irqrestore(q->queue_lock, flags);
 
        return 0;
@@ -3863,7 +3860,7 @@ int __blk_end_request(struct request *rq, int error, int 
nr_bytes)
 
        add_disk_randomness(rq->rq_disk);
 
-       complete_request(rq, error);
+       end_that_request_last(rq, error);
 
        return 0;
 }
-
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