<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From: Kiyoshi Ueda &lt;k-ueda@ct.jp.nec.com&gt;

This patch moves dm_end_request() to make the next patch more readable.
No functional change.

Signed-off-by: Kiyoshi Ueda &lt;k-ueda@ct.jp.nec.com&gt;
Signed-off-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;

---
 drivers/md/dm.c |   62 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 31 insertions(+), 31 deletions(-)

Index: linux-2.6.32/drivers/md/dm.c
===================================================================
--- linux-2.6.32.orig/drivers/md/dm.c
+++ linux-2.6.32/drivers/md/dm.c
@@ -752,6 +752,37 @@ static void free_rq_clone(struct request
 	free_rq_tio(tio);
 }
 
+/*
+ * Complete the clone and the original request.
+ * Must be called without queue lock.
+ */
+static void dm_end_request(struct request *clone, int error)
+{
+	int rw = rq_data_dir(clone);
+	struct dm_rq_target_io *tio = clone-&gt;end_io_data;
+	struct mapped_device *md = tio-&gt;md;
+	struct request *rq = tio-&gt;orig;
+
+	if (blk_pc_request(rq)) {
+		rq-&gt;errors = clone-&gt;errors;
+		rq-&gt;resid_len = clone-&gt;resid_len;
+
+		if (rq-&gt;sense)
+			/*
+			 * We are using the sense buffer of the original
+			 * request.
+			 * So setting the length of the sense data is enough.
+			 */
+			rq-&gt;sense_len = clone-&gt;sense_len;
+	}
+
+	free_rq_clone(clone);
+
+	blk_end_request_all(rq, error);
+
+	rq_completed(md, rw, 1);
+}
+
 static void dm_unprep_request(struct request *rq)
 {
 	struct request *clone = rq-&gt;special;
@@ -815,37 +846,6 @@ static void start_queue(struct request_q
 	spin_unlock_irqrestore(q-&gt;queue_lock, flags);
 }
 
-/*
- * Complete the clone and the original request.
- * Must be called without queue lock.
- */
-static void dm_end_request(struct request *clone, int error)
-{
-	int rw = rq_data_dir(clone);
-	struct dm_rq_target_io *tio = clone-&gt;end_io_data;
-	struct mapped_device *md = tio-&gt;md;
-	struct request *rq = tio-&gt;orig;
-
-	if (blk_pc_request(rq)) {
-		rq-&gt;errors = clone-&gt;errors;
-		rq-&gt;resid_len = clone-&gt;resid_len;
-
-		if (rq-&gt;sense)
-			/*
-			 * We are using the sense buffer of the original
-			 * request.
-			 * So setting the length of the sense data is enough.
-			 */
-			rq-&gt;sense_len = clone-&gt;sense_len;
-	}
-
-	free_rq_clone(clone);
-
-	blk_end_request_all(rq, error);
-
-	rq_completed(md, rw, 1);
-}
-
 static void dm_done(struct request *clone, int error, bool mapped)
 {
 	int r = error;
</pre></body></html>