aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:32:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 10:32:11 -0500
commit456eac94789e1b512515e6974e091ef655f343de (patch)
tree79f277d02e5e480a373c129bdce7564421d360c7 /drivers/md/dm-table.c
parentdedd0c2a48d1eb779373de5eddd04a3e059ce540 (diff)
parentf06f135d8642e2f6812cfcb4ea8e4e9122d4d58c (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: fs/bio.c: fix shadows sparse warning drbd: The kernel code is now equivalent to out of tree release 8.3.7 drbd: Allow online resizing of DRBD devices while peer not reachable (needs to be explicitly forced) drbd: Don't go into StandAlone mode when authentification failes because of network error drivers/block/drbd/drbd_receiver.c: correct NULL test cfq-iosched: Respect ioprio_class when preempting genhd: overlapping variable definition block: removed unused as_io_context DM: Fix device mapper topology stacking block: bdev_stack_limits wrapper block: Fix discard alignment calculation and printing block: Correct handling of bottom device misaligment drbd: check on CONFIG_LBDAF, not LBD drivers/block/drbd: Correct NULL test drbd: Silenced an assert that could triggered after changing write ordering method drbd: Kconfig fix drbd: Fix for a race between IO and a detach operation [Bugz 262] drbd: Use drbd_crypto_is_hash() instead of an open coded check
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index be625475cf6d..4b22feb01a0c 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -503,16 +503,15 @@ int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
503 return 0; 503 return 0;
504 } 504 }
505 505
506 if (blk_stack_limits(limits, &q->limits, start << 9) < 0) 506 if (bdev_stack_limits(limits, bdev, start) < 0)
507 DMWARN("%s: target device %s is misaligned: " 507 DMWARN("%s: adding target device %s caused an alignment inconsistency: "
508 "physical_block_size=%u, logical_block_size=%u, " 508 "physical_block_size=%u, logical_block_size=%u, "
509 "alignment_offset=%u, start=%llu", 509 "alignment_offset=%u, start=%llu",
510 dm_device_name(ti->table->md), bdevname(bdev, b), 510 dm_device_name(ti->table->md), bdevname(bdev, b),
511 q->limits.physical_block_size, 511 q->limits.physical_block_size,
512 q->limits.logical_block_size, 512 q->limits.logical_block_size,
513 q->limits.alignment_offset, 513 q->limits.alignment_offset,
514 (unsigned long long) start << 9); 514 (unsigned long long) start << SECTOR_SHIFT);
515
516 515
517 /* 516 /*
518 * Check if merge fn is supported. 517 * Check if merge fn is supported.
@@ -1026,9 +1025,9 @@ combine_limits:
1026 * for the table. 1025 * for the table.
1027 */ 1026 */
1028 if (blk_stack_limits(limits, &ti_limits, 0) < 0) 1027 if (blk_stack_limits(limits, &ti_limits, 0) < 0)
1029 DMWARN("%s: target device " 1028 DMWARN("%s: adding target device "
1030 "(start sect %llu len %llu) " 1029 "(start sect %llu len %llu) "
1031 "is misaligned", 1030 "caused an alignment inconsistency",
1032 dm_device_name(table->md), 1031 dm_device_name(table->md),
1033 (unsigned long long) ti->begin, 1032 (unsigned long long) ti->begin,
1034 (unsigned long long) ti->len); 1033 (unsigned long long) ti->len);
@@ -1080,15 +1079,6 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
1080 struct queue_limits *limits) 1079 struct queue_limits *limits)
1081{ 1080{
1082 /* 1081 /*
1083 * Each target device in the table has a data area that should normally
1084 * be aligned such that the DM device's alignment_offset is 0.
1085 * FIXME: Propagate alignment_offsets up the stack and warn of
1086 * sub-optimal or inconsistent settings.
1087 */
1088 limits->alignment_offset = 0;
1089 limits->misaligned = 0;
1090
1091 /*
1092 * Copy table's limits to the DM device's request_queue 1082 * Copy table's limits to the DM device's request_queue
1093 */ 1083 */
1094 q->limits = *limits; 1084 q->limits = *limits;