aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2009-12-10 23:52:17 +0000
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 23:52:17 +0000
commit980691e5f3a1b5ebbb2d34014e028fd7f1c6e4fb (patch)
treea4d593cf3818a54c41e6a4115cad63128b738c0b /drivers/md/dm.c
parentdm: refactor request based completion functions (diff)
downloadlinux-dev-980691e5f3a1b5ebbb2d34014e028fd7f1c6e4fb.tar.xz
linux-dev-980691e5f3a1b5ebbb2d34014e028fd7f1c6e4fb.zip
dm: move dm_end_request
This patch moves dm_end_request() to make the next patch more readable. No functional change. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index c65be45a4c42..821a5dd6a8d1 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -752,6 +752,37 @@ static void free_rq_clone(struct request *clone)
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->end_io_data;
+ struct mapped_device *md = tio->md;
+ struct request *rq = tio->orig;
+
+ if (blk_pc_request(rq)) {
+ rq->errors = clone->errors;
+ rq->resid_len = clone->resid_len;
+
+ if (rq->sense)
+ /*
+ * We are using the sense buffer of the original
+ * request.
+ * So setting the length of the sense data is enough.
+ */
+ rq->sense_len = clone->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->special;
@@ -815,37 +846,6 @@ static void start_queue(struct request_queue *q)
spin_unlock_irqrestore(q->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->end_io_data;
- struct mapped_device *md = tio->md;
- struct request *rq = tio->orig;
-
- if (blk_pc_request(rq)) {
- rq->errors = clone->errors;
- rq->resid_len = clone->resid_len;
-
- if (rq->sense)
- /*
- * We are using the sense buffer of the original
- * request.
- * So setting the length of the sense data is enough.
- */
- rq->sense_len = clone->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;