Commit 4897f101 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm table: pass correct dev area size to device_area_is_valid
  dm: remove queue next_ordered workaround for barriers
  dm raid1: wake kmirrord when requeueing delayed bios after remote recovery
parents a9355cf8 5dea271b
...@@ -1318,7 +1318,7 @@ static int crypt_iterate_devices(struct dm_target *ti, ...@@ -1318,7 +1318,7 @@ static int crypt_iterate_devices(struct dm_target *ti,
{ {
struct crypt_config *cc = ti->private; struct crypt_config *cc = ti->private;
return fn(ti, cc->dev, cc->start, data); return fn(ti, cc->dev, cc->start, ti->len, data);
} }
static struct target_type crypt_target = { static struct target_type crypt_target = {
......
...@@ -324,12 +324,12 @@ static int delay_iterate_devices(struct dm_target *ti, ...@@ -324,12 +324,12 @@ static int delay_iterate_devices(struct dm_target *ti,
struct delay_c *dc = ti->private; struct delay_c *dc = ti->private;
int ret = 0; int ret = 0;
ret = fn(ti, dc->dev_read, dc->start_read, data); ret = fn(ti, dc->dev_read, dc->start_read, ti->len, data);
if (ret) if (ret)
goto out; goto out;
if (dc->dev_write) if (dc->dev_write)
ret = fn(ti, dc->dev_write, dc->start_write, data); ret = fn(ti, dc->dev_write, dc->start_write, ti->len, data);
out: out:
return ret; return ret;
......
...@@ -139,7 +139,7 @@ static int linear_iterate_devices(struct dm_target *ti, ...@@ -139,7 +139,7 @@ static int linear_iterate_devices(struct dm_target *ti,
{ {
struct linear_c *lc = ti->private; struct linear_c *lc = ti->private;
return fn(ti, lc->dev, lc->start, data); return fn(ti, lc->dev, lc->start, ti->len, data);
} }
static struct target_type linear_target = { static struct target_type linear_target = {
......
...@@ -1453,7 +1453,7 @@ static int multipath_iterate_devices(struct dm_target *ti, ...@@ -1453,7 +1453,7 @@ static int multipath_iterate_devices(struct dm_target *ti,
list_for_each_entry(pg, &m->priority_groups, list) { list_for_each_entry(pg, &m->priority_groups, list) {
list_for_each_entry(p, &pg->pgpaths, list) { list_for_each_entry(p, &pg->pgpaths, list) {
ret = fn(ti, p->path.dev, ti->begin, data); ret = fn(ti, p->path.dev, ti->begin, ti->len, data);
if (ret) if (ret)
goto out; goto out;
} }
......
...@@ -638,6 +638,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes) ...@@ -638,6 +638,7 @@ static void do_writes(struct mirror_set *ms, struct bio_list *writes)
spin_lock_irq(&ms->lock); spin_lock_irq(&ms->lock);
bio_list_merge(&ms->writes, &requeue); bio_list_merge(&ms->writes, &requeue);
spin_unlock_irq(&ms->lock); spin_unlock_irq(&ms->lock);
delayed_wake(ms);
} }
/* /*
...@@ -1292,7 +1293,7 @@ static int mirror_iterate_devices(struct dm_target *ti, ...@@ -1292,7 +1293,7 @@ static int mirror_iterate_devices(struct dm_target *ti,
for (i = 0; !ret && i < ms->nr_mirrors; i++) for (i = 0; !ret && i < ms->nr_mirrors; i++)
ret = fn(ti, ms->mirror[i].dev, ret = fn(ti, ms->mirror[i].dev,
ms->mirror[i].offset, data); ms->mirror[i].offset, ti->len, data);
return ret; return ret;
} }
......
...@@ -320,10 +320,11 @@ static int stripe_iterate_devices(struct dm_target *ti, ...@@ -320,10 +320,11 @@ static int stripe_iterate_devices(struct dm_target *ti,
int ret = 0; int ret = 0;
unsigned i = 0; unsigned i = 0;
do do {
ret = fn(ti, sc->stripe[i].dev, ret = fn(ti, sc->stripe[i].dev,
sc->stripe[i].physical_start, data); sc->stripe[i].physical_start,
while (!ret && ++i < sc->stripes); sc->stripe_width, data);
} while (!ret && ++i < sc->stripes);
return ret; return ret;
} }
......
...@@ -346,7 +346,7 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md) ...@@ -346,7 +346,7 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md)
* If possible, this checks an area of a destination device is valid. * If possible, this checks an area of a destination device is valid.
*/ */
static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev, static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
sector_t start, void *data) sector_t start, sector_t len, void *data)
{ {
struct queue_limits *limits = data; struct queue_limits *limits = data;
struct block_device *bdev = dev->bdev; struct block_device *bdev = dev->bdev;
...@@ -359,7 +359,7 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev, ...@@ -359,7 +359,7 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
if (!dev_size) if (!dev_size)
return 1; return 1;
if ((start >= dev_size) || (start + ti->len > dev_size)) { if ((start >= dev_size) || (start + len > dev_size)) {
DMWARN("%s: %s too small for target", DMWARN("%s: %s too small for target",
dm_device_name(ti->table->md), bdevname(bdev, b)); dm_device_name(ti->table->md), bdevname(bdev, b));
return 0; return 0;
...@@ -377,11 +377,11 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev, ...@@ -377,11 +377,11 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
return 0; return 0;
} }
if (ti->len & (logical_block_size_sectors - 1)) { if (len & (logical_block_size_sectors - 1)) {
DMWARN("%s: len=%llu not aligned to h/w " DMWARN("%s: len=%llu not aligned to h/w "
"logical block size %hu of %s", "logical block size %hu of %s",
dm_device_name(ti->table->md), dm_device_name(ti->table->md),
(unsigned long long)ti->len, (unsigned long long)len,
limits->logical_block_size, bdevname(bdev, b)); limits->logical_block_size, bdevname(bdev, b));
return 0; return 0;
} }
...@@ -482,7 +482,7 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti, ...@@ -482,7 +482,7 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r)) #define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
sector_t start, void *data) sector_t start, sector_t len, void *data)
{ {
struct queue_limits *limits = data; struct queue_limits *limits = data;
struct block_device *bdev = dev->bdev; struct block_device *bdev = dev->bdev;
...@@ -830,11 +830,6 @@ unsigned dm_table_get_type(struct dm_table *t) ...@@ -830,11 +830,6 @@ unsigned dm_table_get_type(struct dm_table *t)
return t->type; return t->type;
} }
bool dm_table_bio_based(struct dm_table *t)
{
return dm_table_get_type(t) == DM_TYPE_BIO_BASED;
}
bool dm_table_request_based(struct dm_table *t) bool dm_table_request_based(struct dm_table *t)
{ {
return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED; return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED;
......
...@@ -2203,16 +2203,6 @@ int dm_swap_table(struct mapped_device *md, struct dm_table *table) ...@@ -2203,16 +2203,6 @@ int dm_swap_table(struct mapped_device *md, struct dm_table *table)
goto out; goto out;
} }
/*
* It is enought that blk_queue_ordered() is called only once when
* the first bio-based table is bound.
*
* This setting should be moved to alloc_dev() when request-based dm
* supports barrier.
*/
if (!md->map && dm_table_bio_based(table))
blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN, NULL);
__unbind(md); __unbind(md);
r = __bind(md, table, &limits); r = __bind(md, table, &limits);
......
...@@ -61,7 +61,6 @@ int dm_table_any_congested(struct dm_table *t, int bdi_bits); ...@@ -61,7 +61,6 @@ int dm_table_any_congested(struct dm_table *t, int bdi_bits);
int dm_table_any_busy_target(struct dm_table *t); int dm_table_any_busy_target(struct dm_table *t);
int dm_table_set_type(struct dm_table *t); int dm_table_set_type(struct dm_table *t);
unsigned dm_table_get_type(struct dm_table *t); unsigned dm_table_get_type(struct dm_table *t);
bool dm_table_bio_based(struct dm_table *t);
bool dm_table_request_based(struct dm_table *t); bool dm_table_request_based(struct dm_table *t);
int dm_table_alloc_md_mempools(struct dm_table *t); int dm_table_alloc_md_mempools(struct dm_table *t);
void dm_table_free_md_mempools(struct dm_table *t); void dm_table_free_md_mempools(struct dm_table *t);
......
...@@ -84,7 +84,7 @@ typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, ...@@ -84,7 +84,7 @@ typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm,
typedef int (*iterate_devices_callout_fn) (struct dm_target *ti, typedef int (*iterate_devices_callout_fn) (struct dm_target *ti,
struct dm_dev *dev, struct dm_dev *dev,
sector_t physical_start, sector_t start, sector_t len,
void *data); void *data);
typedef int (*dm_iterate_devices_fn) (struct dm_target *ti, typedef int (*dm_iterate_devices_fn) (struct dm_target *ti,
...@@ -104,7 +104,7 @@ void dm_error(const char *message); ...@@ -104,7 +104,7 @@ void dm_error(const char *message);
* Combine device limits. * Combine device limits.
*/ */
int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
sector_t start, void *data); sector_t start, sector_t len, void *data);
struct dm_dev { struct dm_dev {
struct block_device *bdev; struct block_device *bdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment