Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157218
b: refs/heads/master
c: 40bea43
h: refs/heads/master
v: v3
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Sep 4, 2009
1 parent 00255b9 commit b99d33c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 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: a963a956225eb0f8c4d3537f428153c30adf54b8
refs/heads/master: 40bea431274c247425e7f5970d796ff7b37a2b22
13 changes: 12 additions & 1 deletion trunk/drivers/md/dm-stripe.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,27 @@ static int stripe_iterate_devices(struct dm_target *ti,
return ret;
}

static void stripe_io_hints(struct dm_target *ti,
struct queue_limits *limits)
{
struct stripe_c *sc = ti->private;
unsigned chunk_size = (sc->chunk_mask + 1) << 9;

blk_limits_io_min(limits, chunk_size);
limits->io_opt = chunk_size * sc->stripes;
}

static struct target_type stripe_target = {
.name = "striped",
.version = {1, 2, 0},
.version = {1, 3, 0},
.module = THIS_MODULE,
.ctr = stripe_ctr,
.dtr = stripe_dtr,
.map = stripe_map,
.end_io = stripe_end_io,
.status = stripe_status,
.iterate_devices = stripe_iterate_devices,
.io_hints = stripe_io_hints,
};

int __init dm_stripe_init(void)
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,10 @@ int dm_calculate_queue_limits(struct dm_table *table,
ti->type->iterate_devices(ti, dm_set_device_limits,
&ti_limits);

/* Set I/O hints portion of queue limits */
if (ti->type->io_hints)
ti->type->io_hints(ti, &ti_limits);

/*
* Check each device area is consistent with the target's
* overall queue limits.
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/device-mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
iterate_devices_callout_fn fn,
void *data);

typedef void (*dm_io_hints_fn) (struct dm_target *ti,
struct queue_limits *limits);

/*
* Returns:
* 0: The target can handle the next I/O immediately.
Expand Down Expand Up @@ -151,6 +154,7 @@ struct target_type {
dm_merge_fn merge;
dm_busy_fn busy;
dm_iterate_devices_fn iterate_devices;
dm_io_hints_fn io_hints;

/* For internal device-mapper use. */
struct list_head list;
Expand Down

0 comments on commit b99d33c

Please sign in to comment.