diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/bitmap.c | 4 | ||||
-rw-r--r-- | drivers/md/dm-exception-store.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-log.c | 3 | ||||
-rw-r--r-- | drivers/md/dm-snap-persistent.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-table.c | 38 | ||||
-rw-r--r-- | drivers/md/linear.c | 2 | ||||
-rw-r--r-- | drivers/md/md.c | 2 | ||||
-rw-r--r-- | drivers/md/multipath.c | 4 | ||||
-rw-r--r-- | drivers/md/raid0.c | 2 | ||||
-rw-r--r-- | drivers/md/raid1.c | 4 | ||||
-rw-r--r-- | drivers/md/raid10.c | 8 | ||||
-rw-r--r-- | drivers/md/raid5.c | 4 |
12 files changed, 39 insertions, 36 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 56df1cee8fb3..3319c2fec28e 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -232,7 +232,7 @@ static struct page *read_sb_page(mddev_t *mddev, long offset, | |||
232 | target = rdev->sb_start + offset + index * (PAGE_SIZE/512); | 232 | target = rdev->sb_start + offset + index * (PAGE_SIZE/512); |
233 | 233 | ||
234 | if (sync_page_io(rdev->bdev, target, | 234 | if (sync_page_io(rdev->bdev, target, |
235 | roundup(size, bdev_hardsect_size(rdev->bdev)), | 235 | roundup(size, bdev_logical_block_size(rdev->bdev)), |
236 | page, READ)) { | 236 | page, READ)) { |
237 | page->index = index; | 237 | page->index = index; |
238 | attach_page_buffers(page, NULL); /* so that free_buffer will | 238 | attach_page_buffers(page, NULL); /* so that free_buffer will |
@@ -287,7 +287,7 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) | |||
287 | int size = PAGE_SIZE; | 287 | int size = PAGE_SIZE; |
288 | if (page->index == bitmap->file_pages-1) | 288 | if (page->index == bitmap->file_pages-1) |
289 | size = roundup(bitmap->last_page_size, | 289 | size = roundup(bitmap->last_page_size, |
290 | bdev_hardsect_size(rdev->bdev)); | 290 | bdev_logical_block_size(rdev->bdev)); |
291 | /* Just make sure we aren't corrupting data or | 291 | /* Just make sure we aren't corrupting data or |
292 | * metadata | 292 | * metadata |
293 | */ | 293 | */ |
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index a2e26c242141..75d8081a9041 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c | |||
@@ -178,7 +178,7 @@ static int set_chunk_size(struct dm_exception_store *store, | |||
178 | } | 178 | } |
179 | 179 | ||
180 | /* Validate the chunk size against the device block size */ | 180 | /* Validate the chunk size against the device block size */ |
181 | if (chunk_size_ulong % (bdev_hardsect_size(store->cow->bdev) >> 9)) { | 181 | if (chunk_size_ulong % (bdev_logical_block_size(store->cow->bdev) >> 9)) { |
182 | *error = "Chunk size is not a multiple of device blocksize"; | 182 | *error = "Chunk size is not a multiple of device blocksize"; |
183 | return -EINVAL; | 183 | return -EINVAL; |
184 | } | 184 | } |
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index be233bc4d917..6fa8ccf91c70 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c | |||
@@ -413,7 +413,8 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti, | |||
413 | * Buffer holds both header and bitset. | 413 | * Buffer holds both header and bitset. |
414 | */ | 414 | */ |
415 | buf_size = dm_round_up((LOG_OFFSET << SECTOR_SHIFT) + | 415 | buf_size = dm_round_up((LOG_OFFSET << SECTOR_SHIFT) + |
416 | bitset_size, ti->limits.hardsect_size); | 416 | bitset_size, |
417 | ti->limits.logical_block_size); | ||
417 | 418 | ||
418 | if (buf_size > dev->bdev->bd_inode->i_size) { | 419 | if (buf_size > dev->bdev->bd_inode->i_size) { |
419 | DMWARN("log device %s too small: need %llu bytes", | 420 | DMWARN("log device %s too small: need %llu bytes", |
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index e75c6dd76a9a..2662a41337e7 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c | |||
@@ -282,7 +282,7 @@ static int read_header(struct pstore *ps, int *new_snapshot) | |||
282 | */ | 282 | */ |
283 | if (!ps->store->chunk_size) { | 283 | if (!ps->store->chunk_size) { |
284 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, | 284 | ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, |
285 | bdev_hardsect_size(ps->store->cow->bdev) >> 9); | 285 | bdev_logical_block_size(ps->store->cow->bdev) >> 9); |
286 | ps->store->chunk_mask = ps->store->chunk_size - 1; | 286 | ps->store->chunk_mask = ps->store->chunk_size - 1; |
287 | ps->store->chunk_shift = ffs(ps->store->chunk_size) - 1; | 287 | ps->store->chunk_shift = ffs(ps->store->chunk_size) - 1; |
288 | chunk_size_supplied = 0; | 288 | chunk_size_supplied = 0; |
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 429b50b975d5..e9a73bb242b0 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -108,7 +108,8 @@ static void combine_restrictions_low(struct io_restrictions *lhs, | |||
108 | lhs->max_hw_segments = | 108 | lhs->max_hw_segments = |
109 | min_not_zero(lhs->max_hw_segments, rhs->max_hw_segments); | 109 | min_not_zero(lhs->max_hw_segments, rhs->max_hw_segments); |
110 | 110 | ||
111 | lhs->hardsect_size = max(lhs->hardsect_size, rhs->hardsect_size); | 111 | lhs->logical_block_size = max(lhs->logical_block_size, |
112 | rhs->logical_block_size); | ||
112 | 113 | ||
113 | lhs->max_segment_size = | 114 | lhs->max_segment_size = |
114 | min_not_zero(lhs->max_segment_size, rhs->max_segment_size); | 115 | min_not_zero(lhs->max_segment_size, rhs->max_segment_size); |
@@ -509,7 +510,7 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev) | |||
509 | * combine_restrictions_low() | 510 | * combine_restrictions_low() |
510 | */ | 511 | */ |
511 | rs->max_sectors = | 512 | rs->max_sectors = |
512 | min_not_zero(rs->max_sectors, q->max_sectors); | 513 | min_not_zero(rs->max_sectors, queue_max_sectors(q)); |
513 | 514 | ||
514 | /* | 515 | /* |
515 | * Check if merge fn is supported. | 516 | * Check if merge fn is supported. |
@@ -524,24 +525,25 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev) | |||
524 | 525 | ||
525 | rs->max_phys_segments = | 526 | rs->max_phys_segments = |
526 | min_not_zero(rs->max_phys_segments, | 527 | min_not_zero(rs->max_phys_segments, |
527 | q->max_phys_segments); | 528 | queue_max_phys_segments(q)); |
528 | 529 | ||
529 | rs->max_hw_segments = | 530 | rs->max_hw_segments = |
530 | min_not_zero(rs->max_hw_segments, q->max_hw_segments); | 531 | min_not_zero(rs->max_hw_segments, queue_max_hw_segments(q)); |
531 | 532 | ||
532 | rs->hardsect_size = max(rs->hardsect_size, q->hardsect_size); | 533 | rs->logical_block_size = max(rs->logical_block_size, |
534 | queue_logical_block_size(q)); | ||
533 | 535 | ||
534 | rs->max_segment_size = | 536 | rs->max_segment_size = |
535 | min_not_zero(rs->max_segment_size, q->max_segment_size); | 537 | min_not_zero(rs->max_segment_size, queue_max_segment_size(q)); |
536 | 538 | ||
537 | rs->max_hw_sectors = | 539 | rs->max_hw_sectors = |
538 | min_not_zero(rs->max_hw_sectors, q->max_hw_sectors); | 540 | min_not_zero(rs->max_hw_sectors, queue_max_hw_sectors(q)); |
539 | 541 | ||
540 | rs->seg_boundary_mask = | 542 | rs->seg_boundary_mask = |
541 | min_not_zero(rs->seg_boundary_mask, | 543 | min_not_zero(rs->seg_boundary_mask, |
542 | q->seg_boundary_mask); | 544 | queue_segment_boundary(q)); |
543 | 545 | ||
544 | rs->bounce_pfn = min_not_zero(rs->bounce_pfn, q->bounce_pfn); | 546 | rs->bounce_pfn = min_not_zero(rs->bounce_pfn, queue_bounce_pfn(q)); |
545 | 547 | ||
546 | rs->no_cluster |= !test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); | 548 | rs->no_cluster |= !test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); |
547 | } | 549 | } |
@@ -683,8 +685,8 @@ static void check_for_valid_limits(struct io_restrictions *rs) | |||
683 | rs->max_phys_segments = MAX_PHYS_SEGMENTS; | 685 | rs->max_phys_segments = MAX_PHYS_SEGMENTS; |
684 | if (!rs->max_hw_segments) | 686 | if (!rs->max_hw_segments) |
685 | rs->max_hw_segments = MAX_HW_SEGMENTS; | 687 | rs->max_hw_segments = MAX_HW_SEGMENTS; |
686 | if (!rs->hardsect_size) | 688 | if (!rs->logical_block_size) |
687 | rs->hardsect_size = 1 << SECTOR_SHIFT; | 689 | rs->logical_block_size = 1 << SECTOR_SHIFT; |
688 | if (!rs->max_segment_size) | 690 | if (!rs->max_segment_size) |
689 | rs->max_segment_size = MAX_SEGMENT_SIZE; | 691 | rs->max_segment_size = MAX_SEGMENT_SIZE; |
690 | if (!rs->seg_boundary_mask) | 692 | if (!rs->seg_boundary_mask) |
@@ -912,13 +914,13 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q) | |||
912 | * restrictions. | 914 | * restrictions. |
913 | */ | 915 | */ |
914 | blk_queue_max_sectors(q, t->limits.max_sectors); | 916 | blk_queue_max_sectors(q, t->limits.max_sectors); |
915 | q->max_phys_segments = t->limits.max_phys_segments; | 917 | blk_queue_max_phys_segments(q, t->limits.max_phys_segments); |
916 | q->max_hw_segments = t->limits.max_hw_segments; | 918 | blk_queue_max_hw_segments(q, t->limits.max_hw_segments); |
917 | q->hardsect_size = t->limits.hardsect_size; | 919 | blk_queue_logical_block_size(q, t->limits.logical_block_size); |
918 | q->max_segment_size = t->limits.max_segment_size; | 920 | blk_queue_max_segment_size(q, t->limits.max_segment_size); |
919 | q->max_hw_sectors = t->limits.max_hw_sectors; | 921 | blk_queue_max_hw_sectors(q, t->limits.max_hw_sectors); |
920 | q->seg_boundary_mask = t->limits.seg_boundary_mask; | 922 | blk_queue_segment_boundary(q, t->limits.seg_boundary_mask); |
921 | q->bounce_pfn = t->limits.bounce_pfn; | 923 | blk_queue_bounce_limit(q, t->limits.bounce_pfn); |
922 | 924 | ||
923 | if (t->limits.no_cluster) | 925 | if (t->limits.no_cluster) |
924 | queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q); | 926 | queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q); |
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 7a36e38393a1..64f1f3e046e0 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -146,7 +146,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) | |||
146 | * a one page request is never in violation. | 146 | * a one page request is never in violation. |
147 | */ | 147 | */ |
148 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 148 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && |
149 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 149 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) |
150 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); | 150 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
151 | 151 | ||
152 | disk->num_sectors = rdev->sectors; | 152 | disk->num_sectors = rdev->sectors; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 641b211fe3fe..20f6ac338349 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1202,7 +1202,7 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version) | |||
1202 | atomic_set(&rdev->corrected_errors, le32_to_cpu(sb->cnt_corrected_read)); | 1202 | atomic_set(&rdev->corrected_errors, le32_to_cpu(sb->cnt_corrected_read)); |
1203 | 1203 | ||
1204 | rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256; | 1204 | rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256; |
1205 | bmask = queue_hardsect_size(rdev->bdev->bd_disk->queue)-1; | 1205 | bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1; |
1206 | if (rdev->sb_size & bmask) | 1206 | if (rdev->sb_size & bmask) |
1207 | rdev->sb_size = (rdev->sb_size | bmask) + 1; | 1207 | rdev->sb_size = (rdev->sb_size | bmask) + 1; |
1208 | 1208 | ||
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 41ced0cbe823..4ee31aa13c40 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -303,7 +303,7 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) | |||
303 | * merge_bvec_fn will be involved in multipath.) | 303 | * merge_bvec_fn will be involved in multipath.) |
304 | */ | 304 | */ |
305 | if (q->merge_bvec_fn && | 305 | if (q->merge_bvec_fn && |
306 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 306 | queue_max_sectors(q) > (PAGE_SIZE>>9)) |
307 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); | 307 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
308 | 308 | ||
309 | conf->working_disks++; | 309 | conf->working_disks++; |
@@ -467,7 +467,7 @@ static int multipath_run (mddev_t *mddev) | |||
467 | * violating it, not that we ever expect a device with | 467 | * violating it, not that we ever expect a device with |
468 | * a merge_bvec_fn to be involved in multipath */ | 468 | * a merge_bvec_fn to be involved in multipath */ |
469 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 469 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && |
470 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 470 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) |
471 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); | 471 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
472 | 472 | ||
473 | if (!test_bit(Faulty, &rdev->flags)) | 473 | if (!test_bit(Faulty, &rdev->flags)) |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index c08d7559be55..925507e7d673 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -144,7 +144,7 @@ static int create_strip_zones (mddev_t *mddev) | |||
144 | */ | 144 | */ |
145 | 145 | ||
146 | if (rdev1->bdev->bd_disk->queue->merge_bvec_fn && | 146 | if (rdev1->bdev->bd_disk->queue->merge_bvec_fn && |
147 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 147 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) |
148 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); | 148 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
149 | 149 | ||
150 | if (!smallest || (rdev1->sectors < smallest->sectors)) | 150 | if (!smallest || (rdev1->sectors < smallest->sectors)) |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 36df9109cde1..e23758b4a34e 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1130,7 +1130,7 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1130 | * a one page request is never in violation. | 1130 | * a one page request is never in violation. |
1131 | */ | 1131 | */ |
1132 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 1132 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && |
1133 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 1133 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) |
1134 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); | 1134 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
1135 | 1135 | ||
1136 | p->head_position = 0; | 1136 | p->head_position = 0; |
@@ -1996,7 +1996,7 @@ static int run(mddev_t *mddev) | |||
1996 | * a one page request is never in violation. | 1996 | * a one page request is never in violation. |
1997 | */ | 1997 | */ |
1998 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 1998 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && |
1999 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 1999 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) |
2000 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); | 2000 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
2001 | 2001 | ||
2002 | disk->head_position = 0; | 2002 | disk->head_position = 0; |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 499620afb44b..750550c1166f 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1158,8 +1158,8 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1158 | * a one page request is never in violation. | 1158 | * a one page request is never in violation. |
1159 | */ | 1159 | */ |
1160 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 1160 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && |
1161 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 1161 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) |
1162 | mddev->queue->max_sectors = (PAGE_SIZE>>9); | 1162 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
1163 | 1163 | ||
1164 | p->head_position = 0; | 1164 | p->head_position = 0; |
1165 | rdev->raid_disk = mirror; | 1165 | rdev->raid_disk = mirror; |
@@ -2145,8 +2145,8 @@ static int run(mddev_t *mddev) | |||
2145 | * a one page request is never in violation. | 2145 | * a one page request is never in violation. |
2146 | */ | 2146 | */ |
2147 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 2147 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && |
2148 | mddev->queue->max_sectors > (PAGE_SIZE>>9)) | 2148 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) |
2149 | mddev->queue->max_sectors = (PAGE_SIZE>>9); | 2149 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); |
2150 | 2150 | ||
2151 | disk->head_position = 0; | 2151 | disk->head_position = 0; |
2152 | } | 2152 | } |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index bb37fb1b2d82..bef876698232 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3463,10 +3463,10 @@ static int bio_fits_rdev(struct bio *bi) | |||
3463 | { | 3463 | { |
3464 | struct request_queue *q = bdev_get_queue(bi->bi_bdev); | 3464 | struct request_queue *q = bdev_get_queue(bi->bi_bdev); |
3465 | 3465 | ||
3466 | if ((bi->bi_size>>9) > q->max_sectors) | 3466 | if ((bi->bi_size>>9) > queue_max_sectors(q)) |
3467 | return 0; | 3467 | return 0; |
3468 | blk_recount_segments(q, bi); | 3468 | blk_recount_segments(q, bi); |
3469 | if (bi->bi_phys_segments > q->max_phys_segments) | 3469 | if (bi->bi_phys_segments > queue_max_phys_segments(q)) |
3470 | return 0; | 3470 | return 0; |
3471 | 3471 | ||
3472 | if (q->merge_bvec_fn) | 3472 | if (q->merge_bvec_fn) |