Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157216
b: refs/heads/master
c: f6a1ed1
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Sep 4, 2009
1 parent 010968d commit 43f9f45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 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: 8811f46c1f9386fc7017150de9d52359e5b1826e
refs/heads/master: f6a1ed10864b7540fa758bbccf3433fe17070329
22 changes: 11 additions & 11 deletions trunk/drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ 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 invalid.
*/
static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
struct queue_limits *limits = data;
struct block_device *bdev = dev->bdev;
Expand All @@ -357,24 +357,24 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
char b[BDEVNAME_SIZE];

if (!dev_size)
return 1;
return 0;

if ((start >= dev_size) || (start + len > dev_size)) {
DMWARN("%s: %s too small for target",
dm_device_name(ti->table->md), bdevname(bdev, b));
return 0;
return 1;
}

if (logical_block_size_sectors <= 1)
return 1;
return 0;

if (start & (logical_block_size_sectors - 1)) {
DMWARN("%s: start=%llu not aligned to h/w "
"logical block size %hu of %s",
dm_device_name(ti->table->md),
(unsigned long long)start,
limits->logical_block_size, bdevname(bdev, b));
return 0;
return 1;
}

if (len & (logical_block_size_sectors - 1)) {
Expand All @@ -383,10 +383,10 @@ static int device_area_is_valid(struct dm_target *ti, struct dm_dev *dev,
dm_device_name(ti->table->md),
(unsigned long long)len,
limits->logical_block_size, bdevname(bdev, b));
return 0;
return 1;
}

return 1;
return 0;
}

/*
Expand Down Expand Up @@ -1000,8 +1000,8 @@ int dm_calculate_queue_limits(struct dm_table *table,
* Check each device area is consistent with the target's
* overall queue limits.
*/
if (!ti->type->iterate_devices(ti, device_area_is_valid,
&ti_limits))
if (ti->type->iterate_devices(ti, device_area_is_invalid,
&ti_limits))
return -EINVAL;

combine_limits:
Expand Down

0 comments on commit 43f9f45

Please sign in to comment.