Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176549
b: refs/heads/master
c: 980691e
h: refs/heads/master
i:
  176547: b24258a
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Alasdair G Kergon committed Dec 10, 2009
1 parent 5139052 commit 2364a40
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11a68244e16b0c35e122dd55b4e7c595e0fb67a1
refs/heads/master: 980691e5f3a1b5ebbb2d34014e028fd7f1c6e4fb
62 changes: 31 additions & 31 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2364a40

Please sign in to comment.