Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180583
b: refs/heads/master
c: 9eef87d
h: refs/heads/master
i:
  180581: a8d9999
  180579: 441f88b
  180575: 340eded
v: v3
  • Loading branch information
Kiyoshi Ueda authored and Alasdair G Kergon committed Feb 16, 2010
1 parent f537b43 commit f3ede2f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 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: 558569aa9d83e016295bac77d900342908d7fd85
refs/heads/master: 9eef87da2a8ea4920e0d913ff977cac064b68ee0
21 changes: 17 additions & 4 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,10 +1595,15 @@ static int dm_prep_fn(struct request_queue *q, struct request *rq)
return BLKPREP_OK;
}

static void map_request(struct dm_target *ti, struct request *clone,
struct mapped_device *md)
/*
* Returns:
* 0 : the request has been processed (not requeued)
* !0 : the request has been requeued
*/
static int map_request(struct dm_target *ti, struct request *clone,
struct mapped_device *md)
{
int r;
int r, requeued = 0;
struct dm_rq_target_io *tio = clone->end_io_data;

/*
Expand All @@ -1625,6 +1630,7 @@ static void map_request(struct dm_target *ti, struct request *clone,
case DM_MAPIO_REQUEUE:
/* The target wants to requeue the I/O */
dm_requeue_unmapped_request(clone);
requeued = 1;
break;
default:
if (r > 0) {
Expand All @@ -1636,6 +1642,8 @@ static void map_request(struct dm_target *ti, struct request *clone,
dm_kill_unmapped_request(clone, r);
break;
}

return requeued;
}

/*
Expand Down Expand Up @@ -1677,12 +1685,17 @@ static void dm_request_fn(struct request_queue *q)
atomic_inc(&md->pending[rq_data_dir(clone)]);

spin_unlock(q->queue_lock);
map_request(ti, clone, md);
if (map_request(ti, clone, md))
goto requeued;

spin_lock_irq(q->queue_lock);
}

goto out;

requeued:
spin_lock_irq(q->queue_lock);

plug_and_out:
if (!elv_queue_empty(q))
/* Some requests still remain, retry later */
Expand Down

0 comments on commit f3ede2f

Please sign in to comment.