linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
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,
	bharrosh@panasas.com
Subject: [PATCH 30/30] blk_end_request: cleanup of request completion (take 4)
Date: Tue, 11 Dec 2007 17:53:24 -0500 (EST)	[thread overview]
Message-ID: <20071211.175324.11049746.k-ueda@ct.jp.nec.com> (raw)

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 <bharrosh@panasas.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
---
 block/ll_rw_blk.c |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)

Index: 2.6.24-rc4/block/ll_rw_blk.c
===================================================================
--- 2.6.24-rc4.orig/block/ll_rw_blk.c
+++ 2.6.24-rc4/block/ll_rw_blk.c
@@ -3616,6 +3616,12 @@ static void end_that_request_last(struct
 {
 	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();
 
@@ -3633,10 +3639,15 @@ static void end_that_request_last(struct
 		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,
@@ -3737,20 +3748,6 @@ void end_request(struct request *req, in
 }
 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
@@ -3793,7 +3790,7 @@ static int blk_end_io(struct request *rq
 	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;
@@ -3841,7 +3838,7 @@ int __blk_end_request(struct request *rq
 
 	add_disk_randomness(rq->rq_disk);
 
-	complete_request(rq, error);
+	end_that_request_last(rq, error);
 
 	return 0;
 }

                 reply	other threads:[~2007-12-11 22:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071211.175324.11049746.k-ueda@ct.jp.nec.com \
    --to=k-ueda@ct.jp.nec.com \
    --cc=bharrosh@panasas.com \
    --cc=dm-devel@redhat.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).